difftreelog
Merge pull request #153 from usetech-llc/feature/NFTPAR-536_code_style
in: master
Enforce codestyle
117 files changed
.devcontainer/devcontainer.jsondiffbeforeafterboth--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -12,7 +12,8 @@
}
},
"extensions": [
- "matklad.rust-analyzer"
+ "matklad.rust-analyzer",
+ "dbaeumer.vscode-eslint"
],
"remoteUser": "vscode"
}
.github/workflows/codestyle.ymldiffbeforeafterboth--- /dev/null
+++ b/.github/workflows/codestyle.yml
@@ -0,0 +1,37 @@
+name: Code style
+
+on: [push]
+
+jobs:
+ rustfmt:
+ runs-on: ubuntu-20.04
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Install latest nightly
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: nightly
+ default: true
+ target: wasm32-unknown-unknown
+ components: rustfmt, clippy
+ - name: Run cargo fmt
+ run: cargo fmt -- --check
+
+ clippy:
+ if: ${{ false }}
+ runs-on: ubuntu-20.04
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Install substrate dependencies
+ run: sudo apt-get install libssl-dev pkg-config libclang-dev clang
+ - name: Install latest nightly
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: nightly
+ default: true
+ target: wasm32-unknown-unknown
+ components: rustfmt, clippy
+ - name: Run cargo check
+ run: cargo clippy -- -Dwarnings
.github/workflows/tests_codestyle.ymldiffbeforeafterboth--- /dev/null
+++ b/.github/workflows/tests_codestyle.yml
@@ -0,0 +1,14 @@
+name: Tests code style
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: ubuntu-20.04
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install modules
+ run: cd tests && yarn
+ - name: Run ESLint
+ run: cd tests && yarn eslint --ext .ts,.js src/
\ No newline at end of file
.rustfmt.tomldiffbeforeafterboth--- /dev/null
+++ b/.rustfmt.toml
@@ -0,0 +1,2 @@
+hard_tabs = true
+reorder_imports = false
\ No newline at end of file
.vscode/extensions.jsondiffbeforeafterboth--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,5 @@
+{
+ "recommendations": [
+ "dbaeumer.vscode-eslint"
+ ]
+}
\ No newline at end of file
.vscode/settings.jsondiffbeforeafterboth--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,9 @@
+{
+ "eslint.format.enable": true,
+ "[javascript]": {
+ "editor.defaultFormatter": "dbaeumer.vscode-eslint"
+ },
+ "[typescript]": {
+ "editor.defaultFormatter": "dbaeumer.vscode-eslint"
+ }
+}
\ No newline at end of file
Cargo.lockdiffbeforeafterboth959 packageslockfile v3
Might be heavy and slow!
addr2line
0.14.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7depends onused byaddr2line
0.15.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3adepends onused byadler
1.0.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35feused byaead
0.3.2crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331depends onaes
0.5.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd2bc6d3f370b5666245ff421e231cba4353df936e26986d2918e61a8fd6aef6depends onused byaes-gcm
0.7.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0301c9e9c443494d970a07885e8cf3e587bae8356a1d5abd0999068413f7205fused byaes-soft
0.5.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum63dd91889c49327ad7ef3b500fd1109dbd3c509a03db0d4a9ce413b79f575cb6used byaesni
0.8.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0a6fe808308bb07d393e2ea47780043ec47683fcf19cf5efc8ca51c50cc8c68adepends onused byahash
0.4.7crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16eused byaho-corasick
0.7.18crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656fdepends onused byalways-assert
0.1.2crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfbf688625d06217d5b1bb0ea9d9c44a1635fd0ee3534466388d18203174f4d11ansi_term
0.11.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979bdepends onused byansi_term
0.12.1crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2depends onanyhow
1.0.41crates.io↘ 0↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61approx
0.4.0crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278depends onapprox
0.5.0crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99edepends onused byarrayref
0.3.6crates.io↘ 0↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544arrayvec
0.4.12crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9depends onused byarrayvec
0.5.2crates.io↘ 0↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068barrayvec
0.7.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbe4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcdused byasn1_der
0.7.4crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9d6e24d2cce90c53b948c46271bfb053e4bdc2db9b5d3f65e20f8cf28a1b7fc3used byassert_matches
1.5.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9async-attributes
1.1.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5depends onused byasync-channel
1.6.1crates.io↘ 3↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319async-executor
1.4.1crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965depends onused byasync-global-executor
2.0.2crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6depends onused byasync-io
1.4.1crates.io↘ 12↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4bbfd5cf2794b1e908ea8457e6c45f8f8f1f6ec5f74617bf4662623f47503c3bdepends onasync-lock
2.4.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798bdepends onused byasync-mutex
1.4.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156edepends onused byasync-process
1.1.0crates.io↘ 9↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354acdepends onasync-std
1.9.0crates.io↘ 21↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341depends on- async-attributes
1.1.2 - async-channel
1.6.1 - async-global-executor
2.0.2 - async-io
1.4.1 - async-lock
2.4.0 - async-process
1.1.0 - crossbeam-utils
0.8.5 - futures-channel
0.3.15 - futures-core
0.3.15 - futures-io
0.3.15 - futures-lite
1.12.0 - gloo-timers
0.2.1 - kv-log-macro
1.0.7 - log
0.4.14 - memchr
2.4.0 - num_cpus
1.13.0 - once_cell
1.8.0 - pin-project-lite
0.2.6 - pin-utils
0.1.0 - slab
0.4.3 - wasm-bindgen-futures
0.4.24
- async-attributes
async-std-resolver
0.20.3crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumed4e2c3da14d8ad45acb1e3191db7a918e9505b6f155b218e70a7c9a1a48c638depends onused byasync-task
4.0.3crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0async-trait
0.1.50crates.io↘ 3↖ 31sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722depends onused by- async-std-resolver
0.20.3 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - fc-consensus
2.0.0-dev - jsonrpsee-http-client
0.2.0-alpha.6 - jsonrpsee-types
0.2.0-alpha.6 - libp2p-request-response
0.11.0 - polkadot-network-bridge
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - sc-authority-discovery
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-slots
0.9.0 - sc-finality-grandpa
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-service
0.9.0 - sp-authorship
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-consensus-babe
0.9.0 - sp-inherents
3.0.0 - sp-keystore
0.9.0 - sp-timestamp
3.0.0 - substrate-test-client
2.0.1 - trust-dns-proto
0.20.3
- async-std-resolver
asynchronous-codec
0.5.0crates.io↘ 5↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfb4401f0a3622dad2e0763fa79e0eb328bc70fb7dccfdd645341f00d671247d6asynchronous-codec
0.6.0crates.io↘ 5↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690atomic
0.5.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281depends onused byatomic-waker
1.0.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2aused byatty
0.2.14crates.io↘ 3↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8depends onautocfg
1.0.1crates.io↘ 0↖ 16sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464abacktrace
0.3.60crates.io↘ 7↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282depends onbase-x
0.2.8crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28bused bybase58
0.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83used bybase64
0.12.3crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ffused bybase64
0.13.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fdbeef
0.5.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6736e2428df2ca2848d846c43e88745121a6654696e349ce0054a420815a7409used bybeefy-gadget
0.1.0github.com/paritytech/grandpa-bridge-gadget↘ 21↖ 3sourcegit+https://github.com/paritytech/grandpa-bridge-gadget?branch=polkadot-v0.9.3#063e18a1f82945d5a304906db92bfbb571bac459depends on- beefy-primitives
0.1.0 - futures
0.3.15 - hex
0.4.3 - log
0.4.14 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - sc-client-api
3.0.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-network-gossip
0.9.0 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-arithmetic
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-utils
3.0.0 - substrate-prometheus-endpoint
0.9.0 - thiserror
1.0.25
- beefy-primitives
beefy-gadget-rpc
0.1.0github.com/paritytech/grandpa-bridge-gadget↘ 14↖ 1sourcegit+https://github.com/paritytech/grandpa-bridge-gadget?branch=polkadot-v0.9.3#063e18a1f82945d5a304906db92bfbb571bac459depends onused bybeefy-primitives
0.1.0github.com/paritytech/grandpa-bridge-gadget↘ 6↖ 10sourcegit+https://github.com/paritytech/grandpa-bridge-gadget?branch=polkadot-v0.9.3#063e18a1f82945d5a304906db92bfbb571bac459depends onbincode
1.3.3crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcaddepends onbindgen
0.57.0crates.io↘ 11↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263ddepends onused bybitflags
1.2.1crates.io↘ 0↖ 10sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693bitvec
0.17.4crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5cdepends onused bybitvec
0.20.4crates.io↘ 4↖ 12sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848depends onused by- kusama-runtime
0.9.3 - parity-scale-codec
2.1.3 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-test-runtime
0.9.3 - westend-runtime
0.9.3
- kusama-runtime
blake2
0.9.1crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum10a5720225ef5daecf08657f23791354e1685a8c91a4c60c7f3d3b2892f978f4used byblake2-rfc
0.2.18crates.io↘ 2↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400depends onblake2b_simd
0.5.11crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumafa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587used byblake2s_simd
0.5.11crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2used byblake3
0.3.8crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3depends onused byblock-buffer
0.7.3crates.io↘ 4↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688bused byblock-buffer
0.9.0crates.io↘ 2↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4depends onused byblock-cipher
0.8.0crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80depends onblock-padding
0.1.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5depends onused byblock-padding
0.2.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2caeused byblocking
1.0.2crates.io↘ 6↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9depends onbp-header-chain
0.1.0github.com/paritytech/polkadot↘ 8↖ 4sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onbp-messages
0.1.0github.com/paritytech/polkadot↘ 5↖ 3sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2bp-polkadot-core
0.1.0github.com/paritytech/polkadot↘ 10↖ 2sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bybp-rococo
0.1.0github.com/paritytech/polkadot↘ 9↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bybp-runtime
0.1.0github.com/paritytech/polkadot↘ 10↖ 5sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onbp-test-utils
0.1.0github.com/paritytech/polkadot↘ 8↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bybp-wococo
0.1.0github.com/paritytech/polkadot↘ 9↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bybs58
0.4.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3bstr
0.2.16crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279depends onused bybuild-helper
0.1.1crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5fdepends onbumpalo
3.7.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631used bybyte-slice-cast
0.3.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3used bybyte-slice-cast
1.0.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum65c1bf4a04a88c54f589125563643d773f3254b5c38571395e2b591c693bbc81used bybyte-tools
0.3.1crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7byteorder
1.4.3crates.io↘ 0↖ 24sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610used by- aes-soft
0.5.0 - block-buffer
0.7.3 - bytes
0.4.12 - cranelift-codegen
0.71.0 - cuckoofilter
0.5.0 - curve25519-dalek
2.1.2 - curve25519-dalek
3.1.0 - dns-parser
0.8.0 - fixed-hash
0.6.1 - fixed-hash
0.7.0 - h2
0.1.26 - libp2p-gossipsub
0.30.1 - merlin
2.0.1 - parity-multiaddr
0.11.2 - parity-wasm
0.32.0 - parity-ws
0.10.0 - pbkdf2
0.3.0 - pwasm-utils
0.14.0 - pwasm-utils
0.17.1 - ruzstd
0.2.2 - sp-core
3.0.0 - thrift
0.13.0 - uint
0.8.5 - uint
0.9.0
- aes-soft
bytes
0.4.12crates.io↘ 3↖ 16sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81cdepends onbytes
0.5.6crates.io↘ 0↖ 8sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38bytes
1.0.1crates.io↘ 0↖ 19sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040used by- asynchronous-codec
0.5.0 - asynchronous-codec
0.6.0 - http
0.2.4 - libp2p
0.37.1 - libp2p-gossipsub
0.30.1 - libp2p-kad
0.30.0 - libp2p-mplex
0.28.0 - libp2p-noise
0.30.0 - libp2p-plaintext
0.28.0 - libp2p-relay
0.2.0 - libp2p-request-response
0.11.0 - multistream-select
0.10.2 - prost
0.7.0 - prost-build
0.7.0 - prost-types
0.7.0 - rlp
0.5.0 - sc-network
0.9.0 - unsigned-varint
0.6.0 - unsigned-varint
0.7.0
- asynchronous-codec
cache-padded
1.1.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dbaused bycargo_metadata
0.12.3crates.io↘ 5↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7714a157da7991e23d90686b9524b9e12e0407a108647f52e9328f4b3d51ac7fcargo-platform
0.1.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0226944a63d1bf35a3b5f948dd7c59e263db83695c9e8bffc4037de02e30f1d7depends onused bycc
1.0.68crates.io↘ 1↖ 13sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787depends oncexpr
0.4.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27depends onused bycfg_aliases
0.1.1crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89ecfg-if
0.1.10crates.io↘ 0↖ 10sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822cfg-if
1.0.0crates.io↘ 0↖ 33sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbaf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fdused by- async-process
1.1.0 - backtrace
0.3.60 - cpp_demangle
0.3.2 - crc32fast
1.2.1 - crossbeam-channel
0.5.1 - crossbeam-deque
0.8.0 - crossbeam-epoch
0.9.5 - crossbeam-utils
0.8.5 - directories-next
2.0.0 - flate2
1.0.20 - getrandom
0.1.16 - getrandom
0.2.3 - instant
0.1.9 - libloading
0.7.0 - log
0.4.14 - parity-util-mem
0.9.0 - parking_lot_core
0.8.3 - polling
2.1.0 - prometheus
0.11.0 - sha-1
0.9.6 - sha2
0.9.5 - socket2
0.3.19 - tempfile
3.2.0 - tracing
0.1.26 - trust-dns-proto
0.20.3 - trust-dns-resolver
0.20.3 - wasm-bindgen
0.2.74 - wasm-bindgen-futures
0.4.24 - wasmtime
0.24.0 - wasmtime-environ
0.24.0 - wasmtime-jit
0.24.0 - wasmtime-profiling
0.24.0 - wasmtime-runtime
0.24.0
- async-process
chacha20
0.5.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum244fbce0d47e97e8ef2f63b81d5e05882cb518c68531eb33194990d7b7e85845depends onused bychacha20poly1305
0.6.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9bf18d374d66df0c05cdddd528a7db98f78c28e2519b120855c4f84c5027b1f5used bychrono
0.4.19crates.io↘ 5↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73cid
0.6.1crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumff0e3bc0b6446b3f9663c1a6aba6ef06c5aeaa1bc92bd18077be337198ab9768used bycipher
0.2.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801depends onused byckb-merkle-mountain-range
0.3.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume486fe53bb9f2ca0f58cb60e8679a5354fd6687a839942ef0a75967250289ca6depends onused byclang-sys
1.2.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077cdepends onused byclap
2.33.3crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002depends onused bycloudabi
0.0.3crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4fdepends onconcurrent-queue
1.2.2crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3depends onconstant_time_eq
0.1.5crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbcconvert_case
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0eused bycore-foundation
0.7.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171depends onused bycore-foundation-sys
0.7.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8accpp_demangle
0.3.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390depends onused bycpufeatures
0.1.4crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8depends onused bycpuid-bool
0.2.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffbaused bycranelift-bforest
0.71.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbcee7a5107071484772b89fdf37f0f460b7db75f476e43ea7a684fd942470bcfdepends onused bycranelift-codegen
0.71.0crates.io↘ 12↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum654ab96f0f1cab71c0d323618a58360a492da2c341eb2c1f977fc195c664001bdepends oncranelift-codegen-meta
0.71.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum65994cfc5be9d5fd10c5fc30bcdddfa50c04bb79c91329287bff846434ff8f14used bycranelift-entity
0.71.0crates.io↘ 1↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1a2e6884a363e42a9ba980193ea8603a4272f8a92bd8bbaf9f57a94dbea0ff96depends oncranelift-frontend
0.71.0crates.io↘ 4↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume6f41e2f9b57d2c030e249d0958f1cdc2c3cd46accf8c0438b3d1944e9153444cranelift-native
0.71.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaab70ba7575665375d31cbdea2462916ce58be887834e1b83c860b43b51af637used bycranelift-wasm
0.71.0crates.io↘ 9↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf2fc3d2e70da6439adf97648dcdf81834363154f2907405345b6fbe7ca38918cdepends oncrc32fast
1.2.1crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1adepends oncrossbeam-channel
0.5.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4depends onused bycrossbeam-deque
0.7.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285used bycrossbeam-deque
0.8.0crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9used bycrossbeam-epoch
0.8.2crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dacedepends onused bycrossbeam-epoch
0.9.5crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fdused bycrossbeam-queue
0.2.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570used bycrossbeam-utils
0.7.2crates.io↘ 3↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8depends oncrossbeam-utils
0.8.5crates.io↘ 2↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4dbdepends oncrunchy
0.2.2crates.io↘ 0↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7crypto-mac
0.7.0crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5depends onused bycrypto-mac
0.8.0crates.io↘ 2↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeabdepends onct-logs
0.7.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8c8e13110a84b6315df212c045be706af261fd364791cad863285439ebba672edepends onused byctor
0.1.20crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006ddepends onused bycuckoofilter
0.5.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb810a8449931679f64cd7eef1bbd0fa315801b6d5d9cdc1ace2804d6529eee18depends onused bycumulus-client-cli
0.1.0github.com/paritytech/cumulus.git↘ 3↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917used bycumulus-client-collator
0.1.0github.com/paritytech/cumulus.git↘ 17↖ 2sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends on- cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-primitives-core
0.1.0 - futures
0.3.15 - parity-scale-codec
2.1.3 - parking_lot
0.10.2 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-overseer
0.1.0 - polkadot-primitives
0.9.3 - sc-client-api
3.0.0 - sp-api
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-io
3.0.0 - sp-runtime
3.0.0 - tracing
0.1.26
- cumulus-client-consensus-common
cumulus-client-consensus-aura
0.1.0github.com/paritytech/cumulus.git↘ 23↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends on- async-trait
0.1.50 - cumulus-client-consensus-common
0.1.0 - cumulus-primitives-core
0.1.0 - futures
0.3.15 - parity-scale-codec
2.1.3 - parking_lot
0.10.2 - polkadot-service
0.9.3 - sc-client-api
3.0.0 - sc-consensus-aura
0.9.0 - sc-consensus-slots
0.9.0 - sc-telemetry
3.0.0 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - substrate-prometheus-endpoint
0.9.0 - tracing
0.1.26
used by- async-trait
cumulus-client-consensus-common
0.1.0github.com/paritytech/cumulus.git↘ 17↖ 4sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends on- async-trait
0.1.50 - dyn-clone
1.0.4 - futures
0.3.15 - parity-scale-codec
2.1.3 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - sc-client-api
3.0.0 - sp-api
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-runtime
3.0.0 - sp-trie
3.0.0 - substrate-prometheus-endpoint
0.9.0 - tracing
0.1.26
- async-trait
cumulus-client-network
0.1.0github.com/paritytech/cumulus.git↘ 17↖ 2sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends on- derive_more
0.99.14 - futures
0.3.15 - futures-timer
3.0.2 - parity-scale-codec
2.1.3 - parking_lot
0.10.2 - polkadot-node-primitives
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-service
0.9.3 - polkadot-statement-table
0.9.3 - sc-client-api
3.0.0 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-runtime
3.0.0 - tracing
0.1.26
- derive_more
cumulus-client-pov-recovery
0.1.0github.com/paritytech/cumulus.git↘ 19↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends on- cumulus-primitives-core
0.1.0 - futures
0.3.15 - futures-timer
3.0.2 - parity-scale-codec
2.1.3 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-overseer
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-service
0.9.3 - polkadot-statement-table
0.9.3 - rand
0.8.4 - sc-client-api
3.0.0 - sp-api
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-maybe-compressed-blob
3.0.0 - sp-runtime
3.0.0 - tracing
0.1.26
used by- cumulus-primitives-core
cumulus-client-service
0.1.0github.com/paritytech/cumulus.git↘ 21↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends on- cumulus-client-collator
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-primitives-core
0.1.0 - parity-scale-codec
2.1.3 - parking_lot
0.10.2 - polkadot-overseer
0.1.0 - polkadot-primitives
0.9.3 - polkadot-service
0.9.3 - sc-chain-spec
3.0.0 - sc-client-api
3.0.0 - sc-consensus-babe
0.9.0 - sc-service
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-runtime
3.0.0 - tracing
0.1.26
used by- cumulus-client-collator
cumulus-pallet-aura-ext
0.1.0github.com/paritytech/cumulus.git↘ 10↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends onused bycumulus-pallet-dmp-queue
0.1.0github.com/paritytech/cumulus.git↘ 12↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends onused bycumulus-pallet-parachain-system
0.1.0github.com/paritytech/cumulus.git↘ 23↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends on- cumulus-primitives-core
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - environmental
1.1.3 - frame-support
3.0.0 - frame-system
3.0.0 - hash-db
0.15.2 - log
0.4.14 - memory-db
0.26.0 - pallet-balances
3.0.0 - parity-scale-codec
2.1.3 - polkadot-parachain
0.9.3 - serde
1.0.126 - sp-core
3.0.0 - sp-externalities
0.9.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0 - sp-std
3.0.0 - sp-trie
3.0.0 - sp-version
3.0.0 - trie-db
0.22.5 - xcm
0.9.3
used by- cumulus-primitives-core
cumulus-pallet-xcm
0.1.0github.com/paritytech/cumulus.git↘ 9↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends onused bycumulus-pallet-xcmp-queue
0.1.0github.com/paritytech/cumulus.git↘ 11↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends onused bycumulus-primitives-core
0.1.0github.com/paritytech/cumulus.git↘ 11↖ 13sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends onused by- cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - cumulus-primitives-utility
0.1.0 - nft
3.0.0 - nft-runtime
3.0.0 - parachain-info
0.1.0
- cumulus-client-collator
cumulus-primitives-parachain-inherent
0.1.0github.com/paritytech/cumulus.git↘ 13↖ 2sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends oncumulus-primitives-utility
0.1.0github.com/paritytech/cumulus.git↘ 11↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends onused bycurve25519-dalek
2.1.2crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum434e1720189a637d44fe464f4df1e6eb900b4835255b14354497c78af37d9bb8used bycurve25519-dalek
3.1.0crates.io↘ 5↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3darling
0.13.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12depends onused bydarling_core
0.13.0crates.io↘ 6↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3darling_macro
0.13.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15ccdepends onused bydata-encoding
2.3.2crates.io↘ 0↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57data-encoding-macro
0.1.12crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029acaused bydata-encoding-macro-internal
0.1.10crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038dbdepends onused byderivative
2.2.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770bdepends onused byderive_more
0.99.14crates.io↘ 4↖ 25sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320used by- cumulus-client-network
0.1.0 - fc-consensus
2.0.0-dev - metered-channel
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-parachain
0.9.3 - polkadot-runtime-parachains
0.9.3 - reed-solomon-novelpoly
1.0.0 - sc-authority-discovery
0.9.0 - sc-client-api
3.0.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-executor
0.9.0 - sc-executor-common
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-rpc-api
0.9.0 - sc-transaction-graph
3.0.0 - sp-keystore
0.9.0 - sp-transaction-pool
3.0.0 - substrate-prometheus-endpoint
0.9.0
- cumulus-client-network
digest
0.8.1crates.io↘ 1↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5depends ondigest
0.9.0crates.io↘ 1↖ 8sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066depends ondirectories
3.0.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7depends onused bydirectories-next
2.0.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbcdepends onused bydirs-sys
0.3.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780depends onused bydirs-sys-next
0.1.2crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4ddepends onused bydns-parser
0.8.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbeadepends onused bydyn-clonable
0.9.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4depends onused bydyn-clonable-impl
0.9.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5depends onused bydyn-clone
1.0.4crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcfed25519
1.1.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8d0860415b12243916284c67a9be413e044ee6668247b99ba26d94b2bc06c8f6depends onused byed25519-dalek
1.0.1crates.io↘ 6↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9deither
1.6.1crates.io↘ 0↖ 15sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457enum-as-inner
0.3.3crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595used byenumflags2
0.6.4crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum83c8d82922337cd23a15f88b70d8e4ef5f11da38dd7cdb55e84dd5de99695da0depends onenumflags2_derive
0.6.4crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46ccedepends onused byenumn
0.1.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4e58b112d5099aa0857c5d05f0eacab86406dd8c0f85fe5d320a13256d29ecf4depends onused byenv_logger
0.7.1crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36used byenv_logger
0.8.4crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3used byenvironmental
1.1.3crates.io↘ 0↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797erased-serde
0.3.15crates.io↘ 1↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume5b36e6f2295f393f44894c6031f67df4d185b984cd54d08f768ce678007efcddepends onerrno
0.2.7crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfa68f2fb9cae9d37c9b2b3584aba698a2e97f72d7aef7b9f7aa71d8b54ce46feused byerrno-dragonfly
0.1.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067depends onused byethbloom
0.9.2crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum71a6567e6fd35589fea0c63b94b4cf2e55573e413901bdbe60ab15cf0e25e5dfused byethbloom
0.11.0crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum779864b9c7f7ead1f092972c3257496c6a84b46dba2ce131dd8a282cb2cc5972used byethereum
0.7.1crates.io↘ 10↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum567ce064a8232c16e2b2c2173a936b91fbe35c2f2c5278871f5a1a31688b42e9depends onethereum-tx-sign
3.0.4crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbdcbb5f48282fa71ba2864818a442d0ee0ca04ebc9ef9eb1837c48298c3b8cbfdepends onused byethereum-types
0.9.2crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum473aecff686bd8e7b9db0165cbbb53562376b39bf35b427f0c60446a9e1634b0used byethereum-types
0.11.0crates.io↘ 7↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfddepends onevent-listener
2.5.1crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59evm
0.27.0github.com/usetech-llc/evm.git↘ 11↖ 4sourcegit+https://github.com/usetech-llc/evm.git?branch=precompile-output-parachain#e13990a627375f327ca7da3c85d9bdfa0a9e903bdepends onevm-coder
0.1.0workspace↘ 5↖ 1evm-coder-macros
0.1.0workspace↘ 7↖ 1evm-core
0.27.1github.com/usetech-llc/evm.git↘ 4↖ 3sourcegit+https://github.com/usetech-llc/evm.git?branch=precompile-output-parachain#e13990a627375f327ca7da3c85d9bdfa0a9e903bevm-gasometer
0.27.0github.com/usetech-llc/evm.git↘ 4↖ 2sourcegit+https://github.com/usetech-llc/evm.git?branch=precompile-output-parachain#e13990a627375f327ca7da3c85d9bdfa0a9e903bused byevm-runtime
0.27.0github.com/usetech-llc/evm.git↘ 4↖ 3sourcegit+https://github.com/usetech-llc/evm.git?branch=precompile-output-parachain#e13990a627375f327ca7da3c85d9bdfa0a9e903bexit-future
0.2.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5depends onused byfailure
0.1.8crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86depends onfailure_derive
0.1.8crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4used byfake-simd
0.1.2crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deedused byfallible-iterator
0.2.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7used byfastrand
1.4.1crates.io↘ 1↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum77b705829d1e87f762c2df6da140b26af5839e1033aa84aa5f56bb688e4e1bdbdepends onfc-consensus
2.0.0-devgithub.com/usetech-llc/frontier.git↘ 18↖ 3sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends onfc-db
1.0.0github.com/usetech-llc/frontier.git↘ 7↖ 5sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends onfc-mapping-sync
2.0.0-devgithub.com/usetech-llc/frontier.git↘ 11↖ 2sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends onused byfc-rpc
2.0.0-devgithub.com/usetech-llc/frontier.git↘ 34↖ 2sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends on- ethereum
0.7.1 - ethereum-types
0.11.0 - evm
0.27.0 - fc-consensus
2.0.0-dev - fc-db
1.0.0 - fc-rpc-core
1.1.0-dev - fp-consensus
1.0.0 - fp-evm
2.0.0 - fp-rpc
2.0.0 - fp-storage
1.0.1 - futures
0.3.15 - jsonrpc-core
15.1.0 - jsonrpc-core-client
14.2.0 - jsonrpc-derive
14.2.2 - jsonrpc-pubsub
15.1.0 - libsecp256k1
0.3.5 - log
0.4.14 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - parity-scale-codec
2.1.3 - rand
0.7.3 - rlp
0.5.0 - rustc-hex
2.1.0 - sc-client-api
3.0.0 - sc-network
0.9.0 - sc-rpc
3.0.0 - sc-service
0.9.0 - sha3
0.8.2 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-io
3.0.0 - sp-runtime
3.0.0 - sp-storage
3.0.0 - sp-transaction-pool
3.0.0
used by- ethereum
fc-rpc-core
1.1.0-devgithub.com/usetech-llc/frontier.git↘ 8↖ 3sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends onfdlimit
0.2.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1bdepends onused byfile-per-thread-logger
0.1.4crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126depends onused byfinality-grandpa
0.14.1crates.io↘ 7↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum74a1bfdcc776e63e49f741c7ce6116fa1b887e8ac2e3ccb14dd4aa113e54feb9depends onfixed-hash
0.6.1crates.io↘ 4↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum11498d382790b7a8f2fd211780bec78619bba81cdad3a283997c0c41f836759cfixed-hash
0.7.0crates.io↘ 4↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493cfixedbitset
0.2.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04dused byflate2
1.0.20crates.io↘ 5↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0flexi_logger
0.15.12crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaaab3caedb4149800f91e8e4899f29cd9ddf3b569b04c365ca9334f92f7542bfdepends onused byfnv
1.0.7crates.io↘ 0↖ 18sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1fork-tree
3.0.0github.com/paritytech/substrate.git↘ 1↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onform_urlencoded
1.0.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191depends onused byfp-consensus
1.0.0github.com/usetech-llc/frontier.git↘ 7↖ 4sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends onfp-evm
2.0.0github.com/usetech-llc/frontier.git↘ 6↖ 5sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends onfp-rpc
2.0.0github.com/usetech-llc/frontier.git↘ 9↖ 7sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends onfp-storage
1.0.1github.com/usetech-llc/frontier.git↘ 0↖ 2sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843frame-benchmarking
3.1.0github.com/paritytech/substrate.git↘ 12↖ 21sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- frame-benchmarking-cli
3.0.0 - frame-system-benchmarking
3.0.0 - nft
3.0.0 - nft-runtime
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-democracy
3.0.0 - pallet-gilt
3.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-inflation
3.0.0 - pallet-membership
3.0.0 - pallet-mmr
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-scheduler
3.0.0 - pallet-scheduler
3.0.0 - pallet-timestamp
3.0.0 - polkadot-service
0.9.3 - polkadot-test-service
0.9.3
- frame-benchmarking-cli
frame-benchmarking-cli
3.0.0github.com/paritytech/substrate.git↘ 16↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused byframe-election-provider-support
3.0.0github.com/paritytech/substrate.git↘ 6↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onframe-executive
3.0.0github.com/paritytech/substrate.git↘ 8↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onframe-metadata
13.0.0github.com/paritytech/substrate.git↘ 4↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used byframe-support
3.0.0github.com/paritytech/substrate.git↘ 19↖ 76sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- bitflags
1.2.1 - frame-metadata
13.0.0 - frame-support-procedural
3.0.0 - impl-trait-for-tuples
0.2.1 - log
0.4.14 - once_cell
1.8.0 - parity-scale-codec
2.1.3 - paste
1.0.5 - serde
1.0.126 - smallvec
1.6.1 - sp-arithmetic
3.0.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-runtime
3.0.0 - sp-staking
3.0.0 - sp-state-machine
0.9.0 - sp-std
3.0.0 - sp-tracing
3.0.0
used by- bp-header-chain
0.1.0 - bp-messages
0.1.0 - bp-polkadot-core
0.1.0 - bp-runtime
0.1.0 - cumulus-pallet-aura-ext
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-utility
0.1.0 - frame-benchmarking
3.1.0 - frame-election-provider-support
3.0.0 - frame-executive
3.0.0 - frame-system
3.0.0 - frame-system-benchmarking
3.0.0 - frame-try-runtime
0.9.0 - kusama-runtime
0.9.3 - nft-data-structs
0.9.0 - nft-runtime
3.0.0 - pallet-aura
3.0.0 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-beefy
0.1.0 - pallet-bounties
3.0.0 - pallet-bridge-grandpa
0.1.0 - pallet-collective
3.0.0 - pallet-contract-helpers
0.1.0 - pallet-contracts
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-gilt
3.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-inflation
3.0.0 - pallet-membership
3.0.0 - pallet-mmr
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-multisig
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-recovery
3.0.0 - pallet-scheduler
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-society
3.0.0 - pallet-staking
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-tips
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-treasury
3.0.0 - pallet-utility
3.0.0 - pallet-vesting
3.0.0 - pallet-xcm
0.1.0 - parachain-info
0.1.0 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - westend-runtime
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
- bitflags
frame-support-procedural
3.0.0github.com/paritytech/substrate.git↘ 5↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used byframe-support-procedural-tools
3.0.0github.com/paritytech/substrate.git↘ 5↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onframe-support-procedural-tools-derive
3.0.0github.com/paritytech/substrate.git↘ 3↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onframe-system
3.0.0github.com/paritytech/substrate.git↘ 10↖ 71sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- bp-messages
0.1.0 - bp-polkadot-core
0.1.0 - cumulus-pallet-aura-ext
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - frame-benchmarking
3.1.0 - frame-election-provider-support
3.0.0 - frame-executive
3.0.0 - frame-system-benchmarking
3.0.0 - kusama-runtime
0.9.3 - nft-data-structs
0.9.0 - nft-runtime
3.0.0 - pallet-aura
3.0.0 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-beefy
0.1.0 - pallet-bounties
3.0.0 - pallet-bridge-grandpa
0.1.0 - pallet-collective
3.0.0 - pallet-contract-helpers
0.1.0 - pallet-contracts
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-gilt
3.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-inflation
3.0.0 - pallet-membership
3.0.0 - pallet-mmr
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-multisig
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-recovery
3.0.0 - pallet-scheduler
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-society
3.0.0 - pallet-staking
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-tips
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-treasury
3.0.0 - pallet-utility
3.0.0 - pallet-vesting
3.0.0 - pallet-xcm
0.1.0 - parachain-info
0.1.0 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - rococo-runtime
0.9.3 - westend-runtime
0.9.3 - xcm-builder
0.9.3
- bp-messages
frame-system-benchmarking
3.0.0github.com/paritytech/substrate.git↘ 7↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused byframe-system-rpc-runtime-api
3.0.0github.com/paritytech/substrate.git↘ 2↖ 8sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onframe-try-runtime
0.9.0github.com/paritytech/substrate.git↘ 5↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7fs-err
2.6.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5ebd3504ad6116843b8375ad70df74e7bfe83cac77a1f3fe73200c844d43bfe0used byfs-swap
0.2.6crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5used byfs2
0.4.3crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213depends onused byfuchsia-cprng
0.1.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3baused byfuchsia-zircon
0.3.3crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82depends onused byfuchsia-zircon-sys
0.3.3crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7used byfunty
1.1.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7futures
0.1.31crates.io↘ 0↖ 32sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678used by- futures-cpupool
0.1.8 - futures-diagnose
1.0.1 - futures-util
0.3.15 - h2
0.1.26 - http-body
0.1.0 - hyper
0.12.36 - jsonrpc-client-transports
14.2.1 - jsonrpc-client-transports
15.1.0 - jsonrpc-core
14.2.0 - jsonrpc-core
15.1.0 - parity-tokio-ipc
0.4.0 - polkadot-test-service
0.9.3 - sc-rpc-server
3.0.0 - sc-service
0.9.0 - substrate-test-client
2.0.1 - tokio
0.1.22 - tokio-buf
0.1.1 - tokio-codec
0.1.2 - tokio-current-thread
0.1.7 - tokio-executor
0.1.10 - tokio-fs
0.1.7 - tokio-io
0.1.13 - tokio-named-pipes
0.1.0 - tokio-reactor
0.1.12 - tokio-service
0.1.0 - tokio-sync
0.1.8 - tokio-tcp
0.1.4 - tokio-threadpool
0.1.18 - tokio-timer
0.2.13 - tokio-udp
0.1.6 - tokio-uds
0.2.7 - want
0.2.0
- futures-cpupool
futures
0.3.15crates.io↘ 7↖ 107sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27depends onused by- beefy-gadget
0.1.0 - beefy-gadget-rpc
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - exit-future
0.2.0 - fc-consensus
2.0.0-dev - fc-mapping-sync
2.0.0-dev - fc-rpc
2.0.0-dev - finality-grandpa
0.14.1 - futures-diagnose
1.0.1 - if-watch
0.2.2 - intervalier
0.4.0 - libp2p
0.37.1 - libp2p-core
0.28.3 - libp2p-deflate
0.28.0 - libp2p-dns
0.28.1 - libp2p-floodsub
0.29.0 - libp2p-gossipsub
0.30.1 - libp2p-identify
0.29.0 - libp2p-kad
0.30.0 - libp2p-mdns
0.30.2 - libp2p-mplex
0.28.0 - libp2p-noise
0.30.0 - libp2p-ping
0.29.0 - libp2p-plaintext
0.28.0 - libp2p-pnet
0.20.0 - libp2p-relay
0.2.0 - libp2p-request-response
0.11.0 - libp2p-swarm
0.29.0 - libp2p-tcp
0.28.0 - libp2p-uds
0.28.0 - libp2p-wasm-ext
0.28.2 - libp2p-websocket
0.29.0 - libp2p-yamux
0.32.0 - metered-channel
0.1.0 - mick-jaeger
0.1.4 - multistream-select
0.10.2 - nft
3.0.0 - nft-rpc
3.3.1 - polkadot-approval-distribution
0.1.0 - polkadot-availability-bitfield-distribution
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-cli
0.9.3 - polkadot-collator-protocol
0.1.0 - polkadot-gossip-support
0.1.0 - polkadot-network-bridge
0.1.0 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-bitfield-signing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-chain-api
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-node-core-pvf
0.1.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0 - polkadot-test-service
0.9.3 - rw-stream-sink
0.2.1 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-consensus-slots
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-informant
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-network-gossip
0.9.0 - sc-offchain
3.0.0 - sc-peerset
3.0.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-service
0.9.0 - sc-telemetry
3.0.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - soketto
0.4.2 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-transaction-pool
3.0.0 - sp-utils
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-test-client
2.0.1 - substrate-test-utils
3.0.0 - wasm-timer
0.2.5 - yamux
0.9.0
- beefy-gadget
futures-channel
0.3.15crates.io↘ 2↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2depends onfutures-core
0.3.15crates.io↘ 0↖ 16sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1futures-cpupool
0.1.8crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4depends onused byfutures-diagnose
1.0.1crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9depends onused byfutures-executor
0.3.15crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbadaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79used byfutures-io
0.3.15crates.io↘ 0↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumacc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1futures-lite
1.12.0crates.io↘ 7↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48depends onfutures-macro
0.3.15crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121used byfutures-rustls
0.21.1crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8bdepends onused byfutures-sink
0.3.15crates.io↘ 0↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282futures-task
0.3.15crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33daefutures-timer
2.0.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6used byfutures-timer
3.0.2crates.io↘ 0↖ 30sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2cused by- cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - fc-mapping-sync
2.0.0-dev - finality-grandpa
0.14.1 - libp2p-core
0.28.3 - libp2p-relay
0.2.0 - libp2p-tcp
0.28.0 - metered-channel
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-node-core-pvf
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-slots
0.9.0 - sc-finality-grandpa
0.9.0 - sc-network
0.9.0 - sc-network-gossip
0.9.0 - sc-offchain
3.0.0 - sc-service
0.9.0 - sp-consensus
0.9.0 - sp-timestamp
3.0.0 - sp-utils
3.0.0
- cumulus-client-network
futures-util
0.3.15crates.io↘ 14↖ 17sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfeb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967depends onused by- async-std-resolver
0.20.3 - asynchronous-codec
0.5.0 - asynchronous-codec
0.6.0 - futures
0.3.15 - futures-executor
0.3.15 - h2
0.2.7 - hyper
0.13.10 - hyper-rustls
0.21.0 - jsonrpsee-types
0.2.0-alpha.6 - jsonrpsee-utils
0.2.0-alpha.6 - sc-keystore
3.0.0 - streamunordered
0.5.2 - substrate-prometheus-endpoint
0.9.0 - trust-dns-proto
0.20.3 - trust-dns-resolver
0.20.3 - unsigned-varint
0.6.0 - unsigned-varint
0.7.0
- async-std-resolver
gcc
0.3.55crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2used bygeneric-array
0.12.4crates.io↘ 1↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bddepends ongeneric-array
0.14.4crates.io↘ 2↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817depends ongetrandom
0.1.16crates.io↘ 3↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fcegetrandom
0.2.3crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753ghash
0.3.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375depends onused bygimli
0.23.0crates.io↘ 3↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6cegimli
0.24.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189used byglob
0.3.0crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574globset
0.4.7crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf0fc1b9fa0e64ffb1aa5b95daa0f0f167734fd528b7c02eabc581d9d843649b1used bygloo-timers
0.2.1crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891fused byh2
0.1.26crates.io↘ 10↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462depends onused byh2
0.2.7crates.io↘ 12↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535depends onused byhandlebars
3.5.5crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3used byhash-db
0.15.2crates.io↘ 0↖ 18sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364ahash256-std-hasher
0.15.2crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2depends onhashbrown
0.9.1crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04depends onheck
0.3.3crates.io↘ 1↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132cdepends onhermit-abi
0.1.18crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5cdepends onused byhex
0.4.3crates.io↘ 0↖ 12sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70hex_fmt
0.3.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336fused byhex-literal
0.3.1crates.io↘ 0↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5af1f635ef1bc545d78392b136bfe1c9809e029023c84a3638a864a10b8819c8hmac
0.7.1crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695depends onhmac
0.8.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840depends onused byhmac-drbg
0.2.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7bdepends onused byhostname
0.3.1crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867depends onused byhttp
0.1.21crates.io↘ 3↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0depends onhttp
0.2.4crates.io↘ 3↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11depends onhttp-body
0.1.0crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292dused byhttp-body
0.3.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111bdepends onused byhttparse
1.4.1crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68httpdate
0.3.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47used byhumantime
1.3.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdf004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4fdepends onused byhumantime
2.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4used byhyper
0.12.36crates.io↘ 22↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52depends onused byhyper
0.13.10crates.io↘ 16↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bbdepends onhyper-rustls
0.21.0crates.io↘ 10↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6depends onident_case
1.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39used byidna
0.1.5crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844eused byidna
0.2.3crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8if-addrs
0.6.5crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum28538916eb3f3976311f5dfbe67b5362d0add1293d0a9cad17debf86f8e3aa48depends onused byif-addrs-sys
0.3.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumde74b9dd780476e837e5eb5ab7c88b49ed304126e412030a0adba99c8efe79eadepends onused byif-watch
0.2.2crates.io↘ 8↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179depends onimpl-codec
0.4.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53depends onused byimpl-codec
0.5.0crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdf170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877eddepends onimpl-rlp
0.2.1crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5depends onimpl-rlp
0.3.0crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808depends onimpl-serde
0.3.1crates.io↘ 1↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb47ca4d2b6931707a55fce5cf66aff80e2178c8b63bbb4ecb5695cbc870ddf6fdepends onimpl-trait-for-tuples
0.1.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9ddepends onused byimpl-trait-for-tuples
0.2.1crates.io↘ 3↖ 21sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031eedepends onused by- cumulus-primitives-core
0.1.0 - cumulus-primitives-utility
0.1.0 - frame-support
3.0.0 - frame-system
3.0.0 - pallet-authorship
3.0.0 - pallet-evm
4.0.0-dev - pallet-session
3.0.0 - pallet-timestamp
3.0.0 - pallet-treasury
3.0.0 - parity-util-mem
0.9.0 - polkadot-runtime-common
0.9.3 - sc-chain-spec
3.0.0 - sc-consensus-slots
0.9.0 - sp-inherents
3.0.0 - sp-runtime
3.0.0 - sp-runtime-interface
3.0.0 - sp-wasm-interface
3.0.0 - up-sponsorship
0.1.0 - xcm
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
- cumulus-primitives-core
indexmap
1.6.2crates.io↘ 3↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3depends onInflector
0.11.4crates.io↘ 2↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3depends oninstant
0.1.9crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ecdepends oninteger-encoding
1.1.7crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum48dc51180a9b377fd75814d0cc02199c20f8e99433d6762f650d39cdbbd3b56fused byinteger-sqrt
0.1.5crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770depends onused byintervalier
0.4.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275depends onused byiovec
0.1.4crates.io↘ 1↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075edepends onip_network
0.3.4crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2ee15951c035f79eddbef745611ec962f63f4558f1dadf98ab723cc603487c6fipconfig
0.2.2crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7used byipnet
2.3.1crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9itertools
0.9.0crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54bdepends onitertools
0.10.1crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eafdepends onitoa
0.4.7crates.io↘ 0↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736jobserver
0.1.22crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fddepends onused byjs-sys
0.3.51crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062depends onjsonrpc-client-transports
14.2.1crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2773fa94a2a1fd51efb89a8f45b8861023dbb415d18d3c9235ae9388d780f9ecdepends onused byjsonrpc-client-transports
15.1.0crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7depends onused byjsonrpc-core
14.2.0crates.io↘ 5↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62jsonrpc-core
15.1.0crates.io↘ 5↖ 23sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0745a6379e3edc893c84ec203589790774e4247420033e71a76d3ab4687991faused by- beefy-gadget-rpc
0.1.0 - fc-rpc
2.0.0-dev - fc-rpc-core
1.1.0-dev - jsonrpc-client-transports
15.1.0 - jsonrpc-http-server
15.1.0 - jsonrpc-ipc-server
15.1.0 - jsonrpc-pubsub
15.1.0 - jsonrpc-server-utils
15.1.0 - jsonrpc-ws-server
15.1.0 - nft
3.0.0 - nft-rpc
3.3.1 - pallet-contracts-rpc
3.0.0 - pallet-mmr-rpc
3.0.0 - pallet-transaction-payment-rpc
3.0.0 - polkadot-rpc
0.9.3 - sc-consensus-babe-rpc
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-rpc-server
3.0.0 - sc-service
0.9.0 - sc-sync-state-rpc
0.9.0 - substrate-frame-rpc-system
3.0.0
- beefy-gadget-rpc
jsonrpc-core-client
14.2.0crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713depends onjsonrpc-core-client
15.1.0crates.io↘ 1↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6f764902d7b891344a0acb65625f32f6f7c6db006952143bd650209fbe7d94dbdepends onjsonrpc-derive
14.2.2crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd0e77e8812f02155b85a677a96e1d16b60181950c0636199bc4528524fba98dcjsonrpc-derive
15.1.0crates.io↘ 4↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3jsonrpc-http-server
15.1.0crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7depends onused byjsonrpc-ipc-server
15.1.0crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcf50e53e4eea8f421a7316c5f63e395f7bc7c4e786a6dc54d76fab6ff7aa7ce7depends onused byjsonrpc-pubsub
14.2.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986jsonrpc-pubsub
15.1.0crates.io↘ 5↖ 11sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum639558e0604013be9787ae52f798506ae42bf4220fe587bdc5625871cc8b9c77jsonrpc-server-utils
15.1.0crates.io↘ 8↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum72f1f3990650c033bd8f6bd46deac76d990f9bbfb5f8dc8c4767bf0a00392176depends onjsonrpc-ws-server
15.1.0crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6596fe75209b73a2a75ebe1dce4e60e03b88a2b25e8807b667597f6315150d22depends onused byjsonrpsee-http-client
0.2.0-alpha.6crates.io↘ 11↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2737440f37efa10e5ef7beeec43d059d29dc92640978be21fcdcef481a2edb0ddepends onused byjsonrpsee-proc-macros
0.2.0-alpha.6crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5784ee8bb31988fa2c7a755fe31b0e21aa51894a67e5c99b6d4470f0253bf31aused byjsonrpsee-types
0.2.0-alpha.6crates.io↘ 8↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbab3dabceeeeb865897661d532d47202eaae71cd2c606f53cb69f1fbc0555a51depends onjsonrpsee-utils
0.2.0-alpha.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd63cf4d423614e71fd144a8691208539d2b23d8373e069e2fbe023c5eba5e922keccak
0.1.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7kernel32-sys
0.2.2crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098ddepends onkusama-runtime
0.9.3github.com/paritytech/polkadot↘ 72↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- beefy-primitives
0.1.0 - bitvec
0.20.4 - frame-executive
3.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-rpc-runtime-api
3.0.0 - frame-try-runtime
0.9.0 - log
0.4.14 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-bounties
3.0.0 - pallet-collective
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-gilt
3.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-membership
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-multisig
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-recovery
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-society
3.0.0 - pallet-staking
3.0.0 - pallet-staking-reward-fn
3.0.0 - pallet-timestamp
3.0.0 - pallet-tips
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - pallet-treasury
3.0.0 - pallet-utility
3.0.0 - pallet-vesting
3.0.0 - pallet-xcm
0.1.0 - parity-scale-codec
2.1.3 - polkadot-primitives
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - rustc-hex
2.1.0 - serde
1.0.126 - serde_derive
1.0.126 - smallvec
1.6.1 - sp-api
3.0.0 - sp-arithmetic
3.0.0 - sp-authority-discovery
3.0.0 - sp-block-builder
3.0.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-npos-elections
3.0.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-std
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0 - static_assertions
1.1.0 - substrate-wasm-builder
3.0.0 - xcm
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
used by- beefy-primitives
kv-log-macro
1.0.7crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977fdepends onused bykvdb
0.9.0crates.io↘ 2↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8891bd853eff90e33024195d79d578dc984c82f9e0715fcd2b525a0c19d52811depends onkvdb-memorydb
0.9.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum30a0da8e08caf08d384a620ec19bb6c9b85c84137248e202617fb91881f25912used bykvdb-rocksdb
0.11.1crates.io↘ 10↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum94b27cdb788bf1c8ade782289f9dbee626940be2961fd75c7cde993fa2f1ded1depends onlazy_static
1.4.0crates.io↘ 0↖ 41sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646used by- Inflector
0.11.4 - bindgen
0.57.0 - crossbeam-epoch
0.8.2 - crossbeam-epoch
0.9.5 - crossbeam-utils
0.7.2 - crossbeam-utils
0.8.5 - flexi_logger
0.15.12 - fs-swap
0.2.6 - futures-diagnose
1.0.1 - jsonrpc-server-utils
15.1.0 - libp2p
0.37.1 - libp2p-core
0.28.3 - libp2p-mdns
0.30.2 - libp2p-noise
0.30.0 - polkadot-node-jaeger
0.1.0 - polkadot-node-subsystem
0.1.0 - prometheus
0.11.0 - rayon-core
1.9.1 - sc-client-api
3.0.0 - sc-executor
0.9.0 - sc-light
3.0.0 - sc-service
0.9.0 - sc-tracing
3.0.0 - schannel
0.1.19 - sharded-slab
0.1.1 - sp-core
3.0.0 - sp-keyring
3.0.0 - sp-utils
3.0.0 - statrs
0.14.0 - structopt
0.3.21 - tokio
0.2.25 - tokio-reactor
0.1.12 - tokio-threadpool
0.1.18 - tracing-core
0.1.18 - tracing-log
0.1.2 - tracing-subscriber
0.2.18 - trust-dns-proto
0.20.3 - trust-dns-resolver
0.20.3 - wasm-bindgen-backend
0.2.74 - wasmtime-profiling
0.24.0 - wasmtime-runtime
0.24.0
- Inflector
lazycell
1.3.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55used byleb128
0.2.4crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2aused bylibc
0.2.97crates.io↘ 0↖ 68sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6used by- async-io
1.4.1 - async-process
1.1.0 - atty
0.2.14 - backtrace
0.3.60 - chrono
0.4.19 - clang-sys
1.2.0 - core-foundation
0.7.0 - cpufeatures
0.1.4 - dirs-sys
0.3.6 - dirs-sys-next
0.1.2 - errno
0.2.7 - errno-dragonfly
0.1.1 - fdlimit
0.2.1 - flate2
1.0.20 - fs-swap
0.2.6 - fs2
0.4.3 - getrandom
0.1.16 - getrandom
0.2.3 - hermit-abi
0.1.18 - hostname
0.3.1 - if-addrs
0.6.5 - if-addrs-sys
0.3.2 - if-watch
0.2.2 - iovec
0.1.4 - jobserver
0.1.22 - libp2p-tcp
0.28.0 - librocksdb-sys
6.17.3 - mach
0.3.2 - memmap2
0.2.3 - mio
0.6.23 - mio-uds
0.6.8 - net2
0.2.37 - num_cpus
1.13.0 - parity-db
0.2.4 - parity-tokio-ipc
0.4.0 - parking_lot_core
0.6.2 - parking_lot_core
0.7.2 - parking_lot_core
0.8.3 - polkadot-node-core-pvf
0.1.0 - polling
2.1.0 - rand
0.3.23 - rand
0.4.6 - rand
0.7.3 - rand
0.8.4 - region
2.2.0 - ring
0.16.20 - rocksdb
0.16.0 - rpassword
5.0.1 - security-framework
1.0.0 - security-framework-sys
1.0.0 - signal-hook
0.3.9 - signal-hook-registry
1.4.0 - socket2
0.3.19 - socket2
0.4.0 - static_init
0.5.2 - tempfile
3.2.0 - time
0.1.44 - tokio
0.2.25 - tokio-uds
0.2.7 - wasmi
0.6.2 - wasmtime
0.24.0 - wasmtime-cache
0.24.0 - wasmtime-fiber
0.24.0 - wasmtime-profiling
0.24.0 - wasmtime-runtime
0.24.0 - which
4.1.0 - zstd-safe
3.0.1+zstd.1.4.9 - zstd-sys
1.4.20+zstd.1.4.9
- async-io
libloading
0.5.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753depends onused bylibloading
0.7.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6adepends onused bylibm
0.2.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702aused bylibp2p
0.37.1crates.io↘ 31↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum08053fbef67cd777049ef7a95ebaca2ece370b4ed7712c3fa404d69a88cb741bdepends on- atomic
0.5.0 - bytes
1.0.1 - futures
0.3.15 - lazy_static
1.4.0 - libp2p-core
0.28.3 - libp2p-deflate
0.28.0 - libp2p-dns
0.28.1 - libp2p-floodsub
0.29.0 - libp2p-gossipsub
0.30.1 - libp2p-identify
0.29.0 - libp2p-kad
0.30.0 - libp2p-mdns
0.30.2 - libp2p-mplex
0.28.0 - libp2p-noise
0.30.0 - libp2p-ping
0.29.0 - libp2p-plaintext
0.28.0 - libp2p-pnet
0.20.0 - libp2p-relay
0.2.0 - libp2p-request-response
0.11.0 - libp2p-swarm
0.29.0 - libp2p-swarm-derive
0.23.0 - libp2p-tcp
0.28.0 - libp2p-uds
0.28.0 - libp2p-wasm-ext
0.28.2 - libp2p-websocket
0.29.0 - libp2p-yamux
0.32.0 - parity-multiaddr
0.11.2 - parking_lot
0.11.1 - pin-project
1.0.7 - smallvec
1.6.1 - wasm-timer
0.2.5
- atomic
libp2p-core
0.28.3crates.io↘ 26↖ 20sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum554d3e7e9e65f939d66b75fd6a4c67f258fe250da61b91f46c545fc4a89b51d9depends on- asn1_der
0.7.4 - bs58
0.4.0 - ed25519-dalek
1.0.1 - either
1.6.1 - fnv
1.0.7 - futures
0.3.15 - futures-timer
3.0.2 - lazy_static
1.4.0 - libsecp256k1
0.3.5 - log
0.4.14 - multihash
0.13.2 - multistream-select
0.10.2 - parity-multiaddr
0.11.2 - parking_lot
0.11.1 - pin-project
1.0.7 - prost
0.7.0 - prost-build
0.7.0 - rand
0.7.3 - ring
0.16.20 - rw-stream-sink
0.2.1 - sha2
0.9.5 - smallvec
1.6.1 - thiserror
1.0.25 - unsigned-varint
0.7.0 - void
1.0.2 - zeroize
1.3.0
used by- libp2p
0.37.1 - libp2p-deflate
0.28.0 - libp2p-dns
0.28.1 - libp2p-floodsub
0.29.0 - libp2p-gossipsub
0.30.1 - libp2p-identify
0.29.0 - libp2p-kad
0.30.0 - libp2p-mdns
0.30.2 - libp2p-mplex
0.28.0 - libp2p-noise
0.30.0 - libp2p-ping
0.29.0 - libp2p-plaintext
0.28.0 - libp2p-relay
0.2.0 - libp2p-request-response
0.11.0 - libp2p-swarm
0.29.0 - libp2p-tcp
0.28.0 - libp2p-uds
0.28.0 - libp2p-wasm-ext
0.28.2 - libp2p-websocket
0.29.0 - libp2p-yamux
0.32.0
- asn1_der
libp2p-deflate
0.28.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma2181a641cd15f9b6ba71b1335800f309012a0a97a29ffaabbbf40e9d3d58f08used bylibp2p-dns
0.28.1crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum62e63dab8b5ff35e0c101a3e51e843ba782c07bbb1682f5fd827622e0d02b98bdepends onused bylibp2p-floodsub
0.29.0crates.io↘ 10↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum48a9b570f6766301d9c4aa00fce3554cad1598e2f466debbc4dde909028417cfdepends onused bylibp2p-gossipsub
0.30.1crates.io↘ 18↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume7b0c8506a6ec3344b9e706d7c7a6dba826f8ede735cfe13dde12a8c263c4af9depends onused bylibp2p-identify
0.29.0crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5f668f00efd9883e8b7bcc582eaf0164615792608f886f6577da18bcbeea0a46depends onused bylibp2p-kad
0.30.0crates.io↘ 18↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb07312ebe5ee4fd2404447a0609814574df55c65d4e20838b957bbd34907d820depends onused bylibp2p-mdns
0.30.2crates.io↘ 13↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4efa70c1c3d2d91237f8546e27aeb85e287d62c066a7b4f3ea6a696d43ced714depends onused bylibp2p-mplex
0.28.0crates.io↘ 10↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum85e9b544335d1ed30af71daa96edbefadef6f19c7a55f078b9fc92c87163105ddepends onused bylibp2p-noise
0.30.0crates.io↘ 14↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum36db0f0db3b0433f5b9463f1c0cd9eadc0a3734a9170439ce501ff99733a88bddepends onused bylibp2p-ping
0.29.0crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbf4bfaffac63bf3c7ec11ed9d8879d455966ddea7e78ee14737f0b6dce0d1cd1depends onused bylibp2p-plaintext
0.28.0crates.io↘ 9↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0c8c37b4d2a075b4be8442760a5f8c037180f0c8dd5b5734b9978ab868b3aa11depends onused bylibp2p-pnet
0.20.0crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599used bylibp2p-relay
0.2.0crates.io↘ 15↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0b8786aca3f18671d8776289706a5521f6c9124a820f69e358de214b9939440ddepends onused bylibp2p-request-response
0.11.0crates.io↘ 12↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1cdbe172f08e6d0f95fa8634e273d4c4268c4063de2e33e7435194b0130c62e3depends onused bylibp2p-swarm
0.29.0crates.io↘ 8↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1e04d8e1eef675029ec728ba14e8d0da7975d84b6679b699b4ae91a1de9c3a92depends onlibp2p-swarm-derive
0.23.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum365b0a699fea5168676840567582a012ea297b1ca02eee467e58301b9c9c5eeddepends onused bylibp2p-tcp
0.28.0crates.io↘ 9↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2b1a27d21c477951799e99d5c105d78868258502ce092988040a808d5a19bbd9depends onused bylibp2p-uds
0.28.0crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumffd6564bb3b7ff203661ccbb69003c2b551e34cef974f2d6c6a28306a12170b5used bylibp2p-wasm-ext
0.28.2crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume2d413e4cf9b8e5dfbcd2a60d3dc5a3391308bdb463684093d4f67137b7113dedepends onused bylibp2p-websocket
0.29.0crates.io↘ 10↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcace60995ef6f637e4752cccbb2590f6bc358e8741a0d066307636c69a4b3a74depends onused bylibp2p-yamux
0.32.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf35da42cfc6d5cb0dcf3ad6881bc68d146cdf38f98655e09e33fbba4d13eabc4used bylibrocksdb-sys
6.17.3crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5da125e1c0f22c7cae785982115523a0738728498547f415c9054cb17c7e89f9depends onused bylibsecp256k1
0.3.5crates.io↘ 8↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1fc1e2c808481a63dc6da2074752fdd4336a3c8fcc68b83db6f1fd5224ae7962depends onlibz-sys
1.1.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumde5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66depends onused bylinked_hash_set
0.1.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588depends onused bylinked-hash-map
0.5.4crates.io↘ 0↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3linregress
0.4.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb1ff7f341d23e1275eec0656a9a07225fcc86216c4322392868adffe59023d1adepends onused bylock_api
0.3.4crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75depends onlock_api
0.4.4crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07ebdepends onused bylog
0.4.14crates.io↘ 2↖ 174sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710depends onused by- async-io
1.4.1 - async-std
1.9.0 - beefy-gadget
0.1.0 - beefy-gadget-rpc
0.1.0 - cranelift-codegen
0.71.0 - cranelift-frontend
0.71.0 - cranelift-wasm
0.71.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - env_logger
0.7.1 - env_logger
0.8.4 - evm
0.27.0 - fc-consensus
2.0.0-dev - fc-mapping-sync
2.0.0-dev - fc-rpc
2.0.0-dev - file-per-thread-logger
0.1.4 - finality-grandpa
0.14.1 - flexi_logger
0.15.12 - frame-benchmarking
3.1.0 - frame-support
3.0.0 - frame-system
3.0.0 - futures-diagnose
1.0.1 - globset
0.4.7 - h2
0.1.26 - handlebars
3.5.5 - hyper
0.12.36 - hyper-rustls
0.21.0 - if-watch
0.2.2 - jsonrpc-client-transports
14.2.1 - jsonrpc-client-transports
15.1.0 - jsonrpc-core
14.2.0 - jsonrpc-core
15.1.0 - jsonrpc-http-server
15.1.0 - jsonrpc-ipc-server
15.1.0 - jsonrpc-pubsub
14.2.0 - jsonrpc-pubsub
15.1.0 - jsonrpc-server-utils
15.1.0 - jsonrpc-ws-server
15.1.0 - jsonrpsee-http-client
0.2.0-alpha.6 - jsonrpsee-types
0.2.0-alpha.6 - kusama-runtime
0.9.3 - kv-log-macro
1.0.7 - kvdb-rocksdb
0.11.1 - libp2p-core
0.28.3 - libp2p-dns
0.28.1 - libp2p-floodsub
0.29.0 - libp2p-gossipsub
0.30.1 - libp2p-identify
0.29.0 - libp2p-kad
0.30.0 - libp2p-mdns
0.30.2 - libp2p-mplex
0.28.0 - libp2p-noise
0.30.0 - libp2p-ping
0.29.0 - libp2p-plaintext
0.28.0 - libp2p-pnet
0.20.0 - libp2p-relay
0.2.0 - libp2p-request-response
0.11.0 - libp2p-swarm
0.29.0 - libp2p-tcp
0.28.0 - libp2p-uds
0.28.0 - libp2p-websocket
0.29.0 - mio
0.6.23 - mio-extras
2.0.6 - mio-named-pipes
0.1.7 - multistream-select
0.10.2 - nft
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-bridge-grandpa
0.1.0 - pallet-collective
3.0.0 - pallet-contracts
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-evm
4.0.0-dev - pallet-grandpa
3.0.0 - pallet-im-online
3.0.0 - pallet-membership
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-offences
3.0.0 - pallet-scheduler
3.0.0 - pallet-scheduler
3.0.0 - pallet-staking
3.0.0 - pallet-staking-reward-fn
3.0.0 - pallet-timestamp
3.0.0 - parity-db
0.2.4 - parity-tokio-ipc
0.4.0 - parity-ws
0.10.0 - polkadot-cli
0.9.3 - polkadot-node-jaeger
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-test-runtime
0.9.3 - polling
2.1.0 - prost-build
0.7.0 - pwasm-utils
0.14.0 - pwasm-utils
0.17.1 - regalloc
0.0.31 - remote-externalities
0.9.0 - rococo-runtime
0.9.3 - rustls
0.18.1 - rustls
0.19.1 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-slots
0.9.0 - sc-executor
0.9.0 - sc-executor-wasmi
0.9.0 - sc-executor-wasmtime
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-informant
0.9.0 - sc-network
0.9.0 - sc-network-gossip
0.9.0 - sc-offchain
3.0.0 - sc-peerset
3.0.0 - sc-proposer-metrics
0.9.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-rpc-server
3.0.0 - sc-service
0.9.0 - sc-state-db
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - soketto
0.4.2 - sp-allocator
3.0.0 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-finality-grandpa
3.0.0 - sp-io
3.0.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0 - sp-tasks
3.0.0 - sp-timestamp
3.0.0 - sp-tracing
3.0.0 - sp-transaction-pool
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-prometheus-endpoint
0.9.0 - thrift
0.13.0 - tokio-io
0.1.13 - tokio-reactor
0.1.12 - tokio-threadpool
0.1.18 - tokio-udp
0.1.6 - tokio-uds
0.2.7 - tokio-util
0.3.1 - tracing
0.1.26 - tracing-log
0.1.2 - trie-db
0.22.5 - trust-dns-proto
0.20.3 - trust-dns-resolver
0.20.3 - try-runtime-cli
0.9.0 - want
0.2.0 - want
0.3.0 - wasm-bindgen-backend
0.2.74 - wasm-gc-api
0.1.11 - wasmtime
0.24.0 - wasmtime-cache
0.24.0 - wasmtime-environ
0.24.0 - wasmtime-jit
0.24.0 - wasmtime-runtime
0.24.0 - westend-runtime
0.9.3 - xcm-executor
0.9.3 - yamux
0.9.0
- async-io
lru
0.6.5crates.io↘ 1↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1f374d42cdfc1d7dbf3d3dec28afab2eb97ffbf43a3234d795b5986dbf4b90badepends onlru-cache
0.1.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1cdepends onused bymach
0.3.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afadepends onused bymaplit
1.0.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651dused bymatch_cfg
0.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4used bymatchers
0.0.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1depends onused bymatches
0.1.8crates.io↘ 0↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08matrixmultiply
0.3.1crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5a8a15b776d9dfaecd44b03c5828c2199cddff5247215858aac14624f8d6b741depends onused bymaybe-uninit
2.0.0crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00memchr
2.4.0crates.io↘ 0↖ 12sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dcmemmap2
0.2.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4depends onused bymemoffset
0.5.6crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aadepends onused bymemoffset
0.6.4crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9depends onmemory_units
0.3.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882used bymemory-db
0.26.0crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum814bbecfc0451fc314eeea34f05bbcd5b98a7ad7af37faee088b86a1e633f1d4memory-lru
0.1.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbeeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860adepends onmerlin
2.0.1crates.io↘ 4↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42metered-channel
0.1.0github.com/paritytech/polkadot↘ 3↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2mick-jaeger
0.1.4crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc023c3f16109e7f33aa451f773fd61070e265b4977d0b6e344a51049296dd7dfdepends onminicbor
0.8.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum51aa5bb0ca22415daca596a227b507f880ad1b2318a87fa9325312a5d285ca0ddepends onminicbor-derive
0.6.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7f2b9e8883d58e34b18facd16c4564a77ea50fce028ad3d0ee6753440e37acc8depends onused byminiz_oxide
0.4.4crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4bdepends onused bymio
0.6.23crates.io↘ 11↖ 11sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4depends onmio-extras
2.0.6crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19depends onused bymio-named-pipes
0.1.7crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656depends onmio-uds
0.6.8crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumafcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0depends onused bymiow
0.2.2crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944dused bymiow
0.3.7crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21depends onmore-asserts
0.2.1crates.io↘ 0↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238multibase
0.8.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2used bymultihash
0.13.2crates.io↘ 9↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cabdepends onmultihash-derive
0.7.2crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99depends onused bymultimap
0.8.3crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6aused bymultistream-select
0.10.2crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7d91ec0a2440aaff5f78ec35631a7027d50386c6163aa975f7caa0d5da4b6ff8used bynalgebra
0.26.2crates.io↘ 9↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum476d1d59fe02fe54c86356e91650cd892f392782a1cb9fc524ec84f7aa9e1d06depends onused bynalgebra
0.27.1crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120depends onused bynalgebra-macros
0.1.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218depends onused bynames
0.11.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2dadepends onused bynet2
0.2.37crates.io↘ 3↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568aedepends onnft
3.0.0workspace↘ 72↖ 0depends on- cumulus-client-cli
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-service
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - fc-consensus
2.0.0-dev - fc-db
1.0.0 - fc-mapping-sync
2.0.0-dev - fc-rpc
2.0.0-dev - fc-rpc-core
1.1.0-dev - flexi_logger
0.15.12 - fp-rpc
2.0.0 - frame-benchmarking
3.1.0 - frame-benchmarking-cli
3.0.0 - futures
0.3.15 - jsonrpc-core
15.1.0 - jsonrpc-pubsub
15.1.0 - log
0.4.14 - nft-data-structs
0.9.0 - nft-rpc
3.3.1 - nft-runtime
3.0.0 - pallet-contracts
3.0.0 - pallet-contracts-rpc
3.0.0 - pallet-ethereum
2.0.0-dev - pallet-transaction-payment-rpc
3.0.0 - parity-scale-codec
2.1.3 - parking_lot
0.10.2 - polkadot-cli
0.9.3 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-service
0.9.3 - polkadot-test-service
0.9.3 - sc-basic-authorship
0.9.0 - sc-chain-spec
3.0.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-consensus
0.9.0 - sc-consensus-aura
0.9.0 - sc-executor
0.9.0 - sc-finality-grandpa
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-service
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sc-transaction-pool
3.0.0 - serde
1.0.126 - serde_json
1.0.64 - sp-api
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-core
3.0.0 - sp-finality-grandpa
3.0.0 - sp-inherents
3.0.0 - sp-keystore
0.9.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-timestamp
3.0.0 - sp-transaction-pool
3.0.0 - sp-trie
3.0.0 - structopt
0.3.21 - substrate-build-script-utils
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-prometheus-endpoint
0.9.0
- cumulus-client-cli
nft-data-structs
0.9.0workspace↘ 7↖ 3nft-rpc
3.3.1workspace↘ 39↖ 1depends on- fc-db
1.0.0 - fc-mapping-sync
2.0.0-dev - fc-rpc
2.0.0-dev - fc-rpc-core
1.1.0-dev - fp-rpc
2.0.0 - futures
0.3.15 - jsonrpc-core
15.1.0 - jsonrpc-pubsub
15.1.0 - nft-runtime
3.0.0 - pallet-contracts-rpc
3.0.0 - pallet-ethereum
2.0.0-dev - pallet-nft
3.0.0 - pallet-transaction-payment-rpc
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - sc-client-api
3.0.0 - sc-consensus-aura
0.9.0 - sc-consensus-epochs
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-service
0.9.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - sp-api
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-core
3.0.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-storage
3.0.0 - sp-transaction-pool
3.0.0 - substrate-frame-rpc-system
3.0.0 - tokio
0.2.25
used by- fc-db
nft-runtime
3.0.0workspace↘ 59↖ 2depends on- cumulus-pallet-aura-ext
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-utility
0.1.0 - fp-rpc
2.0.0 - frame-benchmarking
3.1.0 - frame-executive
3.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-benchmarking
3.0.0 - frame-system-rpc-runtime-api
3.0.0 - hex-literal
0.3.1 - nft-data-structs
0.9.0 - pallet-aura
3.0.0 - pallet-balances
3.0.0 - pallet-contract-helpers
0.1.0 - pallet-contracts
3.0.0 - pallet-contracts-primitives
3.0.0 - pallet-contracts-rpc-runtime-api
3.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-inflation
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-scheduler
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - pallet-treasury
3.0.0 - pallet-vesting
3.0.0 - pallet-xcm
0.1.0 - parachain-info
0.1.0 - parity-scale-codec
2.1.3 - polkadot-parachain
0.9.3 - serde
1.0.126 - smallvec
1.6.1 - sp-api
3.0.0 - sp-arithmetic
3.0.0 - sp-block-builder
3.0.0 - sp-consensus-aura
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-std
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0 - substrate-wasm-builder
4.0.0 - xcm
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
used by- cumulus-pallet-aura-ext
nodrop
0.1.14crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bbused bynohash-hasher
0.2.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451nom
5.1.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627afdepends onused bynum_cpus
1.13.0crates.io↘ 2↖ 12sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3depends onnum-bigint
0.2.6crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304num-complex
0.3.1crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5depends onused bynum-complex
0.4.0crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085depends onused bynum-integer
0.1.44crates.io↘ 2↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801dbdepends onnum-rational
0.2.4crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aefnum-rational
0.3.2crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07used bynum-rational
0.4.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6aused bynum-traits
0.2.14crates.io↘ 2↖ 28sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290depends onused by- approx
0.4.0 - approx
0.5.0 - bp-runtime
0.1.0 - chrono
0.4.19 - ethereum-tx-sign
3.0.4 - finality-grandpa
0.14.1 - integer-sqrt
0.1.5 - nalgebra
0.26.2 - nalgebra
0.27.1 - num-bigint
0.2.6 - num-complex
0.3.1 - num-complex
0.4.0 - num-integer
0.1.44 - num-rational
0.2.4 - num-rational
0.3.2 - num-rational
0.4.0 - ordered-float
1.1.1 - pallet-bridge-grandpa
0.1.0 - rand_distr
0.4.1 - sc-consensus-babe
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - simba
0.4.0 - simba
0.5.1 - sp-arithmetic
3.0.0 - sp-core
3.0.0 - sp-state-machine
0.9.0 - statrs
0.14.0 - wasmi
0.6.2
- approx
object
0.23.0crates.io↘ 2↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4depends onobject
0.25.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7depends onused byonce_cell
1.8.0crates.io↘ 1↖ 11sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56depends onopaque-debug
0.2.3crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529cused byopaque-debug
0.3.0crates.io↘ 0↖ 8sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5openssl-probe
0.1.4crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95aused byordered-float
1.1.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7depends onused byowning_ref
0.4.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52cedepends onused bypallet-aura
3.0.0github.com/paritytech/substrate.git↘ 9↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-authority-discovery
3.0.0github.com/paritytech/substrate.git↘ 8↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-authorship
3.0.0github.com/paritytech/substrate.git↘ 7↖ 11sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-babe
3.0.0github.com/paritytech/substrate.git↘ 16↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-balances
3.0.0github.com/paritytech/substrate.git↘ 7↖ 17sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- cumulus-pallet-parachain-system
0.1.0 - kusama-runtime
0.9.3 - nft-runtime
3.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-inflation
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-offences
3.0.0 - pallet-treasury
3.0.0 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - rococo-runtime
0.9.3 - westend-runtime
0.9.3
- cumulus-pallet-parachain-system
pallet-beefy
0.1.0github.com/paritytech/grandpa-bridge-gadget↘ 8↖ 2sourcegit+https://github.com/paritytech/grandpa-bridge-gadget?branch=polkadot-v0.9.3#063e18a1f82945d5a304906db92bfbb571bac459depends onpallet-bounties
3.0.0github.com/paritytech/substrate.git↘ 6↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-bridge-grandpa
0.1.0github.com/paritytech/polkadot↘ 14↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypallet-collective
3.0.0github.com/paritytech/substrate.git↘ 8↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-contract-helpers
0.1.0workspace↘ 7↖ 1pallet-contracts
3.0.0github.com/paritytech/substrate.git↘ 16↖ 5sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-contracts-primitives
3.0.0github.com/paritytech/substrate.git↘ 6↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7pallet-contracts-proc-macro
3.0.0github.com/paritytech/substrate.git↘ 3↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bypallet-contracts-rpc
3.0.0github.com/paritytech/substrate.git↘ 12↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bypallet-contracts-rpc-runtime-api
3.0.0github.com/paritytech/substrate.git↘ 5↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-democracy
3.0.0github.com/paritytech/substrate.git↘ 8↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-election-provider-multi-phase
3.0.0github.com/paritytech/substrate.git↘ 12↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-elections-phragmen
4.0.0github.com/paritytech/substrate.git↘ 9↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-ethereum
2.0.0-devgithub.com/usetech-llc/frontier.git↘ 21↖ 5sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends on- ethereum
0.7.1 - ethereum-types
0.11.0 - evm
0.27.0 - fp-consensus
1.0.0 - fp-evm
2.0.0 - fp-rpc
2.0.0 - fp-storage
1.0.1 - frame-support
3.0.0 - frame-system
3.0.0 - libsecp256k1
0.3.5 - pallet-balances
3.0.0 - pallet-evm
4.0.0-dev - pallet-timestamp
3.0.0 - parity-scale-codec
2.1.3 - rlp
0.5.0 - rustc-hex
2.1.0 - serde
1.0.126 - sha3
0.8.2 - sp-io
3.0.0 - sp-runtime
3.0.0 - sp-std
3.0.0
- ethereum
pallet-evm
4.0.0-devgithub.com/usetech-llc/frontier.git↘ 19↖ 4sourcegit+https://github.com/usetech-llc/frontier.git?branch=injected-transactions-parachain#48676fa655fdfb6ceb16fc67d7250d8e618a5843depends onpallet-gilt
3.0.0github.com/paritytech/substrate.git↘ 7↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bypallet-grandpa
3.0.0github.com/paritytech/substrate.git↘ 14↖ 5sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-identity
3.0.0github.com/paritytech/substrate.git↘ 8↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-im-online
3.0.0github.com/paritytech/substrate.git↘ 11↖ 5sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-indices
3.0.0github.com/paritytech/substrate.git↘ 8↖ 5sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-membership
3.0.0github.com/paritytech/substrate.git↘ 8↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-mmr
3.0.0github.com/paritytech/substrate.git↘ 10↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-mmr-primitives
3.0.0github.com/paritytech/substrate.git↘ 9↖ 8sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-mmr-rpc
3.0.0github.com/paritytech/substrate.git↘ 11↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bypallet-multisig
3.0.0github.com/paritytech/substrate.git↘ 7↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-nft
3.0.0workspace↘ 26↖ 2depends on- ethereum
0.7.1 - ethereum-tx-sign
3.0.4 - evm-coder
0.1.0 - fp-evm
2.0.0 - frame-benchmarking
3.1.0 - frame-support
3.0.0 - frame-system
3.0.0 - hex-literal
0.3.1 - nft-data-structs
0.9.0 - pallet-balances
3.0.0 - pallet-contracts
3.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-randomness-collective-flip
3.0.0 - pallet-timestamp
3.0.0 - pallet-transaction-payment
3.0.0 - parity-scale-codec
2.1.3 - primitive-types
0.9.0 - rlp
0.5.0 - serde
1.0.126 - sp-api
3.0.0 - sp-core
3.0.0 - sp-io
3.0.0 - sp-runtime
3.0.0 - sp-std
3.0.0 - up-sponsorship
0.1.0
used by- ethereum
pallet-nft-charge-transaction
3.0.0workspace↘ 12↖ 1pallet-nft-transaction-payment
3.0.0workspace↘ 11↖ 2pallet-nicks
3.0.0github.com/paritytech/substrate.git↘ 6↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-offences
3.0.0github.com/paritytech/substrate.git↘ 9↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-proxy
3.0.0github.com/paritytech/substrate.git↘ 7↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-randomness-collective-flip
3.0.0github.com/paritytech/substrate.git↘ 6↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-recovery
3.0.0github.com/paritytech/substrate.git↘ 7↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-scheduler
3.0.0github.com/paritytech/substrate.git↘ 8↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-session
3.0.0github.com/paritytech/substrate.git↘ 12↖ 13sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-society
3.0.0github.com/paritytech/substrate.git↘ 6↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-staking
3.0.0github.com/paritytech/substrate.git↘ 15↖ 9sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-staking-reward-curve
3.0.0github.com/paritytech/substrate.git↘ 4↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7pallet-staking-reward-fn
3.0.0github.com/paritytech/substrate.git↘ 2↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bypallet-sudo
3.0.0github.com/paritytech/substrate.git↘ 6↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-timestamp
3.0.0github.com/paritytech/substrate.git↘ 11↖ 15sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- kusama-runtime
0.9.3 - nft-runtime
3.0.0 - pallet-aura
3.0.0 - pallet-babe
3.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-inflation
3.0.0 - pallet-nft
3.0.0 - pallet-session
3.0.0 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - westend-runtime
0.9.3
- kusama-runtime
pallet-tips
3.0.0github.com/paritytech/substrate.git↘ 7↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-transaction-payment
3.0.0github.com/paritytech/substrate.git↘ 9↖ 13sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- kusama-runtime
0.9.3 - nft-runtime
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - rococo-runtime
0.9.3 - westend-runtime
0.9.3 - xcm-builder
0.9.3
- kusama-runtime
pallet-transaction-payment-rpc
3.0.0github.com/paritytech/substrate.git↘ 10↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-transaction-payment-rpc-runtime-api
3.0.0github.com/paritytech/substrate.git↘ 4↖ 9sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7pallet-treasury
3.0.0github.com/paritytech/substrate.git↘ 8↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-utility
3.0.0github.com/paritytech/substrate.git↘ 7↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-vesting
3.0.0github.com/paritytech/substrate.git↘ 6↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onpallet-xcm
0.1.0github.com/paritytech/polkadot↘ 8↖ 4sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onparachain-info
0.1.0github.com/paritytech/cumulus.git↘ 5↖ 1sourcegit+https://github.com/paritytech/cumulus.git?branch=polkadot-v0.9.3#78b31b21122995b49f3c2cfe2791f188e33e5917depends onused byparity-db
0.2.4crates.io↘ 9↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2e337f62db341435f0da05b8f6b97e984ef4ea5800510cd07c2d624688c40b47depends onused byparity-multiaddr
0.11.2crates.io↘ 10↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum58341485071825827b7f03cf7efd1cb21e6a709bea778fb50227fd45d2f361b4depends onparity-scale-codec
1.3.7crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma4b26b16c7687c3075982af47719e481815df30bc544f7a6690763a25ca16e9dused byparity-scale-codec
2.1.3crates.io↘ 5↖ 197sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb310f220c335f9df1b3d2e9fbe3890bbfeef5030dad771620f48c5c229877cd3used by- beefy-gadget
0.1.0 - beefy-gadget-rpc
0.1.0 - beefy-primitives
0.1.0 - bp-header-chain
0.1.0 - bp-messages
0.1.0 - bp-polkadot-core
0.1.0 - bp-rococo
0.1.0 - bp-runtime
0.1.0 - bp-test-utils
0.1.0 - bp-wococo
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - cumulus-pallet-aura-ext
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - cumulus-primitives-utility
0.1.0 - ethereum
0.7.1 - evm
0.27.0 - evm-core
0.27.1 - fc-consensus
2.0.0-dev - fc-db
1.0.0 - fc-rpc
2.0.0-dev - finality-grandpa
0.14.1 - fork-tree
3.0.0 - fp-consensus
1.0.0 - fp-evm
2.0.0 - fp-rpc
2.0.0 - frame-benchmarking
3.1.0 - frame-benchmarking-cli
3.0.0 - frame-election-provider-support
3.0.0 - frame-executive
3.0.0 - frame-metadata
13.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-benchmarking
3.0.0 - frame-system-rpc-runtime-api
3.0.0 - frame-try-runtime
0.9.0 - impl-codec
0.5.0 - kusama-runtime
0.9.3 - nft
3.0.0 - nft-data-structs
0.9.0 - nft-runtime
3.0.0 - pallet-aura
3.0.0 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-beefy
0.1.0 - pallet-bounties
3.0.0 - pallet-bridge-grandpa
0.1.0 - pallet-collective
3.0.0 - pallet-contract-helpers
0.1.0 - pallet-contracts
3.0.0 - pallet-contracts-primitives
3.0.0 - pallet-contracts-rpc
3.0.0 - pallet-contracts-rpc-runtime-api
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-gilt
3.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-inflation
3.0.0 - pallet-membership
3.0.0 - pallet-mmr
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-mmr-rpc
3.0.0 - pallet-multisig
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-recovery
3.0.0 - pallet-scheduler
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-society
3.0.0 - pallet-staking
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-tips
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - pallet-treasury
3.0.0 - pallet-utility
3.0.0 - pallet-vesting
3.0.0 - pallet-xcm
0.1.0 - parachain-info
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-core-primitives
0.9.3 - polkadot-erasure-coding
0.9.3 - polkadot-network-bridge
0.1.0 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-pvf
0.1.0 - polkadot-node-jaeger
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-rpc
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-statement-distribution
0.1.0 - polkadot-statement-table
0.9.3 - polkadot-test-runtime
0.9.3 - remote-externalities
0.9.0 - rococo-runtime
0.9.3 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-block-builder
0.9.0 - sc-chain-spec
3.0.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-epochs
0.9.0 - sc-consensus-slots
0.9.0 - sc-executor
0.9.0 - sc-executor-common
0.9.0 - sc-executor-wasmi
0.9.0 - sc-executor-wasmtime
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-light
3.0.0 - sc-network
0.9.0 - sc-offchain
3.0.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-service
0.9.0 - sc-state-db
0.9.0 - sc-transaction-pool
3.0.0 - slot-range-helper
0.9.3 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-arithmetic
3.0.0 - sp-authority-discovery
3.0.0 - sp-authorship
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-consensus-babe
0.9.0 - sp-consensus-slots
0.9.0 - sp-consensus-vrf
0.9.0 - sp-core
3.0.0 - sp-externalities
0.9.0 - sp-finality-grandpa
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-npos-elections
3.0.0 - sp-runtime
3.0.0 - sp-runtime-interface
3.0.0 - sp-sandbox
0.9.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-state-machine
0.9.0 - sp-storage
3.0.0 - sp-timestamp
3.0.0 - sp-tracing
3.0.0 - sp-transaction-pool
3.0.0 - sp-trie
3.0.0 - sp-version
3.0.0 - sp-version-proc-macro
3.0.0 - sp-wasm-interface
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-test-client
2.0.1 - try-runtime-cli
0.9.0 - westend-runtime
0.9.3 - xcm
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
- beefy-gadget
parity-scale-codec-derive
2.1.3crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum81038e13ca2c32587201d544ea2e6b6c47120f1e4eae04478f9f60b6bcb89145used byparity-send-wrapper
0.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6fused byparity-tokio-ipc
0.4.0crates.io↘ 11↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bfdepends onused byparity-util-mem
0.9.0crates.io↘ 10↖ 16sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum664a8c6b8e62d8f9f2f937e391982eb433ab285b4cd9545b342441e04a906e42depends onused by- kvdb
0.9.0 - kvdb-memorydb
0.9.0 - kvdb-rocksdb
0.11.1 - memory-db
0.26.0 - polkadot-core-primitives
0.9.3 - polkadot-node-core-runtime-api
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - sc-client-db
0.9.0 - sc-informant
0.9.0 - sc-service
0.9.0 - sc-state-db
0.9.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - sp-core
3.0.0 - sp-runtime
3.0.0
- kvdb
parity-util-mem-derive
0.1.0crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2parity-wasm
0.32.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512acdepends onused byparity-wasm
0.41.0crates.io↘ 0↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865parity-wasm
0.42.2crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbe5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92parity-ws
0.10.0crates.io↘ 10↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9e02a625dd75084c2a7024f07c575b61b782f729d18702dabb3cdbf31911dc61depends onused byparking
2.0.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72parking_lot
0.9.0crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252parking_lot
0.10.2crates.io↘ 2↖ 11sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505edepends onparking_lot
0.11.1crates.io↘ 3↖ 46sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15ebused by- beefy-gadget
0.1.0 - fc-db
1.0.0 - finality-grandpa
0.14.1 - kvdb-memorydb
0.9.0 - kvdb-rocksdb
0.11.1 - libp2p
0.37.1 - libp2p-core
0.28.3 - libp2p-mplex
0.28.0 - libp2p-yamux
0.32.0 - once_cell
1.8.0 - parity-db
0.2.4 - parity-util-mem
0.9.0 - polkadot-network-bridge
0.1.0 - polkadot-node-jaeger
0.1.0 - polkadot-node-subsystem
0.1.0 - prometheus
0.11.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus
0.9.0 - sc-consensus-babe
0.9.0 - sc-executor
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-keystore
3.0.0 - sc-light
3.0.0 - sc-network
0.9.0 - sc-offchain
3.0.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-service
0.9.0 - sc-state-db
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-database
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-state-machine
0.9.0 - static_init
0.5.2 - trust-dns-resolver
0.20.3 - wasm-timer
0.2.5 - yamux
0.9.0
- beefy-gadget
parking_lot_core
0.6.2crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62bdepends onused byparking_lot_core
0.7.2crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3used byparking_lot_core
0.8.3crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018used bypaste
1.0.5crates.io↘ 0↖ 8sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumacbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58pbkdf2
0.3.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9depends onused bypbkdf2
0.4.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbddepends onused bypdqselect
0.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4ec91767ecc0a0bbe558ce8c9da33c068066c57ecc8bb8477ef8c1ad3ef77c27used bypeeking_take_while
0.1.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099used bypercent-encoding
1.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831used bypercent-encoding
2.1.0crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32epest
2.1.3crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53depends onpest_derive
2.1.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0depends onused bypest_generator
2.1.3crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55used bypest_meta
2.1.3crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11ddepends onused bypetgraph
0.5.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7depends onused bypin-project
0.4.28crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0fdepends onpin-project
1.0.7crates.io↘ 1↖ 14sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4depends onpin-project-internal
0.4.28crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5edepends onused bypin-project-internal
1.0.7crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426fdepends onused bypin-project-lite
0.1.12crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777pin-project-lite
0.2.6crates.io↘ 0↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905pin-utils
0.1.0crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184pkg-config
0.3.19crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884cused byplatforms
1.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325polkadot-approval-distribution
0.1.0github.com/paritytech/polkadot↘ 7↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-availability-bitfield-distribution
0.1.0github.com/paritytech/polkadot↘ 6↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-availability-distribution
0.1.0github.com/paritytech/polkadot↘ 16↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- futures
0.3.15 - lru
0.6.5 - parity-scale-codec
2.1.3 - polkadot-erasure-coding
0.9.3 - polkadot-node-core-runtime-api
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-primitives
0.9.3 - rand
0.8.4 - sp-application-crypto
3.0.0 - sp-core
3.0.0 - sp-keystore
0.9.0 - thiserror
1.0.25 - tracing
0.1.26
used by- futures
polkadot-availability-recovery
0.1.0github.com/paritytech/polkadot↘ 12↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-cli
0.9.3github.com/paritytech/polkadot↘ 13↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-collator-protocol
0.1.0github.com/paritytech/polkadot↘ 13↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-core-primitives
0.9.3github.com/paritytech/polkadot↘ 5↖ 5sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2polkadot-erasure-coding
0.9.3github.com/paritytech/polkadot↘ 7↖ 5sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onpolkadot-gossip-support
0.1.0github.com/paritytech/polkadot↘ 8↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-network-bridge
0.1.0github.com/paritytech/polkadot↘ 13↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-collation-generation
0.1.0github.com/paritytech/polkadot↘ 11↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-approval-voting
0.1.0github.com/paritytech/polkadot↘ 22↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- bitvec
0.20.4 - derive_more
0.99.14 - futures
0.3.15 - futures-timer
3.0.2 - kvdb
0.9.0 - merlin
2.0.1 - parity-scale-codec
2.1.3 - polkadot-node-jaeger
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - polkadot-primitives
0.9.3 - sc-client-api
3.0.0 - sc-keystore
3.0.0 - schnorrkel
0.9.1 - sp-application-crypto
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-slots
0.9.0 - sp-runtime
3.0.0 - tracing
0.1.26
used by- bitvec
polkadot-node-core-av-store
0.1.0github.com/paritytech/polkadot↘ 13↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-backing
0.1.0github.com/paritytech/polkadot↘ 11↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-bitfield-signing
0.1.0github.com/paritytech/polkadot↘ 8↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-candidate-selection
0.1.0github.com/paritytech/polkadot↘ 8↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-candidate-validation
0.1.0github.com/paritytech/polkadot↘ 11↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-chain-api
0.1.0github.com/paritytech/polkadot↘ 6↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-parachains-inherent
0.1.0github.com/paritytech/polkadot↘ 11↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-provisioner
0.1.0github.com/paritytech/polkadot↘ 8↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-node-core-pvf
0.1.0github.com/paritytech/polkadot↘ 21↖ 2sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- always-assert
0.1.2 - assert_matches
1.5.0 - async-process
1.1.0 - async-std
1.9.0 - futures
0.3.15 - futures-timer
3.0.2 - libc
0.2.97 - parity-scale-codec
2.1.3 - pin-project
1.0.7 - polkadot-core-primitives
0.9.3 - polkadot-parachain
0.9.3 - rand
0.8.4 - sc-executor
0.9.0 - sc-executor-common
0.9.0 - sc-executor-wasmtime
0.9.0 - slotmap
1.0.3 - sp-core
3.0.0 - sp-externalities
0.9.0 - sp-io
3.0.0 - sp-wasm-interface
3.0.0 - tracing
0.1.26
- always-assert
polkadot-node-core-runtime-api
0.1.0github.com/paritytech/polkadot↘ 11↖ 2sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onpolkadot-node-jaeger
0.1.0github.com/paritytech/polkadot↘ 11↖ 4sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onpolkadot-node-network-protocol
0.1.0github.com/paritytech/polkadot↘ 8↖ 10sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused by- polkadot-approval-distribution
0.1.0 - polkadot-availability-bitfield-distribution
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-gossip-support
0.1.0 - polkadot-network-bridge
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-statement-distribution
0.1.0
- polkadot-approval-distribution
polkadot-node-primitives
0.1.0github.com/paritytech/polkadot↘ 15↖ 22sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused by- cumulus-client-collator
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - polkadot-approval-distribution
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-erasure-coding
0.9.3 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-jaeger
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0 - polkadot-test-service
0.9.3
- cumulus-client-collator
polkadot-node-subsystem
0.1.0github.com/paritytech/polkadot↘ 23↖ 25sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- async-std
1.9.0 - async-trait
0.1.50 - derive_more
0.99.14 - futures
0.3.15 - futures-timer
3.0.2 - lazy_static
1.4.0 - log
0.4.14 - mick-jaeger
0.1.4 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - pin-project
1.0.7 - polkadot-node-jaeger
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-primitives
0.9.3 - polkadot-procmacro-subsystem-dispatch-gen
0.1.0 - polkadot-statement-table
0.9.3 - sc-network
0.9.0 - smallvec
1.6.1 - sp-core
3.0.0 - substrate-prometheus-endpoint
0.9.0 - thiserror
1.0.25 - tracing
0.1.26
used by- cumulus-client-collator
0.1.0 - cumulus-client-pov-recovery
0.1.0 - polkadot-approval-distribution
0.1.0 - polkadot-availability-bitfield-distribution
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-gossip-support
0.1.0 - polkadot-network-bridge
0.1.0 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-bitfield-signing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-chain-api
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0 - polkadot-test-service
0.9.3
- async-std
polkadot-node-subsystem-util
0.1.0github.com/paritytech/polkadot↘ 21↖ 20sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- async-trait
0.1.50 - futures
0.3.15 - futures-timer
3.0.2 - lru
0.6.5 - metered-channel
0.1.0 - parity-scale-codec
2.1.3 - pin-project
1.0.7 - polkadot-node-jaeger
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-primitives
0.9.3 - rand
0.8.4 - sc-network
0.9.0 - sp-application-crypto
3.0.0 - sp-core
3.0.0 - sp-keystore
0.9.0 - streamunordered
0.5.2 - substrate-prometheus-endpoint
0.9.0 - thiserror
1.0.25 - tracing
0.1.26
used by- polkadot-approval-distribution
0.1.0 - polkadot-availability-bitfield-distribution
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-gossip-support
0.1.0 - polkadot-network-bridge
0.1.0 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-bitfield-signing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-chain-api
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-overseer
0.1.0 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0
- async-trait
polkadot-overseer
0.1.0github.com/paritytech/polkadot↘ 11↖ 8sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onpolkadot-parachain
0.9.3github.com/paritytech/polkadot↘ 8↖ 17sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused by- cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-utility
0.1.0 - nft
3.0.0 - nft-runtime
3.0.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-pvf
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-primitives
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - rococo-runtime
0.9.3 - westend-runtime
0.9.3 - xcm-builder
0.9.3
- cumulus-client-network
polkadot-primitives
0.9.3github.com/paritytech/polkadot↘ 22↖ 45sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- bitvec
0.20.4 - frame-system
3.0.0 - hex-literal
0.3.1 - parity-scale-codec
2.1.3 - parity-util-mem
0.9.0 - polkadot-core-primitives
0.9.3 - polkadot-parachain
0.9.3 - serde
1.0.126 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-arithmetic
3.0.0 - sp-authority-discovery
3.0.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-staking
3.0.0 - sp-std
3.0.0 - sp-trie
3.0.0 - sp-version
3.0.0 - thiserror
1.0.25
used by- cumulus-client-collator
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-utility
0.1.0 - kusama-runtime
0.9.3 - nft
3.0.0 - polkadot-approval-distribution
0.1.0 - polkadot-availability-bitfield-distribution
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-erasure-coding
0.9.3 - polkadot-gossip-support
0.1.0 - polkadot-network-bridge
0.1.0 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-bitfield-signing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-chain-api
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-node-jaeger
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - polkadot-rpc
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0 - polkadot-statement-table
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - rococo-runtime
0.9.3 - westend-runtime
0.9.3
- bitvec
polkadot-procmacro-overseer-subsystems-gen
0.1.0github.com/paritytech/polkadot↘ 4↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2used bypolkadot-procmacro-subsystem-dispatch-gen
0.1.0github.com/paritytech/polkadot↘ 4↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2used bypolkadot-rpc
0.9.3github.com/paritytech/polkadot↘ 26↖ 2sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- beefy-gadget
0.1.0 - beefy-gadget-rpc
0.1.0 - jsonrpc-core
15.1.0 - pallet-mmr-rpc
3.0.0 - pallet-transaction-payment-rpc
3.0.0 - parity-scale-codec
2.1.3 - polkadot-primitives
0.9.3 - sc-chain-spec
3.0.0 - sc-client-api
3.0.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-consensus-epochs
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-keystore
3.0.0 - sc-rpc
3.0.0 - sc-sync-state-rpc
0.9.0 - sp-api
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-babe
0.9.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-transaction-pool
3.0.0 - substrate-frame-rpc-system
3.0.0
- beefy-gadget
polkadot-runtime
0.9.3github.com/paritytech/polkadot↘ 63↖ 2sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- beefy-primitives
0.1.0 - bitvec
0.20.4 - frame-executive
3.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-rpc-runtime-api
3.0.0 - frame-try-runtime
0.9.0 - log
0.4.14 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-bounties
3.0.0 - pallet-collective
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-membership
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-multisig
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-staking
3.0.0 - pallet-staking-reward-curve
3.0.0 - pallet-timestamp
3.0.0 - pallet-tips
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - pallet-treasury
3.0.0 - pallet-utility
3.0.0 - pallet-vesting
3.0.0 - parity-scale-codec
2.1.3 - polkadot-primitives
0.9.3 - polkadot-runtime-common
0.9.3 - rustc-hex
2.1.0 - serde
1.0.126 - serde_derive
1.0.126 - smallvec
1.6.1 - sp-api
3.0.0 - sp-authority-discovery
3.0.0 - sp-block-builder
3.0.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-npos-elections
3.0.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-std
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0 - static_assertions
1.1.0 - substrate-wasm-builder
3.0.0
- beefy-primitives
polkadot-runtime-common
0.9.3github.com/paritytech/polkadot↘ 35↖ 6sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- beefy-primitives
0.1.0 - bitvec
0.20.4 - frame-support
3.0.0 - frame-system
3.0.0 - impl-trait-for-tuples
0.2.1 - libsecp256k1
0.3.5 - log
0.4.14 - pallet-authorship
3.0.0 - pallet-balances
3.0.0 - pallet-beefy
0.1.0 - pallet-mmr
3.0.0 - pallet-offences
3.0.0 - pallet-session
3.0.0 - pallet-staking
3.0.0 - pallet-timestamp
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-treasury
3.0.0 - pallet-vesting
3.0.0 - parity-scale-codec
2.1.3 - polkadot-primitives
0.9.3 - polkadot-runtime-parachains
0.9.3 - rustc-hex
2.1.0 - serde
1.0.126 - serde_derive
1.0.126 - slot-range-helper
0.9.3 - sp-api
3.0.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-std
3.0.0 - static_assertions
1.1.0 - xcm
0.9.3
- beefy-primitives
polkadot-runtime-parachains
0.9.3github.com/paritytech/polkadot↘ 30↖ 7sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- bitvec
0.20.4 - derive_more
0.99.14 - frame-support
3.0.0 - frame-system
3.0.0 - log
0.4.14 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-balances
3.0.0 - pallet-offences
3.0.0 - pallet-session
3.0.0 - pallet-staking
3.0.0 - pallet-timestamp
3.0.0 - pallet-vesting
3.0.0 - parity-scale-codec
2.1.3 - polkadot-primitives
0.9.3 - rand
0.8.4 - rand_chacha
0.3.1 - rustc-hex
2.1.0 - serde
1.0.126 - sp-api
3.0.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-std
3.0.0 - xcm
0.9.3 - xcm-executor
0.9.3
- bitvec
polkadot-service
0.9.3github.com/paritytech/polkadot↘ 85↖ 8sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- beefy-gadget
0.1.0 - beefy-primitives
0.1.0 - frame-benchmarking
3.1.0 - frame-system-rpc-runtime-api
3.0.0 - futures
0.3.15 - hex-literal
0.3.1 - kusama-runtime
0.9.3 - kvdb
0.9.0 - kvdb-rocksdb
0.11.1 - pallet-babe
3.0.0 - pallet-im-online
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-staking
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - polkadot-approval-distribution
0.1.0 - polkadot-availability-bitfield-distribution
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-gossip-support
0.1.0 - polkadot-network-bridge
0.1.0 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-bitfield-signing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-chain-api
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-rpc
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-statement-distribution
0.1.0 - rococo-runtime
0.9.3 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-block-builder
0.9.0 - sc-chain-spec
3.0.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-slots
0.9.0 - sc-consensus-uncles
0.9.0 - sc-executor
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-service
0.9.0 - sc-telemetry
3.0.0 - sc-transaction-pool
3.0.0 - serde
1.0.126 - sp-api
3.0.0 - sp-authority-discovery
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-finality-grandpa
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-state-machine
0.9.0 - sp-storage
3.0.0 - sp-timestamp
3.0.0 - sp-transaction-pool
3.0.0 - sp-trie
3.0.0 - substrate-prometheus-endpoint
0.9.0 - thiserror
1.0.25 - tracing
0.1.26 - westend-runtime
0.9.3
- beefy-gadget
polkadot-statement-distribution
0.1.0github.com/paritytech/polkadot↘ 14↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onused bypolkadot-statement-table
0.9.3github.com/paritytech/polkadot↘ 3↖ 5sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2polkadot-test-runtime
0.9.3github.com/paritytech/polkadot↘ 50↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- beefy-primitives
0.1.0 - bitvec
0.20.4 - frame-election-provider-support
3.0.0 - frame-executive
3.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-rpc-runtime-api
3.0.0 - log
0.4.14 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-grandpa
3.0.0 - pallet-indices
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-session
3.0.0 - pallet-staking
3.0.0 - pallet-staking-reward-curve
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - pallet-vesting
3.0.0 - parity-scale-codec
2.1.3 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - rustc-hex
2.1.0 - serde
1.0.126 - serde_derive
1.0.126 - smallvec
1.6.1 - sp-api
3.0.0 - sp-authority-discovery
3.0.0 - sp-block-builder
3.0.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-std
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0 - substrate-wasm-builder
3.0.0
used by- beefy-primitives
polkadot-test-service
0.9.3github.com/paritytech/polkadot↘ 45↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- frame-benchmarking
3.1.0 - frame-system
3.0.0 - futures
0.1.31 - futures
0.3.15 - hex
0.4.3 - pallet-balances
3.0.0 - pallet-staking
3.0.0 - pallet-transaction-payment
3.0.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-overseer
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-rpc
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - rand
0.8.4 - sc-authority-discovery
0.9.0 - sc-chain-spec
3.0.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-consensus
0.9.0 - sc-consensus-babe
0.9.0 - sc-executor
0.9.0 - sc-finality-grandpa
0.9.0 - sc-network
0.9.0 - sc-service
0.9.0 - sc-tracing
3.0.0 - sc-transaction-pool
3.0.0 - sp-arithmetic
3.0.0 - sp-authority-discovery
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-finality-grandpa
3.0.0 - sp-inherents
3.0.0 - sp-keyring
3.0.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0 - substrate-test-client
2.0.1 - tempfile
3.2.0 - tracing
0.1.26
used by- frame-benchmarking
polling
2.1.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25used bypoly1305
0.6.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4b7456bc1ad2d4cf82b3a016be4c2ac48daf11bf990c1603ebd447fe6f30fca8depends onused bypolyval
0.4.5crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumeebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cdused byppv-lite86
0.2.10crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857primitive-types
0.7.3crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7dd39dcacf71411ba488570da7bbc89b717225e46478b30ba99b92db6b149809used byprimitive-types
0.9.0crates.io↘ 5↖ 11sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adaceproc-macro-crate
0.1.5crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785depends onproc-macro-crate
1.0.0crates.io↘ 2↖ 12sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92depends onused by- frame-support-procedural-tools
3.0.0 - jsonrpsee-proc-macros
0.2.0-alpha.6 - multihash-derive
0.7.2 - pallet-staking-reward-curve
3.0.0 - parity-scale-codec-derive
2.1.3 - sc-chain-spec-derive
3.0.0 - sc-tracing-proc-macro
3.0.0 - sp-api-proc-macro
3.0.0 - sp-npos-elections-compact
3.0.0 - sp-runtime-interface-proc-macro
3.0.0 - sp-version-proc-macro
3.0.0 - substrate-test-utils-derive
0.9.0
- frame-support-procedural-tools
proc-macro-error
1.0.4crates.io↘ 5↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumda25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38cproc-macro-error-attr
1.0.4crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869used byproc-macro-hack
0.5.19crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5proc-macro-nested
0.1.7crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086used byproc-macro2
1.0.27crates.io↘ 1↖ 58sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038depends onused by- async-trait
0.1.50 - bindgen
0.57.0 - darling_core
0.13.0 - derivative
2.2.0 - derive_more
0.99.14 - dyn-clonable-impl
0.9.0 - enum-as-inner
0.3.3 - enumflags2_derive
0.6.4 - enumn
0.1.3 - evm-coder-macros
0.1.0 - failure_derive
0.1.8 - frame-support-procedural
3.0.0 - frame-support-procedural-tools
3.0.0 - frame-support-procedural-tools-derive
3.0.0 - futures-macro
0.3.15 - impl-trait-for-tuples
0.1.3 - impl-trait-for-tuples
0.2.1 - jsonrpc-derive
14.2.2 - jsonrpc-derive
15.1.0 - jsonrpsee-proc-macros
0.2.0-alpha.6 - minicbor-derive
0.6.3 - multihash-derive
0.7.2 - nalgebra-macros
0.1.0 - pallet-contracts-proc-macro
3.0.0 - pallet-staking-reward-curve
3.0.0 - parity-scale-codec-derive
2.1.3 - parity-util-mem-derive
0.1.0 - pest_generator
2.1.3 - pin-project-internal
0.4.28 - pin-project-internal
1.0.7 - polkadot-procmacro-overseer-subsystems-gen
0.1.0 - polkadot-procmacro-subsystem-dispatch-gen
0.1.0 - proc-macro-error
1.0.4 - proc-macro-error-attr
1.0.4 - prost-derive
0.7.0 - quote
1.0.9 - ref-cast-impl
1.0.6 - rlp-derive
0.1.0 - sc-chain-spec-derive
3.0.0 - sc-tracing-proc-macro
3.0.0 - scroll_derive
0.10.5 - serde_derive
1.0.126 - sp-api-proc-macro
3.0.0 - sp-debug-derive
3.0.0 - sp-npos-elections-compact
3.0.0 - sp-runtime-interface-proc-macro
3.0.0 - sp-version-proc-macro
3.0.0 - static_init_macro
0.5.0 - structopt-derive
0.4.14 - strum_macros
0.20.1 - syn
1.0.73 - synstructure
0.12.4 - thiserror-impl
1.0.25 - tokio-macros
0.2.6 - tracing-attributes
0.1.15 - wasm-bindgen-backend
0.2.74 - wasm-bindgen-macro-support
0.2.74 - zeroize_derive
1.1.0
- async-trait
prometheus
0.11.0crates.io↘ 6↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc8425533e7122f0c3cc7a37e6244b16ad3a2cc32ae7ac6276e2a75da0d9c200dprost
0.7.0crates.io↘ 2↖ 13sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2depends onprost-build
0.7.0crates.io↘ 10↖ 10sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3depends onprost-derive
0.7.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4used byprost-types
0.7.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bbdepends onused bypsm
0.1.13crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum21ff0279b4a85e576b97e4a21d13e437ebcd56612706cde5d3f0d5c9399490c0depends onused bypwasm-utils
0.14.0crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0f53bc2558e8376358ebdc28301546471d67336584f6438ed4b7c7457a055fd7depends onpwasm-utils
0.17.1crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum78778a25194f953d1766fc8c6a331ed56f070d09a0511267ee2c150cb71ea8c2depends onused byquick-error
1.2.3crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0quick-error
2.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3used byquicksink
0.1.2crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858used byquote
1.0.9crates.io↘ 1↖ 62sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7depends onused by- async-attributes
1.1.2 - async-trait
0.1.50 - bindgen
0.57.0 - ctor
0.1.20 - darling_core
0.13.0 - darling_macro
0.13.0 - derivative
2.2.0 - derive_more
0.99.14 - dyn-clonable-impl
0.9.0 - enum-as-inner
0.3.3 - enumflags2_derive
0.6.4 - enumn
0.1.3 - evm-coder-macros
0.1.0 - failure_derive
0.1.8 - frame-support-procedural
3.0.0 - frame-support-procedural-tools
3.0.0 - frame-support-procedural-tools-derive
3.0.0 - futures-macro
0.3.15 - impl-trait-for-tuples
0.1.3 - impl-trait-for-tuples
0.2.1 - jsonrpc-derive
14.2.2 - jsonrpc-derive
15.1.0 - jsonrpsee-proc-macros
0.2.0-alpha.6 - libp2p-swarm-derive
0.23.0 - minicbor-derive
0.6.3 - multihash-derive
0.7.2 - nalgebra-macros
0.1.0 - pallet-contracts-proc-macro
3.0.0 - pallet-staking-reward-curve
3.0.0 - parity-scale-codec-derive
2.1.3 - pest_generator
2.1.3 - pin-project-internal
0.4.28 - pin-project-internal
1.0.7 - polkadot-procmacro-overseer-subsystems-gen
0.1.0 - polkadot-procmacro-subsystem-dispatch-gen
0.1.0 - proc-macro-error
1.0.4 - proc-macro-error-attr
1.0.4 - prost-derive
0.7.0 - ref-cast-impl
1.0.6 - rlp-derive
0.1.0 - sc-chain-spec-derive
3.0.0 - sc-tracing-proc-macro
3.0.0 - scroll_derive
0.10.5 - serde_derive
1.0.126 - sp-api-proc-macro
3.0.0 - sp-debug-derive
3.0.0 - sp-npos-elections-compact
3.0.0 - sp-runtime-interface-proc-macro
3.0.0 - sp-version-proc-macro
3.0.0 - static_init_macro
0.5.0 - structopt-derive
0.4.14 - strum_macros
0.20.1 - substrate-test-utils-derive
0.9.0 - syn
1.0.73 - synstructure
0.12.4 - thiserror-impl
1.0.25 - tokio-macros
0.2.6 - tracing-attributes
0.1.15 - wasm-bindgen-backend
0.2.74 - wasm-bindgen-macro
0.2.74 - wasm-bindgen-macro-support
0.2.74 - zeroize_derive
1.1.0
- async-attributes
radium
0.3.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdef50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47acused byradium
0.6.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fbused byrand
0.3.23crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76cdepends onused byrand
0.4.6crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293used byrand
0.7.3crates.io↘ 6↖ 38sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03used by- cuckoofilter
0.5.0 - ed25519-dalek
1.0.1 - fc-rpc
2.0.0-dev - fixed-hash
0.6.1 - jsonrpc-pubsub
14.2.0 - jsonrpc-pubsub
15.1.0 - libp2p-core
0.28.3 - libp2p-floodsub
0.29.0 - libp2p-gossipsub
0.30.1 - libp2p-kad
0.30.0 - libp2p-mplex
0.28.0 - libp2p-noise
0.30.0 - libp2p-ping
0.29.0 - libp2p-pnet
0.20.0 - libp2p-relay
0.2.0 - libp2p-request-response
0.11.0 - libp2p-swarm
0.29.0 - libsecp256k1
0.3.5 - mick-jaeger
0.1.4 - parity-tokio-ipc
0.4.0 - parity-ws
0.10.0 - sc-authority-discovery
0.9.0 - sc-cli
0.9.0 - sc-consensus-babe
0.9.0 - sc-finality-grandpa
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-offchain
3.0.0 - sc-service
0.9.0 - sc-telemetry
3.0.0 - schnorrkel
0.9.1 - snow
0.7.2 - soketto
0.4.2 - sp-core
3.0.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0 - tiny-bip39
0.8.0 - twox-hash
1.6.0
- cuckoofilter
rand
0.8.4crates.io↘ 4↖ 18sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8used by- cumulus-client-pov-recovery
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - fixed-hash
0.7.0 - libp2p-mdns
0.30.2 - nalgebra
0.26.2 - parity-db
0.2.4 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-node-core-pvf
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-runtime-parachains
0.9.3 - polkadot-test-service
0.9.3 - rand_distr
0.4.1 - statrs
0.14.0 - tempfile
3.2.0 - trust-dns-proto
0.20.3 - yamux
0.9.0
- cumulus-client-pov-recovery
rand_chacha
0.2.2crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402depends onused byrand_chacha
0.3.1crates.io↘ 2↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88depends onrand_core
0.3.1crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4bdepends onused byrand_core
0.4.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dcused byrand_core
0.5.1crates.io↘ 1↖ 10sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19depends onrand_core
0.6.3crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7depends onrand_distr
0.4.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum051b398806e42b9cd04ad9ec8f81e355d0a382c543ac6672c62f5a5b452ef142depends onused byrand_hc
0.2.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613cdepends onused byrand_hc
0.3.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7depends onused byrand_pcg
0.2.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429depends onused byrawpointer
0.2.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3used byrayon
1.5.1crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90used byrayon-core
1.9.1crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8edepends onused byrdrand
0.4.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2depends onused byredox_syscall
0.1.57crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ceredox_syscall
0.2.9crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feeedepends onredox_users
0.4.0crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64depends onreed-solomon-novelpoly
1.0.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221used byref-cast
1.0.6crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541dadepends onused byref-cast-impl
1.0.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2depends onused byregalloc
0.0.31crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5used byregex
1.5.4crates.io↘ 3↖ 13sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461regex-automata
0.1.10crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132depends onused byregex-syntax
0.6.25crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89bregion
2.2.0crates.io↘ 4↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0remote-externalities
0.9.0github.com/paritytech/substrate.git↘ 9↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused byremove_dir_all
0.5.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7depends onused byresolv-conf
0.7.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00depends onused byretain_mut
0.1.3crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume9c17925a9027d298a4603d286befe3f9dc0e8ed02523141914eb628798d6e5bring
0.16.20crates.io↘ 7↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fcrlp
0.4.6crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73depends onrlp
0.5.0crates.io↘ 2↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume54369147e3e7796c9b885c7304db87ca3d09a0a98f72843d532868675bbfba8depends onrlp-derive
0.1.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672adepends onused byrocksdb
0.16.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc749134fda8bfc90d0de643d59bfc841dcb3ac8a1062e12b6754bd60235c48b3depends onused byrococo-runtime
0.9.3github.com/paritytech/polkadot↘ 59↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- beefy-primitives
0.1.0 - bp-rococo
0.1.0 - bp-wococo
0.1.0 - frame-executive
3.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-rpc-runtime-api
3.0.0 - hex-literal
0.3.1 - log
0.4.14 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-beefy
0.1.0 - pallet-bridge-grandpa
0.1.0 - pallet-collective
3.0.0 - pallet-grandpa
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-membership
3.0.0 - pallet-mmr
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-session
3.0.0 - pallet-staking
3.0.0 - pallet-staking-reward-curve
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - pallet-utility
3.0.0 - pallet-xcm
0.1.0 - parity-scale-codec
2.1.3 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - serde
1.0.126 - serde_derive
1.0.126 - smallvec
1.6.1 - sp-api
3.0.0 - sp-authority-discovery
3.0.0 - sp-block-builder
3.0.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-std
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0 - substrate-wasm-builder
3.0.0 - xcm
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
used by- beefy-primitives
rpassword
5.0.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efbdepends onused byrustc_version
0.2.3crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030adepends onrustc-demangle
0.1.19crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70cerustc-hash
1.1.0crates.io↘ 0↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2rustc-hex
2.1.0crates.io↘ 0↖ 15sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6rustls
0.18.1crates.io↘ 5↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81rustls
0.19.1crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7used byrustls-native-certs
0.4.0crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum629d439a7672da82dd955498445e496ee2096fe2117b9f796558a43fdb9e59b8used byruzstd
0.2.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00depends onrw-stream-sink
0.2.1crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020ryu
1.0.5crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86eused bysafe-mix
1.0.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215cdepends onsalsa20
0.7.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum399f290ffc409596022fce5ea5d4138184be4784f2b28c62c59f0d8389059a15depends onused bysame-file
1.0.6crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502depends onused bysc-authority-discovery
0.9.0github.com/paritytech/substrate.git↘ 22↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-trait
0.1.50 - derive_more
0.99.14 - either
1.6.1 - futures
0.3.15 - futures-timer
3.0.2 - ip_network
0.3.4 - libp2p
0.37.1 - log
0.4.14 - parity-scale-codec
2.1.3 - prost
0.7.0 - prost-build
0.7.0 - rand
0.7.3 - sc-client-api
3.0.0 - sc-network
0.9.0 - serde_json
1.0.64 - sp-api
3.0.0 - sp-authority-discovery
3.0.0 - sp-blockchain
3.0.0 - sp-core
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - substrate-prometheus-endpoint
0.9.0
- async-trait
sc-basic-authorship
0.9.0github.com/paritytech/substrate.git↘ 16↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-block-builder
0.9.0github.com/paritytech/substrate.git↘ 9↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-chain-spec
3.0.0github.com/paritytech/substrate.git↘ 14↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-chain-spec-derive
3.0.0github.com/paritytech/substrate.git↘ 4↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysc-cli
0.9.0github.com/paritytech/substrate.git↘ 31↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- chrono
0.4.19 - fdlimit
0.2.1 - futures
0.3.15 - hex
0.4.3 - libp2p
0.37.1 - log
0.4.14 - names
0.11.0 - parity-scale-codec
2.1.3 - rand
0.7.3 - regex
1.5.4 - rpassword
5.0.1 - sc-client-api
3.0.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-service
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - serde
1.0.126 - serde_json
1.0.64 - sp-blockchain
3.0.0 - sp-core
3.0.0 - sp-keyring
3.0.0 - sp-keystore
0.9.0 - sp-panic-handler
3.0.0 - sp-runtime
3.0.0 - sp-utils
3.0.0 - sp-version
3.0.0 - structopt
0.3.21 - thiserror
1.0.25 - tiny-bip39
0.8.0 - tokio
0.2.25
- chrono
sc-client-api
3.0.0github.com/paritytech/substrate.git↘ 27↖ 45sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- derive_more
0.99.14 - fnv
1.0.7 - futures
0.3.15 - hash-db
0.15.2 - kvdb
0.9.0 - lazy_static
1.4.0 - log
0.4.14 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - sc-executor
0.9.0 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-database
3.0.0 - sp-externalities
0.9.0 - sp-inherents
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0 - sp-std
3.0.0 - sp-storage
3.0.0 - sp-transaction-pool
3.0.0 - sp-trie
3.0.0 - sp-utils
3.0.0 - sp-version
3.0.0 - substrate-prometheus-endpoint
0.9.0
used by- beefy-gadget
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - fc-consensus
2.0.0-dev - fc-mapping-sync
2.0.0-dev - fc-rpc
2.0.0-dev - nft
3.0.0 - nft-rpc
3.3.1 - polkadot-node-core-approval-voting
0.1.0 - polkadot-overseer
0.1.0 - polkadot-rpc
0.9.3 - polkadot-service
0.9.3 - polkadot-test-service
0.9.3 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-block-builder
0.9.0 - sc-cli
0.9.0 - sc-client-db
0.9.0 - sc-consensus
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-epochs
0.9.0 - sc-consensus-slots
0.9.0 - sc-consensus-uncles
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-informant
0.9.0 - sc-light
3.0.0 - sc-network
0.9.0 - sc-offchain
3.0.0 - sc-rpc
3.0.0 - sc-service
0.9.0 - sc-state-db
0.9.0 - sc-sync-state-rpc
0.9.0 - sc-tracing
3.0.0 - sc-transaction-pool
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-test-client
2.0.1 - try-runtime-cli
0.9.0
- derive_more
sc-client-db
0.9.0github.com/paritytech/substrate.git↘ 23↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- blake2-rfc
0.2.18 - hash-db
0.15.2 - kvdb
0.9.0 - kvdb-memorydb
0.9.0 - kvdb-rocksdb
0.11.1 - linked-hash-map
0.5.4 - log
0.4.14 - parity-db
0.2.4 - parity-scale-codec
2.1.3 - parity-util-mem
0.9.0 - parking_lot
0.11.1 - sc-client-api
3.0.0 - sc-executor
0.9.0 - sc-state-db
0.9.0 - sp-arithmetic
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-database
3.0.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0 - sp-trie
3.0.0 - substrate-prometheus-endpoint
0.9.0
- blake2-rfc
sc-consensus
0.9.0github.com/paritytech/substrate.git↘ 5↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sc-consensus-aura
0.9.0github.com/paritytech/substrate.git↘ 24↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-trait
0.1.50 - derive_more
0.99.14 - futures
0.3.15 - futures-timer
3.0.2 - log
0.4.14 - parity-scale-codec
2.1.3 - sc-block-builder
0.9.0 - sc-client-api
3.0.0 - sc-consensus-slots
0.9.0 - sc-telemetry
3.0.0 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-consensus-slots
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-version
3.0.0 - substrate-prometheus-endpoint
0.9.0
- async-trait
sc-consensus-babe
0.9.0github.com/paritytech/substrate.git↘ 39↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-trait
0.1.50 - derive_more
0.99.14 - fork-tree
3.0.0 - futures
0.3.15 - futures-timer
3.0.2 - log
0.4.14 - merlin
2.0.1 - num-bigint
0.2.6 - num-rational
0.2.4 - num-traits
0.2.14 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - pdqselect
0.1.0 - rand
0.7.3 - retain_mut
0.1.3 - sc-client-api
3.0.0 - sc-consensus-epochs
0.9.0 - sc-consensus-slots
0.9.0 - sc-consensus-uncles
0.9.0 - sc-keystore
3.0.0 - sc-telemetry
3.0.0 - schnorrkel
0.9.1 - serde
1.0.126 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-babe
0.9.0 - sp-consensus-slots
0.9.0 - sp-consensus-vrf
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-utils
3.0.0 - sp-version
3.0.0 - substrate-prometheus-endpoint
0.9.0
- async-trait
sc-consensus-babe-rpc
0.9.0github.com/paritytech/substrate.git↘ 17↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- derive_more
0.99.14 - futures
0.3.15 - jsonrpc-core
15.1.0 - jsonrpc-core-client
15.1.0 - jsonrpc-derive
15.1.0 - sc-consensus-babe
0.9.0 - sc-consensus-epochs
0.9.0 - sc-rpc-api
0.9.0 - serde
1.0.126 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0
used by- derive_more
sc-consensus-epochs
0.9.0github.com/paritytech/substrate.git↘ 6↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-consensus-slots
0.9.0github.com/paritytech/substrate.git↘ 21↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-trait
0.1.50 - futures
0.3.15 - futures-timer
3.0.2 - impl-trait-for-tuples
0.2.1 - log
0.4.14 - parity-scale-codec
2.1.3 - sc-client-api
3.0.0 - sc-telemetry
3.0.0 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-arithmetic
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-slots
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0 - sp-timestamp
3.0.0 - sp-trie
3.0.0 - thiserror
1.0.25
- async-trait
sc-consensus-uncles
0.9.0github.com/paritytech/substrate.git↘ 4↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sc-executor
0.9.0github.com/paritytech/substrate.git↘ 22↖ 12sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- derive_more
0.99.14 - lazy_static
1.4.0 - libsecp256k1
0.3.5 - log
0.4.14 - parity-scale-codec
2.1.3 - parity-wasm
0.41.0 - parking_lot
0.11.1 - sc-executor-common
0.9.0 - sc-executor-wasmi
0.9.0 - sc-executor-wasmtime
0.9.0 - sp-api
3.0.0 - sp-core
3.0.0 - sp-externalities
0.9.0 - sp-io
3.0.0 - sp-panic-handler
3.0.0 - sp-runtime-interface
3.0.0 - sp-serializer
3.0.0 - sp-tasks
3.0.0 - sp-trie
3.0.0 - sp-version
3.0.0 - sp-wasm-interface
3.0.0 - wasmi
0.6.2
- derive_more
sc-executor-common
0.9.0github.com/paritytech/substrate.git↘ 11↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-executor-wasmi
0.9.0github.com/paritytech/substrate.git↘ 8↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bysc-executor-wasmtime
0.9.0github.com/paritytech/substrate.git↘ 11↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-finality-grandpa
0.9.0github.com/paritytech/substrate.git↘ 33↖ 9sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-trait
0.1.50 - derive_more
0.99.14 - dyn-clone
1.0.4 - finality-grandpa
0.14.1 - fork-tree
3.0.0 - futures
0.3.15 - futures-timer
3.0.2 - linked-hash-map
0.5.4 - log
0.4.14 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - pin-project
1.0.7 - rand
0.7.3 - sc-block-builder
0.9.0 - sc-client-api
3.0.0 - sc-consensus
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-network-gossip
0.9.0 - sc-telemetry
3.0.0 - serde_json
1.0.64 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-arithmetic
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-finality-grandpa
3.0.0 - sp-inherents
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-utils
3.0.0 - substrate-prometheus-endpoint
0.9.0
- async-trait
sc-finality-grandpa-rpc
0.9.0github.com/paritytech/substrate.git↘ 17↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-finality-grandpa-warp-sync
0.9.0github.com/paritytech/substrate.git↘ 14↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bysc-informant
0.9.0github.com/paritytech/substrate.git↘ 11↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bysc-keystore
3.0.0github.com/paritytech/substrate.git↘ 13↖ 12sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-light
3.0.0github.com/paritytech/substrate.git↘ 12↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-network
0.9.0github.com/paritytech/substrate.git↘ 46↖ 21sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-std
1.9.0 - async-trait
0.1.50 - asynchronous-codec
0.5.0 - bitflags
1.2.1 - bs58
0.4.0 - bytes
1.0.1 - cid
0.6.1 - derive_more
0.99.14 - either
1.6.1 - erased-serde
0.3.15 - fnv
1.0.7 - fork-tree
3.0.0 - futures
0.3.15 - futures-timer
3.0.2 - hex
0.4.3 - ip_network
0.3.4 - libp2p
0.37.1 - linked-hash-map
0.5.4 - linked_hash_set
0.1.4 - log
0.4.14 - lru
0.6.5 - nohash-hasher
0.2.0 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - pin-project
1.0.7 - prost
0.7.0 - prost-build
0.7.0 - rand
0.7.3 - sc-block-builder
0.9.0 - sc-client-api
3.0.0 - sc-peerset
3.0.0 - serde
1.0.126 - serde_json
1.0.64 - smallvec
1.6.1 - sp-arithmetic
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-runtime
3.0.0 - sp-utils
3.0.0 - substrate-prometheus-endpoint
0.9.0 - thiserror
1.0.25 - unsigned-varint
0.6.0 - void
1.0.2 - wasm-timer
0.2.5 - zeroize
1.3.0
used by- beefy-gadget
0.1.0 - fc-rpc
2.0.0-dev - nft
3.0.0 - nft-rpc
3.3.1 - polkadot-network-bridge
0.1.0 - polkadot-node-jaeger
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0 - polkadot-test-service
0.9.3 - sc-authority-discovery
0.9.0 - sc-chain-spec
3.0.0 - sc-cli
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-informant
0.9.0 - sc-network-gossip
0.9.0 - sc-offchain
3.0.0 - sc-service
0.9.0
- async-std
sc-network-gossip
0.9.0github.com/paritytech/substrate.git↘ 10↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-offchain
3.0.0github.com/paritytech/substrate.git↘ 21↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-peerset
3.0.0github.com/paritytech/substrate.git↘ 6↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysc-proposer-metrics
0.9.0github.com/paritytech/substrate.git↘ 2↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysc-rpc
3.0.0github.com/paritytech/substrate.git↘ 28↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- futures
0.3.15 - hash-db
0.15.2 - jsonrpc-core
15.1.0 - jsonrpc-pubsub
15.1.0 - log
0.4.14 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - sc-block-builder
0.9.0 - sc-client-api
3.0.0 - sc-executor
0.9.0 - sc-keystore
3.0.0 - sc-rpc-api
0.9.0 - sc-tracing
3.0.0 - serde_json
1.0.64 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-chain-spec
3.0.0 - sp-core
3.0.0 - sp-keystore
0.9.0 - sp-offchain
3.0.0 - sp-rpc
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-state-machine
0.9.0 - sp-tracing
3.0.0 - sp-transaction-pool
3.0.0 - sp-utils
3.0.0 - sp-version
3.0.0
- futures
sc-rpc-api
0.9.0github.com/paritytech/substrate.git↘ 18↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- derive_more
0.99.14 - futures
0.3.15 - jsonrpc-core
15.1.0 - jsonrpc-core-client
15.1.0 - jsonrpc-derive
15.1.0 - jsonrpc-pubsub
15.1.0 - log
0.4.14 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - serde
1.0.126 - serde_json
1.0.64 - sp-chain-spec
3.0.0 - sp-core
3.0.0 - sp-rpc
3.0.0 - sp-runtime
3.0.0 - sp-tracing
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0
- derive_more
sc-rpc-server
3.0.0github.com/paritytech/substrate.git↘ 11↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-service
0.9.0github.com/paritytech/substrate.git↘ 57↖ 13sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-trait
0.1.50 - directories
3.0.2 - exit-future
0.2.0 - futures
0.1.31 - futures
0.3.15 - futures-timer
3.0.2 - hash-db
0.15.2 - jsonrpc-core
15.1.0 - jsonrpc-pubsub
15.1.0 - lazy_static
1.4.0 - log
0.4.14 - parity-scale-codec
2.1.3 - parity-util-mem
0.9.0 - parking_lot
0.11.1 - pin-project
1.0.7 - rand
0.7.3 - sc-block-builder
0.9.0 - sc-chain-spec
3.0.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-executor
0.9.0 - sc-informant
0.9.0 - sc-keystore
3.0.0 - sc-light
3.0.0 - sc-network
0.9.0 - sc-offchain
3.0.0 - sc-rpc
3.0.0 - sc-rpc-server
3.0.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sc-transaction-pool
3.0.0 - serde
1.0.126 - serde_json
1.0.64 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-externalities
0.9.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-state-machine
0.9.0 - sp-tracing
3.0.0 - sp-transaction-pool
3.0.0 - sp-trie
3.0.0 - sp-utils
3.0.0 - sp-version
3.0.0 - substrate-prometheus-endpoint
0.9.0 - tempfile
3.2.0 - thiserror
1.0.25 - tracing
0.1.26 - tracing-futures
0.2.5 - wasm-timer
0.2.5
- async-trait
sc-state-db
0.9.0github.com/paritytech/substrate.git↘ 8↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bysc-sync-state-rpc
0.9.0github.com/paritytech/substrate.git↘ 13↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bysc-telemetry
3.0.0github.com/paritytech/substrate.git↘ 13↖ 13sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-tracing
3.0.0github.com/paritytech/substrate.git↘ 30↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- ansi_term
0.12.1 - atty
0.2.14 - erased-serde
0.3.15 - lazy_static
1.4.0 - log
0.4.14 - once_cell
1.8.0 - parking_lot
0.11.1 - regex
1.5.4 - rustc-hash
1.1.0 - sc-client-api
3.0.0 - sc-rpc-server
3.0.0 - sc-telemetry
3.0.0 - sc-tracing-proc-macro
3.0.0 - serde
1.0.126 - serde_json
1.0.64 - sp-api
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-core
3.0.0 - sp-rpc
3.0.0 - sp-runtime
3.0.0 - sp-storage
3.0.0 - sp-tracing
3.0.0 - thiserror
1.0.25 - tracing
0.1.26 - tracing-log
0.1.2 - tracing-subscriber
0.2.18 - wasm-bindgen
0.2.74 - wasm-timer
0.2.5 - web-sys
0.3.51
- ansi_term
sc-tracing-proc-macro
3.0.0github.com/paritytech/substrate.git↘ 4↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysc-transaction-graph
3.0.0github.com/paritytech/substrate.git↘ 15↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsc-transaction-pool
3.0.0github.com/paritytech/substrate.git↘ 19↖ 5sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- futures
0.3.15 - futures-diagnose
1.0.1 - intervalier
0.4.0 - log
0.4.14 - parity-scale-codec
2.1.3 - parity-util-mem
0.9.0 - parking_lot
0.11.1 - sc-client-api
3.0.0 - sc-transaction-graph
3.0.0 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-core
3.0.0 - sp-runtime
3.0.0 - sp-tracing
3.0.0 - sp-transaction-pool
3.0.0 - sp-utils
3.0.0 - substrate-prometheus-endpoint
0.9.0 - thiserror
1.0.25 - wasm-timer
0.2.5
- futures
schannel
0.1.19crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75depends onused byschnorrkel
0.9.1crates.io↘ 11↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862depends onscoped-tls
1.0.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2used byscopeguard
1.1.0crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cdscroll
0.10.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ecdepends onused byscroll_derive
0.10.5crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0depends onused bysct
0.6.1crates.io↘ 2↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228cedepends onsecp256k1
0.19.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc6179428c22c73ac0fbb7b5579a56353ce78ba29759b3b8575183336ea74cdfbdepends onused bysecp256k1-sys
0.3.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum11553d210db090930f4432bea123b31f70bbf693ace14504ea2a35e796c28dd2depends onused bysecrecy
0.7.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0depends onused bysecurity-framework
1.0.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumad502866817f0575705bd7be36e2b2535cc33262d493aa733a2ec862baa2bc2bdepends onused bysecurity-framework-sys
1.0.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum51ceb04988b17b6d1dcd555390fa822ca5637b4a14e1f5099f13d351bed4d6c7depends onused bysemver
0.6.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537depends onused bysemver
0.9.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403depends onused bysemver
0.11.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6depends onused bysemver-parser
0.7.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3used bysemver-parser
0.10.2crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7depends onserde
1.0.126crates.io↘ 1↖ 117sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03depends onused by- beefy-gadget-rpc
0.1.0 - bincode
1.3.3 - bp-header-chain
0.1.0 - cargo-platform
0.1.1 - cargo_metadata
0.12.3 - cranelift-codegen
0.71.0 - cranelift-codegen-shared
0.71.0 - cranelift-entity
0.71.0 - cranelift-wasm
0.71.0 - cumulus-pallet-aura-ext
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - ed25519-dalek
1.0.1 - erased-serde
0.3.15 - ethereum
0.7.1 - ethereum-tx-sign
3.0.4 - evm
0.27.0 - evm-core
0.27.1 - fc-rpc-core
1.1.0-dev - fp-evm
2.0.0 - frame-benchmarking-cli
3.0.0 - frame-metadata
13.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - futures-diagnose
1.0.1 - handlebars
3.5.5 - impl-serde
0.3.1 - indexmap
1.6.2 - jsonrpc-client-transports
14.2.1 - jsonrpc-client-transports
15.1.0 - jsonrpc-core
14.2.0 - jsonrpc-core
15.1.0 - jsonrpc-pubsub
14.2.0 - jsonrpc-pubsub
15.1.0 - jsonrpsee-http-client
0.2.0-alpha.6 - jsonrpsee-types
0.2.0-alpha.6 - kusama-runtime
0.9.3 - nft
3.0.0 - nft-data-structs
0.9.0 - nft-runtime
3.0.0 - pallet-beefy
0.1.0 - pallet-bridge-grandpa
0.1.0 - pallet-contracts
3.0.0 - pallet-contracts-primitives
3.0.0 - pallet-contracts-rpc
3.0.0 - pallet-democracy
3.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-inflation
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-mmr-rpc
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-offences
3.0.0 - pallet-scheduler
3.0.0 - pallet-staking
3.0.0 - pallet-tips
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-treasury
3.0.0 - pallet-xcm
0.1.0 - parachain-info
0.1.0 - parity-multiaddr
0.11.2 - parity-scale-codec
1.3.7 - parity-scale-codec
2.1.3 - polkadot-node-primitives
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - regalloc
0.0.31 - rococo-runtime
0.9.3 - sc-chain-spec
3.0.0 - sc-cli
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-network
0.9.0 - sc-rpc-api
0.9.0 - sc-rpc-server
3.0.0 - sc-service
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sc-transaction-graph
3.0.0 - schnorrkel
0.9.1 - semver
0.11.0 - serde_json
1.0.64 - sp-application-crypto
3.0.0 - sp-arithmetic
3.0.0 - sp-chain-spec
3.0.0 - sp-consensus
0.9.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-finality-grandpa
3.0.0 - sp-keystore
0.9.0 - sp-npos-elections
3.0.0 - sp-rpc
3.0.0 - sp-runtime
3.0.0 - sp-serializer
3.0.0 - sp-storage
3.0.0 - sp-tracing
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-test-client
2.0.1 - toml
0.5.8 - tracing-serde
0.1.2 - tracing-subscriber
0.2.18 - wasmtime
0.24.0 - wasmtime-cache
0.24.0 - wasmtime-environ
0.24.0 - wasmtime-jit
0.24.0 - wasmtime-profiling
0.24.0 - westend-runtime
0.9.3
- beefy-gadget-rpc
serde_derive
1.0.126crates.io↘ 3↖ 10sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43depends onserde_json
1.0.64crates.io↘ 3↖ 33sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79depends onused by- beefy-gadget-rpc
0.1.0 - cargo_metadata
0.12.3 - ethereum-tx-sign
3.0.4 - fc-rpc-core
1.1.0-dev - futures-diagnose
1.0.1 - handlebars
3.5.5 - jsonrpc-client-transports
14.2.1 - jsonrpc-client-transports
15.1.0 - jsonrpc-core
14.2.0 - jsonrpc-core
15.1.0 - jsonrpsee-http-client
0.2.0-alpha.6 - jsonrpsee-types
0.2.0-alpha.6 - nft
3.0.0 - sc-authority-discovery
0.9.0 - sc-chain-spec
3.0.0 - sc-cli
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-keystore
3.0.0 - sc-network
0.9.0 - sc-peerset
3.0.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-rpc-server
3.0.0 - sc-service
0.9.0 - sc-sync-state-rpc
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sp-chain-spec
3.0.0 - sp-serializer
3.0.0 - sp-tracing
3.0.0 - substrate-test-client
2.0.1 - tracing-subscriber
0.2.18
- beefy-gadget-rpc
sha-1
0.8.2crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163dfsha-1
0.9.6crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8c4cfa741c5832d0ef7fab46cabed29c2aae926db0b11bb2069edd8db5e64e16used bysha2
0.8.2crates.io↘ 4↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69sha2
0.9.5crates.io↘ 5↖ 10sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12sha3
0.8.2crates.io↘ 5↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecfsha3
0.9.1crates.io↘ 4↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809sharded-slab
0.1.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3depends onused byshlex
0.1.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2used bysignal-hook
0.3.9crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39depends onused bysignal-hook-registry
1.4.0crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0depends onused bysignature
1.3.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68used bysimba
0.4.0crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5132a955559188f3d13c9ba831e77c802ddc8782783f050ed0c52f5988b95f4cused bysimba
0.5.1crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5cused byslab
0.4.3crates.io↘ 0↖ 15sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527slog
2.7.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06depends onused byslot-range-helper
0.9.3github.com/paritytech/polkadot↘ 5↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2used byslotmap
1.0.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum585cd5dffe4e9e06f6dfdf66708b70aca3f781bed561f4f667b2d9c0d4559e36depends onused bysmallvec
0.6.14crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0depends onused bysmallvec
1.6.1crates.io↘ 0↖ 39sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604eused by- cranelift-codegen
0.71.0 - cranelift-frontend
0.71.0 - cranelift-wasm
0.71.0 - frame-support
3.0.0 - kusama-runtime
0.9.3 - kvdb
0.9.0 - kvdb-rocksdb
0.11.1 - libp2p
0.37.1 - libp2p-core
0.28.3 - libp2p-dns
0.28.1 - libp2p-floodsub
0.29.0 - libp2p-gossipsub
0.30.1 - libp2p-identify
0.29.0 - libp2p-kad
0.30.0 - libp2p-mdns
0.30.2 - libp2p-mplex
0.28.0 - libp2p-relay
0.2.0 - libp2p-request-response
0.11.0 - libp2p-swarm
0.29.0 - multistream-select
0.10.2 - nft-runtime
3.0.0 - pallet-contracts
3.0.0 - pallet-transaction-payment
3.0.0 - parity-util-mem
0.9.0 - parking_lot_core
0.7.2 - parking_lot_core
0.8.3 - polkadot-node-subsystem
0.1.0 - polkadot-runtime
0.9.3 - polkadot-test-runtime
0.9.3 - regalloc
0.0.31 - rococo-runtime
0.9.3 - sc-network
0.9.0 - sp-state-machine
0.9.0 - tracing-subscriber
0.2.18 - trie-db
0.22.5 - trust-dns-proto
0.20.3 - trust-dns-resolver
0.20.3 - wasmtime
0.24.0 - westend-runtime
0.9.3
- cranelift-codegen
snow
0.7.2crates.io↘ 10↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum795dd7aeeee24468e5a32661f6d27f7b5cbed802031b2d7640c7b10f8fb2dd50depends onused bysocket2
0.3.19crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6edepends onused bysocket2
0.4.0crates.io↘ 2↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2depends onsoketto
0.4.2crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb5c71ed3d54db0a699f4948e1bb3e45b450fa31fe602621dee6680361d569c88used bysp-allocator
3.0.0github.com/paritytech/substrate.git↘ 5↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-api
3.0.0github.com/paritytech/substrate.git↘ 10↖ 71sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- beefy-gadget
0.1.0 - beefy-primitives
0.1.0 - bp-polkadot-core
0.1.0 - bp-rococo
0.1.0 - bp-wococo
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - fc-consensus
2.0.0-dev - fc-mapping-sync
2.0.0-dev - fc-rpc
2.0.0-dev - fp-rpc
2.0.0 - frame-benchmarking
3.1.0 - frame-system-rpc-runtime-api
3.0.0 - frame-try-runtime
0.9.0 - kusama-runtime
0.9.3 - nft
3.0.0 - nft-rpc
3.3.1 - nft-runtime
3.0.0 - pallet-contracts-rpc
3.0.0 - pallet-contracts-rpc-runtime-api
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-mmr-rpc
3.0.0 - pallet-nft
3.0.0 - pallet-transaction-payment-rpc
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-overseer
0.1.0 - polkadot-primitives
0.9.3 - polkadot-rpc
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-block-builder
0.9.0 - sc-client-api
3.0.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-consensus-slots
0.9.0 - sc-executor
0.9.0 - sc-finality-grandpa
0.9.0 - sc-light
3.0.0 - sc-offchain
3.0.0 - sc-rpc
3.0.0 - sc-service
0.9.0 - sc-tracing
3.0.0 - sc-transaction-pool
3.0.0 - sp-authority-discovery
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-consensus-babe
0.9.0 - sp-finality-grandpa
3.0.0 - sp-offchain
3.0.0 - sp-session
3.0.0 - sp-timestamp
3.0.0 - sp-transaction-pool
3.0.0 - substrate-frame-rpc-system
3.0.0 - try-runtime-cli
0.9.0 - westend-runtime
0.9.3
- beefy-gadget
sp-api-proc-macro
3.0.0github.com/paritytech/substrate.git↘ 5↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysp-application-crypto
3.0.0github.com/paritytech/substrate.git↘ 5↖ 29sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used by- beefy-gadget
0.1.0 - beefy-primitives
0.1.0 - bp-test-utils
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-pallet-aura-ext
0.1.0 - pallet-aura
3.0.0 - pallet-authority-discovery
3.0.0 - pallet-babe
3.0.0 - pallet-grandpa
3.0.0 - pallet-im-online
3.0.0 - pallet-staking
3.0.0 - polkadot-availability-distribution
0.1.0 - polkadot-gossip-support
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-primitives
0.9.3 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-consensus-slots
0.9.0 - sc-finality-grandpa
0.9.0 - sc-keystore
3.0.0 - sc-service
0.9.0 - sp-authority-discovery
3.0.0 - sp-consensus-aura
0.9.0 - sp-consensus-babe
0.9.0 - sp-finality-grandpa
3.0.0 - sp-runtime
3.0.0
- beefy-gadget
sp-arithmetic
3.0.0github.com/paritytech/substrate.git↘ 7↖ 19sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- beefy-gadget
0.1.0 - frame-election-provider-support
3.0.0 - frame-support
3.0.0 - kusama-runtime
0.9.3 - nft-runtime
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-gilt
3.0.0 - pallet-staking-reward-fn
3.0.0 - polkadot-primitives
0.9.3 - polkadot-test-service
0.9.3 - sc-client-db
0.9.0 - sc-consensus-slots
0.9.0 - sc-finality-grandpa
0.9.0 - sc-network
0.9.0 - sp-consensus-slots
0.9.0 - sp-npos-elections
3.0.0 - sp-runtime
3.0.0 - xcm-builder
0.9.3 - xcm-executor
0.9.3
- beefy-gadget
sp-authority-discovery
3.0.0github.com/paritytech/substrate.git↘ 5↖ 11sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-authorship
3.0.0github.com/paritytech/substrate.git↘ 5↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-block-builder
3.0.0github.com/paritytech/substrate.git↘ 5↖ 19sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used by- cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - fc-consensus
2.0.0-dev - kusama-runtime
0.9.3 - nft
3.0.0 - nft-rpc
3.3.1 - nft-runtime
3.0.0 - polkadot-rpc
0.9.3 - polkadot-runtime
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - sc-block-builder
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-service
0.9.0 - sc-tracing
3.0.0 - substrate-frame-rpc-system
3.0.0 - westend-runtime
0.9.3
- cumulus-client-consensus-aura
sp-blockchain
3.0.0github.com/paritytech/substrate.git↘ 11↖ 47sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- beefy-gadget
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-service
0.1.0 - fc-consensus
2.0.0-dev - fc-mapping-sync
2.0.0-dev - fc-rpc
2.0.0-dev - nft
3.0.0 - nft-rpc
3.3.1 - pallet-contracts-rpc
3.0.0 - pallet-mmr-rpc
3.0.0 - pallet-transaction-payment-rpc
3.0.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-chain-api
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-rpc
0.9.3 - polkadot-service
0.9.3 - polkadot-test-service
0.9.3 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-block-builder
0.9.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-consensus-epochs
0.9.0 - sc-consensus-slots
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-informant
0.9.0 - sc-light
3.0.0 - sc-network
0.9.0 - sc-rpc
3.0.0 - sc-service
0.9.0 - sc-sync-state-rpc
0.9.0 - sc-tracing
3.0.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - sp-transaction-pool
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-test-client
2.0.1 - try-runtime-cli
0.9.0
- beefy-gadget
sp-chain-spec
3.0.0github.com/paritytech/substrate.git↘ 2↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-consensus
0.9.0github.com/paritytech/substrate.git↘ 20↖ 30sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-trait
0.1.50 - futures
0.3.15 - futures-timer
3.0.2 - libp2p
0.37.1 - log
0.4.14 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - serde
1.0.126 - sp-api
3.0.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0 - sp-std
3.0.0 - sp-trie
3.0.0 - sp-utils
3.0.0 - sp-version
3.0.0 - substrate-prometheus-endpoint
0.9.0 - thiserror
1.0.25 - wasm-timer
0.2.5
used by- beefy-gadget
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - fc-consensus
2.0.0-dev - nft
3.0.0 - nft-rpc
3.3.1 - polkadot-network-bridge
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-rpc
0.9.3 - polkadot-service
0.9.3 - polkadot-test-service
0.9.3 - sc-basic-authorship
0.9.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-consensus-slots
0.9.0 - sc-finality-grandpa
0.9.0 - sc-network
0.9.0 - sc-service
0.9.0 - sp-blockchain
3.0.0 - sp-consensus-aura
0.9.0 - sp-consensus-babe
0.9.0 - substrate-test-client
2.0.1
- async-trait
sp-consensus-aura
0.9.0github.com/paritytech/substrate.git↘ 10↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-consensus-babe
0.9.0github.com/paritytech/substrate.git↘ 15↖ 14sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- kusama-runtime
0.9.3 - pallet-babe
3.0.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-rpc
0.9.3 - polkadot-runtime
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - rococo-runtime
0.9.3 - sc-chain-spec
3.0.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - westend-runtime
0.9.3
- kusama-runtime
sp-consensus-slots
0.9.0github.com/paritytech/substrate.git↘ 3↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-consensus-vrf
0.9.0github.com/paritytech/substrate.git↘ 5↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-core
3.0.0github.com/paritytech/substrate.git↘ 37↖ 130sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- base58
0.1.0 - blake2-rfc
0.2.18 - byteorder
1.4.3 - dyn-clonable
0.9.0 - ed25519-dalek
1.0.1 - futures
0.3.15 - hash-db
0.15.2 - hash256-std-hasher
0.15.2 - hex
0.4.3 - impl-serde
0.3.1 - lazy_static
1.4.0 - libsecp256k1
0.3.5 - log
0.4.14 - merlin
2.0.1 - num-traits
0.2.14 - parity-scale-codec
2.1.3 - parity-util-mem
0.9.0 - parking_lot
0.11.1 - primitive-types
0.9.0 - rand
0.7.3 - regex
1.5.4 - schnorrkel
0.9.1 - secrecy
0.7.0 - serde
1.0.126 - sha2
0.9.5 - sp-debug-derive
3.0.0 - sp-externalities
0.9.0 - sp-runtime-interface
3.0.0 - sp-std
3.0.0 - sp-storage
3.0.0 - substrate-bip39
0.4.2 - thiserror
1.0.25 - tiny-bip39
0.8.0 - tiny-keccak
2.0.2 - twox-hash
1.6.0 - wasmi
0.6.2 - zeroize
1.3.0
used by- beefy-gadget
0.1.0 - beefy-gadget-rpc
0.1.0 - beefy-primitives
0.1.0 - bp-header-chain
0.1.0 - bp-polkadot-core
0.1.0 - bp-runtime
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - fc-consensus
2.0.0-dev - fc-db
1.0.0 - fp-consensus
1.0.0 - fp-evm
2.0.0 - fp-rpc
2.0.0 - frame-benchmarking-cli
3.0.0 - frame-executive
3.0.0 - frame-metadata
13.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-benchmarking
3.0.0 - kusama-runtime
0.9.3 - nft
3.0.0 - nft-data-structs
0.9.0 - nft-rpc
3.3.1 - nft-runtime
3.0.0 - pallet-collective
3.0.0 - pallet-contracts
3.0.0 - pallet-contracts-primitives
3.0.0 - pallet-contracts-rpc
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-evm
4.0.0-dev - pallet-grandpa
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-inflation
3.0.0 - pallet-mmr
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-mmr-rpc
3.0.0 - pallet-multisig
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-proxy
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc
3.0.0 - pallet-utility
3.0.0 - polkadot-availability-distribution
0.1.0 - polkadot-cli
0.9.3 - polkadot-collator-protocol
0.1.0 - polkadot-core-primitives
0.9.3 - polkadot-erasure-coding
0.9.3 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-pvf
0.1.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-node-jaeger
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-statement-table
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - remote-externalities
0.9.0 - rococo-runtime
0.9.3 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-block-builder
0.9.0 - sc-chain-spec
3.0.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-consensus-slots
0.9.0 - sc-executor
0.9.0 - sc-executor-common
0.9.0 - sc-executor-wasmi
0.9.0 - sc-executor-wasmtime
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-keystore
3.0.0 - sc-light
3.0.0 - sc-network
0.9.0 - sc-offchain
3.0.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-service
0.9.0 - sc-state-db
0.9.0 - sc-tracing
3.0.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - sp-allocator
3.0.0 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-consensus
0.9.0 - sp-consensus-babe
0.9.0 - sp-consensus-vrf
0.9.0 - sp-finality-grandpa
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-keyring
3.0.0 - sp-keystore
0.9.0 - sp-npos-elections
3.0.0 - sp-offchain
3.0.0 - sp-rpc
3.0.0 - sp-runtime
3.0.0 - sp-sandbox
0.9.0 - sp-session
3.0.0 - sp-state-machine
0.9.0 - sp-tasks
3.0.0 - sp-trie
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-test-client
2.0.1 - try-runtime-cli
0.9.0 - westend-runtime
0.9.3 - xcm-executor
0.9.3
- base58
sp-database
3.0.0github.com/paritytech/substrate.git↘ 2↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-debug-derive
3.0.0github.com/paritytech/substrate.git↘ 3↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-externalities
0.9.0github.com/paritytech/substrate.git↘ 4↖ 14sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-finality-grandpa
3.0.0github.com/paritytech/substrate.git↘ 10↖ 9sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-inherents
3.0.0github.com/paritytech/substrate.git↘ 7↖ 34sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - fc-consensus
2.0.0-dev - frame-support
3.0.0 - kusama-runtime
0.9.3 - nft
3.0.0 - nft-runtime
3.0.0 - pallet-timestamp
3.0.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - rococo-runtime
0.9.3 - sc-basic-authorship
0.9.0 - sc-block-builder
0.9.0 - sc-client-api
3.0.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-slots
0.9.0 - sc-finality-grandpa
0.9.0 - sc-service
0.9.0 - sp-authorship
3.0.0 - sp-block-builder
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-consensus-babe
0.9.0 - sp-timestamp
3.0.0 - westend-runtime
0.9.3
- cumulus-client-consensus-aura
sp-io
3.0.0github.com/paritytech/substrate.git↘ 18↖ 62sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- futures
0.3.15 - hash-db
0.15.2 - libsecp256k1
0.3.5 - log
0.4.14 - parity-scale-codec
2.1.3 - parking_lot
0.11.1 - sp-core
3.0.0 - sp-externalities
0.9.0 - sp-keystore
0.9.0 - sp-maybe-compressed-blob
3.0.0 - sp-runtime-interface
3.0.0 - sp-state-machine
0.9.0 - sp-std
3.0.0 - sp-tracing
3.0.0 - sp-trie
3.0.0 - sp-wasm-interface
3.0.0 - tracing
0.1.26 - tracing-core
0.1.18
used by- bp-runtime
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - fc-rpc
2.0.0-dev - fp-rpc
2.0.0 - frame-benchmarking
3.1.0 - frame-executive
3.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - kusama-runtime
0.9.3 - nft-runtime
3.0.0 - pallet-babe
3.0.0 - pallet-collective
3.0.0 - pallet-contracts
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-inflation
3.0.0 - pallet-membership
3.0.0 - pallet-mmr
3.0.0 - pallet-multisig
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-nicks
3.0.0 - pallet-proxy
3.0.0 - pallet-recovery
3.0.0 - pallet-scheduler
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-staking
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-utility
3.0.0 - polkadot-node-core-pvf
0.1.0 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - remote-externalities
0.9.0 - rococo-runtime
0.9.3 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-executor
0.9.0 - sc-service
0.9.0 - sp-application-crypto
3.0.0 - sp-runtime
3.0.0 - sp-sandbox
0.9.0 - sp-tasks
3.0.0 - westend-runtime
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
- futures
sp-keyring
3.0.0github.com/paritytech/substrate.git↘ 4↖ 4sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-keystore
0.9.0github.com/paritytech/substrate.git↘ 10↖ 30sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- beefy-gadget
0.1.0 - cumulus-client-consensus-aura
0.1.0 - frame-benchmarking-cli
3.0.0 - nft
3.0.0 - polkadot-availability-distribution
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-gossip-support
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-bitfield-signing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-primitives
0.9.3 - polkadot-rpc
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0 - sc-authority-discovery
0.9.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-finality-grandpa
0.9.0 - sc-keystore
3.0.0 - sc-rpc
3.0.0 - sc-service
0.9.0 - sp-consensus-babe
0.9.0 - sp-finality-grandpa
3.0.0 - sp-io
3.0.0 - substrate-test-client
2.0.1
- beefy-gadget
sp-maybe-compressed-blob
3.0.0github.com/paritytech/substrate.git↘ 2↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-npos-elections
3.0.0github.com/paritytech/substrate.git↘ 6↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-npos-elections-compact
3.0.0github.com/paritytech/substrate.git↘ 4↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysp-offchain
3.0.0github.com/paritytech/substrate.git↘ 3↖ 11sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-panic-handler
3.0.0github.com/paritytech/substrate.git↘ 1↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-rpc
3.0.0github.com/paritytech/substrate.git↘ 4↖ 6sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-runtime
3.0.0github.com/paritytech/substrate.git↘ 14↖ 166sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- beefy-gadget
0.1.0 - beefy-gadget-rpc
0.1.0 - beefy-primitives
0.1.0 - bp-header-chain
0.1.0 - bp-polkadot-core
0.1.0 - bp-rococo
0.1.0 - bp-runtime
0.1.0 - bp-test-utils
0.1.0 - bp-wococo
0.1.0 - cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - cumulus-pallet-aura-ext
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - cumulus-primitives-utility
0.1.0 - fc-consensus
2.0.0-dev - fc-db
1.0.0 - fc-mapping-sync
2.0.0-dev - fc-rpc
2.0.0-dev - fp-consensus
1.0.0 - fp-rpc
2.0.0 - frame-benchmarking
3.1.0 - frame-benchmarking-cli
3.0.0 - frame-executive
3.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-benchmarking
3.0.0 - frame-try-runtime
0.9.0 - kusama-runtime
0.9.3 - nft
3.0.0 - nft-data-structs
0.9.0 - nft-rpc
3.3.1 - nft-runtime
3.0.0 - pallet-aura
3.0.0 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-beefy
0.1.0 - pallet-bounties
3.0.0 - pallet-bridge-grandpa
0.1.0 - pallet-collective
3.0.0 - pallet-contract-helpers
0.1.0 - pallet-contracts
3.0.0 - pallet-contracts-primitives
3.0.0 - pallet-contracts-rpc
3.0.0 - pallet-contracts-rpc-runtime-api
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-gilt
3.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-inflation
3.0.0 - pallet-membership
3.0.0 - pallet-mmr
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-mmr-rpc
3.0.0 - pallet-multisig
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-recovery
3.0.0 - pallet-scheduler
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-society
3.0.0 - pallet-staking
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-tips
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - pallet-treasury
3.0.0 - pallet-utility
3.0.0 - pallet-vesting
3.0.0 - pallet-xcm
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-core-primitives
0.9.3 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-rpc
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - polkadot-test-service
0.9.3 - remote-externalities
0.9.0 - rococo-runtime
0.9.3 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-block-builder
0.9.0 - sc-chain-spec
3.0.0 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-consensus-babe-rpc
0.9.0 - sc-consensus-epochs
0.9.0 - sc-consensus-slots
0.9.0 - sc-consensus-uncles
0.9.0 - sc-finality-grandpa
0.9.0 - sc-finality-grandpa-rpc
0.9.0 - sc-finality-grandpa-warp-sync
0.9.0 - sc-informant
0.9.0 - sc-light
3.0.0 - sc-network
0.9.0 - sc-network-gossip
0.9.0 - sc-offchain
3.0.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-rpc-server
3.0.0 - sc-service
0.9.0 - sc-sync-state-rpc
0.9.0 - sc-tracing
3.0.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - slot-range-helper
0.9.3 - sp-api
3.0.0 - sp-authority-discovery
3.0.0 - sp-authorship
3.0.0 - sp-block-builder
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-consensus-babe
0.9.0 - sp-consensus-slots
0.9.0 - sp-consensus-vrf
0.9.0 - sp-finality-grandpa
3.0.0 - sp-inherents
3.0.0 - sp-keyring
3.0.0 - sp-offchain
3.0.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-timestamp
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0 - substrate-frame-rpc-system
3.0.0 - substrate-test-client
2.0.1 - try-runtime-cli
0.9.0 - westend-runtime
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
- beefy-gadget
sp-runtime-interface
3.0.0github.com/paritytech/substrate.git↘ 10↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-runtime-interface-proc-macro
3.0.0github.com/paritytech/substrate.git↘ 5↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysp-sandbox
0.9.0github.com/paritytech/substrate.git↘ 6↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysp-serializer
3.0.0github.com/paritytech/substrate.git↘ 2↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-session
3.0.0github.com/paritytech/substrate.git↘ 6↖ 16sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used by- kusama-runtime
0.9.3 - nft
3.0.0 - nft-rpc
3.3.1 - nft-runtime
3.0.0 - pallet-babe
3.0.0 - pallet-grandpa
3.0.0 - pallet-session
3.0.0 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - sc-rpc
3.0.0 - sc-service
0.9.0 - westend-runtime
0.9.3
- kusama-runtime
sp-staking
3.0.0github.com/paritytech/substrate.git↘ 3↖ 17sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used by- frame-support
3.0.0 - kusama-runtime
0.9.3 - pallet-babe
3.0.0 - pallet-grandpa
3.0.0 - pallet-im-online
3.0.0 - pallet-offences
3.0.0 - pallet-session
3.0.0 - pallet-staking
3.0.0 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-statement-distribution
0.1.0 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - sp-session
3.0.0 - westend-runtime
0.9.3
- frame-support
sp-state-machine
0.9.0github.com/paritytech/substrate.git↘ 16↖ 20sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- bp-runtime
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - frame-benchmarking-cli
3.0.0 - frame-support
3.0.0 - polkadot-service
0.9.3 - polkadot-test-service
0.9.3 - sc-block-builder
0.9.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus-slots
0.9.0 - sc-light
3.0.0 - sc-rpc
3.0.0 - sc-service
0.9.0 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-io
3.0.0 - substrate-test-client
2.0.1 - try-runtime-cli
0.9.0
- bp-runtime
sp-std
3.0.0github.com/paritytech/substrate.git↘ 0↖ 121sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used by- beefy-primitives
0.1.0 - bp-header-chain
0.1.0 - bp-messages
0.1.0 - bp-polkadot-core
0.1.0 - bp-rococo
0.1.0 - bp-runtime
0.1.0 - bp-test-utils
0.1.0 - bp-wococo
0.1.0 - cumulus-pallet-aura-ext
0.1.0 - cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - cumulus-primitives-utility
0.1.0 - fp-consensus
1.0.0 - fp-evm
2.0.0 - fp-rpc
2.0.0 - frame-benchmarking
3.1.0 - frame-election-provider-support
3.0.0 - frame-executive
3.0.0 - frame-metadata
13.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-benchmarking
3.0.0 - frame-try-runtime
0.9.0 - kusama-runtime
0.9.3 - nft-runtime
3.0.0 - pallet-aura
3.0.0 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-beefy
0.1.0 - pallet-bounties
3.0.0 - pallet-bridge-grandpa
0.1.0 - pallet-collective
3.0.0 - pallet-contract-helpers
0.1.0 - pallet-contracts
3.0.0 - pallet-contracts-primitives
3.0.0 - pallet-contracts-rpc-runtime-api
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-ethereum
2.0.0-dev - pallet-evm
4.0.0-dev - pallet-gilt
3.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-inflation
3.0.0 - pallet-membership
3.0.0 - pallet-mmr
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-multisig
3.0.0 - pallet-nft
3.0.0 - pallet-nft-charge-transaction
3.0.0 - pallet-nft-transaction-payment
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-recovery
3.0.0 - pallet-scheduler
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-society
3.0.0 - pallet-staking
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-tips
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-treasury
3.0.0 - pallet-utility
3.0.0 - pallet-vesting
3.0.0 - pallet-xcm
0.1.0 - polkadot-core-primitives
0.9.3 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - sc-client-api
3.0.0 - slot-range-helper
0.9.3 - sp-allocator
3.0.0 - sp-api
3.0.0 - sp-application-crypto
3.0.0 - sp-arithmetic
3.0.0 - sp-authority-discovery
3.0.0 - sp-authorship
3.0.0 - sp-block-builder
3.0.0 - sp-consensus
0.9.0 - sp-consensus-aura
0.9.0 - sp-consensus-babe
0.9.0 - sp-consensus-vrf
0.9.0 - sp-core
3.0.0 - sp-externalities
0.9.0 - sp-finality-grandpa
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-npos-elections
3.0.0 - sp-runtime
3.0.0 - sp-runtime-interface
3.0.0 - sp-sandbox
0.9.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-state-machine
0.9.0 - sp-storage
3.0.0 - sp-tasks
3.0.0 - sp-timestamp
3.0.0 - sp-tracing
3.0.0 - sp-trie
3.0.0 - sp-version
3.0.0 - sp-wasm-interface
3.0.0 - westend-runtime
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
- beefy-primitives
sp-storage
3.0.0github.com/paritytech/substrate.git↘ 6↖ 9sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-tasks
3.0.0github.com/paritytech/substrate.git↘ 6↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysp-timestamp
3.0.0github.com/paritytech/substrate.git↘ 10↖ 7sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-tracing
3.0.0github.com/paritytech/substrate.git↘ 11↖ 9sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsp-transaction-pool
3.0.0github.com/paritytech/substrate.git↘ 9↖ 20sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- fc-rpc
2.0.0-dev - kusama-runtime
0.9.3 - nft
3.0.0 - nft-rpc
3.3.1 - nft-runtime
3.0.0 - polkadot-rpc
0.9.3 - polkadot-runtime
0.9.3 - polkadot-service
0.9.3 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - sc-basic-authorship
0.9.0 - sc-client-api
3.0.0 - sc-informant
0.9.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-service
0.9.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - substrate-frame-rpc-system
3.0.0 - westend-runtime
0.9.3
- fc-rpc
sp-trie
3.0.0github.com/paritytech/substrate.git↘ 7↖ 21sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- bp-runtime
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - cumulus-primitives-utility
0.1.0 - nft
3.0.0 - pallet-bridge-grandpa
0.1.0 - pallet-session
3.0.0 - polkadot-cli
0.9.3 - polkadot-erasure-coding
0.9.3 - polkadot-primitives
0.9.3 - polkadot-service
0.9.3 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus-slots
0.9.0 - sc-executor
0.9.0 - sc-service
0.9.0 - sp-consensus
0.9.0 - sp-io
3.0.0 - sp-state-machine
0.9.0
- bp-runtime
sp-utils
3.0.0github.com/paritytech/substrate.git↘ 5↖ 14sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7sp-version
3.0.0github.com/paritytech/substrate.git↘ 6↖ 22sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- bp-polkadot-core
0.1.0 - bp-rococo
0.1.0 - bp-wococo
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - frame-system
3.0.0 - kusama-runtime
0.9.3 - nft-runtime
3.0.0 - polkadot-primitives
0.9.3 - polkadot-runtime
0.9.3 - polkadot-test-runtime
0.9.3 - rococo-runtime
0.9.3 - sc-cli
0.9.0 - sc-client-api
3.0.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-executor
0.9.0 - sc-rpc
3.0.0 - sc-rpc-api
0.9.0 - sc-service
0.9.0 - sp-api
3.0.0 - sp-consensus
0.9.0 - westend-runtime
0.9.3
- bp-polkadot-core
sp-version-proc-macro
3.0.0github.com/paritytech/substrate.git↘ 5↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysp-wasm-interface
3.0.0github.com/paritytech/substrate.git↘ 4↖ 9sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7spin
0.5.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042dused bystable_deref_trait
1.2.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3used bystatic_assertions
1.1.0crates.io↘ 0↖ 17sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543fused by- fixed-hash
0.6.1 - fixed-hash
0.7.0 - kusama-runtime
0.9.3 - libp2p-noise
0.30.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-staking
3.0.0 - parity-multiaddr
0.11.2 - polkadot-runtime
0.9.3 - polkadot-runtime-common
0.9.3 - rw-stream-sink
0.2.1 - sp-arithmetic
3.0.0 - sp-runtime-interface
3.0.0 - twox-hash
1.6.0 - uint
0.8.5 - uint
0.9.0 - westend-runtime
0.9.3 - yamux
0.9.0
- fixed-hash
static_init
0.5.2crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369cused bystatic_init_macro
0.5.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbfused bystatrs
0.14.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1e0c1f144861fbfd2a8cc82d564ccbf7fb3b7834d4fa128b84e9c2a73371aeadused bystream-cipher
0.7.1crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc80e15f898d8d8f25db24c253ea615cc14acf418ff307822995814e7d42cfa89depends onstreamunordered
0.5.2crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume68576e37c8a37f5372796df15202190349dd80e7ed6a79544c0232213e90e35string
0.2.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6ddepends onused bystrsim
0.8.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6aused bystrsim
0.10.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623used bystructopt
0.3.21crates.io↘ 3↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28cstructopt-derive
0.4.14crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90used bystrum
0.20.0crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5cdepends onstrum_macros
0.20.1crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149used bysubstrate-bip39
0.4.2crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbed6646a0159b9935b5d045611560eeef842b78d7adc3ba36f5ca325a13a0236used bysubstrate-build-script-utils
3.0.0github.com/paritytech/substrate.git↘ 1↖ 2sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bysubstrate-frame-rpc-system
3.0.0github.com/paritytech/substrate.git↘ 16↖ 3sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onsubstrate-prometheus-endpoint
0.9.0github.com/paritytech/substrate.git↘ 7↖ 22sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused by- beefy-gadget
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - fc-consensus
2.0.0-dev - nft
3.0.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-service
0.9.3 - sc-authority-discovery
0.9.0 - sc-basic-authorship
0.9.0 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus-aura
0.9.0 - sc-consensus-babe
0.9.0 - sc-finality-grandpa
0.9.0 - sc-network
0.9.0 - sc-network-gossip
0.9.0 - sc-proposer-metrics
0.9.0 - sc-rpc-server
3.0.0 - sc-service
0.9.0 - sc-transaction-pool
3.0.0 - sp-consensus
0.9.0
- beefy-gadget
substrate-test-client
2.0.1github.com/paritytech/substrate.git↘ 22↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends on- async-trait
0.1.50 - futures
0.1.31 - futures
0.3.15 - hash-db
0.15.2 - hex
0.4.3 - parity-scale-codec
2.1.3 - sc-client-api
3.0.0 - sc-client-db
0.9.0 - sc-consensus
0.9.0 - sc-executor
0.9.0 - sc-light
3.0.0 - sc-offchain
3.0.0 - sc-service
0.9.0 - serde
1.0.126 - serde_json
1.0.64 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-keyring
3.0.0 - sp-keystore
0.9.0 - sp-runtime
3.0.0 - sp-state-machine
0.9.0
used by- async-trait
substrate-test-utils
3.0.0github.com/paritytech/substrate.git↘ 3↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7used bysubstrate-test-utils-derive
0.9.0github.com/paritytech/substrate.git↘ 3↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bysubstrate-wasm-builder
3.0.0crates.io↘ 8↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum79091baab813855ddf65b191de9fe53e656b6b67c1e9bd23fdcbff8788164684depends onsubstrate-wasm-builder
4.0.0crates.io↘ 8↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum93a3d51ad6abbc408b03ea962062bfcc959b438a318d7d4bedd181e1effd0610depends onused bysubtle
1.0.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8eeused bysubtle
2.4.0crates.io↘ 0↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2syn
1.0.73crates.io↘ 3↖ 60sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7used by- async-attributes
1.1.2 - async-trait
0.1.50 - ctor
0.1.20 - darling_core
0.13.0 - darling_macro
0.13.0 - data-encoding-macro-internal
0.1.10 - derivative
2.2.0 - derive_more
0.99.14 - dyn-clonable-impl
0.9.0 - enum-as-inner
0.3.3 - enumflags2_derive
0.6.4 - enumn
0.1.3 - evm-coder-macros
0.1.0 - failure_derive
0.1.8 - frame-support-procedural
3.0.0 - frame-support-procedural-tools
3.0.0 - frame-support-procedural-tools-derive
3.0.0 - futures-macro
0.3.15 - impl-trait-for-tuples
0.1.3 - impl-trait-for-tuples
0.2.1 - jsonrpc-derive
14.2.2 - jsonrpc-derive
15.1.0 - jsonrpsee-proc-macros
0.2.0-alpha.6 - libp2p-swarm-derive
0.23.0 - minicbor-derive
0.6.3 - multihash-derive
0.7.2 - nalgebra-macros
0.1.0 - pallet-contracts-proc-macro
3.0.0 - pallet-staking-reward-curve
3.0.0 - parity-scale-codec-derive
2.1.3 - parity-util-mem-derive
0.1.0 - pest_generator
2.1.3 - pin-project-internal
0.4.28 - pin-project-internal
1.0.7 - polkadot-procmacro-overseer-subsystems-gen
0.1.0 - polkadot-procmacro-subsystem-dispatch-gen
0.1.0 - proc-macro-error
1.0.4 - prost-derive
0.7.0 - ref-cast-impl
1.0.6 - rlp-derive
0.1.0 - sc-chain-spec-derive
3.0.0 - sc-tracing-proc-macro
3.0.0 - scroll_derive
0.10.5 - serde_derive
1.0.126 - sp-api-proc-macro
3.0.0 - sp-debug-derive
3.0.0 - sp-npos-elections-compact
3.0.0 - sp-runtime-interface-proc-macro
3.0.0 - sp-version-proc-macro
3.0.0 - static_init_macro
0.5.0 - structopt-derive
0.4.14 - strum_macros
0.20.1 - substrate-test-utils-derive
0.9.0 - synstructure
0.12.4 - thiserror-impl
1.0.25 - tokio-macros
0.2.6 - tracing-attributes
0.1.15 - wasm-bindgen-backend
0.2.74 - wasm-bindgen-macro-support
0.2.74 - zeroize_derive
1.1.0
- async-attributes
synstructure
0.12.4crates.io↘ 4↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701take_mut
0.2.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60used bytap
1.0.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369used bytarget-lexicon
0.11.2crates.io↘ 0↖ 8sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum422045212ea98508ae3d28025bc5aaa2bd4a9cdaecd442a08da2ee620ee9ea95tempfile
3.2.0crates.io↘ 6↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22termcolor
1.1.2crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4depends ontextwrap
0.11.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060depends onused bythiserror
1.0.25crates.io↘ 1↖ 59sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6depends onused by- beefy-gadget
0.1.0 - cranelift-codegen
0.71.0 - cranelift-wasm
0.71.0 - flexi_logger
0.15.12 - jsonrpsee-http-client
0.2.0-alpha.6 - jsonrpsee-types
0.2.0-alpha.6 - libp2p-core
0.28.3 - libp2p-yamux
0.32.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-cli
0.9.3 - polkadot-collator-protocol
0.1.0 - polkadot-erasure-coding
0.9.3 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-bitfield-signing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-node-jaeger
0.1.0 - polkadot-node-network-protocol
0.1.0 - polkadot-node-primitives
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-primitives
0.9.3 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0 - proc-macro-crate
1.0.0 - prometheus
0.11.0 - reed-solomon-novelpoly
1.0.0 - sc-cli
0.9.0 - sc-consensus-slots
0.9.0 - sc-consensus-uncles
0.9.0 - sc-executor-common
0.9.0 - sc-network
0.9.0 - sc-service
0.9.0 - sc-state-db
0.9.0 - sc-sync-state-rpc
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - sp-allocator
3.0.0 - sp-api
3.0.0 - sp-blockchain
3.0.0 - sp-consensus
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-state-machine
0.9.0 - sp-timestamp
3.0.0 - sp-transaction-pool
3.0.0 - tiny-bip39
0.8.0 - trust-dns-proto
0.20.3 - trust-dns-resolver
0.20.3 - wasmtime-debug
0.24.0 - wasmtime-environ
0.24.0 - wasmtime-jit
0.24.0 - wasmtime-runtime
0.24.0
- beefy-gadget
thiserror-impl
1.0.25crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318ddepends onused bythread_local
1.1.3crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbddepends onused bythreadpool
1.8.1crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaadepends onused bythrift
0.13.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum0c6d965454947cc7266d22716ebfd07b18d84ebaf35eec558586bbb2a8cb6b5bused bytime
0.1.44crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255used bytiny-bip39
0.8.0crates.io↘ 10↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd9e44c4759bae7f1032e286a7ef990bd9ed23fe831b7eeba0beb97484c2e59b8depends onused bytiny-keccak
2.0.2crates.io↘ 1↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237depends ontinyvec
1.2.0crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342depends ontinyvec_macros
0.1.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5cused bytokio
0.1.22crates.io↘ 16↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6depends ontokio
0.2.25crates.io↘ 15↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092depends ontokio-buf
0.1.1crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46depends onused bytokio-codec
0.1.2crates.io↘ 3↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976bdepends ontokio-current-thread
0.1.7crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20edepends onused bytokio-executor
0.1.10crates.io↘ 2↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671depends ontokio-fs
0.1.7crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4used bytokio-io
0.1.13crates.io↘ 3↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674depends ontokio-macros
0.2.6crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265adepends onused bytokio-named-pipes
0.1.0crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eaeused bytokio-reactor
0.1.12crates.io↘ 11↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351depends ontokio-rustls
0.14.1crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889aused bytokio-service
0.1.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162depends onused bytokio-sync
0.1.8crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumedfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87deedepends ontokio-tcp
0.1.4crates.io↘ 6↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72used bytokio-threadpool
0.1.18crates.io↘ 9↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdf720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89depends ontokio-timer
0.2.13crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296used bytokio-udp
0.1.6crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82depends onused bytokio-uds
0.2.7crates.io↘ 10↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0depends ontokio-util
0.3.1crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbe8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499used bytoml
0.5.8crates.io↘ 1↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaadepends ontower-service
0.3.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6used bytracing
0.1.26crates.io↘ 5↖ 42sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89dused by- cumulus-client-collator
0.1.0 - cumulus-client-consensus-aura
0.1.0 - cumulus-client-consensus-common
0.1.0 - cumulus-client-network
0.1.0 - cumulus-client-pov-recovery
0.1.0 - cumulus-client-service
0.1.0 - cumulus-primitives-parachain-inherent
0.1.0 - h2
0.2.7 - hyper
0.13.10 - polkadot-approval-distribution
0.1.0 - polkadot-availability-bitfield-distribution
0.1.0 - polkadot-availability-distribution
0.1.0 - polkadot-availability-recovery
0.1.0 - polkadot-collator-protocol
0.1.0 - polkadot-gossip-support
0.1.0 - polkadot-network-bridge
0.1.0 - polkadot-node-collation-generation
0.1.0 - polkadot-node-core-approval-voting
0.1.0 - polkadot-node-core-av-store
0.1.0 - polkadot-node-core-backing
0.1.0 - polkadot-node-core-bitfield-signing
0.1.0 - polkadot-node-core-candidate-selection
0.1.0 - polkadot-node-core-candidate-validation
0.1.0 - polkadot-node-core-chain-api
0.1.0 - polkadot-node-core-parachains-inherent
0.1.0 - polkadot-node-core-provisioner
0.1.0 - polkadot-node-core-pvf
0.1.0 - polkadot-node-core-runtime-api
0.1.0 - polkadot-node-subsystem
0.1.0 - polkadot-node-subsystem-util
0.1.0 - polkadot-overseer
0.1.0 - polkadot-service
0.9.3 - polkadot-statement-distribution
0.1.0 - polkadot-test-service
0.9.3 - sc-network-gossip
0.9.0 - sc-service
0.9.0 - sc-tracing
3.0.0 - sp-io
3.0.0 - sp-state-machine
0.9.0 - sp-tracing
3.0.0 - tracing-futures
0.2.5 - tracing-subscriber
0.2.18
- cumulus-client-collator
tracing-attributes
0.1.15crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2depends onused bytracing-core
0.1.18crates.io↘ 1↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052depends ontracing-futures
0.2.5crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2depends onused bytracing-log
0.1.2crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3tracing-serde
0.1.2crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumfb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28bdepends onused bytracing-subscriber
0.2.18crates.io↘ 14↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaa5553bf0883ba7c9cbe493b085c29926bd41b66afc31ff72cf17ff4fb60dcd5depends ontrie-db
0.22.5crates.io↘ 5↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcd81fe0c8bc2b528a51c9d2c31dae4483367a26a723a3c9a4a8120311d7774e3trie-root
0.16.0crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum652931506d2c1244d7217a70b99f56718a7b4161b37f04e7cd868072a99f68cddepends ontriehash
0.8.4crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5cdepends onused bytrust-dns-proto
0.20.3crates.io↘ 16↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumad0d7f5db438199a6e2609debe3f69f808d074e0a2888ee0bccb45fe234d03f4depends onused bytrust-dns-resolver
0.20.3crates.io↘ 11↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf6ad17b608a64bd0735e67bde16b0636f8aa8591f831a25d18443ed00a699770depends ontry-runtime-cli
0.9.0github.com/paritytech/substrate.git↘ 15↖ 1sourcegit+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.3#c94e0cdfe5556680dca1996004751eeb114755d7depends onused bytwox-hash
1.6.0crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59used bytypenum
1.13.0crates.io↘ 0↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06uint
0.8.5crates.io↘ 4↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177uint
0.9.0crates.io↘ 4↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382eunicase
2.6.0crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6depends onunicode-bidi
0.3.5crates.io↘ 1↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumeeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0depends onunicode-normalization
0.1.19crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9depends onunicode-segmentation
1.7.1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796used byunicode-width
0.1.8crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3used byunicode-xid
0.2.2crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3universal-hash
0.4.0crates.io↘ 2↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402depends onused byunsigned-varint
0.5.1crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35used byunsigned-varint
0.6.0crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2used byunsigned-varint
0.7.0crates.io↘ 4↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5f8d425fafb8cd76bc3f22aace4af471d3156301d7508f2107e98fbeae10bc7funtrusted
0.7.1crates.io↘ 0↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4aup-sponsorship
0.1.0workspace↘ 1↖ 4url
1.7.2crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355aurl
2.2.2crates.io↘ 4↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578cvalue-bag
1.0.0-alpha.7crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumdd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840aedepends onused byvcpkg
0.2.14crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum70455df2fdf4e9bf580a92e443f1eb0303c390d682e2ea817312c9e81f8c3399used byvec_map
0.8.2crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumf1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191used byversion_check
0.9.3crates.io↘ 0↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fevoid
1.0.2crates.io↘ 0↖ 9sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887dwaker-fn
1.1.0crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceecawalkdir
2.3.2crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56want
0.2.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230depends onused bywant
0.3.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0depends onused bywasi
0.9.0+wasi-snapshot-preview1crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumcccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519used bywasi
0.10.0+wasi-snapshot-preview1crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31fused bywasm-bindgen
0.2.74crates.io↘ 2↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fddepends onwasm-bindgen-backend
0.2.74crates.io↘ 7↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900depends onwasm-bindgen-futures
0.4.24crates.io↘ 4↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1wasm-bindgen-macro
0.2.74crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4used bywasm-bindgen-macro-support
0.2.74crates.io↘ 5↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbe2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97used bywasm-gc-api
0.1.11crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9wasm-timer
0.2.5crates.io↘ 7↖ 20sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbe0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7fdepends onused by- libp2p
0.37.1 - libp2p-gossipsub
0.30.1 - libp2p-identify
0.29.0 - libp2p-kad
0.30.0 - libp2p-ping
0.29.0 - libp2p-relay
0.2.0 - libp2p-request-response
0.11.0 - libp2p-swarm
0.29.0 - polkadot-node-core-bitfield-signing
0.1.0 - sc-informant
0.9.0 - sc-network
0.9.0 - sc-network-gossip
0.9.0 - sc-peerset
3.0.0 - sc-service
0.9.0 - sc-telemetry
3.0.0 - sc-tracing
3.0.0 - sc-transaction-graph
3.0.0 - sc-transaction-pool
3.0.0 - sp-consensus
0.9.0 - sp-timestamp
3.0.0
- libp2p
wasmi
0.6.2crates.io↘ 6↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumbf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92affdepends onwasmi-validation
0.3.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumea78c597064ba73596099281e2f4cfc019075122a65cdda3205af94f0b264d93depends onused bywasmi-validation
0.4.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma2eb8e860796d8be48efef530b60eebf84e74a88bce107374fffb0da97d504b8depends onused bywasmparser
0.76.0crates.io↘ 0↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum755a9a4afe3f6cccbbe6d7e965eef44cf260b001f93e547eba84255c1d0187d8wasmtime
0.24.0crates.io↘ 23↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum718cb52a9fdb7ab12471e9b9d051c9adfa6b5c504e0a1fea045e5eabc81eedd9depends on- anyhow
1.0.41 - backtrace
0.3.60 - bincode
1.3.3 - cfg-if
1.0.0 - cpp_demangle
0.3.2 - indexmap
1.6.2 - libc
0.2.97 - log
0.4.14 - paste
1.0.5 - region
2.2.0 - rustc-demangle
0.1.19 - serde
1.0.126 - smallvec
1.6.1 - target-lexicon
0.11.2 - wasmparser
0.76.0 - wasmtime-cache
0.24.0 - wasmtime-environ
0.24.0 - wasmtime-fiber
0.24.0 - wasmtime-jit
0.24.0 - wasmtime-profiling
0.24.0 - wasmtime-runtime
0.24.0 - wat
1.0.38 - winapi
0.3.9
used by- anyhow
wasmtime-cache
0.24.0crates.io↘ 13↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1f984df56c4adeba91540f9052db9f7a8b3b00cfaac1a023bee50a972f588b0cdepends onused bywasmtime-cranelift
0.24.0crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2a05abbf94e03c2c8ee02254b1949320c4d45093de5d9d6ed4d9351d536075c9depends onused bywasmtime-debug
0.24.0crates.io↘ 8↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum382eecd6281c6c1d1f3c904c3c143e671fc1a9573820cbfa777fba45ce2eda9cdepends onwasmtime-environ
0.24.0crates.io↘ 12↖ 7sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum81011b2b833663d7e0ce34639459a0e301e000fc7331e0298b3a27c78d0cec60depends onwasmtime-fiber
0.24.0crates.io↘ 3↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd92da32e31af2e3d828f485f5f24651ed4d3b7f03a46ea6555eae6940d1402cddepends onused bywasmtime-jit
0.24.0crates.io↘ 25↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9b5f649623859a12d361fe4cc4793de44f7c3ff34c322c5714289787e89650bbdepends on- addr2line
0.14.1 - anyhow
1.0.41 - cfg-if
1.0.0 - cranelift-codegen
0.71.0 - cranelift-entity
0.71.0 - cranelift-frontend
0.71.0 - cranelift-native
0.71.0 - cranelift-wasm
0.71.0 - gimli
0.23.0 - log
0.4.14 - more-asserts
0.2.1 - object
0.23.0 - rayon
1.5.1 - region
2.2.0 - serde
1.0.126 - target-lexicon
0.11.2 - thiserror
1.0.25 - wasmparser
0.76.0 - wasmtime-cranelift
0.24.0 - wasmtime-debug
0.24.0 - wasmtime-environ
0.24.0 - wasmtime-obj
0.24.0 - wasmtime-profiling
0.24.0 - wasmtime-runtime
0.24.0 - winapi
0.3.9
used by- addr2line
wasmtime-obj
0.24.0crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumef2e99cd9858f57fd062e9351e07881cedfc8597928385e02a48d9333b9e15a1depends onused bywasmtime-profiling
0.24.0crates.io↘ 11↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume46c0a590e49278ba7f79ef217af9db4ecc671b50042c185093e22d73524abb2depends onwasmtime-runtime
0.24.0crates.io↘ 14↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1438a09185fc7ca067caf1a80d7e5b398eefd4fb7630d94841448ade60feb3d0depends onwast
36.0.0crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum8b5d7ba374a364571da1cb0a379a3dc302582a2d9937a183bfe35b68ad5bb9c4depends onused bywat
1.0.38crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum16383df7f0e3901484c2dda6294ed6895caa3627ce4f6584141dcf30a33a23e6depends onused byweb-sys
0.3.51crates.io↘ 2↖ 5sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582depends onwebpki
0.21.4crates.io↘ 2↖ 6sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4eadepends onwebpki-roots
0.21.1crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumaabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940depends onused bywepoll-ffi
0.1.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fbdepends onused bywestend-runtime
0.9.3github.com/paritytech/polkadot↘ 70↖ 1sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends on- beefy-primitives
0.1.0 - bitvec
0.20.4 - frame-executive
3.0.0 - frame-support
3.0.0 - frame-system
3.0.0 - frame-system-rpc-runtime-api
3.0.0 - frame-try-runtime
0.9.0 - log
0.4.14 - pallet-authority-discovery
3.0.0 - pallet-authorship
3.0.0 - pallet-babe
3.0.0 - pallet-balances
3.0.0 - pallet-collective
3.0.0 - pallet-democracy
3.0.0 - pallet-election-provider-multi-phase
3.0.0 - pallet-elections-phragmen
4.0.0 - pallet-grandpa
3.0.0 - pallet-identity
3.0.0 - pallet-im-online
3.0.0 - pallet-indices
3.0.0 - pallet-membership
3.0.0 - pallet-mmr-primitives
3.0.0 - pallet-multisig
3.0.0 - pallet-nicks
3.0.0 - pallet-offences
3.0.0 - pallet-proxy
3.0.0 - pallet-randomness-collective-flip
3.0.0 - pallet-recovery
3.0.0 - pallet-scheduler
3.0.0 - pallet-session
3.0.0 - pallet-society
3.0.0 - pallet-staking
3.0.0 - pallet-staking-reward-curve
3.0.0 - pallet-sudo
3.0.0 - pallet-timestamp
3.0.0 - pallet-transaction-payment
3.0.0 - pallet-transaction-payment-rpc-runtime-api
3.0.0 - pallet-treasury
3.0.0 - pallet-utility
3.0.0 - pallet-vesting
3.0.0 - pallet-xcm
0.1.0 - parity-scale-codec
2.1.3 - polkadot-parachain
0.9.3 - polkadot-primitives
0.9.3 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - rustc-hex
2.1.0 - serde
1.0.126 - serde_derive
1.0.126 - smallvec
1.6.1 - sp-api
3.0.0 - sp-authority-discovery
3.0.0 - sp-block-builder
3.0.0 - sp-consensus-babe
0.9.0 - sp-core
3.0.0 - sp-inherents
3.0.0 - sp-io
3.0.0 - sp-npos-elections
3.0.0 - sp-offchain
3.0.0 - sp-runtime
3.0.0 - sp-session
3.0.0 - sp-staking
3.0.0 - sp-std
3.0.0 - sp-transaction-pool
3.0.0 - sp-version
3.0.0 - static_assertions
1.1.0 - substrate-wasm-builder
3.0.0 - xcm
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
used by- beefy-primitives
which
4.1.0crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfedepends onused bywidestring
0.4.3crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumc168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7cused bywinapi
0.2.8crates.io↘ 0↖ 4sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087awinapi
0.3.9crates.io↘ 2↖ 45sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419used by- ansi_term
0.11.0 - ansi_term
0.12.1 - async-io
1.4.1 - async-process
1.1.0 - atty
0.2.14 - chrono
0.4.19 - dirs-sys
0.3.6 - dirs-sys-next
0.1.2 - errno
0.2.7 - fs-swap
0.2.6 - fs2
0.4.3 - hostname
0.3.1 - if-addrs
0.6.5 - if-watch
0.2.2 - ipconfig
0.2.2 - libloading
0.5.2 - libloading
0.7.0 - mio-named-pipes
0.1.7 - miow
0.3.7 - net2
0.2.37 - parity-tokio-ipc
0.4.0 - parity-util-mem
0.9.0 - parking_lot_core
0.6.2 - parking_lot_core
0.7.2 - parking_lot_core
0.8.3 - polling
2.1.0 - rand
0.4.6 - region
2.2.0 - remove_dir_all
0.5.3 - ring
0.16.20 - rpassword
5.0.1 - schannel
0.1.19 - socket2
0.3.19 - socket2
0.4.0 - tempfile
3.2.0 - time
0.1.44 - tokio
0.2.25 - walkdir
2.3.2 - wasmtime
0.24.0 - wasmtime-cache
0.24.0 - wasmtime-fiber
0.24.0 - wasmtime-jit
0.24.0 - wasmtime-runtime
0.24.0 - winapi-util
0.1.5 - winreg
0.6.2
- ansi_term
winapi-build
0.1.1crates.io↘ 0↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bcwinapi-i686-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6used bywinapi-util
0.1.5crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178depends onwinapi-x86_64-pc-windows-gnu
0.4.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183fused bywinreg
0.6.2crates.io↘ 1↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumb2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9depends onused byws2_32-sys
0.2.1crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumd59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5edepends onused bywyz
0.2.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214used byx25519-dalek
1.1.1crates.io↘ 3↖ 2sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4fused byxcm
0.9.3github.com/paritytech/polkadot↘ 3↖ 15sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2used by- cumulus-pallet-dmp-queue
0.1.0 - cumulus-pallet-parachain-system
0.1.0 - cumulus-pallet-xcm
0.1.0 - cumulus-pallet-xcmp-queue
0.1.0 - cumulus-primitives-core
0.1.0 - cumulus-primitives-utility
0.1.0 - kusama-runtime
0.9.3 - nft-runtime
3.0.0 - pallet-xcm
0.1.0 - polkadot-runtime-common
0.9.3 - polkadot-runtime-parachains
0.9.3 - rococo-runtime
0.9.3 - westend-runtime
0.9.3 - xcm-builder
0.9.3 - xcm-executor
0.9.3
- cumulus-pallet-dmp-queue
xcm-builder
0.9.3github.com/paritytech/polkadot↘ 12↖ 4sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onxcm-executor
0.9.3github.com/paritytech/polkadot↘ 10↖ 9sourcegit+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2depends onyamux
0.9.0crates.io↘ 6↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksume7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107used byyansi
0.5.0crates.io↘ 0↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71used byzeroize
1.3.0crates.io↘ 1↖ 15sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efddepends onzeroize_derive
1.1.0crates.io↘ 4↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksuma2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1used byzstd
0.6.1+zstd.1.4.9crates.io↘ 1↖ 3sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum5de55e77f798f205d8561b8fe2ef57abfb6e0ff2abe7fd3c089e119cdb5631a3depends onzstd-safe
3.0.1+zstd.1.4.9crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksum1387cabcd938127b30ce78c4bf00b30387dddf704e3f0881dbc4ff62b5566f8cdepends onused byzstd-sys
1.4.20+zstd.1.4.9crates.io↘ 2↖ 1sourceregistry+https://github.com/rust-lang/crates.io-indexchecksumebd5b733d7cf2d9447e2c3e76a5589b4f5e5ae065c22a2bc0b023cbc331b6c8edepends onused by
README.mddiffbeforeafterboth--- a/README.md
+++ b/README.md
@@ -228,3 +228,26 @@
## Running Integration Tests
See [tests/README.md](./tests/README.md).
+
+## Code Formatting
+
+### Get formatter and linter settings into your branch (if you forked before they were introduced)
+```bash
+git cherry-pick -n 8ff77c21b0d30b2a4648fa35dbf61dfa9d3948a7
+```
+
+### Apply formatting and clippy fixes
+```bash
+cargo clippy
+cargo fmt
+```
+
+### Format tests
+```bash
+pushd tests && yarn fix ; popd
+```
+
+### Check code style in tests
+```bash
+cd tests && yarn eslint --ext .ts,.js src/
+```
\ No newline at end of file
crates/evm-coder-macros/src/lib.rsdiffbeforeafterboth--- a/crates/evm-coder-macros/src/lib.rs
+++ b/crates/evm-coder-macros/src/lib.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)]
+
use darling::FromMeta;
use inflector::cases;
use proc_macro::TokenStream;
crates/evm-coder-macros/src/solidity_interface.rsdiffbeforeafterboth--- a/crates/evm-coder-macros/src/solidity_interface.rs
+++ b/crates/evm-coder-macros/src/solidity_interface.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)]
+
use quote::quote;
use darling::FromMeta;
use inflector::cases;
@@ -262,7 +264,7 @@
ReturnType::Type(_, ty) => ty,
_ => return Err(syn::Error::new(value.sig.output.span(), "interface method should return Result<value>\nif there is no value to return - specify void (which is alias to unit)")),
};
- let result = parse_result_ok(&result)?;
+ let result = parse_result_ok(result)?;
let camel_name = info
.rename_selector
@@ -283,8 +285,8 @@
Ok(Self {
name: ident.clone(),
camel_name,
- pascal_name: snake_ident_to_pascal(&ident),
- screaming_name: snake_ident_to_screaming(&ident),
+ pascal_name: snake_ident_to_pascal(ident),
+ screaming_name: snake_ident_to_screaming(ident),
selector_str,
selector,
args,
@@ -431,7 +433,7 @@
found_error = true;
}
}
- TraitItem::Method(method) => methods.push(Method::try_from(&method)?),
+ TraitItem::Method(method) => methods.push(Method::try_from(method)?),
_ => {}
}
}
@@ -545,6 +547,7 @@
#(
#call_inner
)*
+ #[allow(unreachable_code)] // In case of no inner calls
fn call(&mut self, c: Msg<#call_name>) -> ::core::result::Result<::evm_coder::abi::AbiWriter, Self::Error> {
use ::evm_coder::abi::AbiWrite;
type InternalCall = #call_name;
crates/evm-coder-macros/src/to_log.rsdiffbeforeafterboth--- a/crates/evm-coder-macros/src/to_log.rs
+++ b/crates/evm-coder-macros/src/to_log.rs
@@ -41,7 +41,7 @@
impl Event {
fn try_from(variant: &Variant) -> syn::Result<Self> {
let name = &variant.ident;
- let name_screaming = snake_ident_to_screaming(&name);
+ let name_screaming = snake_ident_to_screaming(name);
let named = match &variant.fields {
Fields::Named(named) => named,
@@ -54,7 +54,7 @@
};
let mut fields = Vec::new();
for field in &named.named {
- fields.push(EventField::try_from(&field)?);
+ fields.push(EventField::try_from(field)?);
}
let mut selector_str = format!("{}(", name);
for (i, arg) in fields.iter().enumerate() {
crates/evm-coder/src/abi.rsdiffbeforeafterboth--- a/crates/evm-coder/src/abi.rs
+++ b/crates/evm-coder/src/abi.rs
@@ -104,7 +104,7 @@
fn subresult(&mut self) -> Result<AbiReader<'i>> {
let offset = self.read_usize()?;
Ok(AbiReader {
- buf: &self.buf,
+ buf: self.buf,
offset: offset + self.offset,
})
}
@@ -252,7 +252,7 @@
impl_abi_writeable!(&str, string);
impl AbiWrite for &string {
fn abi_write(&self, writer: &mut AbiWriter) {
- writer.string(&self)
+ writer.string(self)
}
}
crates/evm-coder/tests/a.rsdiffbeforeafterboth--- a/crates/evm-coder/tests/a.rs
+++ b/crates/evm-coder/tests/a.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)] // This test only checks that macros is not panicking
+
use evm_coder::{solidity_interface, types::*, ToLog};
use evm_coder_macros::solidity;
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.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
################################################################################
@@ -17,196 +17,196 @@
[dependencies.frame-benchmarking]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-benchmarking-cli]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-transaction-payment-rpc]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.substrate-prometheus-endpoint]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-chain-spec]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sc-cli]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-client-api]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sc-consensus]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-executor]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-keystore]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sc-rpc]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sc-rpc-api]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-service]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sc-telemetry]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sc-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sc-tracing]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-block-builder]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-api]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-blockchain]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-consensus]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sp-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sp-core]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-inherents]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-keystore]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sp-offchain]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-runtime]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-session]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-timestamp]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-trie]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.substrate-frame-rpc-system]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-contracts]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-contracts-rpc]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sc-network]
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.serde]
@@ -222,58 +222,58 @@
[dependencies.cumulus-client-consensus-aura]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
[dependencies.cumulus-client-consensus-common]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
[dependencies.cumulus-client-collator]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
[dependencies.cumulus-client-cli]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
[dependencies.cumulus-client-network]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
[dependencies.cumulus-primitives-core]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
[dependencies.cumulus-primitives-parachain-inherent]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
[dependencies.cumulus-client-service]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
################################################################################
# Polkadot dependencies
[dependencies.polkadot-primitives]
git = "https://github.com/paritytech/polkadot"
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
[dependencies.polkadot-service]
git = "https://github.com/paritytech/polkadot"
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
[dependencies.polkadot-cli]
git = "https://github.com/paritytech/polkadot"
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
[dependencies.polkadot-test-service]
git = "https://github.com/paritytech/polkadot"
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
[dependencies.polkadot-parachain]
git = "https://github.com/paritytech/polkadot"
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
################################################################################
@@ -322,7 +322,7 @@
fc-rpc = { version = "2.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
fc-db = { version = "1.0.0", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
fp-rpc = { version = "2.0.0", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
-pallet-ethereum = { version = "2.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
+pallet-ethereum = { version = "3.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
nft-rpc = { path = "../rpc" }
node/cli/build.rsdiffbeforeafterboth--- a/node/cli/build.rs
+++ b/node/cli/build.rs
@@ -6,7 +6,7 @@
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
fn main() {
- generate_cargo_keys();
+ generate_cargo_keys();
- rerun_if_git_head_changed();
+ rerun_if_git_head_changed();
}
node/cli/src/chain_spec.rsdiffbeforeafterboth--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -64,20 +64,22 @@
// ID
"dev",
ChainType::Local,
- move || testnet_genesis(
- // Sudo account
- get_account_id_from_seed::<sr25519::Public>("Alice"),
- vec![
- get_from_seed::<AuraId>("Alice"),
- get_from_seed::<AuraId>("Bob"),
- ],
- // Pre-funded accounts
- vec![
+ move || {
+ testnet_genesis(
+ // Sudo account
get_account_id_from_seed::<sr25519::Public>("Alice"),
- get_account_id_from_seed::<sr25519::Public>("Bob"),
- ],
- id,
- ),
+ vec![
+ get_from_seed::<AuraId>("Alice"),
+ get_from_seed::<AuraId>("Bob"),
+ ],
+ // Pre-funded accounts
+ vec![
+ get_account_id_from_seed::<sr25519::Public>("Alice"),
+ get_account_id_from_seed::<sr25519::Public>("Bob"),
+ ],
+ id,
+ )
+ },
// Bootnodes
vec![],
// Telemetry
@@ -101,30 +103,32 @@
// ID
"local_testnet",
ChainType::Local,
- move || testnet_genesis(
- // Sudo account
- get_account_id_from_seed::<sr25519::Public>("Alice"),
- vec![
- get_from_seed::<AuraId>("Alice"),
- get_from_seed::<AuraId>("Bob"),
- ],
- // Pre-funded accounts
- vec![
+ move || {
+ testnet_genesis(
+ // Sudo account
get_account_id_from_seed::<sr25519::Public>("Alice"),
- get_account_id_from_seed::<sr25519::Public>("Bob"),
- get_account_id_from_seed::<sr25519::Public>("Charlie"),
- get_account_id_from_seed::<sr25519::Public>("Dave"),
- get_account_id_from_seed::<sr25519::Public>("Eve"),
- get_account_id_from_seed::<sr25519::Public>("Ferdie"),
- get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
- get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
- get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
- get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
- get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
- get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
- ],
- id,
- ),
+ vec![
+ get_from_seed::<AuraId>("Alice"),
+ get_from_seed::<AuraId>("Bob"),
+ ],
+ // Pre-funded accounts
+ vec![
+ get_account_id_from_seed::<sr25519::Public>("Alice"),
+ get_account_id_from_seed::<sr25519::Public>("Bob"),
+ get_account_id_from_seed::<sr25519::Public>("Charlie"),
+ get_account_id_from_seed::<sr25519::Public>("Dave"),
+ get_account_id_from_seed::<sr25519::Public>("Eve"),
+ get_account_id_from_seed::<sr25519::Public>("Ferdie"),
+ get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
+ get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
+ ],
+ id,
+ )
+ },
// Bootnodes
vec![],
// Telemetry
@@ -142,83 +146,82 @@
}
fn testnet_genesis(
- root_key: AccountId,
+ root_key: AccountId,
initial_authorities: Vec<AuraId>,
- endowed_accounts: Vec<AccountId>,
+ endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> GenesisConfig {
-
- let vested_accounts = vec![
- get_account_id_from_seed::<sr25519::Public>("Bob"),
- ];
+ let vested_accounts = vec![get_account_id_from_seed::<sr25519::Public>("Bob")];
- GenesisConfig {
+ GenesisConfig {
system: nft_runtime::SystemConfig {
code: nft_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
.to_vec(),
changes_trie_config: Default::default(),
},
- pallet_balances: BalancesConfig {
- balances: endowed_accounts
- .iter()
- .cloned()
- .map(|k| (k, 1 << 70))
- .collect(),
- },
- pallet_treasury: Default::default(),
- pallet_sudo: SudoConfig { key: root_key },
- pallet_vesting: VestingConfig {
- vesting: vested_accounts
- .iter()
- .cloned()
- .map(|k| (k, 1000, 100, 1 << 98))
- .collect(),
- },
- pallet_nft: NftConfig {
- collection_id: vec![(
- 1,
- Collection {
- owner: get_account_id_from_seed::<sr25519::Public>("Alice"),
- mode: CollectionMode::NFT,
- access: AccessMode::Normal,
- decimal_points: 0,
- name: vec![],
- description: vec![],
- token_prefix: vec![],
- mint_mode: false,
+ balances: BalancesConfig {
+ balances: endowed_accounts
+ .iter()
+ .cloned()
+ .map(|k| (k, 1 << 70))
+ .collect(),
+ },
+ treasury: Default::default(),
+ sudo: SudoConfig { key: root_key },
+ vesting: VestingConfig {
+ vesting: vested_accounts
+ .iter()
+ .cloned()
+ .map(|k| (k, 1000, 100, 1 << 98))
+ .collect(),
+ },
+ nft: NftConfig {
+ collection_id: vec![(
+ 1,
+ Collection {
+ owner: get_account_id_from_seed::<sr25519::Public>("Alice"),
+ mode: CollectionMode::NFT,
+ access: AccessMode::Normal,
+ decimal_points: 0,
+ name: vec![],
+ description: vec![],
+ token_prefix: vec![],
+ mint_mode: false,
offchain_schema: vec![],
schema_version: SchemaVersion::default(),
- sponsorship: SponsorshipState::Confirmed(get_account_id_from_seed::<sr25519::Public>("Alice")),
- const_on_chain_schema: vec![],
+ sponsorship: SponsorshipState::Confirmed(get_account_id_from_seed::<
+ sr25519::Public,
+ >("Alice")),
+ const_on_chain_schema: vec![],
variable_on_chain_schema: vec![],
- limits: CollectionLimits::default()
- },
- )],
- nft_item_id: vec![],
- fungible_item_id: vec![],
- refungible_item_id: vec![],
- chain_limit: ChainLimits {
- collection_numbers_limit: 100000,
- account_token_ownership_limit: 1000000,
- collections_admins_limit: 5,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
+ limits: CollectionLimits::default(),
+ },
+ )],
+ nft_item_id: vec![],
+ fungible_item_id: vec![],
+ refungible_item_id: vec![],
+ chain_limit: ChainLimits {
+ collection_numbers_limit: 100000,
+ account_token_ownership_limit: 1000000,
+ collections_admins_limit: 5,
+ custom_data_limit: 2048,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
refungible_sponsor_transfer_timeout: 15,
offchain_schema_limit: 1024,
variable_on_chain_schema_limit: 1024,
const_on_chain_schema_limit: 1024,
- },
- },
+ },
+ },
parachain_info: nft_runtime::ParachainInfoConfig { parachain_id: id },
- pallet_aura: nft_runtime::AuraConfig {
+ aura: nft_runtime::AuraConfig {
authorities: initial_authorities,
},
- cumulus_pallet_aura_ext: Default::default(),
- pallet_evm: EVMConfig {
+ aura_ext: Default::default(),
+ evm: EVMConfig {
accounts: BTreeMap::new(),
},
- pallet_ethereum: EthereumConfig {},
- }
+ ethereum: EthereumConfig {},
+ }
}
node/cli/src/cli.rsdiffbeforeafterboth--- a/node/cli/src/cli.rs
+++ b/node/cli/src/cli.rs
@@ -1,6 +1,4 @@
use crate::chain_spec;
-use cumulus_client_cli;
-use sc_cli;
use std::path::PathBuf;
use structopt::StructOpt;
node/cli/src/command.rsdiffbeforeafterboth--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -18,7 +18,7 @@
use crate::{
chain_spec,
cli::{Cli, RelayChainCli, Subcommand},
- service::{new_partial, ParachainRuntimeExecutor}
+ service::{new_partial, ParachainRuntimeExecutor},
};
use codec::Encode;
use cumulus_primitives_core::ParaId;
@@ -31,7 +31,7 @@
NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli,
};
use sc_service::{
- config::{BasePath, PrometheusConfig}
+ config::{BasePath, PrometheusConfig},
};
use sp_core::hexdisplay::HexDisplay;
use sp_runtime::traits::Block as BlockT;
@@ -120,8 +120,7 @@
}
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
- polkadot_cli::Cli::from_iter([RelayChainCli::executable_name().to_string()].iter())
- .load_spec(id)
+ polkadot_cli::Cli::from_iter([RelayChainCli::executable_name()].iter()).load_spec(id)
}
fn native_runtime_version(chain_spec: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
@@ -129,6 +128,7 @@
}
}
+#[allow(clippy::borrowed_box)]
fn extract_genesis_wasm(chain_spec: &Box<dyn sc_service::ChainSpec>) -> Result<Vec<u8>> {
let mut storage = chain_spec.build_storage()?;
@@ -189,7 +189,7 @@
runner.sync_run(|config| {
let polkadot_cli = RelayChainCli::new(
&config,
- [RelayChainCli::executable_name().to_string()]
+ [RelayChainCli::executable_name()]
.iter()
.chain(cli.relaychain_args.iter()),
);
@@ -251,7 +251,7 @@
}
Ok(())
- },
+ }
Some(Subcommand::Benchmark(cmd)) => {
if cfg!(feature = "runtime-benchmarks") {
let runner = cli.create_runner(cmd)?;
@@ -259,22 +259,20 @@
runner.sync_run(|config| cmd.run::<Block, ParachainRuntimeExecutor>(config))
} else {
Err("Benchmarking wasn't enabled when building the node. \
- You can enable it with `--features runtime-benchmarks`.".into())
+ You can enable it with `--features runtime-benchmarks`."
+ .into())
}
- },
+ }
None => {
let runner = cli.create_runner(&cli.run.normalize())?;
runner.run_node_until_exit(|config| async move {
- // TODO
- let key = sp_core::Pair::generate().0;
-
let para_id =
chain_spec::Extensions::try_get(&*config.chain_spec).map(|e| e.para_id);
let polkadot_cli = RelayChainCli::new(
&config,
- [RelayChainCli::executable_name().to_string()]
+ [RelayChainCli::executable_name()]
.iter()
.chain(cli.relaychain_args.iter()),
);
@@ -289,12 +287,9 @@
let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
let task_executor = config.task_executor.clone();
- let polkadot_config = SubstrateCli::create_configuration(
- &polkadot_cli,
- &polkadot_cli,
- task_executor,
- )
- .map_err(|err| format!("Relay chain argument error: {}", err))?;
+ let polkadot_config =
+ SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, task_executor)
+ .map_err(|err| format!("Relay chain argument error: {}", err))?;
info!("Parachain id: {:?}", id);
info!("Parachain Account: {}", parachain_account);
@@ -308,7 +303,7 @@
}
);
- crate::service::start_node(config, key, polkadot_config, id)
+ crate::service::start_node(config, polkadot_config, id)
.await
.map(|r| r.0)
.map_err(Into::into)
@@ -443,4 +438,4 @@
) -> Result<Option<sc_telemetry::TelemetryEndpoints>> {
self.base.base.telemetry_endpoints(chain_spec)
}
-}
\ No newline at end of file
+}
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -15,9 +15,7 @@
use nft_runtime::RuntimeApi;
// Cumulus Imports
-use cumulus_client_consensus_aura::{
- build_aura_consensus, BuildAuraConsensusParams, SlotProportion,
-};
+use cumulus_client_consensus_aura::{build_aura_consensus, BuildAuraConsensusParams, SlotProportion};
use cumulus_client_consensus_common::ParachainConsensus;
use cumulus_client_network::build_block_announce_validator;
use cumulus_client_service::{
@@ -25,9 +23,6 @@
};
use cumulus_primitives_core::ParaId;
-// Polkadot Imports
-use polkadot_primitives::v1::CollatorPair;
-
// Substrate Imports
use sc_client_api::ExecutorProvider;
pub use sc_executor::NativeExecutor;
@@ -59,20 +54,23 @@
);
pub fn open_frontier_backend(config: &Configuration) -> Result<Arc<fc_db::Backend<Block>>, String> {
- let config_dir = config.base_path.as_ref()
+ let config_dir = config
+ .base_path
+ .as_ref()
.map(|base_path| base_path.config_dir(config.chain_spec.id()))
.unwrap_or_else(|| {
- BasePath::from_project("", "", "nft")
- .config_dir(config.chain_spec.id())
+ BasePath::from_project("", "", "nft").config_dir(config.chain_spec.id())
});
let database_dir = config_dir.join("frontier").join("db");
- Ok(Arc::new(fc_db::Backend::<Block>::new(&fc_db::DatabaseSettings {
- source: fc_db::DatabaseSettingsSrc::RocksDb {
- path: database_dir,
- cache_size: 0,
- }
- })?))
+ Ok(Arc::new(fc_db::Backend::<Block>::new(
+ &fc_db::DatabaseSettings {
+ source: fc_db::DatabaseSettingsSrc::RocksDb {
+ path: database_dir,
+ cache_size: 0,
+ },
+ },
+ )?))
}
type Executor = ParachainRuntimeExecutor;
@@ -85,6 +83,7 @@
///
/// Use this macro if you don't actually need the full service, but just the builder in order to
/// be able to perform chain operations.
+#[allow(clippy::type_complexity)]
pub fn new_partial<BIQ>(
config: &Configuration,
build_import_queue: BIQ,
@@ -95,7 +94,13 @@
FullSelectChain,
sp_consensus::DefaultImportQueue<Block, FullClient>,
sc_transaction_pool::FullPool<Block, FullClient>,
- (Option<Telemetry>, PendingTransactions, Option<FilterPool>, Arc<fc_db::Backend<Block>>, Option<TelemetryWorkerHandle>),
+ (
+ Option<Telemetry>,
+ PendingTransactions,
+ Option<FilterPool>,
+ Arc<fc_db::Backend<Block>>,
+ Option<TelemetryWorkerHandle>,
+ ),
>,
sc_service::Error,
>
@@ -107,12 +112,9 @@
&Configuration,
Option<TelemetryHandle>,
&TaskManager,
- ) -> Result<
- sp_consensus::DefaultImportQueue<Block, FullClient>,
- sc_service::Error,
- >,
+ ) -> Result<sp_consensus::DefaultImportQueue<Block, FullClient>, sc_service::Error>,
{
- let telemetry = config
+ let _telemetry = config
.telemetry_endpoints
.clone()
.filter(|x| !x.is_empty())
@@ -123,7 +125,9 @@
})
.transpose()?;
- let telemetry = config.telemetry_endpoints.clone()
+ let telemetry = config
+ .telemetry_endpoints
+ .clone()
.filter(|x| !x.is_empty())
.map(|endpoints| -> Result<_, sc_telemetry::Error> {
let worker = TelemetryWorker::new(16)?;
@@ -134,7 +138,7 @@
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, Executor>(
- &config,
+ config,
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
)?;
let client = Arc::new(client);
@@ -152,14 +156,13 @@
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
- task_manager.spawn_handle(),
+ task_manager.spawn_essential_handle(),
client.clone(),
);
let pending_transactions: PendingTransactions = Some(Arc::new(Mutex::new(HashMap::new())));
- let filter_pool: Option<FilterPool>
- = Some(Arc::new(Mutex::new(BTreeMap::new())));
+ let filter_pool: Option<FilterPool> = Some(Arc::new(Mutex::new(BTreeMap::new())));
let frontier_backend = open_frontier_backend(config)?;
@@ -178,7 +181,13 @@
task_manager,
transaction_pool,
select_chain,
- other: (telemetry, pending_transactions, filter_pool, frontier_backend, telemetry_worker_handle),
+ other: (
+ telemetry,
+ pending_transactions,
+ filter_pool,
+ frontier_backend,
+ telemetry_worker_handle,
+ ),
};
Ok(params)
@@ -190,7 +199,6 @@
#[sc_tracing::logging::prefix_logs_with("Parachain")]
async fn start_node_impl<BIQ, BIC>(
parachain_config: Configuration,
- collator_key: CollatorPair,
polkadot_config: Configuration,
id: ParaId,
build_import_queue: BIQ,
@@ -204,10 +212,7 @@
&Configuration,
Option<TelemetryHandle>,
&TaskManager,
- ) -> Result<
- sp_consensus::DefaultImportQueue<Block, FullClient>,
- sc_service::Error,
- >,
+ ) -> Result<sp_consensus::DefaultImportQueue<Block, FullClient>, sc_service::Error>,
BIC: FnOnce(
Arc<FullClient>,
Option<&Registry>,
@@ -227,18 +232,21 @@
let parachain_config = prepare_node_config(parachain_config);
let params = new_partial::<BIQ>(¶chain_config, build_import_queue)?;
- let (mut telemetry, pending_transactions, filter_pool, frontier_backend, telemetry_worker_handle) = params.other;
-
- let relay_chain_full_node = cumulus_client_service::build_polkadot_full_node(
- polkadot_config,
- collator_key.clone(),
+ let (
+ mut telemetry,
+ pending_transactions,
+ filter_pool,
+ frontier_backend,
telemetry_worker_handle,
- )
- .map_err(|e| match e {
- polkadot_service::Error::Sub(x) => x,
- s => format!("{}", s).into(),
- })?;
+ ) = params.other;
+ let relay_chain_full_node =
+ cumulus_client_service::build_polkadot_full_node(polkadot_config, telemetry_worker_handle)
+ .map_err(|e| match e {
+ polkadot_service::Error::Sub(x) => x,
+ s => format!("{}", s).into(),
+ })?;
+
let client = params.client.clone();
let backend = params.backend.clone();
let block_announce_validator = build_block_announce_validator(
@@ -254,7 +262,7 @@
let transaction_pool = params.transaction_pool.clone();
let mut task_manager = params.task_manager;
let import_queue = cumulus_client_service::SharedImportQueue::new(params.import_queue);
- let (network, network_status_sinks, system_rpc_tx, start_network) =
+ let (network, system_rpc_tx, start_network) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: ¶chain_config,
client: client.clone(),
@@ -283,7 +291,7 @@
network: rpc_network.clone(),
pending_transactions: pending_transactions.clone(),
select_chain: select_chain.clone(),
- is_authority: is_authority.clone(),
+ is_authority,
// TODO: Unhardcode
max_past_logs: 10000,
};
@@ -302,7 +310,6 @@
keystore: params.keystore_container.sync_keystore(),
backend: backend.clone(),
network: network.clone(),
- network_status_sinks,
system_rpc_tx,
telemetry: telemetry.as_mut(),
})?;
@@ -333,7 +340,6 @@
announce_block,
client: client.clone(),
task_manager: &mut task_manager,
- collator_key,
relay_chain_full_node,
spawner,
parachain_consensus,
@@ -364,15 +370,8 @@
config: &Configuration,
telemetry: Option<TelemetryHandle>,
task_manager: &TaskManager,
-) -> Result<
- sp_consensus::DefaultImportQueue<
- Block,
- FullClient,
- >,
- sc_service::Error,
-> {
+) -> Result<sp_consensus::DefaultImportQueue<Block, FullClient>, sc_service::Error> {
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
-
cumulus_client_consensus_aura::import_queue::<
sp_consensus_aura::sr25519::AuthorityPair,
@@ -383,7 +382,7 @@
_,
_,
>(cumulus_client_consensus_aura::ImportQueueParams {
- block_import: client.clone(),
+ block_import: client.clone(),
client: client.clone(),
create_inherent_data_providers: move |_, _| async move {
let time = sp_timestamp::InherentDataProvider::from_system_time();
@@ -396,7 +395,7 @@
Ok((time, slot))
},
- registry: config.prometheus_registry().clone(),
+ registry: config.prometheus_registry(),
can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),
spawner: &task_manager.spawn_essential_handle(),
telemetry,
@@ -407,13 +406,11 @@
/// Start a normal parachain node.
pub async fn start_node(
parachain_config: Configuration,
- collator_key: CollatorPair,
polkadot_config: Configuration,
id: ParaId,
) -> sc_service::error::Result<(TaskManager, Arc<FullClient>)> {
start_node_impl::<_, _>(
parachain_config,
- collator_key,
polkadot_config,
id,
parachain_build_import_queue,
@@ -432,7 +429,7 @@
task_manager.spawn_handle(),
client.clone(),
transaction_pool,
- prometheus_registry.clone(),
+ prometheus_registry,
telemetry.clone(),
);
@@ -480,7 +477,7 @@
block_import: client.clone(),
relay_chain_client: relay_chain_node.client.clone(),
relay_chain_backend: relay_chain_node.backend.clone(),
- para_client: client.clone(),
+ para_client: client,
backoff_authoring_blocks: Option::<()>::None,
sync_oracle,
keystore,
@@ -493,4 +490,4 @@
},
)
.await
-}
\ No newline at end of file
+}
node/rpc/Cargo.tomldiffbeforeafterboth--- a/node/rpc/Cargo.toml
+++ b/node/rpc/Cargo.toml
@@ -13,33 +13,33 @@
futures = { version = "0.3.1", features = ["compat"] }
jsonrpc-core = "15.0.0"
jsonrpc-pubsub = "15.0.0"
-pallet-contracts-rpc = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-pallet-transaction-payment-rpc = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-pallet-transaction-payment-rpc-runtime-api = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-client-api = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-consensus-aura = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-consensus-epochs = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-finality-grandpa = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-finality-grandpa-rpc = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-keystore = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-network = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-rpc-api = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-rpc = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-service = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-api = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-block-builder = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-blockchain = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-consensus = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-consensus-aura = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-core = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-offchain = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-runtime = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-storage = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-session = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-transaction-pool = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-transaction-pool = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sc-transaction-graph = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-substrate-frame-rpc-system = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
+pallet-contracts-rpc = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+pallet-transaction-payment-rpc = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+pallet-transaction-payment-rpc-runtime-api = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-client-api = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-consensus-aura = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-consensus-epochs = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-finality-grandpa = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-finality-grandpa-rpc = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-keystore = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-network = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-rpc-api = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-rpc = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-service = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-api = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-block-builder = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-blockchain = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-consensus = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-consensus-aura = { version = "0.9", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-core = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-offchain = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-runtime = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-storage = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-session = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-transaction-pool = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-transaction-pool = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sc-transaction-graph = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+substrate-frame-rpc-system = { version = "3.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
tokio = { version = "0.2.13", features = ["macros", "sync"] }
pallet-ethereum = { git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
node/rpc/src/lib.rsdiffbeforeafterboth--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -189,7 +189,7 @@
pool.clone(),
nft_runtime::TransactionConverter,
network.clone(),
- pending_transactions.clone(),
+ pending_transactions,
signers,
overrides.clone(),
backend,
@@ -200,8 +200,8 @@
if let Some(filter_pool) = filter_pool {
io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new(
client.clone(),
- filter_pool.clone(),
- 500 as usize, // max stored filters
+ filter_pool,
+ 500_usize, // max stored filters
overrides.clone(),
max_past_logs,
)));
@@ -217,9 +217,9 @@
io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone())));
io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new(
- pool.clone(),
- client.clone(),
- network.clone(),
+ pool,
+ client,
+ network,
SubscriptionManager::<HexEncodedIdProvider>::with_id_provider(
HexEncodedIdProvider::default(),
Arc::new(subscription_task_executor),
pallets/contract-helpers/Cargo.tomldiffbeforeafterboth--- a/pallets/contract-helpers/Cargo.toml
+++ b/pallets/contract-helpers/Cargo.toml
@@ -15,11 +15,11 @@
version = '0.1.0'
[dependencies]
-frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-pallet-contracts = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
+frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+pallet-contracts = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
[features]
default = ["std"]
pallets/contract-helpers/src/lib.rsdiffbeforeafterboth--- a/pallets/contract-helpers/src/lib.rs
+++ b/pallets/contract-helpers/src/lib.rs
@@ -15,11 +15,11 @@
use sp_std::vec::Vec;
use up_sponsorship::SponsorshipHandler;
- #[pallet::error]
- pub enum Error<T> {
- /// Should be contract owner
- NoPermission,
- }
+ #[pallet::error]
+ pub enum Error<T> {
+ /// Should be contract owner
+ NoPermission,
+ }
#[pallet::config]
pub trait Config: frame_system::Config + pallet_contracts::Config {}
@@ -75,13 +75,16 @@
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(0)]
- fn toggle_sponsoring(
+ pub fn toggle_sponsoring(
origin: OriginFor<T>,
contract: T::AccountId,
sponsoring: bool,
) -> DispatchResult {
let sender = ensure_signed(origin)?;
- ensure!(<Owner<T>>::get(&contract) == sender, <Error<T>>::NoPermission);
+ ensure!(
+ <Owner<T>>::get(&contract) == sender,
+ <Error<T>>::NoPermission
+ );
if sponsoring {
<SelfSponsoring<T>>::insert(contract, true);
@@ -92,13 +95,16 @@
}
#[pallet::weight(0)]
- fn toggle_allowlist(
+ pub fn toggle_allowlist(
origin: OriginFor<T>,
contract: T::AccountId,
enabled: bool,
) -> DispatchResult {
let sender = ensure_signed(origin)?;
- ensure!(<Owner<T>>::get(&contract) == sender, <Error<T>>::NoPermission);
+ ensure!(
+ <Owner<T>>::get(&contract) == sender,
+ <Error<T>>::NoPermission
+ );
if enabled {
<AllowlistEnabled<T>>::insert(contract, true);
@@ -109,14 +115,17 @@
}
#[pallet::weight(0)]
- fn toggle_allowed(
+ pub fn toggle_allowed(
origin: OriginFor<T>,
contract: T::AccountId,
user: T::AccountId,
allowed: bool,
) -> DispatchResult {
let sender = ensure_signed(origin)?;
- ensure!(<Owner<T>>::get(&contract) == sender, <Error<T>>::NoPermission);
+ ensure!(
+ <Owner<T>>::get(&contract) == sender,
+ <Error<T>>::NoPermission
+ );
if allowed {
<Allowlist<T>>::insert(contract, user, true);
@@ -127,13 +136,16 @@
}
#[pallet::weight(0)]
- fn set_sponsoring_rate_limit(
+ pub fn set_sponsoring_rate_limit(
origin: OriginFor<T>,
contract: T::AccountId,
rate_limit: T::BlockNumber,
) -> DispatchResult {
let sender = ensure_signed(origin)?;
- ensure!(<Owner<T>>::get(&contract) == sender, <Error<T>>::NoPermission);
+ ensure!(
+ <Owner<T>>::get(&contract) == sender,
+ <Error<T>>::NoPermission
+ );
<SponsoringRateLimit<T>>::insert(contract, rate_limit);
Ok(())
@@ -174,19 +186,17 @@
_info: &DispatchInfoOf<Self::Call>,
_len: usize,
) -> transaction_validity::TransactionValidity {
- match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
- Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {
- let called_contract: T::AccountId =
- T::Lookup::lookup((*dest).clone()).unwrap_or(T::AccountId::default());
- if <AllowlistEnabled<T>>::get(&called_contract) {
- if !<Allowlist<T>>::get(&called_contract, who)
- && &<Owner<T>>::get(&called_contract) != who
- {
- return Err(transaction_validity::InvalidTransaction::Call.into());
- }
- }
+ if let Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) =
+ IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call)
+ {
+ let called_contract: T::AccountId =
+ T::Lookup::lookup((*dest).clone()).unwrap_or_default();
+ if <AllowlistEnabled<T>>::get(&called_contract)
+ && !<Allowlist<T>>::get(&called_contract, who)
+ && &<Owner<T>>::get(&called_contract) != who
+ {
+ return Err(transaction_validity::InvalidTransaction::Call.into());
}
- _ => {}
}
Ok(transaction_validity::ValidTransaction::default())
}
@@ -200,11 +210,11 @@
) -> Result<Self::Pre, TransactionValidityError> {
match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
Some(pallet_contracts::Call::instantiate(_, _, code_hash, _, salt)) => {
- Ok(Some((who.clone(), code_hash.clone(), salt.clone())))
+ Ok(Some((who.clone(), *code_hash, salt.clone())))
}
Some(pallet_contracts::Call::instantiate_with_code(_, _, code, _, salt)) => {
- let code_hash = &T::Hashing::hash(&code);
- Ok(Some((who.clone(), code_hash.clone(), salt.clone())))
+ let code_hash = &T::Hashing::hash(code);
+ Ok(Some((who.clone(), *code_hash, salt.clone())))
}
_ => Ok(None),
}
@@ -236,24 +246,22 @@
T::AccountId: AsRef<[u8]>,
{
fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {
- match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
- Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {
- let called_contract: T::AccountId =
- T::Lookup::lookup((*dest).clone()).unwrap_or_default();
- if <SelfSponsoring<T>>::get(&called_contract) {
- let last_tx_block = SponsorBasket::<T>::get(&called_contract, &who);
- let block_number =
- <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
- let rate_limit = SponsoringRateLimit::<T>::get(&called_contract);
- let limit_time = last_tx_block + rate_limit;
+ if let Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) =
+ IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call)
+ {
+ let called_contract: T::AccountId =
+ T::Lookup::lookup((*dest).clone()).unwrap_or_default();
+ if <SelfSponsoring<T>>::get(&called_contract) {
+ let last_tx_block = SponsorBasket::<T>::get(&called_contract, &who);
+ let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
+ let rate_limit = SponsoringRateLimit::<T>::get(&called_contract);
+ let limit_time = last_tx_block + rate_limit;
- if block_number >= limit_time {
- SponsorBasket::<T>::insert(&called_contract, who, block_number);
- return Some(called_contract);
- }
+ if block_number >= limit_time {
+ SponsorBasket::<T>::insert(&called_contract, who, block_number);
+ return Some(called_contract);
}
}
- _ => {}
}
None
}
pallets/inflation/Cargo.tomldiffbeforeafterboth--- a/pallets/inflation/Cargo.toml
+++ b/pallets/inflation/Cargo.toml
@@ -43,43 +43,43 @@
default-features = false
optional = true
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-timestamp]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.serde]
@@ -90,18 +90,18 @@
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
pallets/inflation/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/inflation/src/benchmarking.rs
+++ b/pallets/inflation/src/benchmarking.rs
@@ -5,15 +5,15 @@
use sp_std::prelude::*;
use frame_system::RawOrigin;
-use frame_benchmarking::{benchmarks};
+use frame_benchmarking::{benchmarks};
use frame_support::traits::OnInitialize;
benchmarks! {
on_initialize {
- let block1: T::BlockNumber = T::BlockNumber::from(1u32);
- let block2: T::BlockNumber = T::BlockNumber::from(2u32);
- Inflation::<T>::on_initialize(block1); // Create Treasury account
+ let block1: T::BlockNumber = T::BlockNumber::from(1u32);
+ let block2: T::BlockNumber = T::BlockNumber::from(2u32);
+ Inflation::<T>::on_initialize(block1); // Create Treasury account
}: { Inflation::<T>::on_initialize(block2); } // Benchmark deposit_into_existing path
}
pallets/inflation/src/lib.rsdiffbeforeafterboth--- a/pallets/inflation/src/lib.rs
+++ b/pallets/inflation/src/lib.rs
@@ -4,7 +4,6 @@
//
#![recursion_limit = "1024"]
-
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "std")]
@@ -19,8 +18,7 @@
mod tests;
pub use frame_support::{
- construct_runtime, decl_module, decl_storage,
- ensure,
+ construct_runtime, decl_module, decl_storage, ensure,
traits::{
Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
Randomness, IsSubType, WithdrawReasons,
@@ -30,8 +28,7 @@
DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
WeightToFeePolynomial, DispatchClass,
},
- StorageValue,
- transactional,
+ StorageValue, transactional,
};
// #[cfg(feature = "runtime-benchmarks")]
@@ -39,7 +36,7 @@
use sp_runtime::{
Perbill,
- traits::{Zero}
+ traits::{Zero},
};
use sp_std::convert::TryInto;
@@ -71,13 +68,13 @@
}
decl_module! {
- pub struct Module<T: Config> for enum Call
- where
+ pub struct Module<T: Config> for enum Call
+ where
origin: T::Origin,
{
const InflationBlockInterval: T::BlockNumber = T::InflationBlockInterval::get();
- fn on_initialize(now: T::BlockNumber) -> Weight
+ fn on_initialize(now: T::BlockNumber) -> Weight
{
let mut consumed_weight = 0;
let mut add_weight = |reads, writes, weight| {
@@ -95,14 +92,14 @@
if current_year <= TOTAL_YEARS_UNTIL_FLAT {
let amount: BalanceOf<T> = Perbill::from_rational(
- block_interval * (START_INFLATION_PERCENT * TOTAL_YEARS_UNTIL_FLAT - current_year * (START_INFLATION_PERCENT - END_INFLATION_PERCENT)),
+ block_interval * (START_INFLATION_PERCENT * TOTAL_YEARS_UNTIL_FLAT - current_year * (START_INFLATION_PERCENT - END_INFLATION_PERCENT)),
YEAR * TOTAL_YEARS_UNTIL_FLAT
) * ( one_percent * T::Currency::total_issuance() );
<BlockInflation<T>>::put(amount);
}
else {
let amount: BalanceOf<T> = Perbill::from_rational(
- block_interval * END_INFLATION_PERCENT,
+ block_interval * END_INFLATION_PERCENT,
YEAR
) * (one_percent * T::Currency::total_issuance());
<BlockInflation<T>>::put(amount);
pallets/inflation/src/tests.rsdiffbeforeafterboth--- a/pallets/inflation/src/tests.rs
+++ b/pallets/inflation/src/tests.rs
@@ -1,241 +1,242 @@
-#[cfg(test)]
-mod tests {
- use crate as pallet_inflation;
+#![cfg(test)]
+#![allow(clippy::from_over_into)]
+use crate as pallet_inflation;
- use frame_system;
- use frame_support::{traits::{Currency}, parameter_types};
- use frame_support::{traits::OnInitialize};
- use sp_core::H256;
- use sp_runtime::{traits::{BlakeTwo256, IdentityLookup}, testing::Header};
+use frame_support::{
+ traits::{Currency},
+ parameter_types,
+};
+use frame_support::{traits::OnInitialize};
+use sp_core::H256;
+use sp_runtime::{
+ traits::{BlakeTwo256, IdentityLookup},
+ testing::Header,
+};
- type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
- type Block = frame_system::mocking::MockBlock<Test>;
+type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
+type Block = frame_system::mocking::MockBlock<Test>;
- const YEAR: u64 = 5_259_600;
+const YEAR: u64 = 5_259_600;
- parameter_types! {
- pub const ExistentialDeposit: u64 = 1;
- pub const MaxLocks: u32 = 50;
- }
-
- impl pallet_balances::Config for Test {
- type AccountStore = System;
- type Balance = u64;
- type DustRemoval = ();
- type Event = ();
- type ExistentialDeposit = ExistentialDeposit;
- type WeightInfo = ();
- type MaxLocks = MaxLocks;
- }
-
- frame_support::construct_runtime!(
- pub enum Test where
- Block = Block,
- NodeBlock = Block,
- UncheckedExtrinsic = UncheckedExtrinsic,
- {
- Balances: pallet_balances::{Module, Call, Storage},
- System: frame_system::{Module, Call, Config, Storage, Event<T>},
- Inflation: pallet_inflation::{Module, Call, Storage},
- }
- );
+parameter_types! {
+ pub const ExistentialDeposit: u64 = 1;
+ pub const MaxLocks: u32 = 50;
+}
- parameter_types! {
- pub const BlockHashCount: u64 = 250;
- pub BlockWeights: frame_system::limits::BlockWeights =
- frame_system::limits::BlockWeights::simple_max(1024);
- pub const SS58Prefix: u8 = 42;
- }
+impl pallet_balances::Config for Test {
+ type AccountStore = System;
+ type Balance = u64;
+ type DustRemoval = ();
+ type Event = ();
+ type ExistentialDeposit = ExistentialDeposit;
+ type WeightInfo = ();
+ type MaxLocks = MaxLocks;
+}
- impl frame_system::Config for Test {
- type BaseCallFilter = ();
- type BlockWeights = ();
- type BlockLength = ();
- type DbWeight = ();
- type Origin = Origin;
- type Call = Call;
- type Index = u64;
- type BlockNumber = u64;
- type Hash = H256;
- type Hashing = BlakeTwo256;
- type AccountId = u64;
- type Lookup = IdentityLookup<Self::AccountId>;
- type Header = Header;
- type Event = ();
- type BlockHashCount = BlockHashCount;
- type Version = ();
- type PalletInfo = PalletInfo;
- type AccountData = pallet_balances::AccountData<u64>;
- type OnNewAccount = ();
- type OnKilledAccount = ();
- type SystemWeightInfo = ();
- type SS58Prefix = SS58Prefix;
+frame_support::construct_runtime!(
+ pub enum Test where
+ Block = Block,
+ NodeBlock = Block,
+ UncheckedExtrinsic = UncheckedExtrinsic,
+ {
+ Balances: pallet_balances::{Pallet, Call, Storage},
+ System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
+ Inflation: pallet_inflation::{Pallet, Call, Storage},
}
+);
- parameter_types! {
- pub TreasuryAccountId: u64 = 1234;
- pub const InflationBlockInterval: u32 = 100; // every time per how many blocks inflation is applied
- }
-
- impl pallet_inflation::Config for Test {
- type Currency = Balances;
- type TreasuryAccountId = TreasuryAccountId;
- type InflationBlockInterval = InflationBlockInterval;
- }
+parameter_types! {
+ pub const BlockHashCount: u64 = 250;
+ pub BlockWeights: frame_system::limits::BlockWeights =
+ frame_system::limits::BlockWeights::simple_max(1024);
+ pub const SS58Prefix: u8 = 42;
+}
- // Build genesis storage according to the mock runtime.
- pub fn new_test_ext() -> sp_io::TestExternalities {
- frame_system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
- }
+impl frame_system::Config for Test {
+ type BaseCallFilter = ();
+ type BlockWeights = ();
+ type BlockLength = ();
+ type DbWeight = ();
+ type Origin = Origin;
+ type Call = Call;
+ type Index = u64;
+ type BlockNumber = u64;
+ type Hash = H256;
+ type Hashing = BlakeTwo256;
+ type AccountId = u64;
+ type Lookup = IdentityLookup<Self::AccountId>;
+ type Header = Header;
+ type Event = ();
+ type BlockHashCount = BlockHashCount;
+ type Version = ();
+ type PalletInfo = PalletInfo;
+ type AccountData = pallet_balances::AccountData<u64>;
+ type OnNewAccount = ();
+ type OnKilledAccount = ();
+ type SystemWeightInfo = ();
+ type SS58Prefix = SS58Prefix;
+ type OnSetCode = ();
+}
- #[test]
- fn inflation_works() {
- new_test_ext().execute_with(|| {
- // Total issuance = 1_000_000_000
- let initial_issuance: u64 = 1_000_000_000;
- let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
- assert_eq!(Balances::free_balance(1234), initial_issuance);
+parameter_types! {
+ pub TreasuryAccountId: u64 = 1234;
+ pub const InflationBlockInterval: u32 = 100; // every time per how many blocks inflation is applied
+}
- // BlockInflation should be set after 1st block and
- // first inflation deposit should be equal to BlockInflation
- Inflation::on_initialize(1);
- assert!(Inflation::block_inflation() > 0);
- assert_eq!(Balances::free_balance(1234) - initial_issuance, Inflation::block_inflation());
- });
- }
+impl pallet_inflation::Config for Test {
+ type Currency = Balances;
+ type TreasuryAccountId = TreasuryAccountId;
+ type InflationBlockInterval = InflationBlockInterval;
+}
- #[test]
- fn inflation_second_deposit() {
- new_test_ext().execute_with(|| {
- // Total issuance = 1_000_000_000
- let initial_issuance: u64 = 1_000_000_000;
- let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
- assert_eq!(Balances::free_balance(1234), initial_issuance);
- Inflation::on_initialize(1);
+// Build genesis storage according to the mock runtime.
+pub fn new_test_ext() -> sp_io::TestExternalities {
+ frame_system::GenesisConfig::default()
+ .build_storage::<Test>()
+ .unwrap()
+ .into()
+}
- // Next inflation deposit happens when block is multiple of InflationBlockInterval
- let mut block: u32 = 2;
- let balance_before: u64 = Balances::free_balance(1234);
- while block % InflationBlockInterval::get() != 0 {
- Inflation::on_initialize(block as u64);
- block += 1;
- }
- let balance_just_before: u64 = Balances::free_balance(1234);
- assert_eq!(balance_before, balance_just_before);
+#[test]
+fn inflation_works() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
- // The block with inflation
+ // BlockInflation should be set after 1st block and
+ // first inflation deposit should be equal to BlockInflation
+ Inflation::on_initialize(1);
+ assert!(Inflation::block_inflation() > 0);
+ assert_eq!(
+ Balances::free_balance(1234) - initial_issuance,
+ Inflation::block_inflation()
+ );
+ });
+}
+
+#[test]
+fn inflation_second_deposit() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+ Inflation::on_initialize(1);
+
+ // Next inflation deposit happens when block is multiple of InflationBlockInterval
+ let mut block: u32 = 2;
+ let balance_before: u64 = Balances::free_balance(1234);
+ while block % InflationBlockInterval::get() != 0 {
Inflation::on_initialize(block as u64);
- let balance_after: u64 = Balances::free_balance(1234);
- assert_eq!(balance_after - balance_just_before, Inflation::block_inflation());
- });
- }
+ block += 1;
+ }
+ let balance_just_before: u64 = Balances::free_balance(1234);
+ assert_eq!(balance_before, balance_just_before);
- #[test]
- fn inflation_in_1_year() {
- new_test_ext().execute_with(|| {
- // Total issuance = 1_000_000_000
- let initial_issuance: u64 = 1_000_000_000;
- let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
- assert_eq!(Balances::free_balance(1234), initial_issuance);
- Inflation::on_initialize(1);
- let block_inflation_year_0 = Inflation::block_inflation();
+ // The block with inflation
+ Inflation::on_initialize(block as u64);
+ let balance_after: u64 = Balances::free_balance(1234);
+ assert_eq!(
+ balance_after - balance_just_before,
+ Inflation::block_inflation()
+ );
+ });
+}
- Inflation::on_initialize(YEAR);
- let block_inflation_year_1 = Inflation::block_inflation();
+#[test]
+fn inflation_in_1_year() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+ Inflation::on_initialize(1);
+ let block_inflation_year_0 = Inflation::block_inflation();
- // Assert that year 1 inflation is less than year 0
- assert!(block_inflation_year_0 > block_inflation_year_1);
- });
- }
+ Inflation::on_initialize(YEAR);
+ let block_inflation_year_1 = Inflation::block_inflation();
- #[test]
- fn inflation_in_1_to_9_years() {
- new_test_ext().execute_with(|| {
- // Total issuance = 1_000_000_000
- let initial_issuance: u64 = 1_000_000_000;
- let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
- assert_eq!(Balances::free_balance(1234), initial_issuance);
- Inflation::on_initialize(1);
+ // Assert that year 1 inflation is less than year 0
+ assert!(block_inflation_year_0 > block_inflation_year_1);
+ });
+}
- for year in 1..=9 {
- let block_inflation_year_before = Inflation::block_inflation();
- Inflation::on_initialize(YEAR * year);
- let block_inflation_year_after = Inflation::block_inflation();
+#[test]
+fn inflation_in_1_to_9_years() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+ Inflation::on_initialize(1);
- // Assert that next year inflation is less than previous year inflation
- assert!(block_inflation_year_before > block_inflation_year_after);
- }
+ for year in 1..=9 {
+ let block_inflation_year_before = Inflation::block_inflation();
+ Inflation::on_initialize(YEAR * year);
+ let block_inflation_year_after = Inflation::block_inflation();
- });
- }
+ // Assert that next year inflation is less than previous year inflation
+ assert!(block_inflation_year_before > block_inflation_year_after);
+ }
+ });
+}
- #[test]
- fn inflation_after_year_10_is_flat() {
- new_test_ext().execute_with(|| {
- // Total issuance = 1_000_000_000
- let initial_issuance: u64 = 1_000_000_000;
- let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
- assert_eq!(Balances::free_balance(1234), initial_issuance);
- Inflation::on_initialize(YEAR * 9);
+#[test]
+fn inflation_after_year_10_is_flat() {
+ new_test_ext().execute_with(|| {
+ // Total issuance = 1_000_000_000
+ let initial_issuance: u64 = 1_000_000_000;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
+ Inflation::on_initialize(YEAR * 9);
- for year in 10..=20 {
- let block_inflation_year_before = Inflation::block_inflation();
- Inflation::on_initialize(YEAR * year);
- let block_inflation_year_after = Inflation::block_inflation();
+ for year in 10..=20 {
+ let block_inflation_year_before = Inflation::block_inflation();
+ Inflation::on_initialize(YEAR * year);
+ let block_inflation_year_after = Inflation::block_inflation();
- // Assert that next year inflation is equal to previous year inflation
- assert_eq!(block_inflation_year_before, block_inflation_year_after);
- }
- });
- }
+ // Assert that next year inflation is equal to previous year inflation
+ assert_eq!(block_inflation_year_before, block_inflation_year_after);
+ }
+ });
+}
- #[test]
- fn inflation_rate_by_year() {
- new_test_ext().execute_with(|| {
- let payouts: u64 = YEAR / InflationBlockInterval::get() as u64;
+#[test]
+fn inflation_rate_by_year() {
+ new_test_ext().execute_with(|| {
+ let payouts: u64 = YEAR / InflationBlockInterval::get() as u64;
- // Inflation starts at 10% and does down by 2/3% every year until year 9 (included),
- // then it is flat.
- let payout_by_year: [u64; 11] = [
- 1000,
- 933,
- 867,
- 800,
- 733,
- 667,
- 600,
- 533,
- 467,
- 400,
- 400
- ];
+ // Inflation starts at 10% and does down by 2/3% every year until year 9 (included),
+ // then it is flat.
+ let payout_by_year: [u64; 11] = [1000, 933, 867, 800, 733, 667, 600, 533, 467, 400, 400];
- // For accuracy total issuance = payout0 * payouts * 10;
- let initial_issuance: u64 = payout_by_year[0] * payouts * 10;
- let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
- assert_eq!(Balances::free_balance(1234), initial_issuance);
+ // For accuracy total issuance = payout0 * payouts * 10;
+ let initial_issuance: u64 = payout_by_year[0] * payouts * 10;
+ let _ = <Balances as Currency<_>>::deposit_creating(&1234, initial_issuance);
+ assert_eq!(Balances::free_balance(1234), initial_issuance);
- for year in 0..=10 {
- // Year first block
- Inflation::on_initialize(year*YEAR);
- let mut actual_payout = Inflation::block_inflation();
- assert_eq!(actual_payout, payout_by_year[year as usize]);
+ for year in 0..=10 {
+ // Year first block
+ Inflation::on_initialize(year * YEAR);
+ let mut actual_payout = Inflation::block_inflation();
+ assert_eq!(actual_payout, payout_by_year[year as usize]);
- // Year second block
- Inflation::on_initialize(year*YEAR+1);
- actual_payout = Inflation::block_inflation();
- assert_eq!(actual_payout, payout_by_year[year as usize]);
+ // Year second block
+ Inflation::on_initialize(year * YEAR + 1);
+ actual_payout = Inflation::block_inflation();
+ assert_eq!(actual_payout, payout_by_year[year as usize]);
- // Year middle block
- Inflation::on_initialize(year*YEAR + YEAR/2);
- actual_payout = Inflation::block_inflation();
- assert_eq!(actual_payout, payout_by_year[year as usize]);
+ // Year middle block
+ Inflation::on_initialize(year * YEAR + YEAR / 2);
+ actual_payout = Inflation::block_inflation();
+ assert_eq!(actual_payout, payout_by_year[year as usize]);
- // Year last block
- Inflation::on_initialize((year + 1)*YEAR-1);
- actual_payout = Inflation::block_inflation();
- assert_eq!(actual_payout, payout_by_year[year as usize]);
- }
- });
- }
+ // Year last block
+ Inflation::on_initialize((year + 1) * YEAR - 1);
+ actual_payout = Inflation::block_inflation();
+ assert_eq!(actual_payout, payout_by_year[year as usize]);
+ }
+ });
}
pallets/nft-charge-transaction/Cargo.tomldiffbeforeafterboth--- a/pallets/nft-charge-transaction/Cargo.toml
+++ b/pallets/nft-charge-transaction/Cargo.toml
@@ -20,15 +20,15 @@
[dependencies]
serde = { version = "1.0.119", default-features = false }
-frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-pallet-balances = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-pallet-transaction-payment = { default-features = false, version = "3.0.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-frame-benchmarking = { default-features = false, version = "3.0.0", optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-core = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-io = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
+frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+pallet-balances = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+pallet-transaction-payment = { default-features = false, version = "3.0.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+frame-benchmarking = { default-features = false, version = "3.0.0", optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-core = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-io = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
pallet-nft-transaction-payment = { default-features = false, path="../nft-transaction-payment" }
pallets/nft-charge-transaction/src/lib.rsdiffbeforeafterboth--- a/pallets/nft-charge-transaction/src/lib.rs
+++ b/pallets/nft-charge-transaction/src/lib.rs
@@ -11,47 +11,38 @@
#[cfg(feature = "std")]
pub use serde::*;
-#[cfg(feature = "runtime-benchmarks")]
-mod benchmarking;
-
use codec::{Decode, Encode};
use frame_support::traits::Get;
use frame_support::{
decl_module, decl_storage,
- weights::{
- DispatchInfo, PostDispatchInfo, DispatchClass
- }
+ weights::{DispatchInfo, PostDispatchInfo, DispatchClass},
};
use sp_runtime::{
- traits::{
- DispatchInfoOf, Dispatchable, PostDispatchInfoOf, Saturating, SaturatedConversion, SignedExtension, Zero,
+ traits::{
+ DispatchInfoOf, Dispatchable, PostDispatchInfoOf, Saturating, SaturatedConversion,
+ SignedExtension, Zero,
},
- transaction_validity::{
+ transaction_validity::{
TransactionPriority, TransactionValidity, TransactionValidityError, ValidTransaction,
},
- FixedPointOperand, DispatchResult
+ FixedPointOperand, DispatchResult,
};
use pallet_transaction_payment::OnChargeTransaction;
use sp_std::prelude::*;
-
-pub trait Config: frame_system::Config +
- pallet_nft_transaction_payment::Config
-{
-
-}
+pub trait Config: frame_system::Config + pallet_nft_transaction_payment::Config {}
decl_storage! {
- trait Store for Module<T: Config> as NftTransactionPayment
- {}
+ trait Store for Module<T: Config> as NftTransactionPayment
+ {}
}
decl_module! {
- pub struct Module<T: Config> for enum Call
- where
+ pub struct Module<T: Config> for enum Call
+ where
origin: T::Origin,
- {}
+ {}
}
type BalanceOf<T> = <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::Balance;
@@ -61,9 +52,7 @@
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
pub struct ChargeTransactionPayment<T: Config>(#[codec(compact)] BalanceOf<T>);
-impl<T: Config + Send + Sync> sp_std::fmt::Debug
- for ChargeTransactionPayment<T>
-{
+impl<T: Config + Send + Sync> sp_std::fmt::Debug for ChargeTransactionPayment<T> {
#[cfg(feature = "std")]
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
write!(f, "ChargeTransactionPayment<{:?}>", self.0)
@@ -76,32 +65,37 @@
impl<T: Config> ChargeTransactionPayment<T>
where
- T::Call: Dispatchable<Info=DispatchInfo, PostInfo=PostDispatchInfo>,
- BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
+ T::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
+ BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
{
- fn traditional_fee(
- len: usize,
- info: &DispatchInfoOf<T::Call>,
- tip: BalanceOf<T>,
- ) -> BalanceOf<T>
- where
- T::Call: Dispatchable<Info = DispatchInfo>,
- {
- <pallet_transaction_payment::Module<T>>::compute_fee(len as u32, info, tip)
- }
+ fn traditional_fee(
+ len: usize,
+ info: &DispatchInfoOf<T::Call>,
+ tip: BalanceOf<T>,
+ ) -> BalanceOf<T>
+ where
+ T::Call: Dispatchable<Info = DispatchInfo>,
+ {
+ <pallet_transaction_payment::Module<T>>::compute_fee(len as u32, info, tip)
+ }
- fn get_priority(len: usize, info: &DispatchInfoOf<T::Call>, final_fee: BalanceOf<T>) -> TransactionPriority {
- let weight_saturation = T::BlockWeights::get().max_block / info.weight.max(1);
- let max_block_length = *T::BlockLength::get().max.get(DispatchClass::Normal);
- let len_saturation = max_block_length as u64 / (len as u64).max(1);
- let coefficient: BalanceOf<T> = weight_saturation
- .min(len_saturation)
- .saturated_into::<BalanceOf<T>>();
- final_fee
- .saturating_mul(coefficient)
- .saturated_into::<TransactionPriority>()
- }
+ fn get_priority(
+ len: usize,
+ info: &DispatchInfoOf<T::Call>,
+ final_fee: BalanceOf<T>,
+ ) -> TransactionPriority {
+ let weight_saturation = T::BlockWeights::get().max_block / info.weight.max(1);
+ let max_block_length = *T::BlockLength::get().max.get(DispatchClass::Normal);
+ let len_saturation = max_block_length as u64 / (len as u64).max(1);
+ let coefficient: BalanceOf<T> = weight_saturation
+ .min(len_saturation)
+ .saturated_into::<BalanceOf<T>>();
+ final_fee
+ .saturating_mul(coefficient)
+ .saturated_into::<TransactionPriority>()
+ }
+ #[allow(clippy::type_complexity)]
fn withdraw_fee(
&self,
who: &T::AccountId,
@@ -114,39 +108,38 @@
<<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::LiquidityInfo,
),
TransactionValidityError,
- > {
- let tip = self.0;
+ >{
+ let tip = self.0;
- let fee = Self::traditional_fee(len, info, tip);
+ let fee = Self::traditional_fee(len, info, tip);
- // Only mess with balances if fee is not zero.
- if fee.is_zero() {
- return <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::withdraw_fee(who, call, info, fee, tip)
+ // Only mess with balances if fee is not zero.
+ if fee.is_zero() {
+ return <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::withdraw_fee(who, call, info, fee, tip)
.map(|i| (fee, i));
- }
+ }
- // Determine who is paying transaction fee based on ecnomic model
- // Parse call to extract collection ID and access collection sponsor
+ // Determine who is paying transaction fee based on ecnomic model
+ // Parse call to extract collection ID and access collection sponsor
let sponsor = <pallet_nft_transaction_payment::Module<T>>::withdraw_type(who, call);
- let who_pays_fee = sponsor.unwrap_or_else(|| who.clone());
+ let who_pays_fee = sponsor.unwrap_or_else(|| who.clone());
<<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::withdraw_fee(&who_pays_fee, call, info, fee, tip)
.map(|i| (fee, i))
- }
+ }
}
-impl<T: Config + Send + Sync> SignedExtension
- for ChargeTransactionPayment<T>
+impl<T: Config + Send + Sync> SignedExtension for ChargeTransactionPayment<T>
where
- BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
- T::Call: Dispatchable<Info=DispatchInfo, PostInfo=PostDispatchInfo>,
+ BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
+ T::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
{
- const IDENTIFIER: &'static str = "ChargeTransactionPayment";
- type AccountId = T::AccountId;
- type Call = T::Call;
- type AdditionalSigned = ();
- type Pre = (
+ const IDENTIFIER: &'static str = "ChargeTransactionPayment";
+ type AccountId = T::AccountId;
+ type Call = T::Call;
+ type AdditionalSigned = ();
+ type Pre = (
// tip
BalanceOf<T>,
// who pays fee
@@ -154,50 +147,49 @@
// imbalance resulting from withdrawing the fee
<<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::LiquidityInfo,
);
- fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> {
- Ok(())
- }
+ fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> {
+ Ok(())
+ }
- fn validate(
- &self,
- who: &Self::AccountId,
- call: &Self::Call,
- info: &DispatchInfoOf<Self::Call>,
- len: usize,
- ) -> TransactionValidity {
+ fn validate(
+ &self,
+ who: &Self::AccountId,
+ call: &Self::Call,
+ info: &DispatchInfoOf<Self::Call>,
+ len: usize,
+ ) -> TransactionValidity {
let (fee, _) = self.withdraw_fee(who, call, info, len)?;
Ok(ValidTransaction {
priority: Self::get_priority(len, info, fee),
..Default::default()
})
- }
+ }
- fn pre_dispatch(
- self,
- who: &Self::AccountId,
- call: &Self::Call,
- info: &DispatchInfoOf<Self::Call>,
- len: usize,
- ) -> Result<Self::Pre, TransactionValidityError> {
- let (_fee, imbalance) = self.withdraw_fee(who, call, info, len)?;
- Ok((self.0, who.clone(), imbalance))
- }
+ fn pre_dispatch(
+ self,
+ who: &Self::AccountId,
+ call: &Self::Call,
+ info: &DispatchInfoOf<Self::Call>,
+ len: usize,
+ ) -> Result<Self::Pre, TransactionValidityError> {
+ let (_fee, imbalance) = self.withdraw_fee(who, call, info, len)?;
+ Ok((self.0, who.clone(), imbalance))
+ }
- fn post_dispatch(
- pre: Self::Pre,
- info: &DispatchInfoOf<Self::Call>,
- post_info: &PostDispatchInfoOf<Self::Call>,
- len: usize,
- _result: &DispatchResult,
- ) -> Result<(), TransactionValidityError> {
+ fn post_dispatch(
+ pre: Self::Pre,
+ info: &DispatchInfoOf<Self::Call>,
+ post_info: &PostDispatchInfoOf<Self::Call>,
+ len: usize,
+ _result: &DispatchResult,
+ ) -> Result<(), TransactionValidityError> {
let (tip, who, imbalance) = pre;
let actual_fee = pallet_transaction_payment::Pallet::<T>::compute_actual_fee(
- len as u32,
- info,
- post_info,
- tip,
+ len as u32, info, post_info, tip,
);
- <T as pallet_transaction_payment::Config>::OnChargeTransaction::correct_and_deposit_fee(&who, info, post_info, actual_fee, tip, imbalance)?;
+ <T as pallet_transaction_payment::Config>::OnChargeTransaction::correct_and_deposit_fee(
+ &who, info, post_info, actual_fee, tip, imbalance,
+ )?;
Ok(())
- }
-}
\ No newline at end of file
+ }
+}
pallets/nft-transaction-payment/Cargo.tomldiffbeforeafterboth--- a/pallets/nft-transaction-payment/Cargo.toml
+++ b/pallets/nft-transaction-payment/Cargo.toml
@@ -20,14 +20,14 @@
[dependencies]
serde = { version = "1.0.119", default-features = false }
-frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-pallet-transaction-payment = { default-features = false, version = "3.0.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-frame-benchmarking = { default-features = false, version = "3.0.0", optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-core = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-io = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
+frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+pallet-transaction-payment = { default-features = false, version = "3.0.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+frame-benchmarking = { default-features = false, version = "3.0.0", optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-core = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-io = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
up-sponsorship = { default-features = false, path = "../../primitives/sponsorship", version = "0.1.0" }
pallets/nft-transaction-payment/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/nft-transaction-payment/src/benchmarking.rs
+++ b/pallets/nft-transaction-payment/src/benchmarking.rs
@@ -4,15 +4,15 @@
use sp_std::prelude::*;
use frame_system::RawOrigin;
-use frame_benchmarking::{benchmarks};
+use frame_benchmarking::{benchmarks};
use frame_support::traits::OnInitialize;
benchmarks! {
// on_initialize {
- // let block1: T::BlockNumber = T::BlockNumber::from(1u32);
- // let block2: T::BlockNumber = T::BlockNumber::from(2u32);
- // Inflation::<T>::on_initialize(block1); // Create Treasury account
+ // let block1: T::BlockNumber = T::BlockNumber::from(1u32);
+ // let block2: T::BlockNumber = T::BlockNumber::from(2u32);
+ // Inflation::<T>::on_initialize(block1); // Create Treasury account
// }: { Inflation::<T>::on_initialize(block2); } // Benchmark deposit_into_existing path
}
pallets/nft-transaction-payment/src/lib.rsdiffbeforeafterboth--- a/pallets/nft-transaction-payment/src/lib.rs
+++ b/pallets/nft-transaction-payment/src/lib.rs
@@ -28,18 +28,15 @@
}
decl_module! {
- pub struct Module<T: Config> for enum Call
- where
+ pub struct Module<T: Config> for enum Call
+ where
origin: T::Origin,
- {
+ {
}
}
impl<T: Config> Module<T> {
- pub fn withdraw_type(
- who: &T::AccountId,
- call: &T::Call
- ) -> Option<T::AccountId> {
+ pub fn withdraw_type(who: &T::AccountId, call: &T::Call) -> Option<T::AccountId> {
T::SponsorshipHandler::get_sponsor(who, call)
}
-}
\ No newline at end of file
+}
pallets/nft/Cargo.tomldiffbeforeafterboth--- a/pallets/nft/Cargo.toml
+++ b/pallets/nft/Cargo.toml
@@ -56,55 +56,55 @@
default-features = false
optional = true
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-timestamp]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-contracts]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-transaction-payment]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.serde]
@@ -115,19 +115,19 @@
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
@@ -149,12 +149,12 @@
ethereum-tx-sign = { version = "3.0.4", optional = true }
ethereum = { default-features = false, version = "0.7.1" }
rlp = { default-features = false, version = "0.5.0" }
-sp-api = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.3" }
+sp-api = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.7" }
evm-coder = { default-features = false, path = "../../crates/evm-coder" }
primitive-types = { version = "0.9.0", default-features = false, features = ["serde_no_std"] }
-pallet-evm = { default-features = false, version = "4.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
-pallet-ethereum = { default-features = false, version = "2.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
+pallet-evm = { default-features = false, version = "5.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
+pallet-ethereum = { default-features = false, version = "3.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
fp-evm = { default-features = false, version = '2.0.0', git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
hex-literal = "0.3.1"
\ No newline at end of file
pallets/nft/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/nft/src/benchmarking.rs
+++ b/pallets/nft/src/benchmarking.rs
@@ -5,415 +5,415 @@
use sp_std::prelude::*;
use frame_system::RawOrigin;
-use frame_benchmarking::{benchmarks, account, whitelisted_caller}; // , TrackedStorageKey,
+use frame_benchmarking::{benchmarks, account, whitelisted_caller}; // , TrackedStorageKey,
const SEED: u32 = 1;
/*
fn default_nft_data() -> CreateItemData {
- CreateItemData::NFT(CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
+ CreateItemData::NFT(CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
}
fn default_fungible_data () -> CreateItemData {
- CreateItemData::Fungible(CreateFungibleData { })
+ CreateItemData::Fungible(CreateFungibleData { })
}
fn default_re_fungible_data () -> CreateItemData {
- CreateItemData::ReFungible(CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
+ CreateItemData::ReFungible(CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] })
}
*/
benchmarks! {
- create_collection {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = account("caller", 0, SEED);
- }: _(RawOrigin::Signed(caller.clone()), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode)
+ create_collection {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = account("caller", 0, SEED);
+ }: _(RawOrigin::Signed(caller.clone()), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode)
/*
- verify {
- assert_eq!(Nft::<T>::collection_id(2).owner, caller);
- }
- destroy_collection {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: _(RawOrigin::Signed(caller.clone()), 2)
+ verify {
+ assert_eq!(Nft::<T>::collection_id(2).owner, caller);
+ }
+ destroy_collection {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: _(RawOrigin::Signed(caller.clone()), 2)
- add_to_white_list {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- let whitelist_account: T::AccountId = account("admin", 0, SEED);
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: add_to_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
+ add_to_white_list {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ let whitelist_account: T::AccountId = account("admin", 0, SEED);
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: add_to_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
- remove_from_white_list {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- let whitelist_account: T::AccountId = account("admin", 0, SEED);
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- Nft::<T>::add_to_white_list(RawOrigin::Signed(caller.clone()).into(), 2, whitelist_account.clone())?;
- }: remove_from_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
+ remove_from_white_list {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ let whitelist_account: T::AccountId = account("admin", 0, SEED);
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ Nft::<T>::add_to_white_list(RawOrigin::Signed(caller.clone()).into(), 2, whitelist_account.clone())?;
+ }: remove_from_white_list(RawOrigin::Signed(caller.clone()), 2, whitelist_account)
- set_public_access_mode {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_public_access_mode(RawOrigin::Signed(caller.clone()), 2, AccessMode::WhiteList)
+ set_public_access_mode {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_public_access_mode(RawOrigin::Signed(caller.clone()), 2, AccessMode::WhiteList)
- set_mint_permission {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_mint_permission(RawOrigin::Signed(caller.clone()), 2, true)
+ set_mint_permission {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_mint_permission(RawOrigin::Signed(caller.clone()), 2, true)
- change_collection_owner {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let new_owner: T::AccountId = account("admin", 0, SEED);
- }: change_collection_owner(RawOrigin::Signed(caller.clone()), 2, new_owner)
+ change_collection_owner {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let new_owner: T::AccountId = account("admin", 0, SEED);
+ }: change_collection_owner(RawOrigin::Signed(caller.clone()), 2, new_owner)
- add_collection_admin {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let new_admin: T::AccountId = account("admin", 0, SEED);
- }: add_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
+ add_collection_admin {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let new_admin: T::AccountId = account("admin", 0, SEED);
+ }: add_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
- remove_collection_admin {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let new_admin: T::AccountId = account("admin", 0, SEED);
- Nft::<T>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), 2, new_admin.clone())?;
- }: remove_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
+ remove_collection_admin {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let new_admin: T::AccountId = account("admin", 0, SEED);
+ Nft::<T>::add_collection_admin(RawOrigin::Signed(caller.clone()).into(), 2, new_admin.clone())?;
+ }: remove_collection_admin(RawOrigin::Signed(caller.clone()), 2, new_admin)
- set_collection_sponsor {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_collection_sponsor(RawOrigin::Signed(caller.clone()), 2, caller.clone())
+ set_collection_sponsor {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_collection_sponsor(RawOrigin::Signed(caller.clone()), 2, caller.clone())
- confirm_sponsorship {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
- }: confirm_sponsorship(RawOrigin::Signed(caller.clone()), 2)
+ confirm_sponsorship {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+ }: confirm_sponsorship(RawOrigin::Signed(caller.clone()), 2)
- remove_collection_sponsor {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
- Nft::<T>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), 2)?;
- }: remove_collection_sponsor(RawOrigin::Signed(caller.clone()), 2)
+ remove_collection_sponsor {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ Nft::<T>::set_collection_sponsor(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone())?;
+ Nft::<T>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), 2)?;
+ }: remove_collection_sponsor(RawOrigin::Signed(caller.clone()), 2)
- // nft item
- create_item_nft {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
-
- }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+ // nft item
+ create_item_nft {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
- #[extra]
- create_item_nft_large {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- let mut nft_data = CreateNftData {
- const_data: vec![],
- variable_data: vec![]
- };
- for i in 0..1998 {
- nft_data.const_data.push(10);
- nft_data.variable_data.push(10);
- }
- let data = CreateItemData::NFT(nft_data);
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+
+ #[extra]
+ create_item_nft_large {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ let mut nft_data = CreateNftData {
+ const_data: vec![],
+ variable_data: vec![]
+ };
+ for i in 0..1998 {
+ nft_data.const_data.push(10);
+ nft_data.variable_data.push(10);
+ }
+ let data = CreateItemData::NFT(nft_data);
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+
+ }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
- }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+ // fungible item
+ create_item_fungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::Fungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_fungible_data();
+
+ }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+
+ // refungible item
+ create_item_refungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_re_fungible_data();
- // fungible item
- create_item_fungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::Fungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_fungible_data();
+ }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
- }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+ burn_item {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- // refungible item
- create_item_refungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_re_fungible_data();
+ }: burn_item(RawOrigin::Signed(caller.clone()), 2, 1)
- }: create_item(RawOrigin::Signed(caller.clone()), 2, caller.clone(), data)
+ transfer_nft {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- burn_item {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
- }: burn_item(RawOrigin::Signed(caller.clone()), 2, 1)
+ transfer_fungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::Fungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- transfer_nft {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
- }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
-
- transfer_fungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::Fungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ transfer_refungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_re_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+ }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
- transfer_refungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_re_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ approve {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_re_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- }: transfer(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1, 1)
+ }: approve(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1)
- approve {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_re_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ // Nft
+ transfer_from_nft {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
- }: approve(RawOrigin::Signed(caller.clone()), recipient.clone(), 2, 1)
+ }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
- // Nft
- transfer_from_nft {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+ // Fungible
+ transfer_from_fungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::Fungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
- }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+ }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
- // Fungible
- transfer_from_fungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::Fungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+ // ReFungible
+ transfer_from_refungible {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let recipient: T::AccountId = account("recipient", 0, SEED);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_re_fungible_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
- }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+ }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
- // ReFungible
- transfer_from_refungible {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let recipient: T::AccountId = account("recipient", 0, SEED);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_re_fungible_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- Nft::<T>::approve(RawOrigin::Signed(caller.clone()).into(), recipient.clone(), 2, 1)?;
+ enable_contract_sponsoring {
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- }: transfer_from(RawOrigin::Signed(caller.clone()), caller.clone(), recipient.clone(), 2, 1, 1)
+ }: enable_contract_sponsoring(RawOrigin::Signed(caller.clone()), caller.clone(), true)
- enable_contract_sponsoring {
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ set_offchain_schema {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: enable_contract_sponsoring(RawOrigin::Signed(caller.clone()), caller.clone(), true)
+ }: set_offchain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
- set_offchain_schema {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ set_const_on_chain_schema {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_const_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
- }: set_offchain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+ set_variable_on_chain_schema {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::ReFungible(3);
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
- set_const_on_chain_schema {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_const_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
-
- set_variable_on_chain_schema {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::ReFungible(3);
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_variable_on_chain_schema(RawOrigin::Signed(caller.clone()), 2, [1,2,3].to_vec())
+ set_variable_meta_data {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let data = default_nft_data();
+ Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
- set_variable_meta_data {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let data = default_nft_data();
- Nft::<T>::create_item(RawOrigin::Signed(caller.clone()).into(), 2, caller.clone(), data)?;
+ }: set_variable_meta_data(RawOrigin::Signed(caller.clone()), 2, 1, [1, 2, 3].to_vec())
- }: set_variable_meta_data(RawOrigin::Signed(caller.clone()), 2, 1, [1, 2, 3].to_vec())
+ set_schema_version {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ }: set_schema_version(RawOrigin::Signed(caller.clone()), 2, SchemaVersion::Unique)
- set_schema_version {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- }: set_schema_version(RawOrigin::Signed(caller.clone()), 2, SchemaVersion::Unique)
+ set_chain_limits {
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ let limits = ChainLimits {
+ collection_numbers_limit: 0,
+ account_token_ownership_limit: 0,
+ collections_admins_limit: 0,
+ custom_data_limit: 0,
+ nft_sponsor_transfer_timeout: 0,
+ fungible_sponsor_transfer_timeout: 0,
+ refungible_sponsor_transfer_timeout: 0
+ };
+ }: set_chain_limits(RawOrigin::Signed(caller.clone()), limits)
- set_chain_limits {
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- let limits = ChainLimits {
- collection_numbers_limit: 0,
- account_token_ownership_limit: 0,
- collections_admins_limit: 0,
- custom_data_limit: 0,
- nft_sponsor_transfer_timeout: 0,
- fungible_sponsor_transfer_timeout: 0,
- refungible_sponsor_transfer_timeout: 0
- };
- }: set_chain_limits(RawOrigin::Signed(caller.clone()), limits)
+ set_contract_sponsoring_rate_limit {
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
+ let block_number: T::BlockNumber = 0.into();
+ }: set_contract_sponsoring_rate_limit(RawOrigin::Signed(caller.clone()), caller.clone(), block_number)
- set_contract_sponsoring_rate_limit {
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- let block_number: T::BlockNumber = 0.into();
- }: set_contract_sponsoring_rate_limit(RawOrigin::Signed(caller.clone()), caller.clone(), block_number)
+ set_collection_limits{
+ let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
+ let mode: CollectionMode = CollectionMode::NFT;
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
- set_collection_limits{
- let col_name1: Vec<u16> = "Test1".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1".to_vec();
- let mode: CollectionMode = CollectionMode::NFT;
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::create_collection(RawOrigin::Signed(caller.clone()).into(), col_name1.clone(), col_desc1.clone(), token_prefix1.clone(), mode.clone())?;
-
- let cl = CollectionLimits {
- account_token_ownership_limit: 0,
- sponsored_data_size: 0,
- token_limit: 0,
- sponsor_transfer_timeout: 0
- };
+ let cl = CollectionLimits {
+ account_token_ownership_limit: 0,
+ sponsored_data_size: 0,
+ token_limit: 0,
+ sponsor_transfer_timeout: 0
+ };
- }: set_collection_limits(RawOrigin::Signed(caller.clone()), 2, cl)
+ }: set_collection_limits(RawOrigin::Signed(caller.clone()), 2, cl)
- add_to_contract_white_list{
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- }: add_to_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
+ add_to_contract_white_list{
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ }: add_to_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
- remove_from_contract_white_list{
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- Nft::<T>::add_to_contract_white_list(RawOrigin::Signed(caller.clone()).into(), caller.clone(), caller.clone())?;
- }: remove_from_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
+ remove_from_contract_white_list{
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ Nft::<T>::add_to_contract_white_list(RawOrigin::Signed(caller.clone()).into(), caller.clone(), caller.clone())?;
+ }: remove_from_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), caller.clone())
- toggle_contract_white_list{
- let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
- }: toggle_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), true)
+ toggle_contract_white_list{
+ let caller: T::AccountId = T::AccountId::from(whitelisted_caller());
+ }: toggle_contract_white_list(RawOrigin::Signed(caller.clone()), caller.clone(), true)
*/
}
pallets/nft/src/default_weights.rsdiffbeforeafterboth--- a/pallets/nft/src/default_weights.rs
+++ b/pallets/nft/src/default_weights.rs
@@ -2,154 +2,154 @@
impl crate::WeightInfo for () {
fn create_collection() -> Weight {
- (70_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(7 as Weight))
- .saturating_add(DbWeight::get().writes(5 as Weight))
+ 70_000_000_u64
+ .saturating_add(DbWeight::get().reads(7_u64))
+ .saturating_add(DbWeight::get().writes(5_u64))
}
fn destroy_collection() -> Weight {
- (90_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(5 as Weight))
+ 90_000_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(5_u64))
}
fn add_to_white_list() -> Weight {
- (30_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn remove_from_white_list() -> Weight {
- (35_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 30_000_000_u64
+ .saturating_add(DbWeight::get().reads(3_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn remove_from_white_list() -> Weight {
+ 35_000_000_u64
+ .saturating_add(DbWeight::get().reads(3_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn set_public_access_mode() -> Weight {
- (27_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 27_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn set_mint_permission() -> Weight {
- (27_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 27_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn change_collection_owner() -> Weight {
- (27_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 27_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn add_collection_admin() -> Weight {
- (32_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 32_000_000_u64
+ .saturating_add(DbWeight::get().reads(3_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn remove_collection_admin() -> Weight {
- (50_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_collection_sponsor() -> Weight {
- (32_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn confirm_sponsorship() -> Weight {
- (22_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn remove_collection_sponsor() -> Weight {
- (24_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn create_item(s: usize, ) -> Weight {
- (130_000_000 as Weight)
- .saturating_add((2135 as Weight).saturating_mul(s as Weight).saturating_mul(500 as Weight)) // 500 is temporary multiplier, fee for storage
- .saturating_add(DbWeight::get().reads(10 as Weight))
- .saturating_add(DbWeight::get().writes(8 as Weight))
- }
- fn burn_item() -> Weight {
- (170_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(9 as Weight))
- .saturating_add(DbWeight::get().writes(7 as Weight))
- }
- fn transfer() -> Weight {
- (125_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(7 as Weight))
- .saturating_add(DbWeight::get().writes(7 as Weight))
- }
- fn approve() -> Weight {
- (45_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn transfer_from() -> Weight {
- (150_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(9 as Weight))
- .saturating_add(DbWeight::get().writes(8 as Weight))
- }
- fn set_offchain_schema() -> Weight {
- (33_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_const_on_chain_schema() -> Weight {
- (11_100_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_variable_on_chain_schema() -> Weight {
- (11_100_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_variable_meta_data() -> Weight {
- (17_500_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn enable_contract_sponsoring() -> Weight {
- (13_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_schema_version() -> Weight {
- (8_500_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_chain_limits() -> Weight {
- (1_300_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_contract_sponsoring_rate_limit() -> Weight {
- (3_500_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn set_variable_meta_data_sponsoring_rate_limit() -> Weight {
- (3_500_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn toggle_contract_white_list() -> Weight {
- (3_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn add_to_contract_white_list() -> Weight {
- (3_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn remove_from_contract_white_list() -> Weight {
- (3_200_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn set_collection_limits() -> Weight {
- (8_900_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
+ 50_000_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_collection_sponsor() -> Weight {
+ 32_000_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn confirm_sponsorship() -> Weight {
+ 22_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn remove_collection_sponsor() -> Weight {
+ 24_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn create_item(s: usize) -> Weight {
+ 130_000_000_u64
+ .saturating_add(2135_u64.saturating_mul(s as Weight).saturating_mul(500_u64)) // 500 is temporary multiplier, fee for storage
+ .saturating_add(DbWeight::get().reads(10_u64))
+ .saturating_add(DbWeight::get().writes(8_u64))
+ }
+ fn burn_item() -> Weight {
+ 170_000_000_u64
+ .saturating_add(DbWeight::get().reads(9_u64))
+ .saturating_add(DbWeight::get().writes(7_u64))
+ }
+ fn transfer() -> Weight {
+ 125_000_000_u64
+ .saturating_add(DbWeight::get().reads(7_u64))
+ .saturating_add(DbWeight::get().writes(7_u64))
+ }
+ fn approve() -> Weight {
+ 45_000_000_u64
+ .saturating_add(DbWeight::get().reads(3_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn transfer_from() -> Weight {
+ 150_000_000_u64
+ .saturating_add(DbWeight::get().reads(9_u64))
+ .saturating_add(DbWeight::get().writes(8_u64))
+ }
+ fn set_offchain_schema() -> Weight {
+ 33_000_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_const_on_chain_schema() -> Weight {
+ 11_100_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_variable_on_chain_schema() -> Weight {
+ 11_100_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_variable_meta_data() -> Weight {
+ 17_500_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn enable_contract_sponsoring() -> Weight {
+ 13_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_schema_version() -> Weight {
+ 8_500_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_chain_limits() -> Weight {
+ 1_300_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_contract_sponsoring_rate_limit() -> Weight {
+ 3_500_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn set_variable_meta_data_sponsoring_rate_limit() -> Weight {
+ 3_500_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn toggle_contract_white_list() -> Weight {
+ 3_000_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn add_to_contract_white_list() -> Weight {
+ 3_000_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn remove_from_contract_white_list() -> Weight {
+ 3_200_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn set_collection_limits() -> Weight {
+ 8_900_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
}
pallets/nft/src/eth/account.rsdiffbeforeafterboth--- a/pallets/nft/src/eth/account.rs
+++ b/pallets/nft/src/eth/account.rs
@@ -8,128 +8,129 @@
use sp_std::vec::Vec;
use sp_std::clone::Clone;
-pub trait CrossAccountId<AccountId>:
- Encode + EncodeLike + Decode +
- Clone + PartialEq + Ord + core::fmt::Debug // +
- // Serialize + Deserialize<'static>
+pub trait CrossAccountId<AccountId>:
+ Encode + EncodeLike + Decode + Clone + PartialEq + Ord + core::fmt::Debug
+// +
+// Serialize + Deserialize<'static>
{
- fn as_sub(&self) -> &AccountId;
- fn as_eth(&self) -> &H160;
+ fn as_sub(&self) -> &AccountId;
+ fn as_eth(&self) -> &H160;
- fn from_sub(account: AccountId) -> Self;
- fn from_eth(account: H160) -> Self;
+ fn from_sub(account: AccountId) -> Self;
+ fn from_eth(account: H160) -> Self;
}
-#[derive(Eq)]
-#[derive(Serialize, Deserialize)]
+#[derive(Eq, Serialize, Deserialize)]
pub struct BasicCrossAccountId<T: Config> {
- /// If true - then ethereum is canonical encoding
- from_ethereum: bool,
- substrate: T::AccountId,
- ethereum: H160,
+ /// If true - then ethereum is canonical encoding
+ from_ethereum: bool,
+ substrate: T::AccountId,
+ ethereum: H160,
}
impl<T: Config> core::fmt::Debug for BasicCrossAccountId<T> {
- fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
- if self.from_ethereum {
- fmt.debug_tuple("CrossAccountId::Ethereum")
- .field(&self.ethereum)
- .finish()
- } else {
- fmt.debug_tuple("CrossAccountId::Substrate")
- .field(&self.substrate)
- .finish()
- }
- }
+ fn fmt(&self, fmt: &mut core::fmt::Formatter) -> core::fmt::Result {
+ if self.from_ethereum {
+ fmt.debug_tuple("CrossAccountId::Ethereum")
+ .field(&self.ethereum)
+ .finish()
+ } else {
+ fmt.debug_tuple("CrossAccountId::Substrate")
+ .field(&self.substrate)
+ .finish()
+ }
+ }
}
impl<T: Config> PartialOrd for BasicCrossAccountId<T> {
- fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
- Some(self.substrate.cmp(&other.substrate))
- }
+ fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+ Some(self.substrate.cmp(&other.substrate))
+ }
}
impl<T: Config> Ord for BasicCrossAccountId<T> {
- fn cmp(&self, other: &Self) -> Ordering {
- self.partial_cmp(other).expect("substrate account is total ordered")
- }
+ fn cmp(&self, other: &Self) -> Ordering {
+ self.partial_cmp(other)
+ .expect("substrate account is total ordered")
+ }
}
impl<T: Config> PartialEq for BasicCrossAccountId<T> {
- fn eq(&self, other: &Self) -> bool {
- if self.from_ethereum == other.from_ethereum {
- self.substrate == other.substrate && self.ethereum == other.ethereum
- } else if self.from_ethereum {
- // ethereum is canonical encoding, but we need to compare derived address
- self.substrate == other.substrate
- } else {
- self.ethereum == other.ethereum
- }
- }
+ fn eq(&self, other: &Self) -> bool {
+ if self.from_ethereum == other.from_ethereum {
+ self.substrate == other.substrate && self.ethereum == other.ethereum
+ } else if self.from_ethereum {
+ // ethereum is canonical encoding, but we need to compare derived address
+ self.substrate == other.substrate
+ } else {
+ self.ethereum == other.ethereum
+ }
+ }
}
impl<T: Config> Clone for BasicCrossAccountId<T> {
- fn clone(&self) -> Self {
- Self {
- from_ethereum: self.from_ethereum,
- substrate: self.substrate.clone(),
- ethereum: self.ethereum,
- }
- }
+ fn clone(&self) -> Self {
+ Self {
+ from_ethereum: self.from_ethereum,
+ substrate: self.substrate.clone(),
+ ethereum: self.ethereum,
+ }
+ }
}
impl<T: Config> Encode for BasicCrossAccountId<T> {
- fn encode(&self) -> Vec<u8> {
- let as_result = if !self.from_ethereum {
- Ok(self.substrate.clone())
- } else {
- Err(self.ethereum)
- };
- as_result.encode()
- }
+ fn encode(&self) -> Vec<u8> {
+ let as_result = if !self.from_ethereum {
+ Ok(self.substrate.clone())
+ } else {
+ Err(self.ethereum)
+ };
+ as_result.encode()
+ }
}
impl<T: Config> EncodeLike for BasicCrossAccountId<T> {}
impl<T: Config> Decode for BasicCrossAccountId<T> {
- fn decode<I>(input: &mut I) -> Result<Self, codec::Error>
- where I: codec::Input
- {
- Ok(match <Result<T::AccountId, H160>>::decode(input)? {
- Ok(s) => Self::from_sub(s),
- Err(e) => Self::from_eth(e),
- })
- }
+ fn decode<I>(input: &mut I) -> Result<Self, codec::Error>
+ where
+ I: codec::Input,
+ {
+ Ok(match <Result<T::AccountId, H160>>::decode(input)? {
+ Ok(s) => Self::from_sub(s),
+ Err(e) => Self::from_eth(e),
+ })
+ }
}
impl<T: Config> CrossAccountId<T::AccountId> for BasicCrossAccountId<T> {
- fn as_sub(&self) -> &T::AccountId {
- &self.substrate
- }
- fn as_eth(&self) -> &H160 {
- &self.ethereum
- }
- fn from_sub(substrate: T::AccountId) -> Self {
- Self {
- ethereum: T::EvmBackwardsAddressMapping::from_account_id(substrate.clone()),
- substrate,
- from_ethereum: false,
- }
- }
- fn from_eth(ethereum: H160) -> Self {
- Self {
- ethereum,
- substrate: T::EvmAddressMapping::into_account_id(ethereum),
- from_ethereum: true,
- }
- }
+ fn as_sub(&self) -> &T::AccountId {
+ &self.substrate
+ }
+ fn as_eth(&self) -> &H160 {
+ &self.ethereum
+ }
+ fn from_sub(substrate: T::AccountId) -> Self {
+ Self {
+ ethereum: T::EvmBackwardsAddressMapping::from_account_id(substrate.clone()),
+ substrate,
+ from_ethereum: false,
+ }
+ }
+ fn from_eth(ethereum: H160) -> Self {
+ Self {
+ ethereum,
+ substrate: T::EvmAddressMapping::into_account_id(ethereum),
+ from_ethereum: true,
+ }
+ }
}
pub trait EvmBackwardsAddressMapping<AccountId> {
- fn from_account_id(account_id: AccountId) -> H160;
+ fn from_account_id(account_id: AccountId) -> H160;
}
/// Should have same mapping as EnsureAddressTruncated
pub struct MapBackwardsAddressTruncated;
impl EvmBackwardsAddressMapping<AccountId32> for MapBackwardsAddressTruncated {
- fn from_account_id(account_id: AccountId32) -> H160 {
- let mut out = [0; 20];
- out.copy_from_slice(&(account_id.as_ref() as &[u8])[0..20]);
- H160(out)
- }
-}
\ No newline at end of file
+ fn from_account_id(account_id: AccountId32) -> H160 {
+ let mut out = [0; 20];
+ out.copy_from_slice(&(account_id.as_ref() as &[u8])[0..20]);
+ H160(out)
+ }
+}
pallets/nft/src/eth/erc.rsdiffbeforeafterboth--- a/pallets/nft/src/eth/erc.rs
+++ b/pallets/nft/src/eth/erc.rs
@@ -3,132 +3,199 @@
#[solidity_interface]
pub trait InlineNameSymbol {
- type Error;
+ type Error;
- fn name(&self) -> Result<string, Self::Error>;
- fn symbol(&self) -> Result<string, Self::Error>;
+ fn name(&self) -> Result<string, Self::Error>;
+ fn symbol(&self) -> Result<string, Self::Error>;
}
#[solidity_interface]
pub trait InlineTotalSupply {
- type Error;
+ type Error;
- fn total_supply(&self) -> Result<uint256, Self::Error>;
+ fn total_supply(&self) -> Result<uint256, Self::Error>;
}
#[solidity_interface]
pub trait ERC165 {
- type Error;
+ type Error;
- fn supports_interface(&self, interface_id: bytes4) -> Result<bool, Self::Error>;
+ fn supports_interface(&self, interface_id: bytes4) -> Result<bool, Self::Error>;
}
#[solidity_interface(inline_is(InlineNameSymbol))]
pub trait ERC721Metadata {
- type Error;
+ type Error;
- #[solidity(rename_selector = "tokenURI")]
- fn token_uri(&self, token_id: uint256) -> Result<string, Self::Error>;
+ #[solidity(rename_selector = "tokenURI")]
+ fn token_uri(&self, token_id: uint256) -> Result<string, Self::Error>;
}
#[solidity_interface(inline_is(InlineTotalSupply))]
pub trait ERC721Enumerable {
- type Error;
+ type Error;
- fn token_by_index(&self, index: uint256) -> Result<uint256, Self::Error>;
- fn token_of_owner_by_index(&self, owner: address, index: uint256) -> Result<uint256, Self::Error>;
+ fn token_by_index(&self, index: uint256) -> Result<uint256, Self::Error>;
+ fn token_of_owner_by_index(
+ &self,
+ owner: address,
+ index: uint256,
+ ) -> Result<uint256, Self::Error>;
}
-
#[derive(ToLog)]
pub enum ERC721Events {
- Transfer {
- #[indexed] from: address,
- #[indexed] to: address,
- #[indexed] token_id: uint256,
- },
- Approval {
- #[indexed] owner: address,
- #[indexed] approved: address,
- #[indexed] token_id: uint256,
- },
- #[allow(dead_code)]
- ApprovalForAll {
- #[indexed] owner: address,
- #[indexed] operator: address,
- approved: bool,
- }
+ Transfer {
+ #[indexed]
+ from: address,
+ #[indexed]
+ to: address,
+ #[indexed]
+ token_id: uint256,
+ },
+ Approval {
+ #[indexed]
+ owner: address,
+ #[indexed]
+ approved: address,
+ #[indexed]
+ token_id: uint256,
+ },
+ #[allow(dead_code)]
+ ApprovalForAll {
+ #[indexed]
+ owner: address,
+ #[indexed]
+ operator: address,
+ approved: bool,
+ },
}
#[solidity_interface(is(ERC165), events(ERC721Events))]
pub trait ERC721 {
- type Error;
+ type Error;
- fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;
- fn owner_of(&self, token_id: uint256) -> Result<address, Self::Error>;
+ fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;
+ fn owner_of(&self, token_id: uint256) -> Result<address, Self::Error>;
- #[solidity(rename_selector = "safeTransferFrom")]
- fn safe_transfer_from_with_data(&mut self, from: address, to: address, token_id: uint256, data: bytes, value: value) -> Result<void, Self::Error>;
- fn safe_transfer_from(&mut self, from: address, to: address, token_id: uint256, value: value) -> Result<void, Self::Error>;
+ #[solidity(rename_selector = "safeTransferFrom")]
+ fn safe_transfer_from_with_data(
+ &mut self,
+ from: address,
+ to: address,
+ token_id: uint256,
+ data: bytes,
+ value: value,
+ ) -> Result<void, Self::Error>;
+ fn safe_transfer_from(
+ &mut self,
+ from: address,
+ to: address,
+ token_id: uint256,
+ value: value,
+ ) -> Result<void, Self::Error>;
- fn transfer_from(&mut self, caller: caller, from: address, to: address, token_id: uint256, value: value) -> Result<void, Self::Error>;
- fn approve(&mut self, caller: caller, approved: address, token_id: uint256, value: value) -> Result<void, Self::Error>;
- fn set_approval_for_all(&mut self, caller: caller, operator: address, approved: bool) -> Result<void, Self::Error>;
+ fn transfer_from(
+ &mut self,
+ caller: caller,
+ from: address,
+ to: address,
+ token_id: uint256,
+ value: value,
+ ) -> Result<void, Self::Error>;
+ fn approve(
+ &mut self,
+ caller: caller,
+ approved: address,
+ token_id: uint256,
+ value: value,
+ ) -> Result<void, Self::Error>;
+ fn set_approval_for_all(
+ &mut self,
+ caller: caller,
+ operator: address,
+ approved: bool,
+ ) -> Result<void, Self::Error>;
- fn get_approved(&self, token_id: uint256) -> Result<address, Self::Error>;
- fn is_approved_for_all(&self, owner: address, operator: address) -> Result<address, Self::Error>;
+ fn get_approved(&self, token_id: uint256) -> Result<address, Self::Error>;
+ fn is_approved_for_all(
+ &self,
+ owner: address,
+ operator: address,
+ ) -> Result<address, Self::Error>;
}
#[solidity_interface]
pub trait ERC721UniqueExtensions {
- type Error;
+ type Error;
- fn transfer(&mut self, caller: caller, to: address, token_id: uint256, value: value) -> Result<void, Self::Error>;
+ fn transfer(
+ &mut self,
+ caller: caller,
+ to: address,
+ token_id: uint256,
+ value: value,
+ ) -> Result<void, Self::Error>;
}
-#[solidity_interface(is(ERC165, ERC721, ERC721Metadata, ERC721Enumerable, ERC721UniqueExtensions))]
+#[solidity_interface(is(
+ ERC165,
+ ERC721,
+ ERC721Metadata,
+ ERC721Enumerable,
+ ERC721UniqueExtensions
+))]
pub trait UniqueNFT {
- type Error;
+ type Error;
}
#[derive(ToLog)]
pub enum ERC20Events {
- Transfer {
- #[indexed] from: address,
- #[indexed] to: address,
- value: uint256,
- },
- Approval {
- #[indexed] owner: address,
- #[indexed] spender: address,
- value: uint256,
- }
+ Transfer {
+ #[indexed]
+ from: address,
+ #[indexed]
+ to: address,
+ value: uint256,
+ },
+ Approval {
+ #[indexed]
+ owner: address,
+ #[indexed]
+ spender: address,
+ value: uint256,
+ },
}
#[solidity_interface(inline_is(InlineNameSymbol, InlineTotalSupply), events(ERC20Events))]
pub trait ERC20 {
- type Error;
-
- fn decimals(&self) -> Result<uint8, Self::Error>;
- fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;
- fn transfer(&mut self, caller: caller, to: address, value: uint256) -> Result<bool, Self::Error>;
- fn transfer_from(&mut self, caller: caller, from: address, to: address, value: uint256) -> Result<bool, Self::Error>;
- fn approve(&mut self, caller: caller, spender: address, value: uint256) -> Result<bool, Self::Error>;
- fn allowance(&self, owner: address, spender: address) -> Result<uint256, Self::Error>;
+ type Error;
+
+ fn decimals(&self) -> Result<uint8, Self::Error>;
+ fn balance_of(&self, owner: address) -> Result<uint256, Self::Error>;
+ fn transfer(
+ &mut self,
+ caller: caller,
+ to: address,
+ value: uint256,
+ ) -> Result<bool, Self::Error>;
+ fn transfer_from(
+ &mut self,
+ caller: caller,
+ from: address,
+ to: address,
+ value: uint256,
+ ) -> Result<bool, Self::Error>;
+ fn approve(
+ &mut self,
+ caller: caller,
+ spender: address,
+ value: uint256,
+ ) -> Result<bool, Self::Error>;
+ fn allowance(&self, owner: address, spender: address) -> Result<uint256, Self::Error>;
}
#[solidity_interface(is(ERC165, ERC20))]
pub trait UniqueFungible {
- type Error;
+ type Error;
}
-
-/// Runtime metadata like helpers for evm
-#[solidity_interface]
-trait UniqueHelpers {
- type Error;
-
- /// Returns interface for NFT collections
- fn nft_interface(&self) -> Result<string, Self::Error>;
- /// Returns interface for Fungible collections
- fn fungible_interface(&self) -> Result<string, Self::Error>;
-}
\ No newline at end of file
pallets/nft/src/eth/erc_impl.rsdiffbeforeafterboth--- a/pallets/nft/src/eth/erc_impl.rs
+++ b/pallets/nft/src/eth/erc_impl.rs
@@ -56,7 +56,7 @@
Ok(index)
}
- fn token_of_owner_by_index(&self, owner: address, index: uint256) -> Result<uint256> {
+ fn token_of_owner_by_index(&self, _owner: address, _index: uint256) -> Result<uint256> {
// TODO: Not implemetable
Err("not implemented".into())
}
@@ -77,7 +77,7 @@
fn owner_of(&self, token_id: uint256) -> Result<address> {
let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
let token = <NftItemList<T>>::get(self.id, token_id).ok_or("unknown token")?;
- Ok(token.owner.as_eth().clone())
+ Ok(*token.owner.as_eth())
}
fn safe_transfer_from_with_data(
&mut self,
@@ -114,7 +114,7 @@
let to = T::CrossAccountId::from_eth(to);
let token_id = token_id.try_into().map_err(|_| "token_id overflow")?;
- <Module<T>>::transfer_from_internal(&caller, &from, &to, &self, token_id, 1)
+ <Module<T>>::transfer_from_internal(&caller, &from, &to, self, token_id, 1)
.map_err(|_| "transferFrom error")?;
Ok(())
}
@@ -130,7 +130,7 @@
let approved = T::CrossAccountId::from_eth(approved);
let token_id = token_id.try_into().map_err(|_| "token_id overflow")?;
- <Module<T>>::approve_internal(&caller, &approved, &self, token_id, 1)
+ <Module<T>>::approve_internal(&caller, &approved, self, token_id, 1)
.map_err(|_| "approve internal")?;
Ok(())
}
@@ -170,13 +170,13 @@
caller: caller,
to: address,
token_id: uint256,
- value: value,
+ _value: value,
) -> Result<void> {
let caller = T::CrossAccountId::from_eth(caller);
let to = T::CrossAccountId::from_eth(to);
let token_id = token_id.try_into().map_err(|_| "amount overflow")?;
- <Module<T>>::transfer_internal(&caller, &to, &self, token_id, 1)
+ <Module<T>>::transfer_internal(&caller, &to, self, token_id, 1)
.map_err(|_| "transfer error")?;
Ok(())
}
@@ -226,7 +226,7 @@
let to = T::CrossAccountId::from_eth(to);
let amount = amount.try_into().map_err(|_| "amount overflow")?;
- <Module<T>>::transfer_internal(&caller, &to, &self, 1, amount)
+ <Module<T>>::transfer_internal(&caller, &to, self, 1, amount)
.map_err(|_| "transfer error")?;
Ok(true)
}
@@ -242,7 +242,7 @@
let to = T::CrossAccountId::from_eth(to);
let amount = amount.try_into().map_err(|_| "amount overflow")?;
- <Module<T>>::transfer_from_internal(&caller, &from, &to, &self, 1, amount)
+ <Module<T>>::transfer_from_internal(&caller, &from, &to, self, 1, amount)
.map_err(|_| "transferFrom error")?;
Ok(true)
}
@@ -251,7 +251,7 @@
let spender = T::CrossAccountId::from_eth(spender);
let amount = amount.try_into().map_err(|_| "amount overflow")?;
- <Module<T>>::approve_internal(&caller, &spender, &self, 1, amount)
+ <Module<T>>::approve_internal(&caller, &spender, self, 1, amount)
.map_err(|_| "approve internal")?;
Ok(true)
}
pallets/nft/src/eth/log.rsdiffbeforeafterboth--- a/pallets/nft/src/eth/log.rs
+++ b/pallets/nft/src/eth/log.rs
@@ -1,19 +1,19 @@
use sp_std::cell::RefCell;
use sp_std::vec::Vec;
-use sp_core::{H160, H256};
+
use ethereum::Log;
#[derive(Default)]
pub struct LogRecorder(RefCell<Vec<Log>>);
impl LogRecorder {
- pub fn is_empty(&self) -> bool {
- self.0.borrow().is_empty()
- }
- pub fn log(&self, log: Log) {
- self.0.borrow_mut().push(log);
- }
- pub fn retrieve_logs(self) -> Vec<Log> {
- self.0.into_inner()
- }
+ pub fn is_empty(&self) -> bool {
+ self.0.borrow().is_empty()
+ }
+ pub fn log(&self, log: Log) {
+ self.0.borrow_mut().push(log);
+ }
+ pub fn retrieve_logs(self) -> Vec<Log> {
+ self.0.into_inner()
+ }
}
pallets/nft/src/eth/mod.rsdiffbeforeafterboth--- a/pallets/nft/src/eth/mod.rs
+++ b/pallets/nft/src/eth/mod.rs
@@ -28,7 +28,7 @@
];
fn map_eth_to_id(eth: &H160) -> Option<CollectionId> {
- if ð[0..16] != ETH_ACCOUNT_PREFIX {
+ if eth[0..16] != ETH_ACCOUNT_PREFIX {
return None;
}
let mut id_bytes = [0; 4];
@@ -92,12 +92,9 @@
},
)?))
}
- _ => {
- return Err(StringError::from(
- "erc calls only supported to fungible and nft collections for now",
- )
- .into())
- }
+ _ => Err(StringError::from(
+ "erc calls only supported to fungible and nft collections for now",
+ )),
}
}
@@ -111,7 +108,7 @@
.unwrap_or(false)
}
fn get_code(target: &H160) -> Option<Vec<u8>> {
- map_eth_to_id(&target)
+ map_eth_to_id(target)
.and_then(<CollectionById<T>>::get)
.map(|collection| {
match collection.mode {
@@ -130,7 +127,7 @@
input: &[u8],
value: U256,
) -> Option<PrecompileOutput> {
- let mut collection = map_eth_to_id(&target)
+ let mut collection = map_eth_to_id(target)
.and_then(|id| <CollectionHandle<T>>::get_with_gas_limit(id, gas_limit))?;
let (method_id, input) = AbiReader::new_call(input).unwrap();
let result = call_internal(&mut collection, *source, method_id, input, value);
@@ -156,11 +153,10 @@
// TODO: This function is slow, and output can be memoized
pub fn generate_transaction(collection_id: u32, chain_id: u64) -> ethereum::Transaction {
- let contract = collection_id_to_address(collection_id);
-
// FIXME: Can be done on wasm runtime with https://github.com/paritytech/substrate/pull/8728
#[cfg(feature = "std")]
{
+ let contract = collection_id_to_address(collection_id);
let signed = ethereum_tx_sign::RawTransaction {
nonce: 0.into(),
to: Some(contract.0.into()),
@@ -183,6 +179,6 @@
}
#[cfg(not(feature = "std"))]
{
- panic!("transaction generation not yet supported by wasm runtime")
+ panic!("transaction generation not yet supported by wasm runtime while generating transaction for collection_id {}, chain_id {}", collection_id, chain_id)
}
}
pallets/nft/src/eth/sponsoring.rsdiffbeforeafterboth--- a/pallets/nft/src/eth/sponsoring.rs
+++ b/pallets/nft/src/eth/sponsoring.rs
@@ -1,142 +1,170 @@
//! Implements EVM sponsoring logic via OnChargeEVMTransaction
-use crate::{Collection, ChainLimit, CollectionById, Config, NftTransferBasket, FungibleTransferBasket, eth::account::EvmBackwardsAddressMapping};
+use crate::{
+ Collection, ChainLimit, CollectionById, Config, NftTransferBasket, FungibleTransferBasket,
+ eth::account::EvmBackwardsAddressMapping,
+};
use evm_coder::abi::AbiReader;
-use frame_support::{storage::{StorageMap, StorageDoubleMap, StorageValue}, traits::Currency};
+use frame_support::{
+ storage::{StorageMap, StorageDoubleMap, StorageValue},
+ traits::Currency,
+};
use pallet_evm::{EVMCurrencyAdapter, WithdrawReason};
use sp_core::{H160, U256};
use sp_std::prelude::*;
-use super::{account::CrossAccountId, erc::{UniqueFungibleCall, UniqueNFTCall, ERC721Call, ERC20Call, ERC721UniqueExtensionsCall}};
+use super::{
+ account::CrossAccountId,
+ erc::{UniqueFungibleCall, UniqueNFTCall, ERC721Call, ERC20Call, ERC721UniqueExtensionsCall},
+};
use core::convert::TryInto;
type NegativeImbalanceOf<C, T> =
- <C as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance;
+ <C as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance;
pub struct ChargeEvmTransaction;
pub struct ChargeEvmLiquidityInfo<T>
where
- T: Config,
- T: pallet_evm::Config,
+ T: Config,
+ T: pallet_evm::Config,
{
- who: H160,
- negative_imbalance: NegativeImbalanceOf<<T as Config>::Currency, T>,
+ who: H160,
+ negative_imbalance: NegativeImbalanceOf<<T as Config>::Currency, T>,
}
struct AnyError;
-fn try_sponsor<T: Config>(caller: &H160, collection_id: u32, collection: &Collection<T>, call: &[u8]) -> Result<(), AnyError> {
- let (method_id, mut reader) = AbiReader::new_call(call).map_err(|_| AnyError)?;
- match &collection.mode {
- crate::CollectionMode::NFT => {
- let call: UniqueNFTCall = UniqueNFTCall::parse(method_id, &mut reader).map_err(|_| AnyError)?.ok_or(AnyError)?;
- match call {
- UniqueNFTCall::ERC721UniqueExtensions(ERC721UniqueExtensionsCall::Transfer {token_id, ..}) | UniqueNFTCall::ERC721(ERC721Call::TransferFrom {token_id, ..}) => {
- let token_id: u32 = token_id.try_into().map_err(|_| AnyError)?;
- let block_number = <frame_system::Module<T>>::block_number() as T::BlockNumber;
- let collection_limits = &collection.limits;
- let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
- collection_limits.sponsor_transfer_timeout
- } else {
- ChainLimit::get().nft_sponsor_transfer_timeout
- };
+fn try_sponsor<T: Config>(
+ caller: &H160,
+ collection_id: u32,
+ collection: &Collection<T>,
+ call: &[u8],
+) -> Result<(), AnyError> {
+ let (method_id, mut reader) = AbiReader::new_call(call).map_err(|_| AnyError)?;
+ match &collection.mode {
+ crate::CollectionMode::NFT => {
+ let call: UniqueNFTCall = UniqueNFTCall::parse(method_id, &mut reader)
+ .map_err(|_| AnyError)?
+ .ok_or(AnyError)?;
+ match call {
+ UniqueNFTCall::ERC721UniqueExtensions(ERC721UniqueExtensionsCall::Transfer {
+ token_id,
+ ..
+ })
+ | UniqueNFTCall::ERC721(ERC721Call::TransferFrom { token_id, .. }) => {
+ let token_id: u32 = token_id.try_into().map_err(|_| AnyError)?;
+ let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
+ let collection_limits = &collection.limits;
+ let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
+ collection_limits.sponsor_transfer_timeout
+ } else {
+ ChainLimit::get().nft_sponsor_transfer_timeout
+ };
- let mut sponsor = true;
- if <NftTransferBasket<T>>::contains_key(collection_id, token_id) {
- let last_tx_block = <NftTransferBasket<T>>::get(collection_id, token_id);
- let limit_time = last_tx_block + limit.into();
- if block_number <= limit_time {
- sponsor = false;
- }
- }
- if sponsor {
- <NftTransferBasket<T>>::insert(collection_id, token_id, block_number);
- return Ok(())
- }
- },
- _ => {},
- }
- },
- crate::CollectionMode::Fungible(_) => {
- let call: UniqueFungibleCall = UniqueFungibleCall::parse(method_id, &mut reader).map_err(|_| AnyError)?.ok_or(AnyError)?;
- match call {
- UniqueFungibleCall::ERC20(ERC20Call::Transfer {..}) => {
- let who = T::CrossAccountId::from_eth(caller.clone());
- let collection_limits = &collection.limits;
- let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
- collection_limits.sponsor_transfer_timeout
- } else {
- ChainLimit::get().fungible_sponsor_transfer_timeout
- };
+ let mut sponsor = true;
+ if <NftTransferBasket<T>>::contains_key(collection_id, token_id) {
+ let last_tx_block = <NftTransferBasket<T>>::get(collection_id, token_id);
+ let limit_time = last_tx_block + limit.into();
+ if block_number <= limit_time {
+ sponsor = false;
+ }
+ }
+ if sponsor {
+ <NftTransferBasket<T>>::insert(collection_id, token_id, block_number);
+ return Ok(());
+ }
+ }
+ _ => {}
+ }
+ }
+ crate::CollectionMode::Fungible(_) => {
+ let call: UniqueFungibleCall = UniqueFungibleCall::parse(method_id, &mut reader)
+ .map_err(|_| AnyError)?
+ .ok_or(AnyError)?;
+ #[allow(clippy::single_match)]
+ match call {
+ UniqueFungibleCall::ERC20(ERC20Call::Transfer { .. }) => {
+ let who = T::CrossAccountId::from_eth(*caller);
+ let collection_limits = &collection.limits;
+ let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
+ collection_limits.sponsor_transfer_timeout
+ } else {
+ ChainLimit::get().fungible_sponsor_transfer_timeout
+ };
- let block_number = <frame_system::Module<T>>::block_number() as T::BlockNumber;
- let mut sponsored = true;
- if <FungibleTransferBasket<T>>::contains_key(collection_id, who.as_sub()) {
- let last_tx_block = <FungibleTransferBasket<T>>::get(collection_id, who.as_sub());
- let limit_time = last_tx_block + limit.into();
- if block_number <= limit_time {
- sponsored = false;
- }
- }
- if sponsored {
- <FungibleTransferBasket<T>>::insert(collection_id, who.as_sub(), block_number);
- return Ok(())
- }
- },
- _ => {},
- }
- },
- _ => {},
- }
- return Err(AnyError)
+ let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
+ let mut sponsored = true;
+ if <FungibleTransferBasket<T>>::contains_key(collection_id, who.as_sub()) {
+ let last_tx_block =
+ <FungibleTransferBasket<T>>::get(collection_id, who.as_sub());
+ let limit_time = last_tx_block + limit.into();
+ if block_number <= limit_time {
+ sponsored = false;
+ }
+ }
+ if sponsored {
+ <FungibleTransferBasket<T>>::insert(
+ collection_id,
+ who.as_sub(),
+ block_number,
+ );
+ return Ok(());
+ }
+ }
+ _ => {}
+ }
+ }
+ _ => {}
+ }
+ Err(AnyError)
}
impl<T> pallet_evm::OnChargeEVMTransaction<T> for ChargeEvmTransaction
where
- T: Config,
- T: pallet_evm::Config,
+ T: Config,
+ T: pallet_evm::Config,
{
- type LiquidityInfo = Option<ChargeEvmLiquidityInfo<T>>;
+ type LiquidityInfo = Option<ChargeEvmLiquidityInfo<T>>;
- fn withdraw_fee(
- who: &H160,
- reason: WithdrawReason,
- fee: U256,
- ) -> Result<Self::LiquidityInfo, pallet_evm::Error<T>> {
- let mut who_pays_fee = *who;
- if let WithdrawReason::Call { target, input } = &reason {
- if let Some(collection_id) = crate::eth::map_eth_to_id(&target) {
- if let Some(collection) = <CollectionById<T>>::get(collection_id) {
- if let Some(sponsor) = collection.sponsorship.sponsor() {
- if try_sponsor(who, collection_id, &collection, &input).is_ok() {
- who_pays_fee =
- T::EvmBackwardsAddressMapping::from_account_id(sponsor.clone());
- }
- }
- }
- }
- }
+ fn withdraw_fee(
+ who: &H160,
+ reason: WithdrawReason,
+ fee: U256,
+ ) -> Result<Self::LiquidityInfo, pallet_evm::Error<T>> {
+ let mut who_pays_fee = *who;
+ if let WithdrawReason::Call { target, input } = &reason {
+ if let Some(collection_id) = crate::eth::map_eth_to_id(target) {
+ if let Some(collection) = <CollectionById<T>>::get(collection_id) {
+ if let Some(sponsor) = collection.sponsorship.sponsor() {
+ if try_sponsor(who, collection_id, &collection, input).is_ok() {
+ who_pays_fee =
+ T::EvmBackwardsAddressMapping::from_account_id(sponsor.clone());
+ }
+ }
+ }
+ }
+ }
- // TODO: Pay fee from substrate address
- let negative_imbalance = EVMCurrencyAdapter::<<T as Config>::Currency, ()>::withdraw_fee(
- &who_pays_fee,
- reason,
- fee,
- )?;
- Ok(negative_imbalance.map(|i| ChargeEvmLiquidityInfo {
- who: who_pays_fee,
- negative_imbalance: i,
- }))
- }
+ // TODO: Pay fee from substrate address
+ let negative_imbalance = EVMCurrencyAdapter::<<T as Config>::Currency, ()>::withdraw_fee(
+ &who_pays_fee,
+ reason,
+ fee,
+ )?;
+ Ok(negative_imbalance.map(|i| ChargeEvmLiquidityInfo {
+ who: who_pays_fee,
+ negative_imbalance: i,
+ }))
+ }
- fn correct_and_deposit_fee(
- who: &H160,
- corrected_fee: U256,
- already_withdrawn: Self::LiquidityInfo,
- ) -> Result<(), pallet_evm::Error<T>> {
- EVMCurrencyAdapter::<<T as Config>::Currency, ()>::correct_and_deposit_fee(
- &already_withdrawn.as_ref().map(|e| e.who).unwrap_or(*who),
- corrected_fee,
- already_withdrawn.map(|e| e.negative_imbalance),
- )
- }
+ fn correct_and_deposit_fee(
+ who: &H160,
+ corrected_fee: U256,
+ already_withdrawn: Self::LiquidityInfo,
+ ) -> Result<(), pallet_evm::Error<T>> {
+ EVMCurrencyAdapter::<<T as Config>::Currency, ()>::correct_and_deposit_fee(
+ &already_withdrawn.as_ref().map(|e| e.who).unwrap_or(*who),
+ corrected_fee,
+ already_withdrawn.map(|e| e.negative_imbalance),
+ )
+ }
}
pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -4,41 +4,44 @@
//
#![recursion_limit = "1024"]
-
#![cfg_attr(not(feature = "std"), no_std)]
+#![allow(
+ clippy::too_many_arguments,
+ clippy::unnecessary_mut_passed,
+ clippy::unused_unit
+)]
extern crate alloc;
pub use serde::{Serialize, Deserialize};
pub use frame_support::{
- construct_runtime, decl_event, decl_module, decl_storage, decl_error,
- dispatch::DispatchResult,
- ensure, fail, parameter_types,
- traits::{
- Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
- Randomness, IsSubType, WithdrawReasons,
- },
- weights::{
- constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
- DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
- WeightToFeePolynomial, DispatchClass,
- },
- StorageValue,
- transactional,
+ construct_runtime, decl_event, decl_module, decl_storage, decl_error,
+ dispatch::DispatchResult,
+ ensure, fail, parameter_types,
+ traits::{
+ Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
+ Randomness, IsSubType, WithdrawReasons,
+ },
+ weights::{
+ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+ DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
+ WeightToFeePolynomial, DispatchClass,
+ },
+ StorageValue, transactional,
};
use frame_system::{self as system, ensure_signed, ensure_root};
use sp_core::H160;
+use sp_std::vec;
use sp_runtime::sp_std::prelude::Vec;
use core::ops::{Deref, DerefMut};
use core::cell::RefCell;
use nft_data_structs::{
- MAX_DECIMAL_POINTS, MAX_SPONSOR_TIMEOUT, MAX_TOKEN_OWNERSHIP, MAX_REFUNGIBLE_PIECES,
- AccessMode, ChainLimits, Collection, CreateItemData, CollectionLimits,
- CollectionId, CollectionMode, TokenId,
- SchemaVersion, SponsorshipState, Ownership,
- NftItemType, FungibleItemType, ReFungibleItemType
+ MAX_DECIMAL_POINTS, MAX_SPONSOR_TIMEOUT, MAX_TOKEN_OWNERSHIP, MAX_REFUNGIBLE_PIECES,
+ AccessMode, ChainLimits, Collection, CreateItemData, CollectionLimits, CollectionId,
+ CollectionMode, TokenId, SchemaVersion, SponsorshipState, Ownership, NftItemType,
+ FungibleItemType, ReFungibleItemType,
};
use pallet_ethereum::EthereumTransactionSender;
@@ -65,186 +68,186 @@
fn destroy_collection() -> Weight;
fn add_to_white_list() -> Weight;
fn remove_from_white_list() -> Weight;
- fn set_public_access_mode() -> Weight;
- fn set_mint_permission() -> Weight;
- fn change_collection_owner() -> Weight;
- fn add_collection_admin() -> Weight;
- fn remove_collection_admin() -> Weight;
- fn set_collection_sponsor() -> Weight;
- fn confirm_sponsorship() -> Weight;
- fn remove_collection_sponsor() -> Weight;
- fn create_item(s: usize) -> Weight;
- fn burn_item() -> Weight;
- fn transfer() -> Weight;
- fn approve() -> Weight;
- fn transfer_from() -> Weight;
- fn set_offchain_schema() -> Weight;
- fn set_const_on_chain_schema() -> Weight;
- fn set_variable_on_chain_schema() -> Weight;
- fn set_variable_meta_data() -> Weight;
- fn enable_contract_sponsoring() -> Weight;
- fn set_schema_version() -> Weight;
- fn set_chain_limits() -> Weight;
- fn set_contract_sponsoring_rate_limit() -> Weight;
- fn set_variable_meta_data_sponsoring_rate_limit() -> Weight;
- fn toggle_contract_white_list() -> Weight;
- fn add_to_contract_white_list() -> Weight;
- fn remove_from_contract_white_list() -> Weight;
- fn set_collection_limits() -> Weight;
+ fn set_public_access_mode() -> Weight;
+ fn set_mint_permission() -> Weight;
+ fn change_collection_owner() -> Weight;
+ fn add_collection_admin() -> Weight;
+ fn remove_collection_admin() -> Weight;
+ fn set_collection_sponsor() -> Weight;
+ fn confirm_sponsorship() -> Weight;
+ fn remove_collection_sponsor() -> Weight;
+ fn create_item(s: usize) -> Weight;
+ fn burn_item() -> Weight;
+ fn transfer() -> Weight;
+ fn approve() -> Weight;
+ fn transfer_from() -> Weight;
+ fn set_offchain_schema() -> Weight;
+ fn set_const_on_chain_schema() -> Weight;
+ fn set_variable_on_chain_schema() -> Weight;
+ fn set_variable_meta_data() -> Weight;
+ fn enable_contract_sponsoring() -> Weight;
+ fn set_schema_version() -> Weight;
+ fn set_chain_limits() -> Weight;
+ fn set_contract_sponsoring_rate_limit() -> Weight;
+ fn set_variable_meta_data_sponsoring_rate_limit() -> Weight;
+ fn toggle_contract_white_list() -> Weight;
+ fn add_to_contract_white_list() -> Weight;
+ fn remove_from_contract_white_list() -> Weight;
+ fn set_collection_limits() -> Weight;
}
decl_error! {
/// Error for non-fungible-token module.
pub enum Error for Module<T: Config> {
- /// Total collections bound exceeded.
- TotalCollectionsLimitExceeded,
+ /// Total collections bound exceeded.
+ TotalCollectionsLimitExceeded,
/// Decimal_points parameter must be lower than MAX_DECIMAL_POINTS constant, currently it is 30.
- CollectionDecimalPointLimitExceeded,
- /// Collection name can not be longer than 63 char.
- CollectionNameLimitExceeded,
- /// Collection description can not be longer than 255 char.
- CollectionDescriptionLimitExceeded,
- /// Token prefix can not be longer than 15 char.
- CollectionTokenPrefixLimitExceeded,
- /// This collection does not exist.
- CollectionNotFound,
- /// Item not exists.
- TokenNotFound,
- /// Admin not found
- AdminNotFound,
- /// Arithmetic calculation overflow.
- NumOverflow,
- /// Account already has admin role.
- AlreadyAdmin,
- /// You do not own this collection.
- NoPermission,
- /// This address is not set as sponsor, use setCollectionSponsor first.
- ConfirmUnsetSponsorFail,
- /// Collection is not in mint mode.
- PublicMintingNotAllowed,
- /// Sender parameter and item owner must be equal.
- MustBeTokenOwner,
- /// Item balance not enough.
- TokenValueTooLow,
- /// Size of item is too large.
- NftSizeLimitExceeded,
- /// No approve found
- ApproveNotFound,
- /// Requested value more than approved.
- TokenValueNotEnough,
- /// Only approved addresses can call this method.
- ApproveRequired,
- /// Address is not in white list.
- AddresNotInWhiteList,
- /// Number of collection admins bound exceeded.
- CollectionAdminsLimitExceeded,
- /// Owned tokens by a single address bound exceeded.
- AddressOwnershipLimitExceeded,
- /// Length of items properties must be greater than 0.
- EmptyArgument,
- /// const_data exceeded data limit.
- TokenConstDataLimitExceeded,
- /// variable_data exceeded data limit.
- TokenVariableDataLimitExceeded,
- /// Not NFT item data used to mint in NFT collection.
- NotNftDataUsedToMintNftCollectionToken,
- /// Not Fungible item data used to mint in Fungible collection.
- NotFungibleDataUsedToMintFungibleCollectionToken,
- /// Not Re Fungible item data used to mint in Re Fungible collection.
- NotReFungibleDataUsedToMintReFungibleCollectionToken,
- /// Unexpected collection type.
- UnexpectedCollectionType,
- /// Can't store metadata in fungible tokens.
- CantStoreMetadataInFungibleTokens,
- /// Collection token limit exceeded
- CollectionTokenLimitExceeded,
- /// Account token limit exceeded per collection
- AccountTokenLimitExceeded,
- /// Collection limit bounds per collection exceeded
- CollectionLimitBoundsExceeded,
- /// Tried to enable permissions which are only permitted to be disabled
- OwnerPermissionsCantBeReverted,
- /// Schema data size limit bound exceeded
- SchemaDataLimitExceeded,
- /// Maximum refungibility exceeded
- WrongRefungiblePieces,
- /// createRefungible should be called with one owner
- BadCreateRefungibleCall,
- /// Gas limit exceeded
- OutOfGas,
+ CollectionDecimalPointLimitExceeded,
+ /// Collection name can not be longer than 63 char.
+ CollectionNameLimitExceeded,
+ /// Collection description can not be longer than 255 char.
+ CollectionDescriptionLimitExceeded,
+ /// Token prefix can not be longer than 15 char.
+ CollectionTokenPrefixLimitExceeded,
+ /// This collection does not exist.
+ CollectionNotFound,
+ /// Item not exists.
+ TokenNotFound,
+ /// Admin not found
+ AdminNotFound,
+ /// Arithmetic calculation overflow.
+ NumOverflow,
+ /// Account already has admin role.
+ AlreadyAdmin,
+ /// You do not own this collection.
+ NoPermission,
+ /// This address is not set as sponsor, use setCollectionSponsor first.
+ ConfirmUnsetSponsorFail,
+ /// Collection is not in mint mode.
+ PublicMintingNotAllowed,
+ /// Sender parameter and item owner must be equal.
+ MustBeTokenOwner,
+ /// Item balance not enough.
+ TokenValueTooLow,
+ /// Size of item is too large.
+ NftSizeLimitExceeded,
+ /// No approve found
+ ApproveNotFound,
+ /// Requested value more than approved.
+ TokenValueNotEnough,
+ /// Only approved addresses can call this method.
+ ApproveRequired,
+ /// Address is not in white list.
+ AddresNotInWhiteList,
+ /// Number of collection admins bound exceeded.
+ CollectionAdminsLimitExceeded,
+ /// Owned tokens by a single address bound exceeded.
+ AddressOwnershipLimitExceeded,
+ /// Length of items properties must be greater than 0.
+ EmptyArgument,
+ /// const_data exceeded data limit.
+ TokenConstDataLimitExceeded,
+ /// variable_data exceeded data limit.
+ TokenVariableDataLimitExceeded,
+ /// Not NFT item data used to mint in NFT collection.
+ NotNftDataUsedToMintNftCollectionToken,
+ /// Not Fungible item data used to mint in Fungible collection.
+ NotFungibleDataUsedToMintFungibleCollectionToken,
+ /// Not Re Fungible item data used to mint in Re Fungible collection.
+ NotReFungibleDataUsedToMintReFungibleCollectionToken,
+ /// Unexpected collection type.
+ UnexpectedCollectionType,
+ /// Can't store metadata in fungible tokens.
+ CantStoreMetadataInFungibleTokens,
+ /// Collection token limit exceeded
+ CollectionTokenLimitExceeded,
+ /// Account token limit exceeded per collection
+ AccountTokenLimitExceeded,
+ /// Collection limit bounds per collection exceeded
+ CollectionLimitBoundsExceeded,
+ /// Tried to enable permissions which are only permitted to be disabled
+ OwnerPermissionsCantBeReverted,
+ /// Schema data size limit bound exceeded
+ SchemaDataLimitExceeded,
+ /// Maximum refungibility exceeded
+ WrongRefungiblePieces,
+ /// createRefungible should be called with one owner
+ BadCreateRefungibleCall,
+ /// Gas limit exceeded
+ OutOfGas,
}
}
pub struct CollectionHandle<T: Config> {
- pub id: CollectionId,
- collection: Collection<T>,
- logs: eth::log::LogRecorder,
- evm_address: H160,
- gas_limit: RefCell<u64>,
+ pub id: CollectionId,
+ collection: Collection<T>,
+ logs: eth::log::LogRecorder,
+ evm_address: H160,
+ gas_limit: RefCell<u64>,
}
impl<T: Config> CollectionHandle<T> {
pub fn get_with_gas_limit(id: CollectionId, gas_limit: u64) -> Option<Self> {
- <CollectionById<T>>::get(id)
- .map(|collection| Self {
- id,
- collection,
- logs: eth::log::LogRecorder::default(),
- evm_address: eth::collection_id_to_address(id),
- gas_limit: RefCell::new(gas_limit),
- })
+ <CollectionById<T>>::get(id).map(|collection| Self {
+ id,
+ collection,
+ logs: eth::log::LogRecorder::default(),
+ evm_address: eth::collection_id_to_address(id),
+ gas_limit: RefCell::new(gas_limit),
+ })
+ }
+ pub fn get(id: CollectionId) -> Option<Self> {
+ Self::get_with_gas_limit(id, u64::MAX)
+ }
+ pub fn gas_left(&self) -> u64 {
+ *self.gas_limit.borrow()
+ }
+ pub fn consume_gas(&self, gas: u64) -> DispatchResult {
+ let mut gas_limit = self.gas_limit.borrow_mut();
+ if *gas_limit < gas {
+ fail!(Error::<T>::OutOfGas);
+ }
+ *gas_limit -= gas;
+ Ok(())
+ }
+ pub fn log(&self, log: impl evm_coder::ToLog) {
+ self.logs.log(log.to_log(self.evm_address))
+ }
+ pub fn into_inner(self) -> Collection<T> {
+ self.collection
}
- pub fn get(id: CollectionId) -> Option<Self> {
- Self::get_with_gas_limit(id, u64::MAX)
- }
- pub fn gas_left(&self) -> u64 {
- *self.gas_limit.borrow()
- }
- pub fn consume_gas(&self, gas: u64) -> DispatchResult {
- let mut gas_limit = self.gas_limit.borrow_mut();
- if *gas_limit < gas {
- fail!(Error::<T>::OutOfGas);
- }
- *gas_limit -= gas;
- Ok(())
- }
- pub fn log(&self, log: impl evm_coder::ToLog) {
- self.logs.log(log.to_log(self.evm_address))
- }
- pub fn into_inner(self) -> Collection<T> {
- self.collection.clone()
- }
}
impl<T: Config> Deref for CollectionHandle<T> {
- type Target = Collection<T>;
+ type Target = Collection<T>;
- fn deref(&self) -> &Self::Target {
- &self.collection
- }
+ fn deref(&self) -> &Self::Target {
+ &self.collection
+ }
}
impl<T: Config> DerefMut for CollectionHandle<T> {
- fn deref_mut(&mut self) -> &mut Self::Target {
- &mut self.collection
- }
+ fn deref_mut(&mut self) -> &mut Self::Target {
+ &mut self.collection
+ }
}
pub trait Config: system::Config + Sized {
- type Event: From<Event<Self>> + Into<<Self as system::Config>::Event>;
+ type Event: From<Event<Self>> + Into<<Self as system::Config>::Event>;
- /// Weight information for extrinsics in this pallet.
+ /// Weight information for extrinsics in this pallet.
type WeightInfo: WeightInfo;
- type EvmAddressMapping: pallet_evm::AddressMapping<Self::AccountId>;
- type EvmBackwardsAddressMapping: EvmBackwardsAddressMapping<Self::AccountId>;
- type EvmWithdrawOrigin: pallet_evm::EnsureAddressOrigin<Self::Origin, Success = Self::AccountId>;
+ type EvmAddressMapping: pallet_evm::AddressMapping<Self::AccountId>;
+ type EvmBackwardsAddressMapping: EvmBackwardsAddressMapping<Self::AccountId>;
type CrossAccountId: CrossAccountId<Self::AccountId>;
- type Currency: Currency<Self::AccountId>;
- type CollectionCreationPrice: Get<<<Self as Config>::Currency as Currency<Self::AccountId>>::Balance>;
- type TreasuryAccountId: Get<Self::AccountId>;
+ type Currency: Currency<Self::AccountId>;
+ type CollectionCreationPrice: Get<
+ <<Self as Config>::Currency as Currency<Self::AccountId>>::Balance,
+ >;
+ type TreasuryAccountId: Get<Self::AccountId>;
- type EthereumChainId: Get<u64>;
- type EthereumTransactionSender: pallet_ethereum::EthereumTransactionSender;
+ type EthereumChainId: Get<u64>;
+ type EthereumTransactionSender: pallet_ethereum::EthereumTransactionSender;
}
// # Used definitions
@@ -270,1094 +273,1128 @@
// ?3 - real -> controlled
// no confirmation required, so addresses can be easily generated
decl_storage! {
- trait Store for Module<T: Config> as Nft {
+ trait Store for Module<T: Config> as Nft {
- //#region Private members
- /// Id of next collection
- CreatedCollectionCount: u32;
- /// Used for migrations
- ChainVersion: u64;
- /// Id of last collection token
- /// Collection id (controlled?1)
- ItemListIndex: map hasher(blake2_128_concat) CollectionId => TokenId;
- //#endregion
+ //#region Private members
+ /// Id of next collection
+ CreatedCollectionCount: u32;
+ /// Used for migrations
+ ChainVersion: u64;
+ /// Id of last collection token
+ /// Collection id (controlled?1)
+ ItemListIndex: map hasher(blake2_128_concat) CollectionId => TokenId;
+ //#endregion
- //#region Chain limits struct
- pub ChainLimit get(fn chain_limit) config(): ChainLimits;
- //#endregion
+ //#region Chain limits struct
+ pub ChainLimit get(fn chain_limit) config(): ChainLimits;
+ //#endregion
- //#region Bound counters
- /// Amount of collections destroyed, used for total amount tracking with
- /// CreatedCollectionCount
- DestroyedCollectionCount: u32;
- /// Total amount of account owned tokens (NFTs + RFTs + unique fungibles)
- /// Account id (real)
- pub AccountItemCount get(fn account_item_count): map hasher(twox_64_concat) T::AccountId => u32;
- //#endregion
+ //#region Bound counters
+ /// Amount of collections destroyed, used for total amount tracking with
+ /// CreatedCollectionCount
+ DestroyedCollectionCount: u32;
+ /// Total amount of account owned tokens (NFTs + RFTs + unique fungibles)
+ /// Account id (real)
+ pub AccountItemCount get(fn account_item_count): map hasher(twox_64_concat) T::AccountId => u32;
+ //#endregion
- //#region Basic collections
- /// Collection info
- /// Collection id (controlled?1)
- pub CollectionById get(fn collection_id) config(): map hasher(blake2_128_concat) CollectionId => Option<Collection<T>> = None;
- /// List of collection admins
- /// Collection id (controlled?2)
- pub AdminList get(fn admin_list_collection): map hasher(blake2_128_concat) CollectionId => Vec<T::CrossAccountId>;
- /// Whitelisted collection users
- /// Collection id (controlled?2), user id (controlled?3)
- pub WhiteList get(fn white_list): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => bool;
- //#endregion
+ //#region Basic collections
+ /// Collection info
+ /// Collection id (controlled?1)
+ pub CollectionById get(fn collection_id) config(): map hasher(blake2_128_concat) CollectionId => Option<Collection<T>> = None;
+ /// List of collection admins
+ /// Collection id (controlled?2)
+ pub AdminList get(fn admin_list_collection): map hasher(blake2_128_concat) CollectionId => Vec<T::CrossAccountId>;
+ /// Whitelisted collection users
+ /// Collection id (controlled?2), user id (controlled?3)
+ pub WhiteList get(fn white_list): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => bool;
+ //#endregion
- /// How many of collection items user have
- /// Collection id (controlled?2), account id (real)
- pub Balance get(fn balance_count): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => u128;
+ /// How many of collection items user have
+ /// Collection id (controlled?2), account id (real)
+ pub Balance get(fn balance_count): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => u128;
- /// Amount of items which spender can transfer out of owners account (via transferFrom)
- /// Collection id (controlled?2), (token id (controlled ?2) + owner account id (real) + spender account id (controlled?3))
- /// TODO: Off chain worker should remove from this map when token gets removed
- pub Allowances get(fn approved): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) (TokenId, T::AccountId, T::AccountId) => u128;
+ /// Amount of items which spender can transfer out of owners account (via transferFrom)
+ /// Collection id (controlled?2), (token id (controlled ?2) + owner account id (real) + spender account id (controlled?3))
+ /// TODO: Off chain worker should remove from this map when token gets removed
+ pub Allowances get(fn approved): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) (TokenId, T::AccountId, T::AccountId) => u128;
- //#region Item collections
- /// Collection id (controlled?2), token id (controlled?1)
- pub NftItemList get(fn nft_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<NftItemType<T::CrossAccountId>>;
- /// Collection id (controlled?2), owner (controlled?2)
- pub FungibleItemList get(fn fungible_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => FungibleItemType;
- /// Collection id (controlled?2), token id (controlled?1)
- pub ReFungibleItemList get(fn refungible_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<ReFungibleItemType<T::CrossAccountId>>;
- //#endregion
+ //#region Item collections
+ /// Collection id (controlled?2), token id (controlled?1)
+ pub NftItemList get(fn nft_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<NftItemType<T::CrossAccountId>>;
+ /// Collection id (controlled?2), owner (controlled?2)
+ pub FungibleItemList get(fn fungible_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => FungibleItemType;
+ /// Collection id (controlled?2), token id (controlled?1)
+ pub ReFungibleItemList get(fn refungible_item_id) config(): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<ReFungibleItemType<T::CrossAccountId>>;
+ //#endregion
- //#region Index list
- /// Collection id (controlled?2), tokens owner (controlled?2)
- pub AddressTokens get(fn address_tokens): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => Vec<TokenId>;
- //#endregion
+ //#region Index list
+ /// Collection id (controlled?2), tokens owner (controlled?2)
+ pub AddressTokens get(fn address_tokens): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) T::AccountId => Vec<TokenId>;
+ //#endregion
- //#region Tokens transfer rate limit baskets
- /// (Collection id (controlled?2), who created (real))
- /// TODO: Off chain worker should remove from this map when collection gets removed
- pub CreateItemBasket get(fn create_item_basket): map hasher(blake2_128_concat) (CollectionId, T::AccountId) => T::BlockNumber;
- /// Collection id (controlled?2), token id (controlled?2)
- pub NftTransferBasket get(fn nft_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => T::BlockNumber;
- /// Collection id (controlled?2), owning user (real)
- pub FungibleTransferBasket get(fn fungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => T::BlockNumber;
- /// Collection id (controlled?2), token id (controlled?2)
- pub ReFungibleTransferBasket get(fn refungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => T::BlockNumber;
- //#endregion
+ //#region Tokens transfer rate limit baskets
+ /// (Collection id (controlled?2), who created (real))
+ /// TODO: Off chain worker should remove from this map when collection gets removed
+ pub CreateItemBasket get(fn create_item_basket): map hasher(blake2_128_concat) (CollectionId, T::AccountId) => T::BlockNumber;
+ /// Collection id (controlled?2), token id (controlled?2)
+ pub NftTransferBasket get(fn nft_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => T::BlockNumber;
+ /// Collection id (controlled?2), owning user (real)
+ pub FungibleTransferBasket get(fn fungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(twox_64_concat) T::AccountId => T::BlockNumber;
+ /// Collection id (controlled?2), token id (controlled?2)
+ pub ReFungibleTransferBasket get(fn refungible_transfer_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => T::BlockNumber;
+ //#endregion
- /// Variable metadata sponsoring
- /// Collection id (controlled?2), token id (controlled?2)
- pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber> = None;
- }
- add_extra_genesis {
- build(|config: &GenesisConfig<T>| {
- // Modification of storage
- for (_num, _c) in &config.collection_id {
- <Module<T>>::init_collection(_c);
- }
+ /// Variable metadata sponsoring
+ /// Collection id (controlled?2), token id (controlled?2)
+ pub VariableMetaDataBasket get(fn variable_meta_data_basket): double_map hasher(blake2_128_concat) CollectionId, hasher(blake2_128_concat) TokenId => Option<T::BlockNumber> = None;
+ }
+ add_extra_genesis {
+ build(|config: &GenesisConfig<T>| {
+ // Modification of storage
+ for (_num, _c) in &config.collection_id {
+ <Module<T>>::init_collection(_c);
+ }
- for (_num, _c, _i) in &config.nft_item_id {
- <Module<T>>::init_nft_token(*_c, _i);
- }
+ for (_num, _c, _i) in &config.nft_item_id {
+ <Module<T>>::init_nft_token(*_c, _i);
+ }
- for (collection_id, account_id, fungible_item) in &config.fungible_item_id {
- <Module<T>>::init_fungible_token(*collection_id, &T::CrossAccountId::from_sub(account_id.clone()), fungible_item);
- }
+ for (collection_id, account_id, fungible_item) in &config.fungible_item_id {
+ <Module<T>>::init_fungible_token(*collection_id, &T::CrossAccountId::from_sub(account_id.clone()), fungible_item);
+ }
- for (_num, _c, _i) in &config.refungible_item_id {
- <Module<T>>::init_refungible_token(*_c, _i);
- }
- })
- }
+ for (_num, _c, _i) in &config.refungible_item_id {
+ <Module<T>>::init_refungible_token(*_c, _i);
+ }
+ })
+ }
}
decl_event!(
- pub enum Event<T>
- where
- AccountId = <T as frame_system::Config>::AccountId,
- CrossAccountId = <T as Config>::CrossAccountId,
- {
- /// New collection was created
- ///
- /// # Arguments
- ///
- /// * collection_id: Globally unique identifier of newly created collection.
- ///
- /// * mode: [CollectionMode] converted into u8.
- ///
- /// * account_id: Collection owner.
- CollectionCreated(CollectionId, u8, AccountId),
+ pub enum Event<T>
+ where
+ AccountId = <T as frame_system::Config>::AccountId,
+ CrossAccountId = <T as Config>::CrossAccountId,
+ {
+ /// New collection was created
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id: Globally unique identifier of newly created collection.
+ ///
+ /// * mode: [CollectionMode] converted into u8.
+ ///
+ /// * account_id: Collection owner.
+ CollectionCreated(CollectionId, u8, AccountId),
- /// New item was created.
- ///
- /// # Arguments
- ///
- /// * collection_id: Id of the collection where item was created.
- ///
- /// * item_id: Id of an item. Unique within the collection.
- ///
- /// * recipient: Owner of newly created item
- ItemCreated(CollectionId, TokenId, CrossAccountId),
+ /// New item was created.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id: Id of the collection where item was created.
+ ///
+ /// * item_id: Id of an item. Unique within the collection.
+ ///
+ /// * recipient: Owner of newly created item
+ ItemCreated(CollectionId, TokenId, CrossAccountId),
- /// Collection item was burned.
- ///
- /// # Arguments
- ///
- /// collection_id.
- ///
- /// item_id: Identifier of burned NFT.
- ItemDestroyed(CollectionId, TokenId),
+ /// Collection item was burned.
+ ///
+ /// # Arguments
+ ///
+ /// collection_id.
+ ///
+ /// item_id: Identifier of burned NFT.
+ ItemDestroyed(CollectionId, TokenId),
- /// Item was transferred
- ///
- /// * collection_id: Id of collection to which item is belong
- ///
- /// * item_id: Id of an item
- ///
- /// * sender: Original owner of item
- ///
- /// * recipient: New owner of item
- ///
- /// * amount: Always 1 for NFT
- Transfer(CollectionId, TokenId, CrossAccountId, CrossAccountId, u128),
+ /// Item was transferred
+ ///
+ /// * collection_id: Id of collection to which item is belong
+ ///
+ /// * item_id: Id of an item
+ ///
+ /// * sender: Original owner of item
+ ///
+ /// * recipient: New owner of item
+ ///
+ /// * amount: Always 1 for NFT
+ Transfer(CollectionId, TokenId, CrossAccountId, CrossAccountId, u128),
- /// * collection_id
- ///
- /// * item_id
- ///
- /// * sender
- ///
- /// * spender
- ///
- /// * amount
- Approved(CollectionId, TokenId, CrossAccountId, CrossAccountId, u128),
- }
+ /// * collection_id
+ ///
+ /// * item_id
+ ///
+ /// * sender
+ ///
+ /// * spender
+ ///
+ /// * amount
+ Approved(CollectionId, TokenId, CrossAccountId, CrossAccountId, u128),
+ }
);
decl_module! {
- pub struct Module<T: Config> for enum Call
- where
- origin: T::Origin
- {
- fn deposit_event() = default;
- type Error = Error<T>;
+ pub struct Module<T: Config> for enum Call
+ where
+ origin: T::Origin
+ {
+ fn deposit_event() = default;
+ type Error = Error<T>;
- fn on_initialize(_now: T::BlockNumber) -> Weight {
- 0
- }
+ fn on_initialize(_now: T::BlockNumber) -> Weight {
+ 0
+ }
- /// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner and admin of the collection are set to the address that signed the transaction. Both addresses can be changed later.
- ///
- /// # Permissions
- ///
- /// * Anyone.
- ///
- /// # Arguments
- ///
- /// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.
- ///
- /// * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.
- ///
- /// * token_prefix: UTF-8 string with token prefix.
- ///
- /// * mode: [CollectionMode] collection type and type dependent data.
- // returns collection ID
- #[weight = <T as Config>::WeightInfo::create_collection()]
- #[transactional]
- pub fn create_collection(origin,
- collection_name: Vec<u16>,
- collection_description: Vec<u16>,
- token_prefix: Vec<u8>,
- mode: CollectionMode) -> DispatchResult {
+ /// This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner and admin of the collection are set to the address that signed the transaction. Both addresses can be changed later.
+ ///
+ /// # Permissions
+ ///
+ /// * Anyone.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_name: UTF-16 string with collection name (limit 64 characters), will be stored as zero-terminated.
+ ///
+ /// * collection_description: UTF-16 string with collection description (limit 256 characters), will be stored as zero-terminated.
+ ///
+ /// * token_prefix: UTF-8 string with token prefix.
+ ///
+ /// * mode: [CollectionMode] collection type and type dependent data.
+ // returns collection ID
+ #[weight = <T as Config>::WeightInfo::create_collection()]
+ #[transactional]
+ pub fn create_collection(origin,
+ collection_name: Vec<u16>,
+ collection_description: Vec<u16>,
+ token_prefix: Vec<u8>,
+ mode: CollectionMode) -> DispatchResult {
- // Anyone can create a collection
- let who = ensure_signed(origin)?;
+ // Anyone can create a collection
+ let who = ensure_signed(origin)?;
- // Take a (non-refundable) deposit of collection creation
- let mut imbalance = <<<T as Config>::Currency as Currency<T::AccountId>>::PositiveImbalance>::zero();
- imbalance.subsume(<<T as Config>::Currency as Currency<T::AccountId>>::deposit_creating(
- &T::TreasuryAccountId::get(),
- T::CollectionCreationPrice::get(),
- ));
- <T as Config>::Currency::settle(
- &who,
- imbalance,
- WithdrawReasons::TRANSFER,
- ExistenceRequirement::KeepAlive,
- ).map_err(|_| Error::<T>::NoPermission)?;
+ // Take a (non-refundable) deposit of collection creation
+ let mut imbalance = <<<T as Config>::Currency as Currency<T::AccountId>>::PositiveImbalance>::zero();
+ imbalance.subsume(<<T as Config>::Currency as Currency<T::AccountId>>::deposit_creating(
+ &T::TreasuryAccountId::get(),
+ T::CollectionCreationPrice::get(),
+ ));
+ <T as Config>::Currency::settle(
+ &who,
+ imbalance,
+ WithdrawReasons::TRANSFER,
+ ExistenceRequirement::KeepAlive,
+ ).map_err(|_| Error::<T>::NoPermission)?;
- let decimal_points = match mode {
- CollectionMode::Fungible(points) => points,
- _ => 0
- };
+ let decimal_points = match mode {
+ CollectionMode::Fungible(points) => points,
+ _ => 0
+ };
- let chain_limit = ChainLimit::get();
+ let chain_limit = ChainLimit::get();
- let created_count = CreatedCollectionCount::get();
- let destroyed_count = DestroyedCollectionCount::get();
+ let created_count = CreatedCollectionCount::get();
+ let destroyed_count = DestroyedCollectionCount::get();
- // bound Total number of collections
- ensure!(created_count - destroyed_count < chain_limit.collection_numbers_limit, Error::<T>::TotalCollectionsLimitExceeded);
+ // bound Total number of collections
+ ensure!(created_count - destroyed_count < chain_limit.collection_numbers_limit, Error::<T>::TotalCollectionsLimitExceeded);
- // check params
- ensure!(decimal_points <= MAX_DECIMAL_POINTS, Error::<T>::CollectionDecimalPointLimitExceeded);
- ensure!(collection_name.len() <= 64, Error::<T>::CollectionNameLimitExceeded);
- ensure!(collection_description.len() <= 256, Error::<T>::CollectionDescriptionLimitExceeded);
- ensure!(token_prefix.len() <= 16, Error::<T>::CollectionTokenPrefixLimitExceeded);
+ // check params
+ ensure!(decimal_points <= MAX_DECIMAL_POINTS, Error::<T>::CollectionDecimalPointLimitExceeded);
+ ensure!(collection_name.len() <= 64, Error::<T>::CollectionNameLimitExceeded);
+ ensure!(collection_description.len() <= 256, Error::<T>::CollectionDescriptionLimitExceeded);
+ ensure!(token_prefix.len() <= 16, Error::<T>::CollectionTokenPrefixLimitExceeded);
- // Generate next collection ID
- let next_id = created_count
- .checked_add(1)
- .ok_or(Error::<T>::NumOverflow)?;
+ // Generate next collection ID
+ let next_id = created_count
+ .checked_add(1)
+ .ok_or(Error::<T>::NumOverflow)?;
- CreatedCollectionCount::put(next_id);
+ CreatedCollectionCount::put(next_id);
- let limits = CollectionLimits {
- sponsored_data_size: chain_limit.custom_data_limit,
- ..Default::default()
- };
+ let limits = CollectionLimits {
+ sponsored_data_size: chain_limit.custom_data_limit,
+ ..Default::default()
+ };
- // Create new collection
- let new_collection = Collection {
- owner: who.clone(),
- name: collection_name,
- mode: mode.clone(),
- mint_mode: false,
- access: AccessMode::Normal,
- description: collection_description,
- decimal_points: decimal_points,
- token_prefix: token_prefix,
- offchain_schema: Vec::new(),
- schema_version: SchemaVersion::ImageURL,
- sponsorship: SponsorshipState::Disabled,
- variable_on_chain_schema: Vec::new(),
- const_on_chain_schema: Vec::new(),
- limits,
- };
+ // Create new collection
+ let new_collection = Collection {
+ owner: who.clone(),
+ name: collection_name,
+ mode: mode.clone(),
+ mint_mode: false,
+ access: AccessMode::Normal,
+ description: collection_description,
+ decimal_points,
+ token_prefix,
+ offchain_schema: Vec::new(),
+ schema_version: SchemaVersion::ImageURL,
+ sponsorship: SponsorshipState::Disabled,
+ variable_on_chain_schema: Vec::new(),
+ const_on_chain_schema: Vec::new(),
+ limits,
+ };
- // Add new collection to map
- <CollectionById<T>>::insert(next_id, new_collection);
+ // Add new collection to map
+ <CollectionById<T>>::insert(next_id, new_collection);
- // call event
- Self::deposit_event(RawEvent::CollectionCreated(next_id, mode.into(), who));
+ // call event
+ Self::deposit_event(RawEvent::CollectionCreated(next_id, mode.id(), who));
- Ok(())
- }
+ Ok(())
+ }
- /// **DANGEROUS**: Destroys collection and all NFTs within this collection. Users irrecoverably lose their assets and may lose real money.
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- ///
- /// # Arguments
- ///
- /// * collection_id: collection to destroy.
- #[weight = <T as Config>::WeightInfo::destroy_collection()]
- #[transactional]
- pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {
+ /// **DANGEROUS**: Destroys collection and all NFTs within this collection. Users irrecoverably lose their assets and may lose real money.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id: collection to destroy.
+ #[weight = <T as Config>::WeightInfo::destroy_collection()]
+ #[transactional]
+ pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {
- let sender = ensure_signed(origin)?;
- let collection = Self::get_collection(collection_id)?;
- Self::check_owner_permissions(&collection, &sender)?;
- if !collection.limits.owner_can_destroy {
- fail!(Error::<T>::NoPermission);
- }
+ let sender = ensure_signed(origin)?;
+ let collection = Self::get_collection(collection_id)?;
+ Self::check_owner_permissions(&collection, &sender)?;
+ if !collection.limits.owner_can_destroy {
+ fail!(Error::<T>::NoPermission);
+ }
- <AddressTokens<T>>::remove_prefix(collection_id);
- <Allowances<T>>::remove_prefix(collection_id);
- <Balance<T>>::remove_prefix(collection_id);
- <ItemListIndex>::remove(collection_id);
- <AdminList<T>>::remove(collection_id);
- <CollectionById<T>>::remove(collection_id);
- <WhiteList<T>>::remove_prefix(collection_id);
+ <AddressTokens<T>>::remove_prefix(collection_id);
+ <Allowances<T>>::remove_prefix(collection_id);
+ <Balance<T>>::remove_prefix(collection_id);
+ <ItemListIndex>::remove(collection_id);
+ <AdminList<T>>::remove(collection_id);
+ <CollectionById<T>>::remove(collection_id);
+ <WhiteList<T>>::remove_prefix(collection_id);
- <NftItemList<T>>::remove_prefix(collection_id);
- <FungibleItemList<T>>::remove_prefix(collection_id);
- <ReFungibleItemList<T>>::remove_prefix(collection_id);
+ <NftItemList<T>>::remove_prefix(collection_id);
+ <FungibleItemList<T>>::remove_prefix(collection_id);
+ <ReFungibleItemList<T>>::remove_prefix(collection_id);
- <NftTransferBasket<T>>::remove_prefix(collection_id);
- <FungibleTransferBasket<T>>::remove_prefix(collection_id);
- <ReFungibleTransferBasket<T>>::remove_prefix(collection_id);
+ <NftTransferBasket<T>>::remove_prefix(collection_id);
+ <FungibleTransferBasket<T>>::remove_prefix(collection_id);
+ <ReFungibleTransferBasket<T>>::remove_prefix(collection_id);
- <VariableMetaDataBasket<T>>::remove_prefix(collection_id);
+ <VariableMetaDataBasket<T>>::remove_prefix(collection_id);
- DestroyedCollectionCount::put(DestroyedCollectionCount::get()
- .checked_add(1)
- .ok_or(Error::<T>::NumOverflow)?);
+ DestroyedCollectionCount::put(DestroyedCollectionCount::get()
+ .checked_add(1)
+ .ok_or(Error::<T>::NumOverflow)?);
- Ok(())
- }
+ Ok(())
+ }
- /// Add an address to white list.
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * address.
- #[weight = <T as Config>::WeightInfo::add_to_white_list()]
- #[transactional]
- pub fn add_to_white_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
+ /// Add an address to white list.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * address.
+ #[weight = <T as Config>::WeightInfo::add_to_white_list()]
+ #[transactional]
+ pub fn add_to_white_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
- Self::toggle_white_list_internal(
- &sender,
- &collection,
- &address,
- true,
- )?;
+ Self::toggle_white_list_internal(
+ &sender,
+ &collection,
+ &address,
+ true,
+ )?;
- Ok(())
- }
+ Ok(())
+ }
- /// Remove an address from white list.
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * address.
- #[weight = <T as Config>::WeightInfo::remove_from_white_list()]
- #[transactional]
- pub fn remove_from_white_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
+ /// Remove an address from white list.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * address.
+ #[weight = <T as Config>::WeightInfo::remove_from_white_list()]
+ #[transactional]
+ pub fn remove_from_white_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
- Self::toggle_white_list_internal(
- &sender,
- &collection,
- &address,
- false,
- )?;
+ Self::toggle_white_list_internal(
+ &sender,
+ &collection,
+ &address,
+ false,
+ )?;
- Ok(())
- }
+ Ok(())
+ }
- /// Toggle between normal and white list access for the methods with access for `Anyone`.
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * mode: [AccessMode]
- #[weight = <T as Config>::WeightInfo::set_public_access_mode()]
- #[transactional]
- pub fn set_public_access_mode(origin, collection_id: CollectionId, mode: AccessMode) -> DispatchResult
- {
- let sender = ensure_signed(origin)?;
+ /// Toggle between normal and white list access for the methods with access for `Anyone`.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * mode: [AccessMode]
+ #[weight = <T as Config>::WeightInfo::set_public_access_mode()]
+ #[transactional]
+ pub fn set_public_access_mode(origin, collection_id: CollectionId, mode: AccessMode) -> DispatchResult
+ {
+ let sender = ensure_signed(origin)?;
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_permissions(&target_collection, &sender)?;
- target_collection.access = mode;
- Self::save_collection(target_collection);
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_permissions(&target_collection, &sender)?;
+ target_collection.access = mode;
+ Self::save_collection(target_collection);
- Ok(())
- }
+ Ok(())
+ }
- /// Allows Anyone to create tokens if:
- /// * White List is enabled, and
- /// * Address is added to white list, and
- /// * This method was called with True parameter
- ///
- /// # Permissions
- /// * Collection Owner
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.
- #[weight = <T as Config>::WeightInfo::set_mint_permission()]
- #[transactional]
- pub fn set_mint_permission(origin, collection_id: CollectionId, mint_permission: bool) -> DispatchResult
- {
- let sender = ensure_signed(origin)?;
+ /// Allows Anyone to create tokens if:
+ /// * White List is enabled, and
+ /// * Address is added to white list, and
+ /// * This method was called with True parameter
+ ///
+ /// # Permissions
+ /// * Collection Owner
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.
+ #[weight = <T as Config>::WeightInfo::set_mint_permission()]
+ #[transactional]
+ pub fn set_mint_permission(origin, collection_id: CollectionId, mint_permission: bool) -> DispatchResult
+ {
+ let sender = ensure_signed(origin)?;
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_permissions(&target_collection, &sender)?;
- target_collection.mint_mode = mint_permission;
- Self::save_collection(target_collection);
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_permissions(&target_collection, &sender)?;
+ target_collection.mint_mode = mint_permission;
+ Self::save_collection(target_collection);
- Ok(())
- }
+ Ok(())
+ }
- /// Change the owner of the collection.
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * new_owner.
- #[weight = <T as Config>::WeightInfo::change_collection_owner()]
- #[transactional]
- pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult {
+ /// Change the owner of the collection.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * new_owner.
+ #[weight = <T as Config>::WeightInfo::change_collection_owner()]
+ #[transactional]
+ pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult {
- let sender = ensure_signed(origin)?;
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_permissions(&target_collection, &sender)?;
- target_collection.owner = new_owner;
- Self::save_collection(target_collection);
+ let sender = ensure_signed(origin)?;
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_permissions(&target_collection, &sender)?;
+ target_collection.owner = new_owner;
+ Self::save_collection(target_collection);
- Ok(())
- }
+ Ok(())
+ }
- /// Adds an admin of the Collection.
- /// NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership.
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- /// * Collection Admin.
- ///
- /// # Arguments
- ///
- /// * collection_id: ID of the Collection to add admin for.
- ///
- /// * new_admin_id: Address of new admin to add.
- #[weight = <T as Config>::WeightInfo::add_collection_admin()]
- #[transactional]
- pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
- Self::check_owner_or_admin_permissions(&collection, &sender)?;
- let mut admin_arr = <AdminList<T>>::get(collection_id);
+ /// Adds an admin of the Collection.
+ /// NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner.
+ /// * Collection Admin.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id: ID of the Collection to add admin for.
+ ///
+ /// * new_admin_id: Address of new admin to add.
+ #[weight = <T as Config>::WeightInfo::add_collection_admin()]
+ #[transactional]
+ pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
+ Self::check_owner_or_admin_permissions(&collection, &sender)?;
+ let mut admin_arr = <AdminList<T>>::get(collection_id);
- match admin_arr.binary_search(&new_admin_id) {
- Ok(_) => {},
- Err(idx) => {
- let limits = ChainLimit::get();
- ensure!(admin_arr.len() < limits.collections_admins_limit as usize, Error::<T>::CollectionAdminsLimitExceeded);
- admin_arr.insert(idx, new_admin_id);
- <AdminList<T>>::insert(collection_id, admin_arr);
- }
- }
- Ok(())
- }
+ match admin_arr.binary_search(&new_admin_id) {
+ Ok(_) => {},
+ Err(idx) => {
+ let limits = ChainLimit::get();
+ ensure!(admin_arr.len() < limits.collections_admins_limit as usize, Error::<T>::CollectionAdminsLimitExceeded);
+ admin_arr.insert(idx, new_admin_id);
+ <AdminList<T>>::insert(collection_id, admin_arr);
+ }
+ }
+ Ok(())
+ }
- /// Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- /// * Collection Admin.
- ///
- /// # Arguments
- ///
- /// * collection_id: ID of the Collection to remove admin for.
- ///
- /// * account_id: Address of admin to remove.
- #[weight = <T as Config>::WeightInfo::remove_collection_admin()]
- #[transactional]
- pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
- Self::check_owner_or_admin_permissions(&collection, &sender)?;
- let mut admin_arr = <AdminList<T>>::get(collection_id);
+ /// Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner.
+ /// * Collection Admin.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id: ID of the Collection to remove admin for.
+ ///
+ /// * account_id: Address of admin to remove.
+ #[weight = <T as Config>::WeightInfo::remove_collection_admin()]
+ #[transactional]
+ pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
+ Self::check_owner_or_admin_permissions(&collection, &sender)?;
+ let mut admin_arr = <AdminList<T>>::get(collection_id);
- match admin_arr.binary_search(&account_id) {
- Ok(idx) => {
- admin_arr.remove(idx);
- <AdminList<T>>::insert(collection_id, admin_arr);
- },
- Err(_) => {}
- }
- Ok(())
- }
+ if let Ok(idx) = admin_arr.binary_search(&account_id) {
+ admin_arr.remove(idx);
+ <AdminList<T>>::insert(collection_id, admin_arr);
+ }
+ Ok(())
+ }
- /// # Permissions
- ///
- /// * Collection Owner
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * new_sponsor.
- #[weight = <T as Config>::WeightInfo::set_collection_sponsor()]
- #[transactional]
- pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult {
- let sender = ensure_signed(origin)?;
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_permissions(&target_collection, &sender)?;
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * new_sponsor.
+ #[weight = <T as Config>::WeightInfo::set_collection_sponsor()]
+ #[transactional]
+ pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult {
+ let sender = ensure_signed(origin)?;
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_permissions(&target_collection, &sender)?;
- target_collection.sponsorship = SponsorshipState::Unconfirmed(new_sponsor);
- Self::save_collection(target_collection);
+ target_collection.sponsorship = SponsorshipState::Unconfirmed(new_sponsor);
+ Self::save_collection(target_collection);
- Ok(())
- }
+ Ok(())
+ }
- /// # Permissions
- ///
- /// * Sponsor.
- ///
- /// # Arguments
- ///
- /// * collection_id.
- #[weight = <T as Config>::WeightInfo::confirm_sponsorship()]
- #[transactional]
- pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult {
- let sender = ensure_signed(origin)?;
+ /// # Permissions
+ ///
+ /// * Sponsor.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ #[weight = <T as Config>::WeightInfo::confirm_sponsorship()]
+ #[transactional]
+ pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult {
+ let sender = ensure_signed(origin)?;
- let mut target_collection = Self::get_collection(collection_id)?;
- ensure!(
- target_collection.sponsorship.pending_sponsor() == Some(&sender),
- Error::<T>::ConfirmUnsetSponsorFail
- );
+ let mut target_collection = Self::get_collection(collection_id)?;
+ ensure!(
+ target_collection.sponsorship.pending_sponsor() == Some(&sender),
+ Error::<T>::ConfirmUnsetSponsorFail
+ );
- target_collection.sponsorship = SponsorshipState::Confirmed(sender);
- Self::save_collection(target_collection);
+ target_collection.sponsorship = SponsorshipState::Confirmed(sender);
+ Self::save_collection(target_collection);
- Ok(())
- }
+ Ok(())
+ }
- /// Switch back to pay-per-own-transaction model.
- ///
- /// # Permissions
- ///
- /// * Collection owner.
- ///
- /// # Arguments
- ///
- /// * collection_id.
- #[weight = <T as Config>::WeightInfo::remove_collection_sponsor()]
- #[transactional]
- pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult {
- let sender = ensure_signed(origin)?;
+ /// Switch back to pay-per-own-transaction model.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection owner.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ #[weight = <T as Config>::WeightInfo::remove_collection_sponsor()]
+ #[transactional]
+ pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult {
+ let sender = ensure_signed(origin)?;
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_permissions(&target_collection, &sender)?;
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_permissions(&target_collection, &sender)?;
- target_collection.sponsorship = SponsorshipState::Disabled;
- Self::save_collection(target_collection);
+ target_collection.sponsorship = SponsorshipState::Disabled;
+ Self::save_collection(target_collection);
- Ok(())
- }
+ Ok(())
+ }
- /// This method creates a concrete instance of NFT Collection created with CreateCollection method.
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- /// * Collection Admin.
- /// * Anyone if
- /// * White List is enabled, and
- /// * Address is added to white list, and
- /// * MintPermission is enabled (see SetMintPermission method)
- ///
- /// # Arguments
- ///
- /// * collection_id: ID of the collection.
- ///
- /// * owner: Address, initial owner of the NFT.
- ///
- /// * data: Token data to store on chain.
- // #[weight =
- // (130_000_000 as Weight)
- // .saturating_add((2135 as Weight).saturating_mul((properties.len() as u64) as Weight))
- // .saturating_add(RocksDbWeight::get().reads(10 as Weight))
- // .saturating_add(RocksDbWeight::get().writes(8 as Weight))]
+ /// This method creates a concrete instance of NFT Collection created with CreateCollection method.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner.
+ /// * Collection Admin.
+ /// * Anyone if
+ /// * White List is enabled, and
+ /// * Address is added to white list, and
+ /// * MintPermission is enabled (see SetMintPermission method)
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id: ID of the collection.
+ ///
+ /// * owner: Address, initial owner of the NFT.
+ ///
+ /// * data: Token data to store on chain.
+ // #[weight =
+ // (130_000_000 as Weight)
+ // .saturating_add((2135 as Weight).saturating_mul((properties.len() as u64) as Weight))
+ // .saturating_add(RocksDbWeight::get().reads(10 as Weight))
+ // .saturating_add(RocksDbWeight::get().writes(8 as Weight))]
- #[weight = <T as Config>::WeightInfo::create_item(data.len())]
- #[transactional]
- pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
+ #[weight = <T as Config>::WeightInfo::create_item(data.data_size())]
+ #[transactional]
+ pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
- Self::create_item_internal(&sender, &collection, &owner, data)?;
+ Self::create_item_internal(&sender, &collection, &owner, data)?;
- Self::submit_logs(collection)?;
- Ok(())
- }
+ Self::submit_logs(collection)?;
+ Ok(())
+ }
- /// This method creates multiple items in a collection created with CreateCollection method.
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- /// * Collection Admin.
- /// * Anyone if
- /// * White List is enabled, and
- /// * Address is added to white list, and
- /// * MintPermission is enabled (see SetMintPermission method)
- ///
- /// # Arguments
- ///
- /// * collection_id: ID of the collection.
- ///
- /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].
- ///
- /// * owner: Address, initial owner of the NFT.
- #[weight = <T as Config>::WeightInfo::create_item(items_data.into_iter()
- .map(|data| { data.len() })
- .sum())]
- #[transactional]
- pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResult {
+ /// This method creates multiple items in a collection created with CreateCollection method.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner.
+ /// * Collection Admin.
+ /// * Anyone if
+ /// * White List is enabled, and
+ /// * Address is added to white list, and
+ /// * MintPermission is enabled (see SetMintPermission method)
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id: ID of the collection.
+ ///
+ /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].
+ ///
+ /// * owner: Address, initial owner of the NFT.
+ #[weight = <T as Config>::WeightInfo::create_item(items_data.iter()
+ .map(|data| { data.data_size() })
+ .sum())]
+ #[transactional]
+ pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResult {
- ensure!(items_data.len() > 0, Error::<T>::EmptyArgument);
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
+ ensure!(!items_data.is_empty(), Error::<T>::EmptyArgument);
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
- Self::create_multiple_items_internal(&sender, &collection, &owner, items_data)?;
+ Self::create_multiple_items_internal(&sender, &collection, &owner, items_data)?;
- Self::submit_logs(collection)?;
- Ok(())
- }
+ Self::submit_logs(collection)?;
+ Ok(())
+ }
- /// Destroys a concrete instance of NFT.
- ///
- /// # Permissions
- ///
- /// * Collection Owner.
- /// * Collection Admin.
- /// * Current NFT Owner.
- ///
- /// # Arguments
- ///
- /// * collection_id: ID of the collection.
- ///
- /// * item_id: ID of NFT to burn.
- #[weight = <T as Config>::WeightInfo::burn_item()]
- #[transactional]
- pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
+ /// Destroys a concrete instance of NFT.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner.
+ /// * Collection Admin.
+ /// * Current NFT Owner.
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id: ID of the collection.
+ ///
+ /// * item_id: ID of NFT to burn.
+ #[weight = <T as Config>::WeightInfo::burn_item()]
+ #[transactional]
+ pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let target_collection = Self::get_collection(collection_id)?;
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let target_collection = Self::get_collection(collection_id)?;
- Self::burn_item_internal(&sender, &target_collection, item_id, value)?;
+ Self::burn_item_internal(&sender, &target_collection, item_id, value)?;
- Self::submit_logs(target_collection)?;
- Ok(())
- }
+ Self::submit_logs(target_collection)?;
+ Ok(())
+ }
- /// Change ownership of the token.
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- /// * Current NFT owner
- ///
- /// # Arguments
- ///
- /// * recipient: Address of token recipient.
- ///
- /// * collection_id.
- ///
- /// * item_id: ID of the item
- /// * Non-Fungible Mode: Required.
- /// * Fungible Mode: Ignored.
- /// * Re-Fungible Mode: Required.
- ///
- /// * value: Amount to transfer.
- /// * Non-Fungible Mode: Ignored
- /// * Fungible Mode: Must specify transferred amount
- /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
- #[weight = <T as Config>::WeightInfo::transfer()]
- #[transactional]
- pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
+ /// Change ownership of the token.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ /// * Current NFT owner
+ ///
+ /// # Arguments
+ ///
+ /// * recipient: Address of token recipient.
+ ///
+ /// * collection_id.
+ ///
+ /// * item_id: ID of the item
+ /// * Non-Fungible Mode: Required.
+ /// * Fungible Mode: Ignored.
+ /// * Re-Fungible Mode: Required.
+ ///
+ /// * value: Amount to transfer.
+ /// * Non-Fungible Mode: Ignored
+ /// * Fungible Mode: Must specify transferred amount
+ /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
+ #[weight = <T as Config>::WeightInfo::transfer()]
+ #[transactional]
+ pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
- Self::transfer_internal(&sender, &recipient, &collection, item_id, value)?;
+ Self::transfer_internal(&sender, &recipient, &collection, item_id, value)?;
- Self::submit_logs(collection)?;
- Ok(())
- }
+ Self::submit_logs(collection)?;
+ Ok(())
+ }
- /// Set, change, or remove approved address to transfer the ownership of the NFT.
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- /// * Current NFT owner
- ///
- /// # Arguments
- ///
- /// * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).
- ///
- /// * collection_id.
- ///
- /// * item_id: ID of the item.
- #[weight = <T as Config>::WeightInfo::approve()]
- #[transactional]
- pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
+ /// Set, change, or remove approved address to transfer the ownership of the NFT.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ /// * Current NFT owner
+ ///
+ /// # Arguments
+ ///
+ /// * approved: Address that is approved to transfer this NFT or zero (if needed to remove approval).
+ ///
+ /// * collection_id.
+ ///
+ /// * item_id: ID of the item.
+ #[weight = <T as Config>::WeightInfo::approve()]
+ #[transactional]
+ pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
- Self::approve_internal(&sender, &spender, &collection, item_id, amount)?;
+ Self::approve_internal(&sender, &spender, &collection, item_id, amount)?;
- Self::submit_logs(collection)?;
- Ok(())
- }
-
- /// Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.
- ///
- /// # Permissions
- /// * Collection Owner
- /// * Collection Admin
- /// * Current NFT owner
- /// * Address approved by current NFT owner
- ///
- /// # Arguments
- ///
- /// * from: Address that owns token.
- ///
- /// * recipient: Address of token recipient.
- ///
- /// * collection_id.
- ///
- /// * item_id: ID of the item.
- ///
- /// * value: Amount to transfer.
- #[weight = <T as Config>::WeightInfo::transfer_from()]
- #[transactional]
- pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let collection = Self::get_collection(collection_id)?;
+ Self::submit_logs(collection)?;
+ Ok(())
+ }
- Self::transfer_from_internal(&sender, &from, &recipient, &collection, item_id, value)?;
+ /// Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.
+ ///
+ /// # Permissions
+ /// * Collection Owner
+ /// * Collection Admin
+ /// * Current NFT owner
+ /// * Address approved by current NFT owner
+ ///
+ /// # Arguments
+ ///
+ /// * from: Address that owns token.
+ ///
+ /// * recipient: Address of token recipient.
+ ///
+ /// * collection_id.
+ ///
+ /// * item_id: ID of the item.
+ ///
+ /// * value: Amount to transfer.
+ #[weight = <T as Config>::WeightInfo::transfer_from()]
+ #[transactional]
+ pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let collection = Self::get_collection(collection_id)?;
- Self::submit_logs(collection)?;
- Ok(())
- }
- // #[weight = 0]
- // // let no_perm_mes = "You do not have permissions to modify this collection";
- // // ensure!(<ApprovedList<T>>::contains_key((collection_id, item_id)), no_perm_mes);
- // // let list_itm = <ApprovedList<T>>::get((collection_id, item_id));
- // // ensure!(list_itm.contains(&new_owner.clone()), no_perm_mes);
+ Self::transfer_from_internal(&sender, &from, &recipient, &collection, item_id, value)?;
- // // // on_nft_received call
+ Self::submit_logs(collection)?;
+ Ok(())
+ }
+ // #[weight = 0]
+ // // let no_perm_mes = "You do not have permissions to modify this collection";
+ // // ensure!(<ApprovedList<T>>::contains_key((collection_id, item_id)), no_perm_mes);
+ // // let list_itm = <ApprovedList<T>>::get((collection_id, item_id));
+ // // ensure!(list_itm.contains(&new_owner.clone()), no_perm_mes);
- // // Self::transfer(origin, collection_id, item_id, new_owner)?;
+ // // // on_nft_received call
- // Ok(())
- // }
+ // // Self::transfer(origin, collection_id, item_id, new_owner)?;
- /// Set off-chain data schema.
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * schema: String representing the offchain data schema.
- #[weight = <T as Config>::WeightInfo::set_variable_meta_data()]
- #[transactional]
- pub fn set_variable_meta_data (
- origin,
- collection_id: CollectionId,
- item_id: TokenId,
- data: Vec<u8>
- ) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
-
- let collection = Self::get_collection(collection_id)?;
+ // Ok(())
+ // }
- Self::set_variable_meta_data_internal(&sender, &collection, item_id, data)?;
+ /// Set off-chain data schema.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * schema: String representing the offchain data schema.
+ #[weight = <T as Config>::WeightInfo::set_variable_meta_data()]
+ #[transactional]
+ pub fn set_variable_meta_data (
+ origin,
+ collection_id: CollectionId,
+ item_id: TokenId,
+ data: Vec<u8>
+ ) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- Ok(())
- }
-
- /// Set schema standard
- /// ImageURL
- /// Unique
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * schema: SchemaVersion: enum
- #[weight = <T as Config>::WeightInfo::set_schema_version()]
- #[transactional]
- pub fn set_schema_version(
- origin,
- collection_id: CollectionId,
- version: SchemaVersion
- ) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
- target_collection.schema_version = version;
- Self::save_collection(target_collection);
+ let collection = Self::get_collection(collection_id)?;
- Ok(())
- }
+ Self::set_variable_meta_data_internal(&sender, &collection, item_id, data)?;
- /// Set off-chain data schema.
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * schema: String representing the offchain data schema.
- #[weight = <T as Config>::WeightInfo::set_offchain_schema()]
- #[transactional]
- pub fn set_offchain_schema(
- origin,
- collection_id: CollectionId,
- schema: Vec<u8>
- ) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+ Ok(())
+ }
- // check schema limit
- ensure!(schema.len() as u32 <= ChainLimit::get().offchain_schema_limit, "");
+ /// Set schema standard
+ /// ImageURL
+ /// Unique
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * schema: SchemaVersion: enum
+ #[weight = <T as Config>::WeightInfo::set_schema_version()]
+ #[transactional]
+ pub fn set_schema_version(
+ origin,
+ collection_id: CollectionId,
+ version: SchemaVersion
+ ) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+ target_collection.schema_version = version;
+ Self::save_collection(target_collection);
- target_collection.offchain_schema = schema;
- Self::save_collection(target_collection);
+ Ok(())
+ }
- Ok(())
- }
+ /// Set off-chain data schema.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * schema: String representing the offchain data schema.
+ #[weight = <T as Config>::WeightInfo::set_offchain_schema()]
+ #[transactional]
+ pub fn set_offchain_schema(
+ origin,
+ collection_id: CollectionId,
+ schema: Vec<u8>
+ ) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+
+ // check schema limit
+ ensure!(schema.len() as u32 <= ChainLimit::get().offchain_schema_limit, "");
- /// Set const on-chain data schema.
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * schema: String representing the const on-chain data schema.
- #[weight = <T as Config>::WeightInfo::set_const_on_chain_schema()]
- #[transactional]
- pub fn set_const_on_chain_schema (
- origin,
- collection_id: CollectionId,
- schema: Vec<u8>
- ) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+ target_collection.offchain_schema = schema;
+ Self::save_collection(target_collection);
+
+ Ok(())
+ }
+
+ /// Set const on-chain data schema.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * schema: String representing the const on-chain data schema.
+ #[weight = <T as Config>::WeightInfo::set_const_on_chain_schema()]
+ #[transactional]
+ pub fn set_const_on_chain_schema (
+ origin,
+ collection_id: CollectionId,
+ schema: Vec<u8>
+ ) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
- // check schema limit
- ensure!(schema.len() as u32 <= ChainLimit::get().const_on_chain_schema_limit, "");
+ // check schema limit
+ ensure!(schema.len() as u32 <= ChainLimit::get().const_on_chain_schema_limit, "");
- target_collection.const_on_chain_schema = schema;
- Self::save_collection(target_collection);
+ target_collection.const_on_chain_schema = schema;
+ Self::save_collection(target_collection);
- Ok(())
- }
+ Ok(())
+ }
- /// Set variable on-chain data schema.
- ///
- /// # Permissions
- ///
- /// * Collection Owner
- /// * Collection Admin
- ///
- /// # Arguments
- ///
- /// * collection_id.
- ///
- /// * schema: String representing the variable on-chain data schema.
- #[weight = <T as Config>::WeightInfo::set_const_on_chain_schema()]
- #[transactional]
- pub fn set_variable_on_chain_schema (
- origin,
- collection_id: CollectionId,
- schema: Vec<u8>
- ) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
+ /// Set variable on-chain data schema.
+ ///
+ /// # Permissions
+ ///
+ /// * Collection Owner
+ /// * Collection Admin
+ ///
+ /// # Arguments
+ ///
+ /// * collection_id.
+ ///
+ /// * schema: String representing the variable on-chain data schema.
+ #[weight = <T as Config>::WeightInfo::set_const_on_chain_schema()]
+ #[transactional]
+ pub fn set_variable_on_chain_schema (
+ origin,
+ collection_id: CollectionId,
+ schema: Vec<u8>
+ ) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_or_admin_permissions(&target_collection, &sender)?;
- // check schema limit
- ensure!(schema.len() as u32 <= ChainLimit::get().variable_on_chain_schema_limit, "");
+ // check schema limit
+ ensure!(schema.len() as u32 <= ChainLimit::get().variable_on_chain_schema_limit, "");
- target_collection.variable_on_chain_schema = schema;
- Self::save_collection(target_collection);
+ target_collection.variable_on_chain_schema = schema;
+ Self::save_collection(target_collection);
- Ok(())
- }
+ Ok(())
+ }
- // Sudo permissions function
- #[weight = <T as Config>::WeightInfo::set_chain_limits()]
- #[transactional]
- pub fn set_chain_limits(
- origin,
- limits: ChainLimits
- ) -> DispatchResult {
+ // Sudo permissions function
+ #[weight = <T as Config>::WeightInfo::set_chain_limits()]
+ #[transactional]
+ pub fn set_chain_limits(
+ origin,
+ limits: ChainLimits
+ ) -> DispatchResult {
- #[cfg(not(feature = "runtime-benchmarks"))]
- ensure_root(origin)?;
+ #[cfg(not(feature = "runtime-benchmarks"))]
+ ensure_root(origin)?;
- <ChainLimit>::put(limits);
- Ok(())
- }
+ <ChainLimit>::put(limits);
+ Ok(())
+ }
- #[weight = <T as Config>::WeightInfo::set_collection_limits()]
- #[transactional]
- pub fn set_collection_limits(
- origin,
- collection_id: u32,
- new_limits: CollectionLimits<T::BlockNumber>,
- ) -> DispatchResult {
- let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
- let mut target_collection = Self::get_collection(collection_id)?;
- Self::check_owner_permissions(&target_collection, &sender.as_sub())?;
- let old_limits = &target_collection.limits;
- let chain_limits = ChainLimit::get();
+ #[weight = <T as Config>::WeightInfo::set_collection_limits()]
+ #[transactional]
+ pub fn set_collection_limits(
+ origin,
+ collection_id: u32,
+ new_limits: CollectionLimits<T::BlockNumber>,
+ ) -> DispatchResult {
+ let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
+ let mut target_collection = Self::get_collection(collection_id)?;
+ Self::check_owner_permissions(&target_collection, sender.as_sub())?;
+ let old_limits = &target_collection.limits;
+ let chain_limits = ChainLimit::get();
- // collection bounds
- ensure!(new_limits.sponsor_transfer_timeout <= MAX_SPONSOR_TIMEOUT &&
- new_limits.account_token_ownership_limit <= MAX_TOKEN_OWNERSHIP &&
- new_limits.sponsored_data_size <= chain_limits.custom_data_limit,
- Error::<T>::CollectionLimitBoundsExceeded);
+ // collection bounds
+ ensure!(new_limits.sponsor_transfer_timeout <= MAX_SPONSOR_TIMEOUT &&
+ new_limits.account_token_ownership_limit <= MAX_TOKEN_OWNERSHIP &&
+ new_limits.sponsored_data_size <= chain_limits.custom_data_limit,
+ Error::<T>::CollectionLimitBoundsExceeded);
- // token_limit check prev
- ensure!(old_limits.token_limit >= new_limits.token_limit, Error::<T>::CollectionTokenLimitExceeded);
- ensure!(new_limits.token_limit > 0, Error::<T>::CollectionTokenLimitExceeded);
+ // token_limit check prev
+ ensure!(old_limits.token_limit >= new_limits.token_limit, Error::<T>::CollectionTokenLimitExceeded);
+ ensure!(new_limits.token_limit > 0, Error::<T>::CollectionTokenLimitExceeded);
- ensure!(
- (old_limits.owner_can_transfer || !new_limits.owner_can_transfer) &&
- (old_limits.owner_can_destroy || !new_limits.owner_can_destroy),
- Error::<T>::OwnerPermissionsCantBeReverted,
- );
+ ensure!(
+ (old_limits.owner_can_transfer || !new_limits.owner_can_transfer) &&
+ (old_limits.owner_can_destroy || !new_limits.owner_can_destroy),
+ Error::<T>::OwnerPermissionsCantBeReverted,
+ );
- target_collection.limits = new_limits;
- Self::save_collection(target_collection);
+ target_collection.limits = new_limits;
+ Self::save_collection(target_collection);
- Ok(())
- }
- }
+ Ok(())
+ }
+ }
}
impl<T: Config> Module<T> {
- pub fn create_item_internal(sender: &T::CrossAccountId, collection: &CollectionHandle<T>, owner: &T::CrossAccountId, data: CreateItemData) -> DispatchResult {
- Self::can_create_items_in_collection(&collection, &sender, &owner, 1)?;
- Self::validate_create_item_args(&collection, &data)?;
- Self::create_item_no_validation(&collection, owner, data)?;
+ pub fn create_item_internal(
+ sender: &T::CrossAccountId,
+ collection: &CollectionHandle<T>,
+ owner: &T::CrossAccountId,
+ data: CreateItemData,
+ ) -> DispatchResult {
+ Self::can_create_items_in_collection(collection, sender, owner, 1)?;
+ Self::validate_create_item_args(collection, &data)?;
+ Self::create_item_no_validation(collection, owner, data)?;
- Ok(())
- }
+ Ok(())
+ }
- pub fn transfer_internal(sender: &T::CrossAccountId, recipient: &T::CrossAccountId, target_collection: &CollectionHandle<T>, item_id: TokenId, value: u128) -> DispatchResult {
- target_collection.consume_gas(2000000)?;
- // Limits check
- Self::is_correct_transfer(target_collection, &recipient)?;
+ pub fn transfer_internal(
+ sender: &T::CrossAccountId,
+ recipient: &T::CrossAccountId,
+ target_collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ value: u128,
+ ) -> DispatchResult {
+ target_collection.consume_gas(2000000)?;
+ // Limits check
+ Self::is_correct_transfer(target_collection, recipient)?;
- // Transfer permissions check
- ensure!(Self::is_item_owner(&sender, target_collection, item_id) ||
- Self::is_owner_or_admin_permissions(target_collection, &sender),
- Error::<T>::NoPermission);
+ // Transfer permissions check
+ ensure!(
+ Self::is_item_owner(sender, target_collection, item_id)
+ || Self::is_owner_or_admin_permissions(target_collection, sender),
+ Error::<T>::NoPermission
+ );
- if target_collection.access == AccessMode::WhiteList {
- Self::check_white_list(target_collection, &sender)?;
- Self::check_white_list(target_collection, &recipient)?;
- }
+ if target_collection.access == AccessMode::WhiteList {
+ Self::check_white_list(target_collection, sender)?;
+ Self::check_white_list(target_collection, recipient)?;
+ }
- match target_collection.mode
- {
- CollectionMode::NFT => Self::transfer_nft(target_collection, item_id, sender.clone(), recipient.clone())?,
- CollectionMode::Fungible(_) => Self::transfer_fungible(target_collection, value, &sender, &recipient)?,
- CollectionMode::ReFungible => Self::transfer_refungible(target_collection, item_id, value, sender.clone(), recipient.clone())?,
- _ => ()
- };
+ match target_collection.mode {
+ CollectionMode::NFT => Self::transfer_nft(
+ target_collection,
+ item_id,
+ sender.clone(),
+ recipient.clone(),
+ )?,
+ CollectionMode::Fungible(_) => {
+ Self::transfer_fungible(target_collection, value, sender, recipient)?
+ }
+ CollectionMode::ReFungible => Self::transfer_refungible(
+ target_collection,
+ item_id,
+ value,
+ sender.clone(),
+ recipient.clone(),
+ )?,
+ _ => (),
+ };
- Self::deposit_event(RawEvent::Transfer(target_collection.id, item_id, sender.clone(), recipient.clone(), value));
+ Self::deposit_event(RawEvent::Transfer(
+ target_collection.id,
+ item_id,
+ sender.clone(),
+ recipient.clone(),
+ value,
+ ));
- Ok(())
- }
+ Ok(())
+ }
pub fn approve_internal(
sender: &T::CrossAccountId,
spender: &T::CrossAccountId,
collection: &CollectionHandle<T>,
item_id: TokenId,
- amount: u128
+ amount: u128,
) -> DispatchResult {
- collection.consume_gas(2000000)?;
- Self::token_exists(&collection, item_id)?;
+ collection.consume_gas(2000000)?;
+ Self::token_exists(collection, item_id)?;
// Transfer permissions check
- let bypasses_limits = collection.limits.owner_can_transfer &&
- Self::is_owner_or_admin_permissions(
- &collection,
- &sender,
- );
+ let bypasses_limits = collection.limits.owner_can_transfer
+ && Self::is_owner_or_admin_permissions(collection, sender);
let allowance_limit = if bypasses_limits {
None
- } else if let Some(amount) = Self::owned_amount(
- &sender,
- &collection,
- item_id,
- ) {
+ } else if let Some(amount) = Self::owned_amount(sender, collection, item_id) {
Some(amount)
} else {
fail!(Error::<T>::NoPermission);
};
if collection.access == AccessMode::WhiteList {
- Self::check_white_list(&collection, &sender)?;
- Self::check_white_list(&collection, &spender)?;
+ Self::check_white_list(collection, sender)?;
+ Self::check_white_list(collection, spender)?;
}
let allowance: u128 = amount
- .checked_add(<Allowances<T>>::get(collection.id, (item_id, sender.as_sub(), spender.as_sub())))
+ .checked_add(<Allowances<T>>::get(
+ collection.id,
+ (item_id, sender.as_sub(), spender.as_sub()),
+ ))
.ok_or(Error::<T>::NumOverflow)?;
if let Some(limit) = allowance_limit {
ensure!(limit >= allowance, Error::<T>::TokenValueTooLow);
}
- <Allowances<T>>::insert(collection.id, (item_id, sender.as_sub(), spender.as_sub()), allowance);
+ <Allowances<T>>::insert(
+ collection.id,
+ (item_id, sender.as_sub(), spender.as_sub()),
+ allowance,
+ );
if matches!(collection.mode, CollectionMode::NFT) {
// TODO: NFT: only one owner may exist for token in ERC721
collection.log(ERC721Events::Approval {
- owner: *sender.as_eth(),
- approved: *spender.as_eth(),
- token_id: item_id.into(),
- });
+ owner: *sender.as_eth(),
+ approved: *spender.as_eth(),
+ token_id: item_id.into(),
+ });
}
if matches!(collection.mode, CollectionMode::Fungible(_)) {
// TODO: NFT: only one owner may exist for token in ERC20
collection.log(ERC20Events::Approval {
- owner: *sender.as_eth(),
- spender: *spender.as_eth(),
- value: allowance.into()
- });
+ owner: *sender.as_eth(),
+ spender: *spender.as_eth(),
+ value: allowance.into(),
+ });
}
- Self::deposit_event(RawEvent::Approved(collection.id, item_id, sender.clone(), spender.clone(), allowance));
+ Self::deposit_event(RawEvent::Approved(
+ collection.id,
+ item_id,
+ sender.clone(),
+ spender.clone(),
+ allowance,
+ ));
Ok(())
}
@@ -1369,879 +1406,981 @@
item_id: TokenId,
amount: u128,
) -> DispatchResult {
- collection.consume_gas(2000000)?;
+ collection.consume_gas(2000000)?;
// Check approval
- let approval: u128 = <Allowances<T>>::get(collection.id, (item_id, from.as_sub(), sender.as_sub()));
+ let approval: u128 =
+ <Allowances<T>>::get(collection.id, (item_id, from.as_sub(), sender.as_sub()));
// Limits check
- Self::is_correct_transfer(&collection, &recipient)?;
+ Self::is_correct_transfer(collection, recipient)?;
// Transfer permissions check
ensure!(
- approval >= amount ||
- (
- collection.limits.owner_can_transfer &&
- Self::is_owner_or_admin_permissions(&collection, &sender)
- ),
+ approval >= amount
+ || (collection.limits.owner_can_transfer
+ && Self::is_owner_or_admin_permissions(collection, sender)),
Error::<T>::NoPermission
);
if collection.access == AccessMode::WhiteList {
- Self::check_white_list(&collection, &sender)?;
- Self::check_white_list(&collection, &recipient)?;
+ Self::check_white_list(collection, sender)?;
+ Self::check_white_list(collection, recipient)?;
}
// Reduce approval by transferred amount or remove if remaining approval drops to 0
let allowance = approval.saturating_sub(amount);
if allowance > 0 {
- <Allowances<T>>::insert(collection.id, (item_id, from.as_sub(), sender.as_sub()), allowance);
+ <Allowances<T>>::insert(
+ collection.id,
+ (item_id, from.as_sub(), sender.as_sub()),
+ allowance,
+ );
} else {
<Allowances<T>>::remove(collection.id, (item_id, from.as_sub(), sender.as_sub()));
}
match collection.mode {
CollectionMode::NFT => {
- Self::transfer_nft(&collection, item_id, from.clone(), recipient.clone())?
+ Self::transfer_nft(collection, item_id, from.clone(), recipient.clone())?
}
CollectionMode::Fungible(_) => {
- Self::transfer_fungible(&collection, amount, &from, &recipient)?
- }
- CollectionMode::ReFungible => {
- Self::transfer_refungible(&collection, item_id, amount, from.clone(), recipient.clone())?
+ Self::transfer_fungible(collection, amount, from, recipient)?
}
- _ => ()
+ CollectionMode::ReFungible => Self::transfer_refungible(
+ collection,
+ item_id,
+ amount,
+ from.clone(),
+ recipient.clone(),
+ )?,
+ _ => (),
};
if matches!(collection.mode, CollectionMode::Fungible(_)) {
collection.log(ERC20Events::Approval {
- owner: *from.as_eth(),
- spender: *sender.as_eth(),
- value: allowance.into()
- });
+ owner: *from.as_eth(),
+ spender: *sender.as_eth(),
+ value: allowance.into(),
+ });
}
Ok(())
}
- pub fn set_variable_meta_data_internal(
- sender: &T::CrossAccountId,
- collection: &CollectionHandle<T>,
- item_id: TokenId,
- data: Vec<u8>,
- ) -> DispatchResult {
- Self::token_exists(&collection, item_id)?;
+ pub fn set_variable_meta_data_internal(
+ sender: &T::CrossAccountId,
+ collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ data: Vec<u8>,
+ ) -> DispatchResult {
+ Self::token_exists(collection, item_id)?;
- ensure!(ChainLimit::get().custom_data_limit >= data.len() as u32, Error::<T>::TokenVariableDataLimitExceeded);
+ ensure!(
+ ChainLimit::get().custom_data_limit >= data.len() as u32,
+ Error::<T>::TokenVariableDataLimitExceeded
+ );
- // Modify permissions check
- ensure!(Self::is_item_owner(&sender, &collection, item_id) ||
- Self::is_owner_or_admin_permissions(&collection, &sender),
- Error::<T>::NoPermission);
+ // Modify permissions check
+ ensure!(
+ Self::is_item_owner(sender, collection, item_id)
+ || Self::is_owner_or_admin_permissions(collection, sender),
+ Error::<T>::NoPermission
+ );
- match collection.mode
- {
- CollectionMode::NFT => Self::set_nft_variable_data(&collection, item_id, data)?,
- CollectionMode::ReFungible => Self::set_re_fungible_variable_data(&collection, item_id, data)?,
- CollectionMode::Fungible(_) => fail!(Error::<T>::CantStoreMetadataInFungibleTokens),
- _ => fail!(Error::<T>::UnexpectedCollectionType)
- };
+ match collection.mode {
+ CollectionMode::NFT => Self::set_nft_variable_data(collection, item_id, data)?,
+ CollectionMode::ReFungible => {
+ Self::set_re_fungible_variable_data(collection, item_id, data)?
+ }
+ CollectionMode::Fungible(_) => fail!(Error::<T>::CantStoreMetadataInFungibleTokens),
+ _ => fail!(Error::<T>::UnexpectedCollectionType),
+ };
- Ok(())
- }
+ Ok(())
+ }
- pub fn create_multiple_items_internal(
- sender: &T::CrossAccountId,
- collection: &CollectionHandle<T>,
- owner: &T::CrossAccountId,
- items_data: Vec<CreateItemData>,
- ) -> DispatchResult {
- Self::can_create_items_in_collection(&collection, &sender, &owner, items_data.len() as u32)?;
+ pub fn create_multiple_items_internal(
+ sender: &T::CrossAccountId,
+ collection: &CollectionHandle<T>,
+ owner: &T::CrossAccountId,
+ items_data: Vec<CreateItemData>,
+ ) -> DispatchResult {
+ Self::can_create_items_in_collection(collection, sender, owner, items_data.len() as u32)?;
- for data in &items_data {
- Self::validate_create_item_args(&collection, data)?;
- }
- for data in &items_data {
- Self::create_item_no_validation(&collection, owner, data.clone())?;
- }
+ for data in &items_data {
+ Self::validate_create_item_args(collection, data)?;
+ }
+ for data in &items_data {
+ Self::create_item_no_validation(collection, owner, data.clone())?;
+ }
- Ok(())
- }
+ Ok(())
+ }
- pub fn burn_item_internal(
- sender: &T::CrossAccountId,
- collection: &CollectionHandle<T>,
- item_id: TokenId,
- value: u128,
- ) -> DispatchResult {
- ensure!(
- Self::is_item_owner(&sender, &collection, item_id) ||
- (
- collection.limits.owner_can_transfer &&
- Self::is_owner_or_admin_permissions(&collection, &sender)
- ),
- Error::<T>::NoPermission
- );
+ pub fn burn_item_internal(
+ sender: &T::CrossAccountId,
+ collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ value: u128,
+ ) -> DispatchResult {
+ ensure!(
+ Self::is_item_owner(sender, collection, item_id)
+ || (collection.limits.owner_can_transfer
+ && Self::is_owner_or_admin_permissions(collection, sender)),
+ Error::<T>::NoPermission
+ );
- if collection.access == AccessMode::WhiteList {
- Self::check_white_list(&collection, &sender)?;
- }
+ if collection.access == AccessMode::WhiteList {
+ Self::check_white_list(collection, sender)?;
+ }
- match collection.mode
- {
- CollectionMode::NFT => Self::burn_nft_item(&collection, item_id)?,
- CollectionMode::Fungible(_) => Self::burn_fungible_item(&sender, &collection, value)?,
- CollectionMode::ReFungible => Self::burn_refungible_item(&collection, item_id, &sender)?,
- _ => ()
- };
+ match collection.mode {
+ CollectionMode::NFT => Self::burn_nft_item(collection, item_id)?,
+ CollectionMode::Fungible(_) => Self::burn_fungible_item(sender, collection, value)?,
+ CollectionMode::ReFungible => Self::burn_refungible_item(collection, item_id, sender)?,
+ _ => (),
+ };
- Ok(())
- }
+ Ok(())
+ }
- pub fn toggle_white_list_internal(
- sender: &T::CrossAccountId,
- collection: &CollectionHandle<T>,
- address: &T::CrossAccountId,
- whitelisted: bool,
- ) -> DispatchResult {
- Self::check_owner_or_admin_permissions(&collection, &sender)?;
+ pub fn toggle_white_list_internal(
+ sender: &T::CrossAccountId,
+ collection: &CollectionHandle<T>,
+ address: &T::CrossAccountId,
+ whitelisted: bool,
+ ) -> DispatchResult {
+ Self::check_owner_or_admin_permissions(collection, sender)?;
- if whitelisted {
- <WhiteList<T>>::insert(collection.id, address.as_sub(), true);
- } else {
- <WhiteList<T>>::remove(collection.id, address.as_sub());
- }
+ if whitelisted {
+ <WhiteList<T>>::insert(collection.id, address.as_sub(), true);
+ } else {
+ <WhiteList<T>>::remove(collection.id, address.as_sub());
+ }
- Ok(())
- }
+ Ok(())
+ }
- fn is_correct_transfer(collection: &CollectionHandle<T>, recipient: &T::CrossAccountId) -> DispatchResult {
- let collection_id = collection.id;
+ fn is_correct_transfer(
+ collection: &CollectionHandle<T>,
+ recipient: &T::CrossAccountId,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- // check token limit and account token limit
- let account_items: u32 = <AddressTokens<T>>::get(collection_id, recipient.as_sub()).len() as u32;
- ensure!(collection.limits.account_token_ownership_limit > account_items, Error::<T>::AccountTokenLimitExceeded);
-
- Ok(())
- }
+ // check token limit and account token limit
+ let account_items: u32 =
+ <AddressTokens<T>>::get(collection_id, recipient.as_sub()).len() as u32;
+ ensure!(
+ collection.limits.account_token_ownership_limit > account_items,
+ Error::<T>::AccountTokenLimitExceeded
+ );
- fn can_create_items_in_collection(collection: &CollectionHandle<T>, sender: &T::CrossAccountId, owner: &T::CrossAccountId, amount: u32) -> DispatchResult {
- let collection_id = collection.id;
+ Ok(())
+ }
- // check token limit and account token limit
- let total_items: u32 = ItemListIndex::get(collection_id)
- .checked_add(amount)
- .ok_or(Error::<T>::CollectionTokenLimitExceeded)?;
- let account_items: u32 = (<AddressTokens<T>>::get(collection_id, owner.as_sub()).len() as u32)
- .checked_add(amount)
- .ok_or(Error::<T>::AccountTokenLimitExceeded)?;
- ensure!(collection.limits.token_limit >= total_items, Error::<T>::CollectionTokenLimitExceeded);
- ensure!(collection.limits.account_token_ownership_limit >= account_items, Error::<T>::AccountTokenLimitExceeded);
+ fn can_create_items_in_collection(
+ collection: &CollectionHandle<T>,
+ sender: &T::CrossAccountId,
+ owner: &T::CrossAccountId,
+ amount: u32,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- if !Self::is_owner_or_admin_permissions(collection, &sender) {
- ensure!(collection.mint_mode == true, Error::<T>::PublicMintingNotAllowed);
- Self::check_white_list(collection, owner)?;
- Self::check_white_list(collection, sender)?;
- }
+ // check token limit and account token limit
+ let total_items: u32 = ItemListIndex::get(collection_id)
+ .checked_add(amount)
+ .ok_or(Error::<T>::CollectionTokenLimitExceeded)?;
+ let account_items: u32 = (<AddressTokens<T>>::get(collection_id, owner.as_sub()).len()
+ as u32)
+ .checked_add(amount)
+ .ok_or(Error::<T>::AccountTokenLimitExceeded)?;
+ ensure!(
+ collection.limits.token_limit >= total_items,
+ Error::<T>::CollectionTokenLimitExceeded
+ );
+ ensure!(
+ collection.limits.account_token_ownership_limit >= account_items,
+ Error::<T>::AccountTokenLimitExceeded
+ );
- Ok(())
- }
+ if !Self::is_owner_or_admin_permissions(collection, sender) {
+ ensure!(collection.mint_mode, Error::<T>::PublicMintingNotAllowed);
+ Self::check_white_list(collection, owner)?;
+ Self::check_white_list(collection, sender)?;
+ }
- fn validate_create_item_args(target_collection: &CollectionHandle<T>, data: &CreateItemData) -> DispatchResult {
- match target_collection.mode
- {
- CollectionMode::NFT => {
- if let CreateItemData::NFT(data) = data {
- // check sizes
- ensure!(ChainLimit::get().custom_data_limit >= data.const_data.len() as u32, Error::<T>::TokenConstDataLimitExceeded);
- ensure!(ChainLimit::get().custom_data_limit >= data.variable_data.len() as u32, Error::<T>::TokenVariableDataLimitExceeded);
- } else {
- fail!(Error::<T>::NotNftDataUsedToMintNftCollectionToken);
- }
- },
- CollectionMode::Fungible(_) => {
- if let CreateItemData::Fungible(_) = data {
- } else {
- fail!(Error::<T>::NotFungibleDataUsedToMintFungibleCollectionToken);
- }
- },
- CollectionMode::ReFungible => {
- if let CreateItemData::ReFungible(data) = data {
+ Ok(())
+ }
- // check sizes
- ensure!(ChainLimit::get().custom_data_limit >= data.const_data.len() as u32, Error::<T>::TokenConstDataLimitExceeded);
- ensure!(ChainLimit::get().custom_data_limit >= data.variable_data.len() as u32, Error::<T>::TokenVariableDataLimitExceeded);
+ fn validate_create_item_args(
+ target_collection: &CollectionHandle<T>,
+ data: &CreateItemData,
+ ) -> DispatchResult {
+ match target_collection.mode {
+ CollectionMode::NFT => {
+ if let CreateItemData::NFT(data) = data {
+ // check sizes
+ ensure!(
+ ChainLimit::get().custom_data_limit >= data.const_data.len() as u32,
+ Error::<T>::TokenConstDataLimitExceeded
+ );
+ ensure!(
+ ChainLimit::get().custom_data_limit >= data.variable_data.len() as u32,
+ Error::<T>::TokenVariableDataLimitExceeded
+ );
+ } else {
+ fail!(Error::<T>::NotNftDataUsedToMintNftCollectionToken);
+ }
+ }
+ CollectionMode::Fungible(_) => {
+ if let CreateItemData::Fungible(_) = data {
+ } else {
+ fail!(Error::<T>::NotFungibleDataUsedToMintFungibleCollectionToken);
+ }
+ }
+ CollectionMode::ReFungible => {
+ if let CreateItemData::ReFungible(data) = data {
+ // check sizes
+ ensure!(
+ ChainLimit::get().custom_data_limit >= data.const_data.len() as u32,
+ Error::<T>::TokenConstDataLimitExceeded
+ );
+ ensure!(
+ ChainLimit::get().custom_data_limit >= data.variable_data.len() as u32,
+ Error::<T>::TokenVariableDataLimitExceeded
+ );
- // Check refungibility limits
- ensure!(data.pieces <= MAX_REFUNGIBLE_PIECES, Error::<T>::WrongRefungiblePieces);
- ensure!(data.pieces > 0, Error::<T>::WrongRefungiblePieces);
- } else {
- fail!(Error::<T>::NotReFungibleDataUsedToMintReFungibleCollectionToken);
- }
- },
- _ => { fail!(Error::<T>::UnexpectedCollectionType); }
- };
+ // Check refungibility limits
+ ensure!(
+ data.pieces <= MAX_REFUNGIBLE_PIECES,
+ Error::<T>::WrongRefungiblePieces
+ );
+ ensure!(data.pieces > 0, Error::<T>::WrongRefungiblePieces);
+ } else {
+ fail!(Error::<T>::NotReFungibleDataUsedToMintReFungibleCollectionToken);
+ }
+ }
+ _ => {
+ fail!(Error::<T>::UnexpectedCollectionType);
+ }
+ };
- Ok(())
- }
+ Ok(())
+ }
- fn create_item_no_validation(collection: &CollectionHandle<T>, owner: &T::CrossAccountId, data: CreateItemData) -> DispatchResult {
- match data
- {
- CreateItemData::NFT(data) => {
- let item = NftItemType {
- owner: owner.clone(),
- const_data: data.const_data,
- variable_data: data.variable_data
- };
+ fn create_item_no_validation(
+ collection: &CollectionHandle<T>,
+ owner: &T::CrossAccountId,
+ data: CreateItemData,
+ ) -> DispatchResult {
+ match data {
+ CreateItemData::NFT(data) => {
+ let item = NftItemType {
+ owner: owner.clone(),
+ const_data: data.const_data,
+ variable_data: data.variable_data,
+ };
- Self::add_nft_item(collection, item)?;
- },
- CreateItemData::Fungible(data) => {
- Self::add_fungible_item(collection, &owner, data.value)?;
- },
- CreateItemData::ReFungible(data) => {
- let mut owner_list = Vec::new();
- owner_list.push(Ownership {owner: owner.clone(), fraction: data.pieces});
+ Self::add_nft_item(collection, item)?;
+ }
+ CreateItemData::Fungible(data) => {
+ Self::add_fungible_item(collection, owner, data.value)?;
+ }
+ CreateItemData::ReFungible(data) => {
+ let owner_list = vec![Ownership {
+ owner: owner.clone(),
+ fraction: data.pieces,
+ }];
- let item = ReFungibleItemType {
- owner: owner_list,
- const_data: data.const_data,
- variable_data: data.variable_data
- };
+ let item = ReFungibleItemType {
+ owner: owner_list,
+ const_data: data.const_data,
+ variable_data: data.variable_data,
+ };
- Self::add_refungible_item(collection, item)?;
- }
- };
+ Self::add_refungible_item(collection, item)?;
+ }
+ };
- Ok(())
- }
+ Ok(())
+ }
- fn add_fungible_item(collection: &CollectionHandle<T>, owner: &T::CrossAccountId, value: u128) -> DispatchResult {
- let collection_id = collection.id;
+ fn add_fungible_item(
+ collection: &CollectionHandle<T>,
+ owner: &T::CrossAccountId,
+ value: u128,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- // Does new owner already have an account?
- let balance: u128 = <FungibleItemList<T>>::get(collection_id, owner.as_sub()).value;
+ // Does new owner already have an account?
+ let balance: u128 = <FungibleItemList<T>>::get(collection_id, owner.as_sub()).value;
- // Mint
- let item = FungibleItemType {
- value: balance.checked_add(value).ok_or(Error::<T>::NumOverflow)?,
- };
- <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), item);
+ // Mint
+ let item = FungibleItemType {
+ value: balance.checked_add(value).ok_or(Error::<T>::NumOverflow)?,
+ };
+ <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), item);
- // Update balance
- let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
- .checked_add(value)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+ // Update balance
+ let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
+ .checked_add(value)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
- Self::deposit_event(RawEvent::ItemCreated(collection_id, 0, owner.clone()));
- Ok(())
- }
+ Self::deposit_event(RawEvent::ItemCreated(collection_id, 0, owner.clone()));
+ Ok(())
+ }
- fn add_refungible_item(collection: &CollectionHandle<T>, item: ReFungibleItemType<T::CrossAccountId>) -> DispatchResult {
- let collection_id = collection.id;
+ fn add_refungible_item(
+ collection: &CollectionHandle<T>,
+ item: ReFungibleItemType<T::CrossAccountId>,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- let current_index = <ItemListIndex>::get(collection_id)
- .checked_add(1)
- .ok_or(Error::<T>::NumOverflow)?;
- let itemcopy = item.clone();
+ let current_index = <ItemListIndex>::get(collection_id)
+ .checked_add(1)
+ .ok_or(Error::<T>::NumOverflow)?;
+ let itemcopy = item.clone();
- ensure!(
- item.owner.len() == 1,
- Error::<T>::BadCreateRefungibleCall,
- );
- let item_owner = item.owner.first().expect("only one owner is defined");
+ ensure!(item.owner.len() == 1, Error::<T>::BadCreateRefungibleCall,);
+ let item_owner = item.owner.first().expect("only one owner is defined");
- let value = item_owner.fraction;
- let owner = item_owner.owner.clone();
+ let value = item_owner.fraction;
+ let owner = item_owner.owner.clone();
- Self::add_token_index(collection_id, current_index, &owner)?;
+ Self::add_token_index(collection_id, current_index, &owner)?;
- <ItemListIndex>::insert(collection_id, current_index);
- <ReFungibleItemList<T>>::insert(collection_id, current_index, itemcopy);
+ <ItemListIndex>::insert(collection_id, current_index);
+ <ReFungibleItemList<T>>::insert(collection_id, current_index, itemcopy);
- // Update balance
- let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
- .checked_add(value)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+ // Update balance
+ let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
+ .checked_add(value)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
- Self::deposit_event(RawEvent::ItemCreated(collection_id, current_index, owner));
- Ok(())
- }
+ Self::deposit_event(RawEvent::ItemCreated(collection_id, current_index, owner));
+ Ok(())
+ }
- fn add_nft_item(collection: &CollectionHandle<T>, item: NftItemType<T::CrossAccountId>) -> DispatchResult {
- let collection_id = collection.id;
+ fn add_nft_item(
+ collection: &CollectionHandle<T>,
+ item: NftItemType<T::CrossAccountId>,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- let current_index = <ItemListIndex>::get(collection_id)
- .checked_add(1)
- .ok_or(Error::<T>::NumOverflow)?;
+ let current_index = <ItemListIndex>::get(collection_id)
+ .checked_add(1)
+ .ok_or(Error::<T>::NumOverflow)?;
- let item_owner = item.owner.clone();
- Self::add_token_index(collection_id, current_index, &item.owner)?;
+ let item_owner = item.owner.clone();
+ Self::add_token_index(collection_id, current_index, &item.owner)?;
- <ItemListIndex>::insert(collection_id, current_index);
- <NftItemList<T>>::insert(collection_id, current_index, item);
+ <ItemListIndex>::insert(collection_id, current_index);
+ <NftItemList<T>>::insert(collection_id, current_index, item);
- // Update balance
- let new_balance = <Balance<T>>::get(collection_id, item_owner.as_sub())
- .checked_add(1)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, item_owner.as_sub(), new_balance);
+ // Update balance
+ let new_balance = <Balance<T>>::get(collection_id, item_owner.as_sub())
+ .checked_add(1)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, item_owner.as_sub(), new_balance);
- collection.log(ERC721Events::Transfer {
- from: H160::default(),
- to: *item_owner.as_eth(),
- token_id: current_index.into(),
- });
- Self::deposit_event(RawEvent::ItemCreated(collection_id, current_index, item_owner));
- Ok(())
- }
+ collection.log(ERC721Events::Transfer {
+ from: H160::default(),
+ to: *item_owner.as_eth(),
+ token_id: current_index.into(),
+ });
+ Self::deposit_event(RawEvent::ItemCreated(
+ collection_id,
+ current_index,
+ item_owner,
+ ));
+ Ok(())
+ }
- fn burn_refungible_item(
- collection: &CollectionHandle<T>,
- item_id: TokenId,
- owner: &T::CrossAccountId,
- ) -> DispatchResult {
- let collection_id = collection.id;
+ fn burn_refungible_item(
+ collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ owner: &T::CrossAccountId,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- let mut token = <ReFungibleItemList<T>>::get(collection_id, item_id)
- .ok_or(Error::<T>::TokenNotFound)?;
- let rft_balance = token
- .owner
- .iter()
- .find(|&i| i.owner == *owner)
- .ok_or(Error::<T>::TokenNotFound)?;
- Self::remove_token_index(collection_id, item_id, owner)?;
+ let mut token = <ReFungibleItemList<T>>::get(collection_id, item_id)
+ .ok_or(Error::<T>::TokenNotFound)?;
+ let rft_balance = token
+ .owner
+ .iter()
+ .find(|&i| i.owner == *owner)
+ .ok_or(Error::<T>::TokenNotFound)?;
+ Self::remove_token_index(collection_id, item_id, owner)?;
- // update balance
- let new_balance = <Balance<T>>::get(collection_id, rft_balance.owner.as_sub())
- .checked_sub(rft_balance.fraction)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, rft_balance.owner.as_sub(), new_balance);
+ // update balance
+ let new_balance = <Balance<T>>::get(collection_id, rft_balance.owner.as_sub())
+ .checked_sub(rft_balance.fraction)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, rft_balance.owner.as_sub(), new_balance);
- // Re-create owners list with sender removed
- let index = token
- .owner
- .iter()
- .position(|i| i.owner == *owner)
- .expect("owned item is exists");
- token.owner.remove(index);
- let owner_count = token.owner.len();
+ // Re-create owners list with sender removed
+ let index = token
+ .owner
+ .iter()
+ .position(|i| i.owner == *owner)
+ .expect("owned item is exists");
+ token.owner.remove(index);
+ let owner_count = token.owner.len();
- // Burn the token completely if this was the last (only) owner
- if owner_count == 0 {
- <ReFungibleItemList<T>>::remove(collection_id, item_id);
- <VariableMetaDataBasket<T>>::remove(collection_id, item_id);
- }
- else {
- <ReFungibleItemList<T>>::insert(collection_id, item_id, token);
- }
+ // Burn the token completely if this was the last (only) owner
+ if owner_count == 0 {
+ <ReFungibleItemList<T>>::remove(collection_id, item_id);
+ <VariableMetaDataBasket<T>>::remove(collection_id, item_id);
+ } else {
+ <ReFungibleItemList<T>>::insert(collection_id, item_id, token);
+ }
- Ok(())
- }
+ Ok(())
+ }
- fn burn_nft_item(collection: &CollectionHandle<T>, item_id: TokenId) -> DispatchResult {
- let collection_id = collection.id;
+ fn burn_nft_item(collection: &CollectionHandle<T>, item_id: TokenId) -> DispatchResult {
+ let collection_id = collection.id;
- let item = <NftItemList<T>>::get(collection_id, item_id)
- .ok_or(Error::<T>::TokenNotFound)?;
- Self::remove_token_index(collection_id, item_id, &item.owner)?;
+ let item =
+ <NftItemList<T>>::get(collection_id, item_id).ok_or(Error::<T>::TokenNotFound)?;
+ Self::remove_token_index(collection_id, item_id, &item.owner)?;
- // update balance
- let new_balance = <Balance<T>>::get(collection_id, item.owner.as_sub())
- .checked_sub(1)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, item.owner.as_sub(), new_balance);
- <NftItemList<T>>::remove(collection_id, item_id);
- <VariableMetaDataBasket<T>>::remove(collection_id, item_id);
+ // update balance
+ let new_balance = <Balance<T>>::get(collection_id, item.owner.as_sub())
+ .checked_sub(1)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, item.owner.as_sub(), new_balance);
+ <NftItemList<T>>::remove(collection_id, item_id);
+ <VariableMetaDataBasket<T>>::remove(collection_id, item_id);
- Self::deposit_event(RawEvent::ItemDestroyed(collection.id, item_id));
- Ok(())
- }
+ Self::deposit_event(RawEvent::ItemDestroyed(collection.id, item_id));
+ Ok(())
+ }
- fn burn_fungible_item(owner: &T::CrossAccountId, collection: &CollectionHandle<T>, value: u128) -> DispatchResult {
- let collection_id = collection.id;
+ fn burn_fungible_item(
+ owner: &T::CrossAccountId,
+ collection: &CollectionHandle<T>,
+ value: u128,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- let mut balance = <FungibleItemList<T>>::get(collection_id, owner.as_sub());
- ensure!(balance.value >= value, Error::<T>::TokenValueNotEnough);
+ let mut balance = <FungibleItemList<T>>::get(collection_id, owner.as_sub());
+ ensure!(balance.value >= value, Error::<T>::TokenValueNotEnough);
- // update balance
- let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
- .checked_sub(value)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+ // update balance
+ let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
+ .checked_sub(value)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
- if balance.value - value > 0 {
- balance.value -= value;
- <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), balance);
- }
- else {
- <FungibleItemList<T>>::remove(collection_id, owner.as_sub());
- }
+ if balance.value - value > 0 {
+ balance.value -= value;
+ <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), balance);
+ } else {
+ <FungibleItemList<T>>::remove(collection_id, owner.as_sub());
+ }
- collection.log(ERC20Events::Transfer {
- from: *owner.as_eth(),
- to: H160::default(),
- value: value.into(),
- });
- Ok(())
- }
+ collection.log(ERC20Events::Transfer {
+ from: *owner.as_eth(),
+ to: H160::default(),
+ value: value.into(),
+ });
+ Ok(())
+ }
- pub fn get_collection(collection_id: CollectionId) -> Result<CollectionHandle<T>, sp_runtime::DispatchError> {
- Ok(<CollectionHandle<T>>::get(collection_id)
- .ok_or(Error::<T>::CollectionNotFound)?)
- }
+ pub fn get_collection(
+ collection_id: CollectionId,
+ ) -> Result<CollectionHandle<T>, sp_runtime::DispatchError> {
+ Ok(<CollectionHandle<T>>::get(collection_id).ok_or(Error::<T>::CollectionNotFound)?)
+ }
- fn save_collection(collection: CollectionHandle<T>) {
- <CollectionById<T>>::insert(collection.id, collection.into_inner());
- }
+ fn save_collection(collection: CollectionHandle<T>) {
+ <CollectionById<T>>::insert(collection.id, collection.into_inner());
+ }
- pub fn submit_logs(collection: CollectionHandle<T>) -> DispatchResult {
- if collection.logs.is_empty() {
- return Ok(())
- }
- T::EthereumTransactionSender::submit_logs_transaction(
- eth::generate_transaction(collection.id, T::EthereumChainId::get()),
- collection.logs.retrieve_logs(),
- )
- }
+ pub fn submit_logs(collection: CollectionHandle<T>) -> DispatchResult {
+ if collection.logs.is_empty() {
+ return Ok(());
+ }
+ T::EthereumTransactionSender::submit_logs_transaction(
+ eth::generate_transaction(collection.id, T::EthereumChainId::get()),
+ collection.logs.retrieve_logs(),
+ )
+ }
- fn check_owner_permissions(target_collection: &CollectionHandle<T>, subject: &T::AccountId) -> DispatchResult {
- ensure!(
- *subject == target_collection.owner,
- Error::<T>::NoPermission
- );
+ fn check_owner_permissions(
+ target_collection: &CollectionHandle<T>,
+ subject: &T::AccountId,
+ ) -> DispatchResult {
+ ensure!(
+ *subject == target_collection.owner,
+ Error::<T>::NoPermission
+ );
- Ok(())
- }
+ Ok(())
+ }
- fn is_owner_or_admin_permissions(collection: &CollectionHandle<T>, subject: &T::CrossAccountId) -> bool {
- *subject.as_sub() == collection.owner || <AdminList<T>>::get(collection.id).contains(&subject)
- }
+ fn is_owner_or_admin_permissions(
+ collection: &CollectionHandle<T>,
+ subject: &T::CrossAccountId,
+ ) -> bool {
+ *subject.as_sub() == collection.owner
+ || <AdminList<T>>::get(collection.id).contains(subject)
+ }
- fn check_owner_or_admin_permissions(
- collection: &CollectionHandle<T>,
- subject: &T::CrossAccountId,
- ) -> DispatchResult {
- ensure!(Self::is_owner_or_admin_permissions(collection, subject), Error::<T>::NoPermission);
+ fn check_owner_or_admin_permissions(
+ collection: &CollectionHandle<T>,
+ subject: &T::CrossAccountId,
+ ) -> DispatchResult {
+ ensure!(
+ Self::is_owner_or_admin_permissions(collection, subject),
+ Error::<T>::NoPermission
+ );
- Ok(())
- }
+ Ok(())
+ }
- fn owned_amount(
- subject: &T::CrossAccountId,
- target_collection: &CollectionHandle<T>,
- item_id: TokenId,
- ) -> Option<u128> {
- let collection_id = target_collection.id;
+ fn owned_amount(
+ subject: &T::CrossAccountId,
+ target_collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ ) -> Option<u128> {
+ let collection_id = target_collection.id;
- match target_collection.mode {
- CollectionMode::NFT => (<NftItemList<T>>::get(collection_id, item_id)?.owner == *subject)
- .then(|| 1),
- CollectionMode::Fungible(_) => Some(<FungibleItemList<T>>::get(collection_id, &subject.as_sub())
- .value),
- CollectionMode::ReFungible => <ReFungibleItemList<T>>::get(collection_id, item_id)?
- .owner
- .iter()
- .find(|i| i.owner == *subject)
- .map(|i| i.fraction),
- CollectionMode::Invalid => None,
- }
- }
+ match target_collection.mode {
+ CollectionMode::NFT => {
+ (<NftItemList<T>>::get(collection_id, item_id)?.owner == *subject).then(|| 1)
+ }
+ CollectionMode::Fungible(_) => {
+ Some(<FungibleItemList<T>>::get(collection_id, &subject.as_sub()).value)
+ }
+ CollectionMode::ReFungible => <ReFungibleItemList<T>>::get(collection_id, item_id)?
+ .owner
+ .iter()
+ .find(|i| i.owner == *subject)
+ .map(|i| i.fraction),
+ CollectionMode::Invalid => None,
+ }
+ }
- fn is_item_owner(subject: &T::CrossAccountId, target_collection: &CollectionHandle<T>, item_id: TokenId) -> bool {
- match target_collection.mode {
- CollectionMode::Fungible(_) => true,
- _ => Self::owned_amount(&subject, target_collection, item_id).is_some(),
- }
- }
+ fn is_item_owner(
+ subject: &T::CrossAccountId,
+ target_collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ ) -> bool {
+ match target_collection.mode {
+ CollectionMode::Fungible(_) => true,
+ _ => Self::owned_amount(subject, target_collection, item_id).is_some(),
+ }
+ }
- fn check_white_list(collection: &CollectionHandle<T>, address: &T::CrossAccountId) -> DispatchResult {
- let collection_id = collection.id;
+ fn check_white_list(
+ collection: &CollectionHandle<T>,
+ address: &T::CrossAccountId,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- let mes = Error::<T>::AddresNotInWhiteList;
- ensure!(<WhiteList<T>>::contains_key(collection_id, address.as_sub()), mes);
+ let mes = Error::<T>::AddresNotInWhiteList;
+ ensure!(
+ <WhiteList<T>>::contains_key(collection_id, address.as_sub()),
+ mes
+ );
- Ok(())
- }
+ Ok(())
+ }
- /// Check if token exists. In case of Fungible, check if there is an entry for
- /// the owner in fungible balances double map
- fn token_exists(
- target_collection: &CollectionHandle<T>,
- item_id: TokenId,
- ) -> DispatchResult {
- let collection_id = target_collection.id;
- let exists = match target_collection.mode
- {
- CollectionMode::NFT => <NftItemList<T>>::contains_key(collection_id, item_id),
- CollectionMode::Fungible(_) => true,
- CollectionMode::ReFungible => <ReFungibleItemList<T>>::contains_key(collection_id, item_id),
- _ => false
- };
+ /// Check if token exists. In case of Fungible, check if there is an entry for
+ /// the owner in fungible balances double map
+ fn token_exists(target_collection: &CollectionHandle<T>, item_id: TokenId) -> DispatchResult {
+ let collection_id = target_collection.id;
+ let exists = match target_collection.mode {
+ CollectionMode::NFT => <NftItemList<T>>::contains_key(collection_id, item_id),
+ CollectionMode::Fungible(_) => true,
+ CollectionMode::ReFungible => {
+ <ReFungibleItemList<T>>::contains_key(collection_id, item_id)
+ }
+ _ => false,
+ };
- ensure!(exists == true, Error::<T>::TokenNotFound);
- Ok(())
- }
+ ensure!(exists, Error::<T>::TokenNotFound);
+ Ok(())
+ }
- fn transfer_fungible(
- collection: &CollectionHandle<T>,
- value: u128,
- owner: &T::CrossAccountId,
- recipient: &T::CrossAccountId,
- ) -> DispatchResult {
- let collection_id = collection.id;
+ fn transfer_fungible(
+ collection: &CollectionHandle<T>,
+ value: u128,
+ owner: &T::CrossAccountId,
+ recipient: &T::CrossAccountId,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
- let mut balance = <FungibleItemList<T>>::get(collection_id, owner.as_sub());
- ensure!(balance.value >= value, Error::<T>::TokenValueTooLow);
+ let mut balance = <FungibleItemList<T>>::get(collection_id, owner.as_sub());
+ ensure!(balance.value >= value, Error::<T>::TokenValueTooLow);
- // Send balance to recipient (updates balanceOf of recipient)
- Self::add_fungible_item(collection, recipient, value)?;
+ // Send balance to recipient (updates balanceOf of recipient)
+ Self::add_fungible_item(collection, recipient, value)?;
- // update balanceOf of sender
- <Balance<T>>::insert(collection_id, owner.as_sub(), balance.value - value);
+ // update balanceOf of sender
+ <Balance<T>>::insert(collection_id, owner.as_sub(), balance.value - value);
- // Reduce or remove sender
- if balance.value == value {
- <FungibleItemList<T>>::remove(collection_id, owner.as_sub());
- }
- else {
- balance.value -= value;
- <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), balance);
- }
+ // Reduce or remove sender
+ if balance.value == value {
+ <FungibleItemList<T>>::remove(collection_id, owner.as_sub());
+ } else {
+ balance.value -= value;
+ <FungibleItemList<T>>::insert(collection_id, owner.as_sub(), balance);
+ }
- collection.log(ERC20Events::Transfer {
- from: *owner.as_eth(),
- to: *recipient.as_eth(),
- value: value.into(),
- });
- Self::deposit_event(RawEvent::Transfer(collection.id, 1, owner.clone(), recipient.clone(), value));
+ collection.log(ERC20Events::Transfer {
+ from: *owner.as_eth(),
+ to: *recipient.as_eth(),
+ value: value.into(),
+ });
+ Self::deposit_event(RawEvent::Transfer(
+ collection.id,
+ 1,
+ owner.clone(),
+ recipient.clone(),
+ value,
+ ));
- Ok(())
- }
+ Ok(())
+ }
- fn transfer_refungible(
- collection: &CollectionHandle<T>,
- item_id: TokenId,
- value: u128,
- owner: T::CrossAccountId,
- new_owner: T::CrossAccountId,
- ) -> DispatchResult {
- let collection_id = collection.id;
- let full_item = <ReFungibleItemList<T>>::get(collection_id, item_id)
- .ok_or(Error::<T>::TokenNotFound)?;
+ fn transfer_refungible(
+ collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ value: u128,
+ owner: T::CrossAccountId,
+ new_owner: T::CrossAccountId,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
+ let full_item = <ReFungibleItemList<T>>::get(collection_id, item_id)
+ .ok_or(Error::<T>::TokenNotFound)?;
- let item = full_item
- .owner
- .iter()
- .filter(|i| i.owner == owner)
- .next()
- .ok_or(Error::<T>::TokenNotFound)?;
- let amount = item.fraction;
+ let item = full_item
+ .owner
+ .iter()
+ .find(|i| i.owner == owner)
+ .ok_or(Error::<T>::TokenNotFound)?;
+ let amount = item.fraction;
- ensure!(amount >= value, Error::<T>::TokenValueTooLow);
+ ensure!(amount >= value, Error::<T>::TokenValueTooLow);
- // update balance
- let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.as_sub())
- .checked_sub(value)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, item.owner.as_sub(), balance_old_owner);
+ // update balance
+ let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.as_sub())
+ .checked_sub(value)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, item.owner.as_sub(), balance_old_owner);
- let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.as_sub())
- .checked_add(value)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, new_owner.as_sub(), balance_new_owner);
+ let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.as_sub())
+ .checked_add(value)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, new_owner.as_sub(), balance_new_owner);
- let old_owner = item.owner.clone();
- let new_owner_has_account = full_item.owner.iter().any(|i| i.owner == new_owner);
+ let old_owner = item.owner.clone();
+ let new_owner_has_account = full_item.owner.iter().any(|i| i.owner == new_owner);
- // transfer
- if amount == value && !new_owner_has_account {
- // change owner
- // new owner do not have account
- let mut new_full_item = full_item.clone();
- new_full_item
- .owner
- .iter_mut()
- .find(|i| i.owner == owner)
- .expect("old owner does present in refungible")
- .owner = new_owner.clone();
- <ReFungibleItemList<T>>::insert(collection_id, item_id, new_full_item);
+ let mut new_full_item = full_item.clone();
+ // transfer
+ if amount == value && !new_owner_has_account {
+ // change owner
+ // new owner do not have account
+ new_full_item
+ .owner
+ .iter_mut()
+ .find(|i| i.owner == owner)
+ .expect("old owner does present in refungible")
+ .owner = new_owner.clone();
+ <ReFungibleItemList<T>>::insert(collection_id, item_id, new_full_item);
- // update index collection
- Self::move_token_index(collection_id, item_id, &old_owner, &new_owner)?;
- } else {
- let mut new_full_item = full_item.clone();
- new_full_item
- .owner
- .iter_mut()
- .find(|i| i.owner == owner)
- .expect("old owner does present in refungible")
- .fraction -= value;
+ // update index collection
+ Self::move_token_index(collection_id, item_id, &old_owner, &new_owner)?;
+ } else {
+ new_full_item
+ .owner
+ .iter_mut()
+ .find(|i| i.owner == owner)
+ .expect("old owner does present in refungible")
+ .fraction -= value;
- // separate amount
- if new_owner_has_account {
- // new owner has account
- new_full_item
- .owner
- .iter_mut()
- .find(|i| i.owner == new_owner)
- .expect("new owner has account")
- .fraction += value;
- } else {
- // new owner do not have account
- new_full_item.owner.push(Ownership {
- owner: new_owner.clone(),
- fraction: value,
- });
- Self::add_token_index(collection_id, item_id, &new_owner)?;
- }
+ // separate amount
+ if new_owner_has_account {
+ // new owner has account
+ new_full_item
+ .owner
+ .iter_mut()
+ .find(|i| i.owner == new_owner)
+ .expect("new owner has account")
+ .fraction += value;
+ } else {
+ // new owner do not have account
+ new_full_item.owner.push(Ownership {
+ owner: new_owner.clone(),
+ fraction: value,
+ });
+ Self::add_token_index(collection_id, item_id, &new_owner)?;
+ }
- <ReFungibleItemList<T>>::insert(collection_id, item_id, new_full_item);
- }
+ <ReFungibleItemList<T>>::insert(collection_id, item_id, new_full_item);
+ }
- Self::deposit_event(RawEvent::Transfer(collection.id, item_id, owner, new_owner, amount));
+ Self::deposit_event(RawEvent::Transfer(
+ collection.id,
+ item_id,
+ owner,
+ new_owner,
+ amount,
+ ));
- Ok(())
- }
+ Ok(())
+ }
- fn transfer_nft(
- collection: &CollectionHandle<T>,
- item_id: TokenId,
- sender: T::CrossAccountId,
- new_owner: T::CrossAccountId,
- ) -> DispatchResult {
- let collection_id = collection.id;
- let mut item = <NftItemList<T>>::get(collection_id, item_id)
- .ok_or(Error::<T>::TokenNotFound)?;
+ fn transfer_nft(
+ collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ sender: T::CrossAccountId,
+ new_owner: T::CrossAccountId,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
+ let mut item =
+ <NftItemList<T>>::get(collection_id, item_id).ok_or(Error::<T>::TokenNotFound)?;
- ensure!(
- sender == item.owner,
- Error::<T>::MustBeTokenOwner
- );
+ ensure!(sender == item.owner, Error::<T>::MustBeTokenOwner);
- // update balance
- let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.as_sub())
- .checked_sub(1)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, item.owner.as_sub(), balance_old_owner);
+ // update balance
+ let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.as_sub())
+ .checked_sub(1)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, item.owner.as_sub(), balance_old_owner);
- let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.as_sub())
- .checked_add(1)
- .ok_or(Error::<T>::NumOverflow)?;
- <Balance<T>>::insert(collection_id, new_owner.as_sub(), balance_new_owner);
+ let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.as_sub())
+ .checked_add(1)
+ .ok_or(Error::<T>::NumOverflow)?;
+ <Balance<T>>::insert(collection_id, new_owner.as_sub(), balance_new_owner);
- // change owner
- let old_owner = item.owner.clone();
- item.owner = new_owner.clone();
- <NftItemList<T>>::insert(collection_id, item_id, item);
+ // change owner
+ let old_owner = item.owner.clone();
+ item.owner = new_owner.clone();
+ <NftItemList<T>>::insert(collection_id, item_id, item);
- // update index collection
- Self::move_token_index(collection_id, item_id, &old_owner, &new_owner)?;
+ // update index collection
+ Self::move_token_index(collection_id, item_id, &old_owner, &new_owner)?;
- collection.log(ERC721Events::Transfer {
- from: *sender.as_eth(),
- to: *new_owner.as_eth(),
- token_id: item_id.into(),
- });
- Self::deposit_event(RawEvent::Transfer(collection.id, item_id, sender, new_owner, 1));
+ collection.log(ERC721Events::Transfer {
+ from: *sender.as_eth(),
+ to: *new_owner.as_eth(),
+ token_id: item_id.into(),
+ });
+ Self::deposit_event(RawEvent::Transfer(
+ collection.id,
+ item_id,
+ sender,
+ new_owner,
+ 1,
+ ));
- Ok(())
- }
-
- fn set_re_fungible_variable_data(
- collection: &CollectionHandle<T>,
- item_id: TokenId,
- data: Vec<u8>
- ) -> DispatchResult {
- let collection_id = collection.id;
- let mut item = <ReFungibleItemList<T>>::get(collection_id, item_id)
- .ok_or(Error::<T>::TokenNotFound)?;
+ Ok(())
+ }
- item.variable_data = data;
+ fn set_re_fungible_variable_data(
+ collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ data: Vec<u8>,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
+ let mut item = <ReFungibleItemList<T>>::get(collection_id, item_id)
+ .ok_or(Error::<T>::TokenNotFound)?;
- <ReFungibleItemList<T>>::insert(collection_id, item_id, item);
+ item.variable_data = data;
- Ok(())
- }
+ <ReFungibleItemList<T>>::insert(collection_id, item_id, item);
- fn set_nft_variable_data(
- collection: &CollectionHandle<T>,
- item_id: TokenId,
- data: Vec<u8>
- ) -> DispatchResult {
- let collection_id = collection.id;
- let mut item = <NftItemList<T>>::get(collection_id, item_id)
- .ok_or(Error::<T>::TokenNotFound)?;
-
- item.variable_data = data;
+ Ok(())
+ }
- <NftItemList<T>>::insert(collection_id, item_id, item);
-
- Ok(())
- }
+ fn set_nft_variable_data(
+ collection: &CollectionHandle<T>,
+ item_id: TokenId,
+ data: Vec<u8>,
+ ) -> DispatchResult {
+ let collection_id = collection.id;
+ let mut item =
+ <NftItemList<T>>::get(collection_id, item_id).ok_or(Error::<T>::TokenNotFound)?;
- #[allow(dead_code)]
- fn init_collection(item: &Collection<T>) {
- // check params
- assert!(
- item.decimal_points <= MAX_DECIMAL_POINTS,
- "decimal_points parameter must be lower than MAX_DECIMAL_POINTS"
- );
- assert!(
- item.name.len() <= 64,
- "Collection name can not be longer than 63 char"
- );
- assert!(
- item.name.len() <= 256,
- "Collection description can not be longer than 255 char"
- );
- assert!(
- item.token_prefix.len() <= 16,
- "Token prefix can not be longer than 15 char"
- );
+ item.variable_data = data;
- // Generate next collection ID
- let next_id = CreatedCollectionCount::get()
- .checked_add(1)
- .unwrap();
+ <NftItemList<T>>::insert(collection_id, item_id, item);
- CreatedCollectionCount::put(next_id);
- }
+ Ok(())
+ }
- #[allow(dead_code)]
- fn init_nft_token(collection_id: CollectionId, item: &NftItemType<T::CrossAccountId>) {
- let current_index = <ItemListIndex>::get(collection_id)
- .checked_add(1)
- .unwrap();
+ #[allow(dead_code)]
+ fn init_collection(item: &Collection<T>) {
+ // check params
+ assert!(
+ item.decimal_points <= MAX_DECIMAL_POINTS,
+ "decimal_points parameter must be lower than MAX_DECIMAL_POINTS"
+ );
+ assert!(
+ item.name.len() <= 64,
+ "Collection name can not be longer than 63 char"
+ );
+ assert!(
+ item.name.len() <= 256,
+ "Collection description can not be longer than 255 char"
+ );
+ assert!(
+ item.token_prefix.len() <= 16,
+ "Token prefix can not be longer than 15 char"
+ );
- Self::add_token_index(collection_id, current_index, &item.owner).unwrap();
+ // Generate next collection ID
+ let next_id = CreatedCollectionCount::get().checked_add(1).unwrap();
- <ItemListIndex>::insert(collection_id, current_index);
+ CreatedCollectionCount::put(next_id);
+ }
- // Update balance
- let new_balance = <Balance<T>>::get(collection_id, item.owner.as_sub())
- .checked_add(1)
- .unwrap();
- <Balance<T>>::insert(collection_id, item.owner.as_sub(), new_balance);
- }
+ #[allow(dead_code)]
+ fn init_nft_token(collection_id: CollectionId, item: &NftItemType<T::CrossAccountId>) {
+ let current_index = <ItemListIndex>::get(collection_id).checked_add(1).unwrap();
- #[allow(dead_code)]
- fn init_fungible_token(collection_id: CollectionId, owner: &T::CrossAccountId, item: &FungibleItemType) {
- let current_index = <ItemListIndex>::get(collection_id)
- .checked_add(1)
- .unwrap();
+ Self::add_token_index(collection_id, current_index, &item.owner).unwrap();
- Self::add_token_index(collection_id, current_index, owner).unwrap();
+ <ItemListIndex>::insert(collection_id, current_index);
- <ItemListIndex>::insert(collection_id, current_index);
+ // Update balance
+ let new_balance = <Balance<T>>::get(collection_id, item.owner.as_sub())
+ .checked_add(1)
+ .unwrap();
+ <Balance<T>>::insert(collection_id, item.owner.as_sub(), new_balance);
+ }
- // Update balance
- let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
- .checked_add(item.value)
- .unwrap();
- <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
- }
+ #[allow(dead_code)]
+ fn init_fungible_token(
+ collection_id: CollectionId,
+ owner: &T::CrossAccountId,
+ item: &FungibleItemType,
+ ) {
+ let current_index = <ItemListIndex>::get(collection_id).checked_add(1).unwrap();
- #[allow(dead_code)]
- fn init_refungible_token(collection_id: CollectionId, item: &ReFungibleItemType<T::CrossAccountId>) {
- let current_index = <ItemListIndex>::get(collection_id)
- .checked_add(1)
- .unwrap();
+ Self::add_token_index(collection_id, current_index, owner).unwrap();
- let value = item.owner.first().unwrap().fraction;
- let owner = item.owner.first().unwrap().owner.clone();
+ <ItemListIndex>::insert(collection_id, current_index);
- Self::add_token_index(collection_id, current_index, &owner).unwrap();
+ // Update balance
+ let new_balance = <Balance<T>>::get(collection_id, owner.as_sub())
+ .checked_add(item.value)
+ .unwrap();
+ <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+ }
- <ItemListIndex>::insert(collection_id, current_index);
+ #[allow(dead_code)]
+ fn init_refungible_token(
+ collection_id: CollectionId,
+ item: &ReFungibleItemType<T::CrossAccountId>,
+ ) {
+ let current_index = <ItemListIndex>::get(collection_id).checked_add(1).unwrap();
- // Update balance
- let new_balance = <Balance<T>>::get(collection_id, &owner.as_sub())
- .checked_add(value)
- .unwrap();
- <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
- }
+ let value = item.owner.first().unwrap().fraction;
+ let owner = item.owner.first().unwrap().owner.clone();
- fn add_token_index(collection_id: CollectionId, item_index: TokenId, owner: &T::CrossAccountId) -> DispatchResult {
- // add to account limit
- if <AccountItemCount<T>>::contains_key(owner.as_sub()) {
+ Self::add_token_index(collection_id, current_index, &owner).unwrap();
- // bound Owned tokens by a single address
- let count = <AccountItemCount<T>>::get(owner.as_sub());
- ensure!(count < ChainLimit::get().account_token_ownership_limit, Error::<T>::AddressOwnershipLimitExceeded);
+ <ItemListIndex>::insert(collection_id, current_index);
- <AccountItemCount<T>>::insert(owner.as_sub(), count
- .checked_add(1)
- .ok_or(Error::<T>::NumOverflow)?);
- }
- else {
- <AccountItemCount<T>>::insert(owner.as_sub(), 1);
- }
+ // Update balance
+ let new_balance = <Balance<T>>::get(collection_id, &owner.as_sub())
+ .checked_add(value)
+ .unwrap();
+ <Balance<T>>::insert(collection_id, owner.as_sub(), new_balance);
+ }
- let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.as_sub());
- if list_exists {
- let mut list = <AddressTokens<T>>::get(collection_id, owner.as_sub());
- let item_contains = list.contains(&item_index.clone());
+ fn add_token_index(
+ collection_id: CollectionId,
+ item_index: TokenId,
+ owner: &T::CrossAccountId,
+ ) -> DispatchResult {
+ // add to account limit
+ if <AccountItemCount<T>>::contains_key(owner.as_sub()) {
+ // bound Owned tokens by a single address
+ let count = <AccountItemCount<T>>::get(owner.as_sub());
+ ensure!(
+ count < ChainLimit::get().account_token_ownership_limit,
+ Error::<T>::AddressOwnershipLimitExceeded
+ );
- if !item_contains {
- list.push(item_index.clone());
- }
+ <AccountItemCount<T>>::insert(
+ owner.as_sub(),
+ count.checked_add(1).ok_or(Error::<T>::NumOverflow)?,
+ );
+ } else {
+ <AccountItemCount<T>>::insert(owner.as_sub(), 1);
+ }
- <AddressTokens<T>>::insert(collection_id, owner.as_sub(), list);
- } else {
- let mut itm = Vec::new();
- itm.push(item_index.clone());
- <AddressTokens<T>>::insert(collection_id, owner.as_sub(), itm);
- }
+ let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.as_sub());
+ if list_exists {
+ let mut list = <AddressTokens<T>>::get(collection_id, owner.as_sub());
+ let item_contains = list.contains(&item_index.clone());
- Ok(())
- }
+ if !item_contains {
+ list.push(item_index);
+ }
- fn remove_token_index(
- collection_id: CollectionId,
- item_index: TokenId,
- owner: &T::CrossAccountId,
- ) -> DispatchResult {
+ <AddressTokens<T>>::insert(collection_id, owner.as_sub(), list);
+ } else {
+ let itm = vec![item_index];
+ <AddressTokens<T>>::insert(collection_id, owner.as_sub(), itm);
+ }
- // update counter
- <AccountItemCount<T>>::insert(owner.as_sub(),
- <AccountItemCount<T>>::get(owner.as_sub())
- .checked_sub(1)
- .ok_or(Error::<T>::NumOverflow)?);
+ Ok(())
+ }
+ fn remove_token_index(
+ collection_id: CollectionId,
+ item_index: TokenId,
+ owner: &T::CrossAccountId,
+ ) -> DispatchResult {
+ // update counter
+ <AccountItemCount<T>>::insert(
+ owner.as_sub(),
+ <AccountItemCount<T>>::get(owner.as_sub())
+ .checked_sub(1)
+ .ok_or(Error::<T>::NumOverflow)?,
+ );
- let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.as_sub());
- if list_exists {
- let mut list = <AddressTokens<T>>::get(collection_id, owner.as_sub());
- let item_contains = list.contains(&item_index.clone());
+ let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.as_sub());
+ if list_exists {
+ let mut list = <AddressTokens<T>>::get(collection_id, owner.as_sub());
+ let item_contains = list.contains(&item_index.clone());
- if item_contains {
- list.retain(|&item| item != item_index);
- <AddressTokens<T>>::insert(collection_id, owner.as_sub(), list);
- }
- }
+ if item_contains {
+ list.retain(|&item| item != item_index);
+ <AddressTokens<T>>::insert(collection_id, owner.as_sub(), list);
+ }
+ }
- Ok(())
- }
+ Ok(())
+ }
- fn move_token_index(
- collection_id: CollectionId,
- item_index: TokenId,
- old_owner: &T::CrossAccountId,
- new_owner: &T::CrossAccountId,
- ) -> DispatchResult {
- Self::remove_token_index(collection_id, item_index, old_owner)?;
- Self::add_token_index(collection_id, item_index, new_owner)?;
+ fn move_token_index(
+ collection_id: CollectionId,
+ item_index: TokenId,
+ old_owner: &T::CrossAccountId,
+ new_owner: &T::CrossAccountId,
+ ) -> DispatchResult {
+ Self::remove_token_index(collection_id, item_index, old_owner)?;
+ Self::add_token_index(collection_id, item_index, new_owner)?;
- Ok(())
- }
+ Ok(())
+ }
}
sp_api::decl_runtime_apis! {
- pub trait NftApi {
- /// Used for ethereum integration
- fn eth_contract_code(account: H160) -> Option<Vec<u8>>;
- }
-}
\ No newline at end of file
+ pub trait NftApi {
+ /// Used for ethereum integration
+ fn eth_contract_code(account: H160) -> Option<Vec<u8>>;
+ }
+}
pallets/nft/src/mock.rsdiffbeforeafterboth--- a/pallets/nft/src/mock.rs
+++ b/pallets/nft/src/mock.rs
@@ -1,19 +1,21 @@
+#![allow(clippy::from_over_into)]
+
use crate as pallet_template;
use sp_core::H256;
-use frame_support::{
- parameter_types,
- weights::IdentityFee,
-};
+use frame_support::{parameter_types, weights::IdentityFee};
use sp_runtime::{
- traits::{BlakeTwo256, IdentityLookup},
- testing::Header,
+ traits::{BlakeTwo256, IdentityLookup},
+ testing::Header,
Perbill,
};
-use pallet_transaction_payment::{ CurrencyAdapter};
+use pallet_transaction_payment::{CurrencyAdapter};
use frame_system as system;
+use pallet_evm::AddressMapping;
+use crate::{EvmBackwardsAddressMapping, CrossAccountId};
+use codec::{Encode, Decode};
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
-type Block = frame_system::mocking::MockBlock<Test>;
+type Block = frame_system::mocking::MockBlock<Test>;
// Configure a mock runtime to test the pallet.
frame_support::construct_runtime!(
@@ -22,9 +24,9 @@
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
- System: frame_system::{Module, Call, Config, Storage, Event<T>},
- TemplateModule: pallet_template::{Module, Call, Storage},
- Balances: pallet_balances::{Module, Call, Storage},
+ System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
+ TemplateModule: pallet_template::{Pallet, Call, Storage},
+ Balances: pallet_balances::{Pallet, Call, Storage},
}
);
@@ -56,6 +58,7 @@
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = SS58Prefix;
+ type OnSetCode = ();
}
parameter_types! {
@@ -64,10 +67,10 @@
}
//frame_system::Module<Test>;
impl pallet_balances::Config for Test {
- type AccountStore = System;
- type Balance = u64;
- type DustRemoval = ();
- type Event = ();
+ type AccountStore = System;
+ type Balance = u64;
+ type DustRemoval = ();
+ type Event = ();
type ExistentialDeposit = ExistentialDeposit;
type WeightInfo = ();
type MaxLocks = MaxLocks;
@@ -78,7 +81,7 @@
}
impl pallet_transaction_payment::Config for Test {
- type OnChargeTransaction = CurrencyAdapter<pallet_balances::Module<Test>, ()>;
+ type OnChargeTransaction = CurrencyAdapter<pallet_balances::Pallet<Test>, ()>;
type TransactionByteFee = TransactionByteFee;
type WeightToFee = IdentityFee<u64>;
type FeeMultiplierUpdate = ();
@@ -94,27 +97,26 @@
type WeightInfo = ();
}
-type Timestamp = pallet_timestamp::Module<Test>;
-type Randomness = pallet_randomness_collective_flip::Module<Test>;
+type Timestamp = pallet_timestamp::Pallet<Test>;
+type Randomness = pallet_randomness_collective_flip::Pallet<Test>;
parameter_types! {
pub const TombstoneDeposit: u64 = 1;
pub const DepositPerContract: u64 = 1;
pub const DepositPerStorageByte: u64 = 1;
pub const DepositPerStorageItem: u64 = 1;
- pub RentFraction: Perbill = Perbill::from_rational_approximation(1u32, 30 * 24 * 60 * 10);
+ pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * 24 * 60 * 10);
pub const SurchargeReward: u64 = 1;
pub const SignedClaimHandicap: u32 = 2;
- pub const MaxDepth: u32 = 32;
- pub const MaxValueSize: u32 = 16 * 1024;
pub DeletionWeightLimit: u64 = u64::MAX;//Perbill::from_percent(10);
pub DeletionQueueDepth: u32 = 10;
+ pub Schedule: pallet_contracts::Schedule<Test> = Default::default();
}
impl pallet_contracts::Config for Test {
type Time = Timestamp;
type Randomness = Randomness;
- type Currency = pallet_balances::Module<Test>;
+ type Currency = pallet_balances::Pallet<Test>;
type Event = ();
type RentPayment = ();
type SignedClaimHandicap = SignedClaimHandicap;
@@ -125,29 +127,80 @@
type RentFraction = RentFraction;
type SurchargeReward = SurchargeReward;
type DeletionWeightLimit = DeletionWeightLimit;
- type MaxDepth = MaxDepth;
type DeletionQueueDepth = DeletionQueueDepth;
- type MaxValueSize = MaxValueSize;
type ChainExtension = ();
- type MaxCodeSize = ();
type WeightPrice = ();
type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
+ type Schedule = Schedule;
+ type CallStack = [pallet_contracts::Frame<Self>; 31];
}
parameter_types! {
pub const CollectionCreationPrice: u32 = 0;
- pub TreasuryAccountId: u64 = 1234;
+ pub TreasuryAccountId: u64 = 1234;
+ pub EthereumChainId: u32 = 1111;
}
+pub struct TestEvmAddressMapping;
+impl AddressMapping<u64> for TestEvmAddressMapping {
+ fn into_account_id(_addr: sp_core::H160) -> u64 {
+ unimplemented!()
+ }
+}
+
+pub struct TestEvmBackwardsAddressMapping;
+impl EvmBackwardsAddressMapping<u64> for TestEvmBackwardsAddressMapping {
+ fn from_account_id(_account_id: u64) -> sp_core::H160 {
+ unimplemented!()
+ }
+}
+
+#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
+pub struct TestCrossAccountId(u64, sp_core::H160);
+impl CrossAccountId<u64> for TestCrossAccountId {
+ fn from_sub(sub: u64) -> Self {
+ let mut eth = [0; 20];
+ eth[12..20].copy_from_slice(&sub.to_be_bytes());
+ Self(sub, sp_core::H160(eth))
+ }
+ fn as_sub(&self) -> &u64 {
+ &self.0
+ }
+ fn from_eth(_eth: sp_core::H160) -> Self {
+ unimplemented!()
+ }
+ fn as_eth(&self) -> &sp_core::H160 {
+ &self.1
+ }
+}
+
+pub struct TestEtheremTransactionSender;
+impl pallet_ethereum::EthereumTransactionSender for TestEtheremTransactionSender {
+ fn submit_logs_transaction(
+ _tx: pallet_ethereum::Transaction,
+ _logs: Vec<pallet_ethereum::Log>,
+ ) -> Result<(), sp_runtime::DispatchError> {
+ Ok(())
+ }
+}
+
impl pallet_template::Config for Test {
type Event = ();
type WeightInfo = ();
type CollectionCreationPrice = CollectionCreationPrice;
- type Currency = pallet_balances::Module<Test>;
- type TreasuryAccountId = TreasuryAccountId;
+ type Currency = pallet_balances::Pallet<Test>;
+ type TreasuryAccountId = TreasuryAccountId;
+ type EvmAddressMapping = TestEvmAddressMapping;
+ type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping;
+ type CrossAccountId = TestCrossAccountId;
+ type EthereumChainId = EthereumChainId;
+ type EthereumTransactionSender = TestEtheremTransactionSender;
}
// Build genesis storage according to the mock runtime.
pub fn new_test_ext() -> sp_io::TestExternalities {
- system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
-}
\ No newline at end of file
+ system::GenesisConfig::default()
+ .build_storage::<Test>()
+ .unwrap()
+ .into()
+}
pallets/nft/src/sponsorship.rsdiffbeforeafterboth--- a/pallets/nft/src/sponsorship.rs
+++ b/pallets/nft/src/sponsorship.rs
@@ -1,4 +1,8 @@
-use crate::{Config, Call, CollectionById, CreateItemBasket, VariableMetaDataBasket, ReFungibleTransferBasket, FungibleTransferBasket, NftTransferBasket, ChainLimit, CreateItemData, CollectionMode};
+use crate::{
+ Config, Call, CollectionById, CreateItemBasket, VariableMetaDataBasket,
+ ReFungibleTransferBasket, FungibleTransferBasket, NftTransferBasket, ChainLimit,
+ CreateItemData, CollectionMode,
+};
use core::marker::PhantomData;
use up_sponsorship::SponsorshipHandler;
use frame_support::{
@@ -6,7 +10,6 @@
storage::{StorageMap, StorageDoubleMap, StorageValue},
};
use nft_data_structs::{TokenId, CollectionId};
-use alloc::vec::Vec;
pub struct NftSponsorshipHandler<T>(PhantomData<T>);
impl<T: Config> NftSponsorshipHandler<T> {
@@ -15,7 +18,6 @@
collection_id: &CollectionId,
_properties: &CreateItemData,
) -> Option<T::AccountId> {
-
let collection = CollectionById::<T>::get(collection_id)?;
// sponsor timeout
@@ -32,9 +34,8 @@
CreateItemBasket::<T>::insert((collection_id, who.clone()), block_number);
// check free create limit
- if collection.limits.sponsored_data_size >= (_properties.len() as u32) {
- collection.sponsorship.sponsor()
- .cloned()
+ if collection.limits.sponsored_data_size >= (_properties.data_size() as u32) {
+ collection.sponsorship.sponsor().cloned()
} else {
None
}
@@ -45,13 +46,11 @@
collection_id: &CollectionId,
item_id: &TokenId,
) -> Option<T::AccountId> {
-
let collection = CollectionById::<T>::get(collection_id)?;
let limits = ChainLimit::get();
let mut sponsor_transfer = false;
if collection.sponsorship.confirmed() {
-
let collection_limits = collection.limits.clone();
let collection_mode = collection.mode.clone();
@@ -59,7 +58,6 @@
let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
sponsor_transfer = match collection_mode {
CollectionMode::NFT => {
-
// get correct limit
let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
collection_limits.sponsor_transfer_timeout
@@ -82,7 +80,6 @@
sponsored
}
CollectionMode::Fungible(_) => {
-
// get correct limit
let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
collection_limits.sponsor_transfer_timeout
@@ -106,7 +103,6 @@
sponsored
}
CollectionMode::ReFungible => {
-
// get correct limit
let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
collection_limits.sponsor_transfer_timeout
@@ -116,7 +112,8 @@
let mut sponsored = true;
if ReFungibleTransferBasket::<T>::contains_key(collection_id, item_id) {
- let last_tx_block = ReFungibleTransferBasket::<T>::get(collection_id, item_id);
+ let last_tx_block =
+ ReFungibleTransferBasket::<T>::get(collection_id, item_id);
let limit_time = last_tx_block + limit.into();
if block_number <= limit_time {
sponsored = false;
@@ -128,32 +125,27 @@
sponsored
}
- _ => {
- false
- },
+ _ => false,
};
}
if !sponsor_transfer {
None
} else {
- collection.sponsorship.sponsor()
- .cloned()
+ collection.sponsorship.sponsor().cloned()
}
}
-
+
pub fn withdraw_set_variable_meta_data(
collection_id: &CollectionId,
item_id: &TokenId,
- data: &Vec<u8>,
+ data: &[u8],
) -> Option<T::AccountId> {
-
let mut sponsor_metadata_changes = false;
let collection = CollectionById::<T>::get(collection_id)?;
- if
- collection.sponsorship.confirmed() &&
+ if collection.sponsorship.confirmed() &&
// Can't sponsor fungible collection, this tx will be rejected
// as invalid
!matches!(collection.mode, CollectionMode::Fungible(_)) &&
@@ -164,7 +156,7 @@
if VariableMetaDataBasket::<T>::get(collection_id, item_id)
.map(|last_block| block_number - last_block > rate_limit)
- .unwrap_or(true)
+ .unwrap_or(true)
{
sponsor_metadata_changes = true;
VariableMetaDataBasket::<T>::insert(collection_id, item_id, block_number);
@@ -177,27 +169,26 @@
} else {
collection.sponsorship.sponsor().cloned()
}
-
}
}
impl<T, C> SponsorshipHandler<T::AccountId, C> for NftSponsorshipHandler<T>
-where
- T: Config,
- C: IsSubType<Call<T>>
+where
+ T: Config,
+ C: IsSubType<Call<T>>,
{
- fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {
- match IsSubType::<Call<T>>::is_sub_type(call)? {
- Call::create_item(collection_id, _owner, _properties) => {
- Self::withdraw_create_item(who, collection_id, &_properties)
- },
- Call::transfer(_new_owner, collection_id, item_id, _value) => {
- Self::withdraw_transfer(who, collection_id, item_id)
- },
- Call::set_variable_meta_data(collection_id, item_id, data) => {
- Self::withdraw_set_variable_meta_data(collection_id, item_id, &data)
- },
+ fn get_sponsor(who: &T::AccountId, call: &C) -> Option<T::AccountId> {
+ match IsSubType::<Call<T>>::is_sub_type(call)? {
+ Call::create_item(collection_id, _owner, properties) => {
+ Self::withdraw_create_item(who, collection_id, properties)
+ }
+ Call::transfer(_new_owner, collection_id, item_id, _value) => {
+ Self::withdraw_transfer(who, collection_id, item_id)
+ }
+ Call::set_variable_meta_data(collection_id, item_id, data) => {
+ Self::withdraw_set_variable_meta_data(collection_id, item_id, data)
+ }
_ => None,
- }
- }
-}
\ No newline at end of file
+ }
+ }
+}
pallets/nft/src/tests.rsdiffbeforeafterboth--- a/pallets/nft/src/tests.rs
+++ b/pallets/nft/src/tests.rs
@@ -1,81 +1,109 @@
// Tests to be written here
use super::*;
use crate::mock::*;
-use crate::{AccessMode, CollectionMode,
- Ownership, ChainLimits, CreateItemData, CreateNftData, CreateFungibleData, CreateReFungibleData,
- CollectionId, TokenId, MAX_DECIMAL_POINTS};
+use crate::{AccessMode, CollectionMode, Ownership, ChainLimits, CreateItemData};
+use nft_data_structs::{
+ CreateNftData, CreateFungibleData, CreateReFungibleData, CollectionId, TokenId,
+ MAX_DECIMAL_POINTS,
+};
use frame_support::{assert_noop, assert_ok};
-use frame_system::{ RawOrigin };
+use frame_system::{RawOrigin};
fn default_collection_numbers_limit() -> u32 {
- 10
+ 10
}
fn default_limits() {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: default_collection_numbers_limit(),
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: default_collection_numbers_limit(),
+ account_token_ownership_limit: 10,
+ collections_admins_limit: 5,
+ custom_data_limit: 2048,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
}
fn default_nft_data() -> CreateNftData {
- CreateNftData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1] }
+ CreateNftData {
+ const_data: vec![1, 2, 3],
+ variable_data: vec![3, 2, 1],
+ }
}
-fn default_fungible_data () -> CreateFungibleData {
- CreateFungibleData { value: 5 }
+fn default_fungible_data() -> CreateFungibleData {
+ CreateFungibleData { value: 5 }
}
-fn default_re_fungible_data () -> CreateReFungibleData {
- CreateReFungibleData { const_data: vec![1, 2, 3], variable_data: vec![3, 2, 1], pieces: 1023 }
+fn default_re_fungible_data() -> CreateReFungibleData {
+ CreateReFungibleData {
+ const_data: vec![1, 2, 3],
+ variable_data: vec![3, 2, 1],
+ pieces: 1023,
+ }
}
-fn create_test_collection_for_owner(mode: &CollectionMode, owner: u64, id: CollectionId) -> CollectionId {
- let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
+fn create_test_collection_for_owner(
+ mode: &CollectionMode,
+ owner: u64,
+ id: CollectionId,
+) -> CollectionId {
+ let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
- let origin1 = Origin::signed(owner);
- assert_ok!(TemplateModule::create_collection(
- origin1.clone(),
- col_name1.clone(),
- col_desc1.clone(),
- token_prefix1.clone(),
- mode.clone()
- ));
+ let origin1 = Origin::signed(owner);
+ assert_ok!(TemplateModule::create_collection(
+ origin1,
+ col_name1,
+ col_desc1,
+ token_prefix1,
+ mode.clone()
+ ));
- let saved_col_name: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
- let saved_description: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
- let saved_prefix: Vec<u8> = b"token_prefix1\0".to_vec();
- assert_eq!(TemplateModule::collection_id(id).unwrap().owner, owner);
- assert_eq!(TemplateModule::collection_id(id).unwrap().name, saved_col_name);
- assert_eq!(TemplateModule::collection_id(id).unwrap().mode, *mode);
- assert_eq!(TemplateModule::collection_id(id).unwrap().description, saved_description);
- assert_eq!(TemplateModule::collection_id(id).unwrap().token_prefix, saved_prefix);
- id
+ let saved_col_name: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+ let saved_description: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+ let saved_prefix: Vec<u8> = b"token_prefix1\0".to_vec();
+ assert_eq!(TemplateModule::collection_id(id).unwrap().owner, owner);
+ assert_eq!(
+ TemplateModule::collection_id(id).unwrap().name,
+ saved_col_name
+ );
+ assert_eq!(TemplateModule::collection_id(id).unwrap().mode, *mode);
+ assert_eq!(
+ TemplateModule::collection_id(id).unwrap().description,
+ saved_description
+ );
+ assert_eq!(
+ TemplateModule::collection_id(id).unwrap().token_prefix,
+ saved_prefix
+ );
+ id
}
fn create_test_collection(mode: &CollectionMode, id: CollectionId) -> CollectionId {
- create_test_collection_for_owner(&mode, 1, id)
+ create_test_collection_for_owner(&mode, 1, id)
}
fn create_test_item(collection_id: CollectionId, data: &CreateItemData) {
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::create_item(
- origin1.clone(),
- collection_id,
- 1,
- data.clone()
- ));
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::create_item(
+ origin1,
+ collection_id,
+ account(1),
+ data.clone()
+ ));
+}
+fn account(sub: u64) -> TestCrossAccountId {
+ TestCrossAccountId::from_sub(sub)
}
// Use cases tests region
@@ -83,149 +111,166 @@
#[test]
fn set_version_schema() {
- new_test_ext().execute_with(|| {
- default_limits();
- let origin1 = Origin::signed(1);
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- assert_ok!(TemplateModule::set_schema_version(origin1, collection_id, SchemaVersion::Unique));
- assert_eq!(TemplateModule::collection_id(collection_id).unwrap().schema_version, SchemaVersion::Unique);
- });
+ new_test_ext().execute_with(|| {
+ default_limits();
+ let origin1 = Origin::signed(1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ assert_ok!(TemplateModule::set_schema_version(
+ origin1,
+ collection_id,
+ SchemaVersion::Unique
+ ));
+ assert_eq!(
+ TemplateModule::collection_id(collection_id)
+ .unwrap()
+ .schema_version,
+ SchemaVersion::Unique
+ );
+ });
}
#[test]
fn create_fungible_collection_fails_with_large_decimal_numbers() {
- new_test_ext().execute_with(|| {
- default_limits();
+ new_test_ext().execute_with(|| {
+ default_limits();
- let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
+ let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
- let origin1 = Origin::signed(1);
- assert_noop!(TemplateModule::create_collection(
- origin1,
- col_name1,
- col_desc1,
- token_prefix1,
- CollectionMode::Fungible(MAX_DECIMAL_POINTS + 1)
- ), Error::<Test>::CollectionDecimalPointLimitExceeded);
- });
+ let origin1 = Origin::signed(1);
+ assert_noop!(
+ TemplateModule::create_collection(
+ origin1,
+ col_name1,
+ col_desc1,
+ token_prefix1,
+ CollectionMode::Fungible(MAX_DECIMAL_POINTS + 1)
+ ),
+ Error::<Test>::CollectionDecimalPointLimitExceeded
+ );
+ });
}
#[test]
fn create_nft_item() {
- new_test_ext().execute_with(|| {
- default_limits();
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- let data = default_nft_data();
- create_test_item(collection_id, &data.clone().into());
- let item = TemplateModule::nft_item_id(collection_id, 1).unwrap();
- assert_eq!(item.const_data, data.const_data);
- assert_eq!(item.variable_data, data.variable_data);
- });
+ new_test_ext().execute_with(|| {
+ default_limits();
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.clone().into());
+ let item = TemplateModule::nft_item_id(collection_id, 1).unwrap();
+ assert_eq!(item.const_data, data.const_data);
+ assert_eq!(item.variable_data, data.variable_data);
+ });
}
// Use cases tests region
// #region
#[test]
fn create_nft_multiple_items() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
+ create_test_collection(&CollectionMode::NFT, 1);
- let items_data = vec![default_nft_data(), default_nft_data(), default_nft_data()];
+ let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::create_multiple_items(
- origin1.clone(),
- 1,
- 1,
- items_data.clone().into_iter().map(|d| { d.into() }).collect()
- ));
- for (index, data) in items_data.iter().enumerate() {
- let item = TemplateModule::nft_item_id(1, (index + 1) as TokenId).unwrap();
- assert_eq!(item.const_data.to_vec(), data.const_data);
- assert_eq!(item.variable_data.to_vec(), data.variable_data);
- }
- });
+ let items_data = vec![default_nft_data(), default_nft_data(), default_nft_data()];
+
+ assert_ok!(TemplateModule::create_multiple_items(
+ origin1,
+ 1,
+ account(1),
+ items_data
+ .clone()
+ .into_iter()
+ .map(|d| { d.into() })
+ .collect()
+ ));
+ for (index, data) in items_data.iter().enumerate() {
+ let item = TemplateModule::nft_item_id(1, (index + 1) as TokenId).unwrap();
+ assert_eq!(item.const_data.to_vec(), data.const_data);
+ assert_eq!(item.variable_data.to_vec(), data.variable_data);
+ }
+ });
}
#[test]
fn create_refungible_item() {
- new_test_ext().execute_with(|| {
- default_limits();
- let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+ let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
- let data = default_re_fungible_data();
- create_test_item(collection_id, &data.clone().into());
- let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
- assert_eq!(
- item.const_data,
- data.const_data
- );
- assert_eq!(
- item.variable_data,
- data.variable_data
- );
- assert_eq!(
- item.owner[0],
- Ownership {
- owner: 1,
- fraction: 1023
- }
- );
- });
+ let data = default_re_fungible_data();
+ create_test_item(collection_id, &data.clone().into());
+ let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
+ assert_eq!(item.const_data, data.const_data);
+ assert_eq!(item.variable_data, data.variable_data);
+ assert_eq!(
+ item.owner[0],
+ Ownership {
+ owner: account(1),
+ fraction: 1023
+ }
+ );
+ });
}
#[test]
fn create_multiple_refungible_items() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- create_test_collection(&CollectionMode::ReFungible, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
+ create_test_collection(&CollectionMode::ReFungible, 1);
- let items_data = vec![default_re_fungible_data(), default_re_fungible_data(), default_re_fungible_data()];
+ let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::create_multiple_items(
- origin1.clone(),
- 1,
- 1,
- items_data.clone().into_iter().map(|d| { d.into() }).collect()
- ));
- for (index, data) in items_data.iter().enumerate() {
+ let items_data = vec![
+ default_re_fungible_data(),
+ default_re_fungible_data(),
+ default_re_fungible_data(),
+ ];
- let item = TemplateModule::refungible_item_id(1, (index + 1) as TokenId).unwrap();
- assert_eq!(item.const_data.to_vec(), data.const_data);
- assert_eq!(item.variable_data.to_vec(), data.variable_data);
- assert_eq!(
- item.owner[0],
- Ownership {
- owner: 1,
- fraction: 1023
- }
- );
- }
- });
+ assert_ok!(TemplateModule::create_multiple_items(
+ origin1,
+ 1,
+ account(1),
+ items_data
+ .clone()
+ .into_iter()
+ .map(|d| { d.into() })
+ .collect()
+ ));
+ for (index, data) in items_data.iter().enumerate() {
+ let item = TemplateModule::refungible_item_id(1, (index + 1) as TokenId).unwrap();
+ assert_eq!(item.const_data.to_vec(), data.const_data);
+ assert_eq!(item.variable_data.to_vec(), data.variable_data);
+ assert_eq!(
+ item.owner[0],
+ Ownership {
+ owner: account(1),
+ fraction: 1023
+ }
+ );
+ }
+ });
}
#[test]
fn create_fungible_item() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let data = default_fungible_data();
- create_test_item(collection_id, &data.into());
+ let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
- assert_eq!(TemplateModule::fungible_item_id(collection_id, 1).value, 5);
- });
+ let data = default_fungible_data();
+ create_test_item(collection_id, &data.into());
+
+ assert_eq!(TemplateModule::fungible_item_id(collection_id, 1).value, 5);
+ });
}
//#[test]
@@ -245,7 +290,7 @@
// 1,
// items_data.clone().into_iter().map(|d| { d.into() }).collect()
// ));
-
+
// for (index, _) in items_data.iter().enumerate() {
// assert_eq!(TemplateModule::fungible_item_id(1, (index + 1) as TokenId).value, 5);
// }
@@ -256,636 +301,746 @@
#[test]
fn transfer_fungible_item() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
- let data = default_fungible_data();
- create_test_item(collection_id, &data.into());
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 5);
- assert_eq!(TemplateModule::balance_count(1, 1), 5);
+ let data = default_fungible_data();
+ create_test_item(collection_id, &data.into());
- // change owner scenario
- assert_ok!(TemplateModule::transfer(origin1.clone(), 2, 1, 1, 5));
- assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 0);
- assert_eq!(TemplateModule::balance_count(1, 1), 0);
- assert_eq!(TemplateModule::balance_count(1, 2), 5);
+ assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 5);
+ assert_eq!(TemplateModule::balance_count(1, 1), 5);
- // split item scenario
- assert_ok!(TemplateModule::transfer(origin2.clone(), 3, 1, 1, 3));
- assert_eq!(TemplateModule::balance_count(1, 2), 2);
- assert_eq!(TemplateModule::balance_count(1, 3), 3);
+ // change owner scenario
+ assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 5));
+ assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 0);
+ assert_eq!(TemplateModule::balance_count(1, 1), 0);
+ assert_eq!(TemplateModule::balance_count(1, 2), 5);
- // split item and new owner has account scenario
- assert_ok!(TemplateModule::transfer(origin2.clone(), 3, 1, 1, 1));
- assert_eq!(TemplateModule::fungible_item_id(1, 2).value, 1);
- assert_eq!(TemplateModule::fungible_item_id(1, 3).value, 4);
- assert_eq!(TemplateModule::balance_count(1, 2), 1);
- assert_eq!(TemplateModule::balance_count(1, 3), 4);
- });
+ // split item scenario
+ assert_ok!(TemplateModule::transfer(
+ origin2.clone(),
+ account(3),
+ 1,
+ 1,
+ 3
+ ));
+ assert_eq!(TemplateModule::balance_count(1, 2), 2);
+ assert_eq!(TemplateModule::balance_count(1, 3), 3);
+
+ // split item and new owner has account scenario
+ assert_ok!(TemplateModule::transfer(origin2, account(3), 1, 1, 1));
+ assert_eq!(TemplateModule::fungible_item_id(1, 2).value, 1);
+ assert_eq!(TemplateModule::fungible_item_id(1, 3).value, 4);
+ assert_eq!(TemplateModule::balance_count(1, 2), 1);
+ assert_eq!(TemplateModule::balance_count(1, 3), 4);
+ });
}
#[test]
fn transfer_refungible_item() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let data = default_re_fungible_data();
- create_test_item(collection_id, &data.clone().into());
+ let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
- {
- let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
- assert_eq!(
- item.const_data,
- data.const_data
- );
- assert_eq!(
- item.variable_data,
- data.variable_data
- );
- assert_eq!(
- item.owner[0],
- Ownership {
- owner: 1,
- fraction: 1023
- }
- );
- }
- assert_eq!(TemplateModule::balance_count(1, 1), 1023);
- assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+ let data = default_re_fungible_data();
+ create_test_item(collection_id, &data.clone().into());
- // change owner scenario
- assert_ok!(TemplateModule::transfer(origin1.clone(), 2, 1, 1, 1023));
- assert_eq!(
- TemplateModule::refungible_item_id(1, 1).unwrap().owner[0],
- Ownership {
- owner: 2,
- fraction: 1023
- }
- );
- assert_eq!(TemplateModule::balance_count(1, 1), 0);
- assert_eq!(TemplateModule::balance_count(1, 2), 1023);
- // assert_eq!(TemplateModule::address_tokens(1, 1), []);
- assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
+ {
+ let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
+ assert_eq!(item.const_data, data.const_data);
+ assert_eq!(item.variable_data, data.variable_data);
+ assert_eq!(
+ item.owner[0],
+ Ownership {
+ owner: account(1),
+ fraction: 1023
+ }
+ );
+ }
+ assert_eq!(TemplateModule::balance_count(1, 1), 1023);
+ assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+
+ // change owner scenario
+ assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 1023));
+ assert_eq!(
+ TemplateModule::refungible_item_id(1, 1).unwrap().owner[0],
+ Ownership {
+ owner: account(2),
+ fraction: 1023
+ }
+ );
+ assert_eq!(TemplateModule::balance_count(1, 1), 0);
+ assert_eq!(TemplateModule::balance_count(1, 2), 1023);
+ // assert_eq!(TemplateModule::address_tokens(1, 1), []);
+ assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
- // split item scenario
- assert_ok!(TemplateModule::transfer(origin2.clone(), 3, 1, 1, 500));
- {
- let item = TemplateModule::refungible_item_id(1, 1).unwrap();
- assert_eq!(
- item.owner[0],
- Ownership {
- owner: 2,
- fraction: 523
- }
- );
- assert_eq!(
- item.owner[1],
- Ownership {
- owner: 3,
- fraction: 500
- }
- );
- }
- assert_eq!(TemplateModule::balance_count(1, 2), 523);
- assert_eq!(TemplateModule::balance_count(1, 3), 500);
- assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
- assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
+ // split item scenario
+ assert_ok!(TemplateModule::transfer(
+ origin2.clone(),
+ account(3),
+ 1,
+ 1,
+ 500
+ ));
+ {
+ let item = TemplateModule::refungible_item_id(1, 1).unwrap();
+ assert_eq!(
+ item.owner[0],
+ Ownership {
+ owner: account(2),
+ fraction: 523
+ }
+ );
+ assert_eq!(
+ item.owner[1],
+ Ownership {
+ owner: account(3),
+ fraction: 500
+ }
+ );
+ }
+ assert_eq!(TemplateModule::balance_count(1, 2), 523);
+ assert_eq!(TemplateModule::balance_count(1, 3), 500);
+ assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+ assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
- // split item and new owner has account scenario
- assert_ok!(TemplateModule::transfer(origin2.clone(), 3, 1, 1, 200));
- {
- let item = TemplateModule::refungible_item_id(1, 1).unwrap();
- assert_eq!(
- item.owner[0],
- Ownership {
- owner: 2,
- fraction: 323
- }
- );
- assert_eq!(
- item.owner[1],
- Ownership {
- owner: 3,
- fraction: 700
- }
- );
- }
- assert_eq!(TemplateModule::balance_count(1, 2), 323);
- assert_eq!(TemplateModule::balance_count(1, 3), 700);
- assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
- assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
- });
+ // split item and new owner has account scenario
+ assert_ok!(TemplateModule::transfer(origin2, account(3), 1, 1, 200));
+ {
+ let item = TemplateModule::refungible_item_id(1, 1).unwrap();
+ assert_eq!(
+ item.owner[0],
+ Ownership {
+ owner: account(2),
+ fraction: 323
+ }
+ );
+ assert_eq!(
+ item.owner[1],
+ Ownership {
+ owner: account(3),
+ fraction: 700
+ }
+ );
+ }
+ assert_eq!(TemplateModule::balance_count(1, 2), 323);
+ assert_eq!(TemplateModule::balance_count(1, 3), 700);
+ assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+ assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
+ });
}
#[test]
fn transfer_nft_item() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
- assert_eq!(TemplateModule::balance_count(1, 1), 1);
- assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- // default scenario
- assert_ok!(TemplateModule::transfer(origin1.clone(), 2, 1, 1, 1000));
- assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().owner, 2);
- assert_eq!(TemplateModule::balance_count(1, 1), 0);
- assert_eq!(TemplateModule::balance_count(1, 2), 1);
- // assert_eq!(TemplateModule::address_tokens(1, 1), []);
- assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
- });
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
+ assert_eq!(TemplateModule::balance_count(1, 1), 1);
+ assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+
+ let origin1 = Origin::signed(1);
+ // default scenario
+ assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 1000));
+ assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().owner, account(2));
+ assert_eq!(TemplateModule::balance_count(1, 1), 0);
+ assert_eq!(TemplateModule::balance_count(1, 2), 1);
+ // assert_eq!(TemplateModule::address_tokens(1, 1), []);
+ assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+ });
}
#[test]
fn nft_approve_and_transfer_from() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- assert_eq!(TemplateModule::balance_count(1, 1), 1);
- assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- // neg transfer
- assert_noop!(TemplateModule::transfer_from(
- origin2.clone(),
- 1,
- 2,
- 1,
- 1,
- 1), Error::<Test>::NoPermission);
+ assert_eq!(TemplateModule::balance_count(1, 1), 1);
+ assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
- // do approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1, 5));
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
- assert_eq!(
- TemplateModule::approved(1, (1, 1, 2)),
- 5
- );
+ // neg transfer
+ assert_noop!(
+ TemplateModule::transfer_from(origin2.clone(), account(1), account(2), 1, 1, 1),
+ Error::<Test>::NoPermission
+ );
- assert_ok!(TemplateModule::transfer_from(
- origin2.clone(),
- 1,
- 3,
- 1,
- 1,
- 1
- ));
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 4);
- });
+ // do approve
+ assert_ok!(TemplateModule::approve(origin1, account(2), 1, 1, 5));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
+
+ assert_ok!(TemplateModule::transfer_from(
+ origin2,
+ account(1),
+ account(3),
+ 1,
+ 1,
+ 1
+ ));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 4);
+ });
}
#[test]
fn nft_approve_and_transfer_from_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let data = default_nft_data();
- create_test_item(collection_id, &data.clone().into());
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().const_data, data.const_data);
- assert_eq!(TemplateModule::balance_count(1, 1), 1);
- assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.clone().into());
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- 1,
- true
- ));
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- 1,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 3));
+ assert_eq!(
+ TemplateModule::nft_item_id(1, 1).unwrap().const_data,
+ data.const_data
+ );
+ assert_eq!(TemplateModule::balance_count(1, 1), 1);
+ assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ 1,
+ true
+ ));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ 1,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(1)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(3)
+ ));
- // do approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1, 5));
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
- assert_ok!(TemplateModule::approve(origin1.clone(), 3, 1, 1, 5));
- assert_eq!(TemplateModule::approved(1, (1, 1, 3)), 5);
+ // do approve
+ assert_ok!(TemplateModule::approve(
+ origin1.clone(),
+ account(2),
+ 1,
+ 1,
+ 5
+ ));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
+ assert_ok!(TemplateModule::approve(origin1, account(3), 1, 1, 5));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 3)), 5);
- assert_ok!(TemplateModule::transfer_from(
- origin2.clone(),
- 1,
- 3,
- 1,
- 1,
- 1
- ));
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 4);
- });
+ assert_ok!(TemplateModule::transfer_from(
+ origin2,
+ account(1),
+ account(3),
+ 1,
+ 1,
+ 1
+ ));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 4);
+ });
}
#[test]
fn refungible_approve_and_transfer_from() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
-
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- let data = default_re_fungible_data();
- create_test_item(collection_id, &data.into());
+ let data = default_re_fungible_data();
+ create_test_item(collection_id, &data.into());
- assert_eq!(TemplateModule::balance_count(1, 1), 1023);
- assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+ assert_eq!(TemplateModule::balance_count(1, 1), 1023);
+ assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- 1,
- true
- ));
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- 1,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 3));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ 1,
+ true
+ ));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ 1,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(1)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(3)
+ ));
- // do approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1, 1023));
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1023);
+ // do approve
+ assert_ok!(TemplateModule::approve(origin1, account(2), 1, 1, 1023));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1023);
- assert_ok!(TemplateModule::transfer_from(
- origin2.clone(),
- 1,
- 3,
- 1,
- 1,
- 100
- ));
- assert_eq!(TemplateModule::balance_count(1, 1), 923);
- assert_eq!(TemplateModule::balance_count(1, 3), 100);
- assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
- assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
+ assert_ok!(TemplateModule::transfer_from(
+ origin2,
+ account(1),
+ account(3),
+ 1,
+ 1,
+ 100
+ ));
+ assert_eq!(TemplateModule::balance_count(1, 1), 923);
+ assert_eq!(TemplateModule::balance_count(1, 3), 100);
+ assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+ assert_eq!(TemplateModule::address_tokens(1, 3), [1]);
- assert_eq!(
- TemplateModule::approved(1, (1, 1, 2)),
- 923
- );
- });
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 923);
+ });
}
#[test]
fn fungible_approve_and_transfer_from() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
-
- let data = default_fungible_data();
- create_test_item(collection_id, &data.into());
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+
+ let data = default_fungible_data();
+ create_test_item(collection_id, &data.into());
+
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_eq!(TemplateModule::balance_count(1, 1), 5);
+ assert_eq!(TemplateModule::balance_count(1, 1), 5);
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- 1,
- true
- ));
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- 1,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 3));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ 1,
+ true
+ ));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ 1,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(1)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(3)
+ ));
- // do approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1, 5));
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
- assert_ok!(TemplateModule::approve(origin1.clone(), 3, 1, 1, 5));
- assert_eq!(TemplateModule::approved(1, (1, 1, 3)), 5);
- assert_eq!(
- TemplateModule::approved(1, (1, 1, 2)),
- 5
- );
+ // do approve
+ assert_ok!(TemplateModule::approve(
+ origin1.clone(),
+ account(2),
+ 1,
+ 1,
+ 5
+ ));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
+ assert_ok!(TemplateModule::approve(origin1, account(3), 1, 1, 5));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 3)), 5);
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 5);
- assert_ok!(TemplateModule::transfer_from(
- origin2.clone(),
- 1,
- 3,
- 1,
- 1,
- 4
- ));
- assert_eq!(TemplateModule::balance_count(1, 1), 1);
- assert_eq!(TemplateModule::balance_count(1, 3), 4);
+ assert_ok!(TemplateModule::transfer_from(
+ origin2.clone(),
+ account(1),
+ account(3),
+ 1,
+ 1,
+ 4
+ ));
+ assert_eq!(TemplateModule::balance_count(1, 1), 1);
+ assert_eq!(TemplateModule::balance_count(1, 3), 4);
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
- assert_noop!(TemplateModule::transfer_from(
- origin2.clone(),
- 1,
- 3,
- 1,
- 1,
- 4
- ), Error::<Test>::NoPermission);
- });
+ assert_noop!(
+ TemplateModule::transfer_from(origin2, account(1), account(3), 1, 1, 4),
+ Error::<Test>::NoPermission
+ );
+ });
}
#[test]
fn change_collection_owner() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::change_collection_owner(
- origin1.clone(),
- collection_id,
- 2
- ));
- assert_eq!(TemplateModule::collection_id(collection_id).unwrap().owner, 2);
- });
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::change_collection_owner(
+ origin1,
+ collection_id,
+ 2
+ ));
+ assert_eq!(
+ TemplateModule::collection_id(collection_id).unwrap().owner,
+ 2
+ );
+ });
}
#[test]
fn destroy_collection() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
- });
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::destroy_collection(origin1, collection_id));
+ });
}
#[test]
fn burn_nft_item() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
-
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- // check balance (collection with id = 1, user id = 1)
- assert_eq!(TemplateModule::balance_count(1, 1), 1);
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
- // burn item
- assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 5));
- assert_noop!(
- TemplateModule::burn_item(origin1.clone(), 1, 1, 5),
- Error::<Test>::TokenNotFound
- );
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
+
+ // check balance (collection with id = 1, user id = 1)
+ assert_eq!(TemplateModule::balance_count(1, 1), 1);
+
+ // burn item
+ assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 5));
+ assert_noop!(
+ TemplateModule::burn_item(origin1, 1, 1, 5),
+ Error::<Test>::TokenNotFound
+ );
- assert_eq!(TemplateModule::balance_count(1, 1), 0);
- });
+ assert_eq!(TemplateModule::balance_count(1, 1), 0);
+ });
}
#[test]
fn burn_fungible_item() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
-
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
-
- let data = default_fungible_data();
- create_test_item(collection_id, &data.into());
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+
+ let data = default_fungible_data();
+ create_test_item(collection_id, &data.into());
- // check balance (collection with id = 1, user id = 1)
- assert_eq!(TemplateModule::balance_count(1, 1), 5);
+ // check balance (collection with id = 1, user id = 1)
+ assert_eq!(TemplateModule::balance_count(1, 1), 5);
- // burn item
- assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 5));
- assert_noop!(
- TemplateModule::burn_item(origin1.clone(), 1, 1, 5),
- Error::<Test>::TokenValueNotEnough
- );
+ // burn item
+ assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 5));
+ assert_noop!(
+ TemplateModule::burn_item(origin1, 1, 1, 5),
+ Error::<Test>::TokenValueNotEnough
+ );
- assert_eq!(TemplateModule::balance_count(1, 1), 0);
- });
+ assert_eq!(TemplateModule::balance_count(1, 1), 0);
+ });
}
#[test]
fn burn_refungible_item() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
- let origin1 = Origin::signed(1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- true
- ));
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
+ let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+ let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), 1, 2));
-
- let data = default_re_fungible_data();
- create_test_item(collection_id, &data.into());
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ collection_id,
+ true
+ ));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(1)
+ ));
+
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ 1,
+ account(2)
+ ));
+
+ let data = default_re_fungible_data();
+ create_test_item(collection_id, &data.into());
- // check balance (collection with id = 1, user id = 2)
- assert_eq!(TemplateModule::balance_count(1, 1), 1023);
+ // check balance (collection with id = 1, user id = 2)
+ assert_eq!(TemplateModule::balance_count(1, 1), 1023);
- // burn item
- assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 1023));
- assert_noop!(
- TemplateModule::burn_item(origin1.clone(), 1, 1, 1023),
- Error::<Test>::TokenNotFound
- );
+ // burn item
+ assert_ok!(TemplateModule::burn_item(origin1.clone(), 1, 1, 1023));
+ assert_noop!(
+ TemplateModule::burn_item(origin1, 1, 1, 1023),
+ Error::<Test>::TokenNotFound
+ );
- assert_eq!(TemplateModule::balance_count(1, 1), 0);
- });
+ assert_eq!(TemplateModule::balance_count(1, 1), 0);
+ });
}
#[test]
fn add_collection_admin() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
- create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
- create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
-
- let origin1 = Origin::signed(1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- // collection admin
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, 2));
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, 3));
+ let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
+ create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
+ create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
+
+ let origin1 = Origin::signed(1);
+
+ // collection admin
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ collection1_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1,
+ collection1_id,
+ account(3)
+ ));
- assert_eq!(TemplateModule::admin_list_collection(collection1_id).contains(&2), true);
- assert_eq!(TemplateModule::admin_list_collection(collection1_id).contains(&3), true);
- });
+ assert!(TemplateModule::admin_list_collection(collection1_id).contains(&account(2)),);
+ assert!(TemplateModule::admin_list_collection(collection1_id).contains(&account(3)),);
+ });
}
#[test]
fn remove_collection_admin() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
- create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
- create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
+ create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
+ create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
- // collection admin
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, 2));
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection1_id, 3));
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_eq!(TemplateModule::admin_list_collection(1).contains(&2), true);
- assert_eq!(TemplateModule::admin_list_collection(1).contains(&3), true);
+ // collection admin
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ collection1_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1,
+ collection1_id,
+ account(3)
+ ));
- // remove admin
- assert_ok!(TemplateModule::remove_collection_admin(
- origin2.clone(),
- 1,
- 3
- ));
- assert_eq!(TemplateModule::admin_list_collection(1).contains(&3), false);
- });
+ assert!(TemplateModule::admin_list_collection(1).contains(&account(2)),);
+ assert!(TemplateModule::admin_list_collection(1).contains(&account(3)),);
+
+ // remove admin
+ assert_ok!(TemplateModule::remove_collection_admin(
+ origin2,
+ 1,
+ account(3)
+ ));
+ assert!(!TemplateModule::admin_list_collection(1).contains(&account(3)),);
+ });
}
#[test]
fn balance_of() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let nft_collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let fungible_collection_id = create_test_collection(&CollectionMode::Fungible(3), 2);
- let re_fungible_collection_id = create_test_collection(&CollectionMode::ReFungible, 3);
-
- // check balance before
- assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 0);
- assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 0);
- assert_eq!(TemplateModule::balance_count(re_fungible_collection_id, 1), 0);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let nft_collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let fungible_collection_id = create_test_collection(&CollectionMode::Fungible(3), 2);
+ let re_fungible_collection_id = create_test_collection(&CollectionMode::ReFungible, 3);
+
+ // check balance before
+ assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 0);
+ assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 0);
+ assert_eq!(
+ TemplateModule::balance_count(re_fungible_collection_id, 1),
+ 0
+ );
+
+ let nft_data = default_nft_data();
+ create_test_item(nft_collection_id, &nft_data.into());
+
+ let fungible_data = default_fungible_data();
+ create_test_item(fungible_collection_id, &fungible_data.into());
- let nft_data = default_nft_data();
- create_test_item(nft_collection_id, &nft_data.into());
-
- let fungible_data = default_fungible_data();
- create_test_item(fungible_collection_id, &fungible_data.into());
-
- let re_fungible_data = default_re_fungible_data();
- create_test_item(re_fungible_collection_id, &re_fungible_data.into());
+ let re_fungible_data = default_re_fungible_data();
+ create_test_item(re_fungible_collection_id, &re_fungible_data.into());
- // check balance (collection with id = 1, user id = 1)
- assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 1);
- assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 5);
- assert_eq!(TemplateModule::balance_count(re_fungible_collection_id, 1), 1023);
- assert_eq!(TemplateModule::nft_item_id(nft_collection_id, 1).unwrap().owner, 1);
- assert_eq!(TemplateModule::fungible_item_id(fungible_collection_id, 1).value, 5);
- assert_eq!(TemplateModule::refungible_item_id(re_fungible_collection_id, 1).unwrap().owner[0].owner, 1);
- });
+ // check balance (collection with id = 1, user id = 1)
+ assert_eq!(TemplateModule::balance_count(nft_collection_id, 1), 1);
+ assert_eq!(TemplateModule::balance_count(fungible_collection_id, 1), 5);
+ assert_eq!(
+ TemplateModule::balance_count(re_fungible_collection_id, 1),
+ 1023
+ );
+ assert_eq!(
+ TemplateModule::nft_item_id(nft_collection_id, 1)
+ .unwrap()
+ .owner,
+ account(1)
+ );
+ assert_eq!(
+ TemplateModule::fungible_item_id(fungible_collection_id, 1).value,
+ 5
+ );
+ assert_eq!(
+ TemplateModule::refungible_item_id(re_fungible_collection_id, 1)
+ .unwrap()
+ .owner[0]
+ .owner,
+ account(1)
+ );
+ });
}
#[test]
fn approve() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
-
- // approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1, 1));
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
- });
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
+
+ let origin1 = Origin::signed(1);
+
+ // approve
+ assert_ok!(TemplateModule::approve(origin1, account(2), 1, 1, 1));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
+ });
}
#[test]
fn transfer_from() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- // approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 2, 1, 1, 1));
- assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- 1,
- true
- ));
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- 1,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 3));
+ // approve
+ assert_ok!(TemplateModule::approve(
+ origin1.clone(),
+ account(2),
+ 1,
+ 1,
+ 1
+ ));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 2)), 1);
- assert_ok!(TemplateModule::transfer_from(
- origin2.clone(),
- 1,
- 2,
- 1,
- 1,
- 1
- ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ 1,
+ true
+ ));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ 1,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(1)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(origin1, 1, account(3)));
- // after transfer
- assert_eq!(TemplateModule::balance_count(1, 1), 0);
- assert_eq!(TemplateModule::balance_count(1, 2), 1);
- });
+ assert_ok!(TemplateModule::transfer_from(
+ origin2,
+ account(1),
+ account(2),
+ 1,
+ 1,
+ 1
+ ));
+
+ // after transfer
+ assert_eq!(TemplateModule::balance_count(1, 1), 0);
+ assert_eq!(TemplateModule::balance_count(1, 2), 1);
+ });
}
// #endregion
@@ -895,1093 +1050,1304 @@
#[test]
fn owner_can_add_address_to_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
- assert_eq!(TemplateModule::white_list(collection_id, 2), true);
- });
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1,
+ collection_id,
+ account(2)
+ ));
+ assert!(TemplateModule::white_list(collection_id, 2));
+ });
}
#[test]
fn admin_can_add_address_to_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ new_test_ext().execute_with(|| {
+ default_limits();
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
- assert_ok!(TemplateModule::add_to_white_list(origin2.clone(), collection_id, 3));
- assert_eq!(TemplateModule::white_list(collection_id, 3), true);
- });
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
+
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1,
+ collection_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin2,
+ collection_id,
+ account(3)
+ ));
+ assert!(TemplateModule::white_list(collection_id, 3));
+ });
}
#[test]
fn nonprivileged_user_cannot_add_address_to_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin2 = Origin::signed(2);
- assert_noop!(
- TemplateModule::add_to_white_list(origin2.clone(), collection_id, 3),
- Error::<Test>::NoPermission
- );
- });
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let origin2 = Origin::signed(2);
+ assert_noop!(
+ TemplateModule::add_to_white_list(origin2, collection_id, account(3)),
+ Error::<Test>::NoPermission
+ );
+ });
}
#[test]
fn nobody_can_add_address_to_white_list_of_nonexisting_collection() {
- new_test_ext().execute_with(|| {
- default_limits();
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
+ let origin1 = Origin::signed(1);
- assert_noop!(
- TemplateModule::add_to_white_list(origin1.clone(), 1, 2),
- Error::<Test>::CollectionNotFound
- );
- });
+ assert_noop!(
+ TemplateModule::add_to_white_list(origin1, 1, account(2)),
+ Error::<Test>::CollectionNotFound
+ );
+ });
}
#[test]
fn nobody_can_add_address_to_white_list_of_deleted_collection() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
- assert_noop!(
- TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2),
- Error::<Test>::CollectionNotFound
- );
- });
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::destroy_collection(
+ origin1.clone(),
+ collection_id
+ ));
+ assert_noop!(
+ TemplateModule::add_to_white_list(origin1, collection_id, account(2)),
+ Error::<Test>::CollectionNotFound
+ );
+ });
}
// If address is already added to white list, nothing happens
#[test]
fn address_is_already_added_to_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
-
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
- assert_eq!(TemplateModule::white_list(collection_id, 2), true);
- });
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
+
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1,
+ collection_id,
+ account(2)
+ ));
+ assert!(TemplateModule::white_list(collection_id, 2));
+ });
}
#[test]
fn owner_can_remove_address_from_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
- assert_ok!(TemplateModule::remove_from_white_list(
- origin1.clone(),
- collection_id,
- 2
- ));
- assert_eq!(TemplateModule::white_list(collection_id, 2), false);
- });
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::remove_from_white_list(
+ origin1,
+ collection_id,
+ account(2)
+ ));
+ assert!(!TemplateModule::white_list(collection_id, 2));
+ });
}
#[test]
fn admin_can_remove_address_from_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ new_test_ext().execute_with(|| {
+ default_limits();
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 3));
- assert_ok!(TemplateModule::remove_from_white_list(
- origin2.clone(),
- collection_id,
- 3
- ));
- assert_eq!(TemplateModule::white_list(collection_id, 3), false);
- });
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1,
+ collection_id,
+ account(3)
+ ));
+ assert_ok!(TemplateModule::remove_from_white_list(
+ origin2,
+ collection_id,
+ account(3)
+ ));
+ assert!(!TemplateModule::white_list(collection_id, 3));
+ });
}
#[test]
fn nonprivileged_user_cannot_remove_address_from_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
- assert_noop!(
- TemplateModule::remove_from_white_list(origin2.clone(), collection_id, 2),
- Error::<Test>::NoPermission
- );
- assert_eq!(TemplateModule::white_list(collection_id, 2), true);
- });
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1,
+ collection_id,
+ account(2)
+ ));
+ assert_noop!(
+ TemplateModule::remove_from_white_list(origin2, collection_id, account(2)),
+ Error::<Test>::NoPermission
+ );
+ assert!(TemplateModule::white_list(collection_id, 2));
+ });
}
#[test]
fn nobody_can_remove_address_from_white_list_of_nonexisting_collection() {
- new_test_ext().execute_with(|| {
- default_limits();
- let origin1 = Origin::signed(1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+ let origin1 = Origin::signed(1);
- assert_noop!(
- TemplateModule::remove_from_white_list(origin1.clone(), 1, 2),
- Error::<Test>::CollectionNotFound
- );
- });
+ assert_noop!(
+ TemplateModule::remove_from_white_list(origin1, 1, account(2)),
+ Error::<Test>::CollectionNotFound
+ );
+ });
}
#[test]
fn nobody_can_remove_address_from_white_list_of_deleted_collection() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ new_test_ext().execute_with(|| {
+ default_limits();
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
- assert_ok!(TemplateModule::destroy_collection(origin1.clone(), collection_id));
- assert_noop!(
- TemplateModule::remove_from_white_list(origin2.clone(), collection_id, 2),
- Error::<Test>::CollectionNotFound
- );
- assert_eq!(TemplateModule::white_list(collection_id, 2), false);
- });
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
+
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::destroy_collection(origin1, collection_id));
+ assert_noop!(
+ TemplateModule::remove_from_white_list(origin2, collection_id, account(2)),
+ Error::<Test>::CollectionNotFound
+ );
+ assert!(!TemplateModule::white_list(collection_id, 2));
+ });
}
// If address is already removed from white list, nothing happens
#[test]
fn address_is_already_removed_from_white_list() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
- assert_ok!(TemplateModule::remove_from_white_list(
- origin1.clone(),
- collection_id,
- 2
- ));
- assert_ok!(TemplateModule::remove_from_white_list(
- origin1.clone(),
- collection_id,
- 2
- ));
- assert_eq!(TemplateModule::white_list(collection_id, 2), false);
- });
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
+
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::remove_from_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::remove_from_white_list(
+ origin1,
+ collection_id,
+ account(2)
+ ));
+ assert!(!TemplateModule::white_list(collection_id, 2));
+ });
}
// If Public Access mode is set to WhiteList, tokens can’t be transferred from a non-whitelisted address with transfer or transferFrom (2 tests)
#[test]
fn white_list_test_1() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
-
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let origin1 = Origin::signed(1);
+
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
- assert_noop!(
- TemplateModule::transfer(origin1.clone(), 3, 1, 1, 1),
- Error::<Test>::AddresNotInWhiteList
- );
- });
+ assert_noop!(
+ TemplateModule::transfer(origin1, account(3), 1, 1, 1),
+ Error::<Test>::AddresNotInWhiteList
+ );
+ });
}
#[test]
fn white_list_test_2() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
-
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ new_test_ext().execute_with(|| {
+ default_limits();
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 2));
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
- // do approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 1, 1, 1, 1));
- assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 1);
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- assert_ok!(TemplateModule::remove_from_white_list(
- origin1.clone(),
- 1,
- 1
- ));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(1)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(2)
+ ));
+
+ // do approve
+ assert_ok!(TemplateModule::approve(
+ origin1.clone(),
+ account(1),
+ 1,
+ 1,
+ 1
+ ));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 1);
- assert_noop!(
- TemplateModule::transfer_from(origin1.clone(), 1, 3, 1, 1, 1),
- Error::<Test>::AddresNotInWhiteList
- );
- });
+ assert_ok!(TemplateModule::remove_from_white_list(
+ origin1.clone(),
+ 1,
+ account(1)
+ ));
+
+ assert_noop!(
+ TemplateModule::transfer_from(origin1, account(1), account(3), 1, 1, 1),
+ Error::<Test>::AddresNotInWhiteList
+ );
+ });
}
// If Public Access mode is set to WhiteList, tokens can’t be transferred to a non-whitelisted address with transfer or transferFrom (2 tests)
#[test]
fn white_list_test_3() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let origin1 = Origin::signed(1);
- let origin1 = Origin::signed(1);
-
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), 1, 1));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ 1,
+ account(1)
+ ));
- assert_noop!(
- TemplateModule::transfer(origin1.clone(), 3, 1, 1, 1),
- Error::<Test>::AddresNotInWhiteList
- );
- });
+ assert_noop!(
+ TemplateModule::transfer(origin1, account(3), 1, 1, 1),
+ Error::<Test>::AddresNotInWhiteList
+ );
+ });
}
#[test]
fn white_list_test_4() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 1));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- // do approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 1, 1, 1, 1));
- assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 1);
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(1)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+
+ // do approve
+ assert_ok!(TemplateModule::approve(
+ origin1.clone(),
+ account(1),
+ 1,
+ 1,
+ 1
+ ));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 1);
- assert_ok!(TemplateModule::remove_from_white_list(
- origin1.clone(),
- collection_id,
- 2
- ));
+ assert_ok!(TemplateModule::remove_from_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
- assert_noop!(
- TemplateModule::transfer_from(origin1.clone(), 1, 3, 1, 1, 1),
- Error::<Test>::AddresNotInWhiteList
- );
- });
+ assert_noop!(
+ TemplateModule::transfer_from(origin1, account(1), account(3), 1, 1, 1),
+ Error::<Test>::AddresNotInWhiteList
+ );
+ });
}
// If Public Access mode is set to WhiteList, tokens can’t be destroyed by a non-whitelisted address (even if it owned them before enabling WhiteList mode)
#[test]
fn white_list_test_5() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let origin1 = Origin::signed(1);
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_noop!(
- TemplateModule::burn_item(origin1.clone(), 1, 1, 5),
- Error::<Test>::AddresNotInWhiteList
- );
- });
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_noop!(
+ TemplateModule::burn_item(origin1, 1, 1, 5),
+ Error::<Test>::AddresNotInWhiteList
+ );
+ });
}
// If Public Access mode is set to WhiteList, token transfers can’t be Approved by a non-whitelisted address (see Approve method).
#[test]
fn white_list_test_6() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
+ let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
+
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
- // do approve
- assert_noop!(
- TemplateModule::approve(origin1.clone(), 1, 1, 1, 5),
- Error::<Test>::AddresNotInWhiteList
- );
- });
+ // do approve
+ assert_noop!(
+ TemplateModule::approve(origin1, account(1), 1, 1, 5),
+ Error::<Test>::AddresNotInWhiteList
+ );
+ });
}
// If Public Access mode is set to WhiteList, tokens can be transferred from a whitelisted address with transfer or transferFrom (2 tests) and
// tokens can be transferred from a whitelisted address with transfer or transferFrom (2 tests)
#[test]
fn white_list_test_7() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
-
- let origin1 = Origin::signed(1);
+ let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 1));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(1)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
- assert_ok!(TemplateModule::transfer(origin1.clone(), 2, 1, 1, 1));
- });
+ assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 1));
+ });
}
#[test]
fn white_list_test_8() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
-
- let origin1 = Origin::signed(1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 1));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
- // do approve
- assert_ok!(TemplateModule::approve(origin1.clone(), 1, 1, 1, 5));
- assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 5);
+ let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::transfer_from(
- origin1.clone(),
- 1,
- 2,
- 1,
- 1,
- 1
- ));
- });
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(1)
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+
+ // do approve
+ assert_ok!(TemplateModule::approve(
+ origin1.clone(),
+ account(1),
+ 1,
+ 1,
+ 5
+ ));
+ assert_eq!(TemplateModule::approved(1, (1, 1, 1)), 5);
+
+ assert_ok!(TemplateModule::transfer_from(
+ origin1,
+ account(1),
+ account(2),
+ 1,
+ 1,
+ 1
+ ));
+ });
}
// If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens can be created by owner.
#[test]
fn white_list_test_9() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- false
- ));
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let origin1 = Origin::signed(1);
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
- });
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1,
+ collection_id,
+ false
+ ));
+
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
+ });
}
// If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens can be created by admin.
#[test]
fn white_list_test_10() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- false
- ));
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ collection_id,
+ false
+ ));
- assert_ok!(TemplateModule::create_item(
- origin2.clone(),
- collection_id,
- 2,
- default_nft_data().into()
- ));
- });
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1,
+ collection_id,
+ account(2)
+ ));
+
+ assert_ok!(TemplateModule::create_item(
+ origin2,
+ collection_id,
+ account(2),
+ default_nft_data().into()
+ ));
+ });
}
// If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens cannot be created by non-privileged and white listed address.
#[test]
fn white_list_test_11() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- false
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_noop!(
- TemplateModule::create_item(origin2.clone(), 1, 2, default_nft_data().into()),
- Error::<Test>::PublicMintingNotAllowed
- );
- });
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ collection_id,
+ false
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1,
+ collection_id,
+ account(2)
+ ));
+
+ assert_noop!(
+ TemplateModule::create_item(origin2, 1, account(2), default_nft_data().into()),
+ Error::<Test>::PublicMintingNotAllowed
+ );
+ });
}
// If Public Access mode is set to WhiteList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-white listed address.
#[test]
fn white_list_test_12() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- false
- ));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1,
+ collection_id,
+ false
+ ));
- assert_noop!(
- TemplateModule::create_item(origin2.clone(), 1, 2, default_nft_data().into()),
- Error::<Test>::PublicMintingNotAllowed
- );
- });
+ assert_noop!(
+ TemplateModule::create_item(origin2, 1, account(2), default_nft_data().into()),
+ Error::<Test>::PublicMintingNotAllowed
+ );
+ });
}
// If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by owner.
#[test]
fn white_list_test_13() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- true
- ));
+ let origin1 = Origin::signed(1);
+
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1,
+ collection_id,
+ true
+ ));
- let data = default_nft_data();
- create_test_item(collection_id, &data.into());
- });
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.into());
+ });
}
// If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by admin.
#[test]
fn white_list_test_14() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- true
- ));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ collection_id,
+ true
+ ));
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1,
+ collection_id,
+ account(2)
+ ));
- assert_ok!(TemplateModule::create_item(
- origin2.clone(),
- 1,
- 2,
- default_nft_data().into()
- ));
- });
+ assert_ok!(TemplateModule::create_item(
+ origin2,
+ 1,
+ account(2),
+ default_nft_data().into()
+ ));
+ });
}
// If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-white listed address.
#[test]
fn white_list_test_15() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- true
- ));
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_noop!(
- TemplateModule::create_item(origin2.clone(), 1, 2, default_nft_data().into()),
- Error::<Test>::AddresNotInWhiteList
- );
- });
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1,
+ collection_id,
+ true
+ ));
+
+ assert_noop!(
+ TemplateModule::create_item(origin2, 1, account(2), default_nft_data().into()),
+ Error::<Test>::AddresNotInWhiteList
+ );
+ });
}
// If Public Access mode is set to WhiteList, and Mint Permission is set to true, tokens can be created by non-privileged and white listed address.
#[test]
fn white_list_test_16() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let origin2 = Origin::signed(2);
+ let origin1 = Origin::signed(1);
+ let origin2 = Origin::signed(2);
- assert_ok!(TemplateModule::set_public_access_mode(
- origin1.clone(),
- collection_id,
- AccessMode::WhiteList
- ));
- assert_ok!(TemplateModule::set_mint_permission(
- origin1.clone(),
- collection_id,
- true
- ));
- assert_ok!(TemplateModule::add_to_white_list(origin1.clone(), collection_id, 2));
+ assert_ok!(TemplateModule::set_public_access_mode(
+ origin1.clone(),
+ collection_id,
+ AccessMode::WhiteList
+ ));
+ assert_ok!(TemplateModule::set_mint_permission(
+ origin1.clone(),
+ collection_id,
+ true
+ ));
+ assert_ok!(TemplateModule::add_to_white_list(
+ origin1,
+ collection_id,
+ account(2)
+ ));
- assert_ok!(TemplateModule::create_item(
- origin2.clone(),
- 1,
- 2,
- default_nft_data().into()
- ));
- });
+ assert_ok!(TemplateModule::create_item(
+ origin2,
+ 1,
+ account(2),
+ default_nft_data().into()
+ ));
+ });
}
// Total number of collections. Positive test
#[test]
fn total_number_collections_bound() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- create_test_collection(&CollectionMode::NFT, 1);
- });
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ create_test_collection(&CollectionMode::NFT, 1);
+ });
}
// Total number of collections. Negotive test
#[test]
fn total_number_collections_bound_neg() {
- new_test_ext().execute_with(|| {
- default_limits();
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
+ let origin1 = Origin::signed(1);
- for i in 0..default_collection_numbers_limit() {
- create_test_collection(&CollectionMode::NFT, i + 1);
- }
+ for i in 0..default_collection_numbers_limit() {
+ create_test_collection(&CollectionMode::NFT, i + 1);
+ }
- let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
- let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
- let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
+ let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
+ let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
+ let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
- // 11-th collection in chain. Expects error
- assert_noop!(TemplateModule::create_collection(
- origin1.clone(),
- col_name1.clone(),
- col_desc1.clone(),
- token_prefix1.clone(),
- CollectionMode::NFT
- ), Error::<Test>::TotalCollectionsLimitExceeded);
- });
+ // 11-th collection in chain. Expects error
+ assert_noop!(
+ TemplateModule::create_collection(
+ origin1,
+ col_name1,
+ col_desc1,
+ token_prefix1,
+ CollectionMode::NFT
+ ),
+ Error::<Test>::TotalCollectionsLimitExceeded
+ );
+ });
}
// Owned tokens by a single address. Positive test
#[test]
fn owned_tokens_bound() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let data = default_nft_data();
- create_test_item(collection_id, &data.clone().into());
- create_test_item(collection_id, &data.into());
- });
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.clone().into());
+ create_test_item(collection_id, &data.into());
+ });
}
// Owned tokens by a single address. Negotive test
#[test]
fn owned_tokens_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 1,
- collections_admins_limit: 5,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: 10,
+ account_token_ownership_limit: 1,
+ collections_admins_limit: 5,
+ custom_data_limit: 2048,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
- let origin1 = Origin::signed(1);
- let data = default_nft_data();
- create_test_item(collection_id, &data.clone().into());
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- assert_noop!(TemplateModule::create_item(
- origin1.clone(),
- 1,
- 1,
- data.into()
- ), Error::<Test>::AddressOwnershipLimitExceeded);
- });
+ let origin1 = Origin::signed(1);
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.clone().into());
+
+ assert_noop!(
+ TemplateModule::create_item(origin1, 1, account(1), data.into()),
+ Error::<Test>::AddressOwnershipLimitExceeded
+ );
+ });
}
// Number of collection admins. Positive test
#[test]
fn collection_admins_bound() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 2,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: 10,
+ account_token_ownership_limit: 10,
+ collections_admins_limit: 2,
+ custom_data_limit: 2048,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let origin1 = Origin::signed(1);
- let origin1 = Origin::signed(1);
-
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 3));
- });
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1,
+ collection_id,
+ account(3)
+ ));
+ });
}
// Number of collection admins. Negotive test
#[test]
fn collection_admins_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 1,
- collections_admins_limit: 1,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: 10,
+ account_token_ownership_limit: 1,
+ collections_admins_limit: 1,
+ custom_data_limit: 2048,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
- let origin1 = Origin::signed(1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+
+ let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 2));
- assert_noop!(TemplateModule::add_collection_admin(origin1.clone(), collection_id, 3), Error::<Test>::CollectionAdminsLimitExceeded);
- });
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ collection_id,
+ account(2)
+ ));
+ assert_noop!(
+ TemplateModule::add_collection_admin(origin1, collection_id, account(3)),
+ Error::<Test>::CollectionAdminsLimitExceeded
+ );
+ });
}
// NFT custom data size. Negative test const_data.
#[test]
fn custom_data_size_nft_const_data_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: 10,
+ account_token_ownership_limit: 10,
+ collections_admins_limit: 5,
+ custom_data_limit: 2,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
+
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let too_big_const_data = CreateItemData::NFT(CreateNftData{
- const_data: vec![1, 2, 3, 4],
- variable_data: vec![]
- });
+ let origin1 = Origin::signed(1);
+ let too_big_const_data = CreateItemData::NFT(CreateNftData {
+ const_data: vec![1, 2, 3, 4],
+ variable_data: vec![],
+ });
- assert_noop!(TemplateModule::create_item(
- origin1.clone(),
- collection_id,
- 1,
- too_big_const_data
- ), Error::<Test>::TokenConstDataLimitExceeded);
- });
+ assert_noop!(
+ TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
+ Error::<Test>::TokenConstDataLimitExceeded
+ );
+ });
}
// NFT custom data size. Negative test variable_data.
#[test]
fn custom_data_size_nft_variable_data_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: 10,
+ account_token_ownership_limit: 10,
+ collections_admins_limit: 5,
+ custom_data_limit: 2,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let too_big_const_data = CreateItemData::NFT(CreateNftData{
- const_data: vec![],
- variable_data: vec![1, 2, 3, 4]
- });
+ let origin1 = Origin::signed(1);
+ let too_big_const_data = CreateItemData::NFT(CreateNftData {
+ const_data: vec![],
+ variable_data: vec![1, 2, 3, 4],
+ });
- assert_noop!(TemplateModule::create_item(
- origin1.clone(),
- collection_id,
- 1,
- too_big_const_data
- ), Error::<Test>::TokenVariableDataLimitExceeded);
- });
+ assert_noop!(
+ TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
+ Error::<Test>::TokenVariableDataLimitExceeded
+ );
+ });
}
// Re fungible custom data size. Negative test const_data.
#[test]
fn custom_data_size_re_fungible_const_data_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: 10,
+ account_token_ownership_limit: 10,
+ collections_admins_limit: 5,
+ custom_data_limit: 2,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let too_big_const_data = CreateItemData::NFT(CreateNftData{
- const_data: vec![1, 2, 3, 4],
- variable_data: vec![]
- });
+ let origin1 = Origin::signed(1);
+ let too_big_const_data = CreateItemData::NFT(CreateNftData {
+ const_data: vec![1, 2, 3, 4],
+ variable_data: vec![],
+ });
- assert_noop!(TemplateModule::create_item(
- origin1.clone(),
- collection_id,
- 1,
- too_big_const_data
- ), Error::<Test>::TokenConstDataLimitExceeded);
- });
+ assert_noop!(
+ TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
+ Error::<Test>::TokenConstDataLimitExceeded
+ );
+ });
}
// Re fungible custom data size. Negative test variable_data.
#[test]
fn custom_data_size_re_fungible_variable_data_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: 10,
+ account_token_ownership_limit: 10,
+ collections_admins_limit: 5,
+ custom_data_limit: 2,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- let too_big_const_data = CreateItemData::NFT(CreateNftData{
- const_data: vec![],
- variable_data: vec![1, 2, 3, 4]
- });
+ let origin1 = Origin::signed(1);
+ let too_big_const_data = CreateItemData::NFT(CreateNftData {
+ const_data: vec![],
+ variable_data: vec![1, 2, 3, 4],
+ });
- assert_noop!(TemplateModule::create_item(
- origin1.clone(),
- collection_id,
- 1,
- too_big_const_data
- ), Error::<Test>::TokenVariableDataLimitExceeded);
- });
+ assert_noop!(
+ TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
+ Error::<Test>::TokenVariableDataLimitExceeded
+ );
+ });
}
// #endregion
#[test]
fn set_const_on_chain_schema() {
- new_test_ext().execute_with(|| {
- default_limits();
+ new_test_ext().execute_with(|| {
+ default_limits();
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::set_const_on_chain_schema(origin1, collection_id, b"test const on chain schema".to_vec()));
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::set_const_on_chain_schema(
+ origin1,
+ collection_id,
+ b"test const on chain schema".to_vec()
+ ));
- assert_eq!(TemplateModule::collection_id(collection_id).unwrap().const_on_chain_schema, b"test const on chain schema".to_vec());
- assert_eq!(TemplateModule::collection_id(collection_id).unwrap().variable_on_chain_schema, b"".to_vec());
- });
+ assert_eq!(
+ TemplateModule::collection_id(collection_id)
+ .unwrap()
+ .const_on_chain_schema,
+ b"test const on chain schema".to_vec()
+ );
+ assert_eq!(
+ TemplateModule::collection_id(collection_id)
+ .unwrap()
+ .variable_on_chain_schema,
+ b"".to_vec()
+ );
+ });
}
#[test]
fn set_variable_on_chain_schema() {
- new_test_ext().execute_with(|| {
- default_limits();
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ new_test_ext().execute_with(|| {
+ default_limits();
- let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::set_variable_on_chain_schema(origin1, collection_id, b"test variable on chain schema".to_vec()));
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- assert_eq!(TemplateModule::collection_id(collection_id).unwrap().const_on_chain_schema, b"".to_vec());
- assert_eq!(TemplateModule::collection_id(collection_id).unwrap().variable_on_chain_schema, b"test variable on chain schema".to_vec());
- });
+ let origin1 = Origin::signed(1);
+ assert_ok!(TemplateModule::set_variable_on_chain_schema(
+ origin1,
+ collection_id,
+ b"test variable on chain schema".to_vec()
+ ));
+
+ assert_eq!(
+ TemplateModule::collection_id(collection_id)
+ .unwrap()
+ .const_on_chain_schema,
+ b"".to_vec()
+ );
+ assert_eq!(
+ TemplateModule::collection_id(collection_id)
+ .unwrap()
+ .variable_on_chain_schema,
+ b"test variable on chain schema".to_vec()
+ );
+ });
}
#[test]
fn set_variable_meta_data_on_nft_token_stores_variable_meta_data() {
- new_test_ext().execute_with(|| {
- default_limits();
+ new_test_ext().execute_with(|| {
+ default_limits();
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
-
- let data = default_nft_data();
- create_test_item(1, &data.into());
-
- let variable_data = b"test set_variable_meta_data method.".to_vec();
- assert_ok!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data.clone()));
+ let origin1 = Origin::signed(1);
- assert_eq!(TemplateModule::nft_item_id(collection_id, 1).unwrap().variable_data, variable_data);
- });
+ let data = default_nft_data();
+ create_test_item(1, &data.into());
+
+ let variable_data = b"test set_variable_meta_data method.".to_vec();
+ assert_ok!(TemplateModule::set_variable_meta_data(
+ origin1,
+ collection_id,
+ 1,
+ variable_data.clone()
+ ));
+
+ assert_eq!(
+ TemplateModule::nft_item_id(collection_id, 1)
+ .unwrap()
+ .variable_data,
+ variable_data
+ );
+ });
}
#[test]
fn set_variable_meta_data_on_re_fungible_token_stores_variable_meta_data() {
- new_test_ext().execute_with(|| {
- default_limits();
+ new_test_ext().execute_with(|| {
+ default_limits();
- let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+ let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
- let origin1 = Origin::signed(1);
+ let origin1 = Origin::signed(1);
- let data = default_re_fungible_data();
- create_test_item(1, &data.into());
+ let data = default_re_fungible_data();
+ create_test_item(1, &data.into());
- let variable_data = b"test set_variable_meta_data method.".to_vec();
- assert_ok!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data.clone()));
+ let variable_data = b"test set_variable_meta_data method.".to_vec();
+ assert_ok!(TemplateModule::set_variable_meta_data(
+ origin1,
+ collection_id,
+ 1,
+ variable_data.clone()
+ ));
- assert_eq!(TemplateModule::refungible_item_id(collection_id, 1).unwrap().variable_data, variable_data);
- });
+ assert_eq!(
+ TemplateModule::refungible_item_id(collection_id, 1)
+ .unwrap()
+ .variable_data,
+ variable_data
+ );
+ });
}
-
#[test]
fn set_variable_meta_data_on_fungible_token_fails() {
- new_test_ext().execute_with(|| {
- default_limits();
+ new_test_ext().execute_with(|| {
+ default_limits();
- let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
+ let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
- let origin1 = Origin::signed(1);
+ let origin1 = Origin::signed(1);
- let data = default_fungible_data();
- create_test_item(1, &data.into());
+ let data = default_fungible_data();
+ create_test_item(1, &data.into());
- let variable_data = b"test set_variable_meta_data method.".to_vec();
- assert_noop!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data.clone()), Error::<Test>::CantStoreMetadataInFungibleTokens);
- });
+ let variable_data = b"test set_variable_meta_data method.".to_vec();
+ assert_noop!(
+ TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data),
+ Error::<Test>::CantStoreMetadataInFungibleTokens
+ );
+ });
}
#[test]
fn set_variable_meta_data_on_nft_token_fails_for_big_data() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: default_collection_numbers_limit(),
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 10,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: default_collection_numbers_limit(),
+ account_token_ownership_limit: 10,
+ collections_admins_limit: 5,
+ custom_data_limit: 10,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+ let collection_id = create_test_collection(&CollectionMode::NFT, 1);
- let origin1 = Origin::signed(1);
+ let origin1 = Origin::signed(1);
- let data = default_nft_data();
- create_test_item(1, &data.into());
+ let data = default_nft_data();
+ create_test_item(1, &data.into());
- let variable_data = b"test set_variable_meta_data method, bigger than limits.".to_vec();
- assert_noop!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data), Error::<Test>::TokenVariableDataLimitExceeded);
- });
+ let variable_data = b"test set_variable_meta_data method, bigger than limits.".to_vec();
+ assert_noop!(
+ TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data),
+ Error::<Test>::TokenVariableDataLimitExceeded
+ );
+ });
}
#[test]
fn set_variable_meta_data_on_re_fungible_token_fails_for_big_data() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(RawOrigin::Root.into(), ChainLimits {
- collection_numbers_limit: default_collection_numbers_limit(),
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 10,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }));
+ new_test_ext().execute_with(|| {
+ assert_ok!(TemplateModule::set_chain_limits(
+ RawOrigin::Root.into(),
+ ChainLimits {
+ collection_numbers_limit: default_collection_numbers_limit(),
+ account_token_ownership_limit: 10,
+ collections_admins_limit: 5,
+ custom_data_limit: 10,
+ nft_sponsor_transfer_timeout: 15,
+ fungible_sponsor_transfer_timeout: 15,
+ refungible_sponsor_transfer_timeout: 15,
+ const_on_chain_schema_limit: 1024,
+ offchain_schema_limit: 1024,
+ variable_on_chain_schema_limit: 1024,
+ }
+ ));
+ let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
- let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
+ let origin1 = Origin::signed(1);
- let origin1 = Origin::signed(1);
-
- let data = default_re_fungible_data();
- create_test_item(1, &data.into());
+ let data = default_re_fungible_data();
+ create_test_item(1, &data.into());
- let variable_data = b"test set_variable_meta_data method, bigger than limits.".to_vec();
- assert_noop!(TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data), Error::<Test>::TokenVariableDataLimitExceeded);
- });
+ let variable_data = b"test set_variable_meta_data method, bigger than limits.".to_vec();
+ assert_noop!(
+ TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data),
+ Error::<Test>::TokenVariableDataLimitExceeded
+ );
+ });
}
pallets/scheduler/Cargo.tomldiffbeforeafterboth--- a/pallets/scheduler/Cargo.toml
+++ b/pallets/scheduler/Cargo.toml
@@ -12,19 +12,19 @@
[dependencies]
serde = { version = "1.0.119", default-features = false }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
-frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-io = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-frame-benchmarking = { default-features = false, version = '3.0.0', optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
+frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-runtime = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-io = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+frame-benchmarking = { default-features = false, version = '3.0.0', optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
up-sponsorship = { default-features = false, path = "../../primitives/sponsorship", version = "0.1.0" }
log = { version = "0.4.14", default-features = false }
[dev-dependencies]
-sp-core = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-substrate-test-utils = { version = "3.0.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
+sp-core = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+substrate-test-utils = { version = "3.0.0", git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
[features]
default = ["std"]
pallets/scheduler/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/scheduler/src/benchmarking.rs
+++ b/pallets/scheduler/src/benchmarking.rs
@@ -31,7 +31,7 @@
const BLOCK_NUMBER: u32 = 2;
// Add `n` named items to the schedule
-fn fill_schedule<T: Config> (when: T::BlockNumber, n: u32) -> Result<(), &'static str> {
+fn fill_schedule<T: Config>(when: T::BlockNumber, n: u32) -> Result<(), &'static str> {
// Essentially a no-op call.
let call = frame_system::Call::set_storage(vec![]);
for i in 0..n {
@@ -47,7 +47,10 @@
call.clone().into(),
)?;
}
- ensure!(Agenda::<T>::get(when).len() == n as usize, "didn't fill schedule");
+ ensure!(
+ Agenda::<T>::get(when).len() == n as usize,
+ "didn't fill schedule"
+ );
Ok(())
}
@@ -141,8 +144,4 @@
}
}
-impl_benchmark_test_suite!(
- Scheduler,
- crate::tests::new_test_ext(),
- crate::tests::Test,
-);
+impl_benchmark_test_suite!(Scheduler, crate::tests::new_test_ext(), crate::tests::Test,);
pallets/scheduler/src/lib.rsdiffbeforeafterboth--- a/pallets/scheduler/src/lib.rs
+++ b/pallets/scheduler/src/lib.rs
@@ -50,17 +50,25 @@
// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
+#![allow(clippy::type_complexity, clippy::boxed_local, clippy::unused_unit)]
mod benchmarking;
pub mod weights;
use sp_std::{prelude::*, marker::PhantomData, borrow::Borrow};
use codec::{Encode, Decode, Codec};
-use sp_runtime::{RuntimeDebug, traits::{Zero, One, BadOrigin, Saturating}};
+use sp_runtime::{
+ RuntimeDebug,
+ traits::{Zero, One, BadOrigin, Saturating},
+};
use frame_support::{
decl_module, decl_storage, decl_event, decl_error, IterableStorageMap,
dispatch::{Dispatchable, DispatchError, DispatchResult, Parameter},
- traits::{Get, schedule::{self, DispatchTime}, OriginTrait, EnsureOrigin, IsType},
+ traits::{
+ Get,
+ schedule::{self, DispatchTime},
+ OriginTrait, EnsureOrigin, IsType,
+ },
weights::{GetDispatchInfo, Weight},
};
use frame_system::{self as system, ensure_signed};
@@ -72,22 +80,24 @@
/// should be added to our implied traits list.
///
/// `system::Config` should always be included in our implied traits.
-/// //
-pub trait Config: system::Config
-{
-
+/// //
+pub trait Config: system::Config {
/// The overarching event type.
type Event: From<Event<Self>> + Into<<Self as system::Config>::Event>;
/// The aggregated origin which the dispatch will take.
type Origin: OriginTrait<PalletsOrigin = Self::PalletsOrigin>
- + From<Self::PalletsOrigin> + IsType<<Self as system::Config>::Origin>;
+ + From<Self::PalletsOrigin>
+ + IsType<<Self as system::Config>::Origin>;
/// The caller origin, overarching type of all pallets origins.
type PalletsOrigin: From<system::RawOrigin<Self::AccountId>> + Codec + Clone + Eq;
/// The aggregated call type.
- type Call: Parameter + Dispatchable<Origin=<Self as Config>::Origin> + GetDispatchInfo + From<system::Call<Self>>;
+ type Call: Parameter
+ + Dispatchable<Origin = <Self as Config>::Origin>
+ + GetDispatchInfo
+ + From<system::Call<Self>>;
/// The maximum weight that may be scheduled per block for any dispatchables of less priority
/// than `schedule::HARD_DEADLINE`.
@@ -141,7 +151,8 @@
}
/// The current version of Scheduled struct.
-pub type Scheduled<Call, BlockNumber, PalletsOrigin, AccountId> = ScheduledV2<Call, BlockNumber, PalletsOrigin, AccountId>;
+pub type Scheduled<Call, BlockNumber, PalletsOrigin, AccountId> =
+ ScheduledV2<Call, BlockNumber, PalletsOrigin, AccountId>;
// A value placed in storage that represents the current version of the Scheduler storage.
// This value is used by the `on_runtime_upgrade` logic to determine whether we run
@@ -160,7 +171,6 @@
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)]
pub struct CallSpec {
-
module: u32,
method: u32,
}
@@ -172,7 +182,7 @@
=> Vec<Option<Scheduled<<T as Config>::Call, T::BlockNumber, T::PalletsOrigin, T::AccountId>>>;
pub SpecAgenda: map hasher(twox_64_concat) T::BlockNumber
- => Vec<Option<CallSpec>>;
+ => Vec<Option<CallSpec>>;
/// Lookup from identity to the block number and index of the task.
Lookup: map hasher(twox_64_concat) Vec<u8> => Option<TaskAddress<T::BlockNumber>>;
@@ -210,8 +220,8 @@
decl_module! {
/// Scheduler module declaration.
- pub struct Module<T: Config> for enum Call
- where
+ pub struct Module<T: Config> for enum Call
+ where
origin: <T as system::Config>::Origin
{
type Error = Error<T>;
@@ -234,7 +244,7 @@
maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
priority: schedule::Priority,
call: Box<<T as Config>::Call>,
- )
+ )
{
let origin = <T as Config>::Origin::from(origin);
Self::do_schedule(DispatchTime::At(when), maybe_periodic, priority, origin.caller().clone(), *call)?;
@@ -402,12 +412,12 @@
let origin = <<T as Config>::Origin as From<T::PalletsOrigin>>::from(
s.origin.clone()
).into();
- let sender = ensure_signed(origin).unwrap_or(T::AccountId::default());
+ let sender = ensure_signed(origin).unwrap_or_default();
let who_will_pay = T::SponsorshipHandler::get_sponsor(&sender, &s.call).unwrap_or(sender);
let sponsor = T::PalletsOrigin::from(system::RawOrigin::Signed(who_will_pay));
let r = s.call.clone().dispatch(sponsor.into());
let maybe_id = s.maybe_id.clone();
- if let &Some((period, count)) = &s.maybe_periodic {
+ if let Some((period, count)) = s.maybe_periodic {
if count > 1 {
s.maybe_periodic = Some((period, count - 1));
} else {
@@ -420,11 +430,9 @@
Lookup::<T>::insert(id, (next, next_index as u32));
}
Agenda::<T>::append(next, Some(s));
- } else {
- if let Some(ref id) = s.maybe_id {
- Lookup::<T>::remove(id);
- }
- }
+ } else if let Some(ref id) = s.maybe_id {
+ Lookup::<T>::remove(id);
+ }
Self::deposit_event(RawEvent::Dispatched(
(now, index),
maybe_id,
@@ -454,20 +462,25 @@
StorageVersion::put(Releases::V2);
Agenda::<T>::translate::<
- Vec<Option<ScheduledV1<<T as Config>::Call, T::BlockNumber>>>, _
- >(|_, agenda| Some(
- agenda
- .into_iter()
- .map(|schedule| schedule.map(|schedule| ScheduledV2 {
- maybe_id: schedule.maybe_id,
- priority: schedule.priority,
- call: schedule.call,
- maybe_periodic: schedule.maybe_periodic,
- origin: system::RawOrigin::Root.into(),
- _phantom: Default::default(),
- }))
- .collect::<Vec<_>>()
- ));
+ Vec<Option<ScheduledV1<<T as Config>::Call, T::BlockNumber>>>,
+ _,
+ >(|_, agenda| {
+ Some(
+ agenda
+ .into_iter()
+ .map(|schedule| {
+ schedule.map(|schedule| ScheduledV2 {
+ maybe_id: schedule.maybe_id,
+ priority: schedule.priority,
+ call: schedule.call,
+ maybe_periodic: schedule.maybe_periodic,
+ origin: system::RawOrigin::Root.into(),
+ _phantom: Default::default(),
+ })
+ })
+ .collect::<Vec<_>>(),
+ )
+ });
true
} else {
@@ -478,20 +491,25 @@
/// Helper to migrate scheduler when the pallet origin type has changed.
pub fn migrate_origin<OldOrigin: Into<T::PalletsOrigin> + codec::Decode>() {
Agenda::<T>::translate::<
- Vec<Option<Scheduled<<T as Config>::Call, T::BlockNumber, OldOrigin, T::AccountId>>>, _
- >(|_, agenda| Some(
- agenda
- .into_iter()
- .map(|schedule| schedule.map(|schedule| Scheduled {
- maybe_id: schedule.maybe_id,
- priority: schedule.priority,
- call: schedule.call,
- maybe_periodic: schedule.maybe_periodic,
- origin: schedule.origin.into(),
- _phantom: Default::default(),
- }))
- .collect::<Vec<_>>()
- ));
+ Vec<Option<Scheduled<<T as Config>::Call, T::BlockNumber, OldOrigin, T::AccountId>>>,
+ _,
+ >(|_, agenda| {
+ Some(
+ agenda
+ .into_iter()
+ .map(|schedule| {
+ schedule.map(|schedule| Scheduled {
+ maybe_id: schedule.maybe_id,
+ priority: schedule.priority,
+ call: schedule.call,
+ maybe_periodic: schedule.maybe_periodic,
+ origin: schedule.origin.into(),
+ _phantom: Default::default(),
+ })
+ })
+ .collect::<Vec<_>>(),
+ )
+ });
}
fn resolve_time(when: DispatchTime<T::BlockNumber>) -> Result<T::BlockNumber, DispatchError> {
@@ -501,11 +519,11 @@
DispatchTime::At(x) => x,
// The current block has already completed it's scheduled tasks, so
// Schedule the task at lest one block after this current block.
- DispatchTime::After(x) => now.saturating_add(x).saturating_add(One::one())
+ DispatchTime::After(x) => now.saturating_add(x).saturating_add(One::one()),
};
if when <= now {
- return Err(Error::<T>::TargetBlockNumberInPast.into())
+ return Err(Error::<T>::TargetBlockNumberInPast.into());
}
Ok(when)
@@ -516,7 +534,7 @@
maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
priority: schedule::Priority,
origin: T::PalletsOrigin,
- call: <T as Config>::Call
+ call: <T as Config>::Call,
) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
let when = Self::resolve_time(when)?;
@@ -526,7 +544,12 @@
// Remove one from the number of repetitions since we will schedule one now.
.map(|(p, c)| (p, c - 1));
let s = Some(Scheduled {
- maybe_id: None, priority, call, maybe_periodic, origin, _phantom: PhantomData::<T::AccountId>::default(),
+ maybe_id: None,
+ priority,
+ call,
+ maybe_periodic,
+ origin,
+ _phantom: PhantomData::<T::AccountId>::default(),
});
Agenda::<T>::append(when, s);
let index = Agenda::<T>::decode_len(when).unwrap_or(1) as u32 - 1;
@@ -544,22 +567,21 @@
fn do_cancel(
origin: Option<T::PalletsOrigin>,
- (when, index): TaskAddress<T::BlockNumber>
+ (when, index): TaskAddress<T::BlockNumber>,
) -> Result<(), DispatchError> {
- let scheduled = Agenda::<T>::try_mutate(
- when,
- |agenda| {
- agenda.get_mut(index as usize)
- .map_or(Ok(None), |s| -> Result<Option<Scheduled<_, _, _, _>>, DispatchError> {
- if let (Some(ref o), Some(ref s)) = (origin, s.borrow()) {
- if *o != s.origin {
- return Err(BadOrigin.into());
- }
- };
- Ok(s.take())
- })
- },
- )?;
+ let scheduled = Agenda::<T>::try_mutate(when, |agenda| {
+ agenda.get_mut(index as usize).map_or(
+ Ok(None),
+ |s| -> Result<Option<Scheduled<_, _, _, _>>, DispatchError> {
+ if let (Some(ref o), Some(ref s)) = (origin, s.borrow()) {
+ if *o != s.origin {
+ return Err(BadOrigin.into());
+ }
+ };
+ Ok(s.take())
+ },
+ )
+ })?;
if let Some(s) = scheduled {
if let Some(id) = s.maybe_id {
Lookup::<T>::remove(id);
@@ -567,7 +589,7 @@
Self::deposit_event(RawEvent::Canceled(when, index));
Ok(())
} else {
- Err(Error::<T>::NotFound)?
+ Err(Error::<T>::NotFound.into())
}
}
@@ -605,7 +627,7 @@
) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
// ensure id it is unique
if Lookup::<T>::contains_key(&id) {
- return Err(Error::<T>::FailedToSchedule)?
+ return Err(Error::<T>::FailedToSchedule.into());
}
let when = Self::resolve_time(when)?;
@@ -617,7 +639,12 @@
.map(|(p, c)| (p, c - 1));
let s = Scheduled {
- maybe_id: Some(id.clone()), priority, call, maybe_periodic, origin, _phantom: Default::default()
+ maybe_id: Some(id.clone()),
+ priority,
+ call,
+ maybe_periodic,
+ origin,
+ _phantom: Default::default(),
};
Agenda::<T>::append(when, Some(s));
let index = Agenda::<T>::decode_len(when).unwrap_or(1) as u32 - 1;
@@ -653,7 +680,7 @@
Self::deposit_event(RawEvent::Canceled(when, index));
Ok(())
} else {
- Err(Error::<T>::NotFound)?
+ Err(Error::<T>::NotFound.into())
}
})
}
@@ -664,33 +691,38 @@
) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
let new_time = Self::resolve_time(new_time)?;
- Lookup::<T>::try_mutate_exists(id, |lookup| -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
- let (when, index) = lookup.ok_or(Error::<T>::NotFound)?;
+ Lookup::<T>::try_mutate_exists(
+ id,
+ |lookup| -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
+ let (when, index) = lookup.ok_or(Error::<T>::NotFound)?;
- if new_time == when {
- return Err(Error::<T>::RescheduleNoChange.into());
- }
+ if new_time == when {
+ return Err(Error::<T>::RescheduleNoChange.into());
+ }
- Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
- let task = agenda.get_mut(index as usize).ok_or(Error::<T>::NotFound)?;
- let task = task.take().ok_or(Error::<T>::NotFound)?;
- Agenda::<T>::append(new_time, Some(task));
+ Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
+ let task = agenda.get_mut(index as usize).ok_or(Error::<T>::NotFound)?;
+ let task = task.take().ok_or(Error::<T>::NotFound)?;
+ Agenda::<T>::append(new_time, Some(task));
- Ok(())
- })?;
+ Ok(())
+ })?;
- let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
- Self::deposit_event(RawEvent::Canceled(when, index));
- Self::deposit_event(RawEvent::Scheduled(new_time, new_index));
+ let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
+ Self::deposit_event(RawEvent::Canceled(when, index));
+ Self::deposit_event(RawEvent::Scheduled(new_time, new_index));
- *lookup = Some((new_time, new_index));
+ *lookup = Some((new_time, new_index));
- Ok((new_time, new_index))
- })
+ Ok((new_time, new_index))
+ },
+ )
}
}
-impl<T: Config> schedule::Anon<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin> for Module<T> {
+impl<T: Config> schedule::Anon<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin>
+ for Module<T>
+{
type Address = TaskAddress<T::BlockNumber>;
fn schedule(
@@ -698,7 +730,7 @@
maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
priority: schedule::Priority,
origin: T::PalletsOrigin,
- call: <T as Config>::Call
+ call: <T as Config>::Call,
) -> Result<Self::Address, DispatchError> {
Self::do_schedule(when, maybe_periodic, priority, origin, call)
}
@@ -715,11 +747,16 @@
}
fn next_dispatch_time((when, index): Self::Address) -> Result<T::BlockNumber, ()> {
- Agenda::<T>::get(when).get(index as usize).ok_or(()).map(|_| when)
+ Agenda::<T>::get(when)
+ .get(index as usize)
+ .ok_or(())
+ .map(|_| when)
}
}
-impl<T: Config> schedule::Named<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin> for Module<T> {
+impl<T: Config> schedule::Named<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin>
+ for Module<T>
+{
type Address = TaskAddress<T::BlockNumber>;
fn schedule_named(
@@ -745,17 +782,19 @@
}
fn next_dispatch_time(id: Vec<u8>) -> Result<T::BlockNumber, ()> {
- Lookup::<T>::get(id).and_then(|(when, index)| Agenda::<T>::get(when).get(index as usize).map(|_| when)).ok_or(())
+ Lookup::<T>::get(id)
+ .and_then(|(when, index)| Agenda::<T>::get(when).get(index as usize).map(|_| when))
+ .ok_or(())
}
}
#[cfg(test)]
+#[allow(clippy::from_over_into)]
mod tests {
use super::*;
use frame_support::{
- parameter_types, assert_ok, ord_parameter_types,
- assert_noop, assert_err, Hashable,
+ parameter_types, assert_ok, ord_parameter_types, assert_noop, assert_err, Hashable,
traits::{OnInitialize, OnFinalize, Filter},
weights::constants::RocksDbWeight,
};
@@ -887,10 +926,13 @@
type ScheduleOrigin = EnsureOneOf<u64, EnsureRoot<u64>, EnsureSignedBy<One, u64>>;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = ();
+ type SponsorshipHandler = ();
}
pub fn new_test_ext() -> sp_io::TestExternalities {
- let t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
+ let t = system::GenesisConfig::default()
+ .build_storage::<Test>()
+ .unwrap();
t.into()
}
@@ -910,8 +952,16 @@
fn basic_scheduling_works() {
new_test_ext().execute_with(|| {
let call = Call::Logger(logger::Call::log(42, 1000));
- assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
- assert_ok!(Scheduler::do_schedule(DispatchTime::At(4), None, 127, root(), call));
+ assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+ &call
+ ));
+ assert_ok!(Scheduler::do_schedule(
+ DispatchTime::At(4),
+ None,
+ 127,
+ root(),
+ call
+ ));
run_to_block(3);
assert!(logger::log().is_empty());
run_to_block(4);
@@ -926,9 +976,17 @@
new_test_ext().execute_with(|| {
run_to_block(2);
let call = Call::Logger(logger::Call::log(42, 1000));
- assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
+ assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+ &call
+ ));
// This will schedule the call 3 blocks after the next block... so block 3 + 3 = 6
- assert_ok!(Scheduler::do_schedule(DispatchTime::After(3), None, 127, root(), call));
+ assert_ok!(Scheduler::do_schedule(
+ DispatchTime::After(3),
+ None,
+ 127,
+ root(),
+ call
+ ));
run_to_block(5);
assert!(logger::log().is_empty());
run_to_block(6);
@@ -943,8 +1001,16 @@
new_test_ext().execute_with(|| {
run_to_block(2);
let call = Call::Logger(logger::Call::log(42, 1000));
- assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
- assert_ok!(Scheduler::do_schedule(DispatchTime::After(0), None, 127, root(), call));
+ assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+ &call
+ ));
+ assert_ok!(Scheduler::do_schedule(
+ DispatchTime::After(0),
+ None,
+ 127,
+ root(),
+ call
+ ));
// Will trigger on the next block.
run_to_block(3);
assert_eq!(logger::log(), vec![(root(), 42u32)]);
@@ -958,7 +1024,11 @@
new_test_ext().execute_with(|| {
// at #4, every 3 blocks, 3 times.
assert_ok!(Scheduler::do_schedule(
- DispatchTime::At(4), Some((3, 3)), 127, root(), Call::Logger(logger::Call::log(42, 1000))
+ DispatchTime::At(4),
+ Some((3, 3)),
+ 127,
+ root(),
+ Call::Logger(logger::Call::log(42, 1000))
));
run_to_block(3);
assert!(logger::log().is_empty());
@@ -971,9 +1041,15 @@
run_to_block(9);
assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32)]);
run_to_block(10);
- assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]);
+ assert_eq!(
+ logger::log(),
+ vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]
+ );
run_to_block(100);
- assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]);
+ assert_eq!(
+ logger::log(),
+ vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]
+ );
});
}
@@ -981,15 +1057,26 @@
fn reschedule_works() {
new_test_ext().execute_with(|| {
let call = Call::Logger(logger::Call::log(42, 1000));
- assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
- assert_eq!(Scheduler::do_schedule(DispatchTime::At(4), None, 127, root(), call).unwrap(), (4, 0));
+ assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+ &call
+ ));
+ assert_eq!(
+ Scheduler::do_schedule(DispatchTime::At(4), None, 127, root(), call).unwrap(),
+ (4, 0)
+ );
run_to_block(3);
assert!(logger::log().is_empty());
- assert_eq!(Scheduler::do_reschedule((4, 0), DispatchTime::At(6)).unwrap(), (6, 0));
+ assert_eq!(
+ Scheduler::do_reschedule((4, 0), DispatchTime::At(6)).unwrap(),
+ (6, 0)
+ );
- assert_noop!(Scheduler::do_reschedule((6, 0), DispatchTime::At(6)), Error::<Test>::RescheduleNoChange);
+ assert_noop!(
+ Scheduler::do_reschedule((6, 0), DispatchTime::At(6)),
+ Error::<Test>::RescheduleNoChange
+ );
run_to_block(4);
assert!(logger::log().is_empty());
@@ -1006,17 +1093,34 @@
fn reschedule_named_works() {
new_test_ext().execute_with(|| {
let call = Call::Logger(logger::Call::log(42, 1000));
- assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
- assert_eq!(Scheduler::do_schedule_named(
- 1u32.encode(), DispatchTime::At(4), None, 127, root(), call
- ).unwrap(), (4, 0));
+ assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+ &call
+ ));
+ assert_eq!(
+ Scheduler::do_schedule_named(
+ 1u32.encode(),
+ DispatchTime::At(4),
+ None,
+ 127,
+ root(),
+ call
+ )
+ .unwrap(),
+ (4, 0)
+ );
run_to_block(3);
assert!(logger::log().is_empty());
- assert_eq!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)).unwrap(), (6, 0));
+ assert_eq!(
+ Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)).unwrap(),
+ (6, 0)
+ );
- assert_noop!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)), Error::<Test>::RescheduleNoChange);
+ assert_noop!(
+ Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)),
+ Error::<Test>::RescheduleNoChange
+ );
run_to_block(4);
assert!(logger::log().is_empty());
@@ -1033,16 +1137,33 @@
fn reschedule_named_perodic_works() {
new_test_ext().execute_with(|| {
let call = Call::Logger(logger::Call::log(42, 1000));
- assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(&call));
- assert_eq!(Scheduler::do_schedule_named(
- 1u32.encode(), DispatchTime::At(4), Some((3, 3)), 127, root(), call
- ).unwrap(), (4, 0));
+ assert!(!<Test as frame_system::Config>::BaseCallFilter::filter(
+ &call
+ ));
+ assert_eq!(
+ Scheduler::do_schedule_named(
+ 1u32.encode(),
+ DispatchTime::At(4),
+ Some((3, 3)),
+ 127,
+ root(),
+ call
+ )
+ .unwrap(),
+ (4, 0)
+ );
run_to_block(3);
assert!(logger::log().is_empty());
- assert_eq!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(5)).unwrap(), (5, 0));
- assert_eq!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)).unwrap(), (6, 0));
+ assert_eq!(
+ Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(5)).unwrap(),
+ (5, 0)
+ );
+ assert_eq!(
+ Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(6)).unwrap(),
+ (6, 0)
+ );
run_to_block(5);
assert!(logger::log().is_empty());
@@ -1050,7 +1171,10 @@
run_to_block(6);
assert_eq!(logger::log(), vec![(root(), 42u32)]);
- assert_eq!(Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(10)).unwrap(), (10, 0));
+ assert_eq!(
+ Scheduler::do_reschedule_named(1u32.encode(), DispatchTime::At(10)).unwrap(),
+ (10, 0)
+ );
run_to_block(9);
assert_eq!(logger::log(), vec![(root(), 42u32)]);
@@ -1059,10 +1183,16 @@
assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32)]);
run_to_block(13);
- assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]);
+ assert_eq!(
+ logger::log(),
+ vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]
+ );
run_to_block(100);
- assert_eq!(logger::log(), vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]);
+ assert_eq!(
+ logger::log(),
+ vec![(root(), 42u32), (root(), 42u32), (root(), 42u32)]
+ );
});
}
@@ -1071,11 +1201,22 @@
new_test_ext().execute_with(|| {
// at #4.
Scheduler::do_schedule_named(
- 1u32.encode(), DispatchTime::At(4), None, 127, root(), Call::Logger(logger::Call::log(69, 1000))
- ).unwrap();
+ 1u32.encode(),
+ DispatchTime::At(4),
+ None,
+ 127,
+ root(),
+ Call::Logger(logger::Call::log(69, 1000)),
+ )
+ .unwrap();
let i = Scheduler::do_schedule(
- DispatchTime::At(4), None, 127, root(), Call::Logger(logger::Call::log(42, 1000))
- ).unwrap();
+ DispatchTime::At(4),
+ None,
+ 127,
+ root(),
+ Call::Logger(logger::Call::log(42, 1000)),
+ )
+ .unwrap();
run_to_block(3);
assert!(logger::log().is_empty());
assert_ok!(Scheduler::do_cancel_named(None, 1u32.encode()));
@@ -1095,8 +1236,9 @@
Some((3, 3)),
127,
root(),
- Call::Logger(logger::Call::log(42, 1000))
- ).unwrap();
+ Call::Logger(logger::Call::log(42, 1000)),
+ )
+ .unwrap();
// same id results in error.
assert!(Scheduler::do_schedule_named(
1u32.encode(),
@@ -1105,11 +1247,18 @@
127,
root(),
Call::Logger(logger::Call::log(69, 1000))
- ).is_err());
+ )
+ .is_err());
// different id is ok.
Scheduler::do_schedule_named(
- 2u32.encode(), DispatchTime::At(8), None, 127, root(), Call::Logger(logger::Call::log(69, 1000))
- ).unwrap();
+ 2u32.encode(),
+ DispatchTime::At(8),
+ None,
+ 127,
+ root(),
+ Call::Logger(logger::Call::log(69, 1000)),
+ )
+ .unwrap();
run_to_block(3);
assert!(logger::log().is_empty());
run_to_block(4);
@@ -1135,7 +1284,8 @@
DispatchTime::At(4),
None,
127,
- root(), Call::Logger(logger::Call::log(69, MaximumSchedulerWeight::get() / 2))
+ root(),
+ Call::Logger(logger::Call::log(69, MaximumSchedulerWeight::get() / 2))
));
// 69 and 42 do not fit together
run_to_block(4);
@@ -1197,19 +1347,22 @@
DispatchTime::At(4),
None,
255,
- root(), Call::Logger(logger::Call::log(42, MaximumSchedulerWeight::get() / 3))
+ root(),
+ Call::Logger(logger::Call::log(42, MaximumSchedulerWeight::get() / 3))
));
assert_ok!(Scheduler::do_schedule(
DispatchTime::At(4),
None,
127,
- root(), Call::Logger(logger::Call::log(69, MaximumSchedulerWeight::get() / 2))
+ root(),
+ Call::Logger(logger::Call::log(69, MaximumSchedulerWeight::get() / 2))
));
assert_ok!(Scheduler::do_schedule(
DispatchTime::At(4),
None,
126,
- root(), Call::Logger(logger::Call::log(2600, MaximumSchedulerWeight::get() / 2))
+ root(),
+ Call::Logger(logger::Call::log(2600, MaximumSchedulerWeight::get() / 2))
));
// 2600 does not fit with 69 or 42, but has higher priority, so will go through
@@ -1217,25 +1370,32 @@
assert_eq!(logger::log(), vec![(root(), 2600u32)]);
// 69 and 42 fit together
run_to_block(5);
- assert_eq!(logger::log(), vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]);
+ assert_eq!(
+ logger::log(),
+ vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]
+ );
});
}
#[test]
fn on_initialize_weight_is_correct() {
new_test_ext().execute_with(|| {
- let base_weight: Weight = <Test as frame_system::Config>::DbWeight::get().reads_writes(1, 2);
+ let base_weight: Weight =
+ <Test as frame_system::Config>::DbWeight::get().reads_writes(1, 2);
let base_multiplier = 0;
let named_multiplier = <Test as frame_system::Config>::DbWeight::get().writes(1);
- let periodic_multiplier = <Test as frame_system::Config>::DbWeight::get().reads_writes(1, 1);
+ let periodic_multiplier =
+ <Test as frame_system::Config>::DbWeight::get().reads_writes(1, 1);
// Named
- assert_ok!(
- Scheduler::do_schedule_named(
- 1u32.encode(), DispatchTime::At(1), None, 255, root(),
- Call::Logger(logger::Call::log(3, MaximumSchedulerWeight::get() / 3))
- )
- );
+ assert_ok!(Scheduler::do_schedule_named(
+ 1u32.encode(),
+ DispatchTime::At(1),
+ None,
+ 255,
+ root(),
+ Call::Logger(logger::Call::log(3, MaximumSchedulerWeight::get() / 3))
+ ));
// Anon Periodic
assert_ok!(Scheduler::do_schedule(
DispatchTime::At(1),
@@ -1254,29 +1414,53 @@
));
// Named Periodic
assert_ok!(Scheduler::do_schedule_named(
- 2u32.encode(), DispatchTime::At(1), Some((1000, 3)), 126, root(),
- Call::Logger(logger::Call::log(2600, MaximumSchedulerWeight::get() / 2)))
- );
+ 2u32.encode(),
+ DispatchTime::At(1),
+ Some((1000, 3)),
+ 126,
+ root(),
+ Call::Logger(logger::Call::log(2600, MaximumSchedulerWeight::get() / 2))
+ ));
// Will include the named periodic only
let actual_weight = Scheduler::on_initialize(1);
let call_weight = MaximumSchedulerWeight::get() / 2;
assert_eq!(
- actual_weight, call_weight + base_weight + base_multiplier + named_multiplier + periodic_multiplier
+ actual_weight,
+ call_weight
+ + base_weight + base_multiplier
+ + named_multiplier + periodic_multiplier
);
assert_eq!(logger::log(), vec![(root(), 2600u32)]);
// Will include anon and anon periodic
let actual_weight = Scheduler::on_initialize(2);
let call_weight = MaximumSchedulerWeight::get() / 2 + MaximumSchedulerWeight::get() / 3;
- assert_eq!(actual_weight, call_weight + base_weight + base_multiplier * 2 + periodic_multiplier);
- assert_eq!(logger::log(), vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]);
+ assert_eq!(
+ actual_weight,
+ call_weight + base_weight + base_multiplier * 2 + periodic_multiplier
+ );
+ assert_eq!(
+ logger::log(),
+ vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32)]
+ );
// Will include named only
let actual_weight = Scheduler::on_initialize(3);
let call_weight = MaximumSchedulerWeight::get() / 3;
- assert_eq!(actual_weight, call_weight + base_weight + base_multiplier + named_multiplier);
- assert_eq!(logger::log(), vec![(root(), 2600u32), (root(), 69u32), (root(), 42u32), (root(), 3u32)]);
+ assert_eq!(
+ actual_weight,
+ call_weight + base_weight + base_multiplier + named_multiplier
+ );
+ assert_eq!(
+ logger::log(),
+ vec![
+ (root(), 2600u32),
+ (root(), 69u32),
+ (root(), 42u32),
+ (root(), 3u32)
+ ]
+ );
// Will contain none
let actual_weight = Scheduler::on_initialize(4);
@@ -1289,7 +1473,14 @@
new_test_ext().execute_with(|| {
let call = Box::new(Call::Logger(logger::Call::log(69, 1000)));
let call2 = Box::new(Call::Logger(logger::Call::log(42, 1000)));
- assert_ok!(Scheduler::schedule_named(Origin::root(), 1u32.encode(), 4, None, 127, call));
+ assert_ok!(Scheduler::schedule_named(
+ Origin::root(),
+ 1u32.encode(),
+ 4,
+ None,
+ 127,
+ call
+ ));
assert_ok!(Scheduler::schedule(Origin::root(), 4, None, 127, call2));
run_to_block(3);
// Scheduled calls are in the agenda.
@@ -1333,15 +1524,29 @@
new_test_ext().execute_with(|| {
let call = Box::new(Call::Logger(logger::Call::log(69, 1000)));
let call2 = Box::new(Call::Logger(logger::Call::log(42, 1000)));
- assert_ok!(
- Scheduler::schedule_named(system::RawOrigin::Signed(1).into(), 1u32.encode(), 4, None, 127, call)
- );
- assert_ok!(Scheduler::schedule(system::RawOrigin::Signed(1).into(), 4, None, 127, call2));
+ assert_ok!(Scheduler::schedule_named(
+ system::RawOrigin::Signed(1).into(),
+ 1u32.encode(),
+ 4,
+ None,
+ 127,
+ call
+ ));
+ assert_ok!(Scheduler::schedule(
+ system::RawOrigin::Signed(1).into(),
+ 4,
+ None,
+ 127,
+ call2
+ ));
run_to_block(3);
// Scheduled calls are in the agenda.
assert_eq!(Agenda::<Test>::get(4).len(), 2);
assert!(logger::log().is_empty());
- assert_ok!(Scheduler::cancel_named(system::RawOrigin::Signed(1).into(), 1u32.encode()));
+ assert_ok!(Scheduler::cancel_named(
+ system::RawOrigin::Signed(1).into(),
+ 1u32.encode()
+ ));
assert_ok!(Scheduler::cancel(system::RawOrigin::Signed(1).into(), 4, 1));
// Scheduled calls are made NONE, so should not effect state
run_to_block(100);
@@ -1355,10 +1560,20 @@
let call = Box::new(Call::Logger(logger::Call::log(69, 1000)));
let call2 = Box::new(Call::Logger(logger::Call::log(42, 1000)));
assert_noop!(
- Scheduler::schedule_named(system::RawOrigin::Signed(2).into(), 1u32.encode(), 4, None, 127, call),
+ Scheduler::schedule_named(
+ system::RawOrigin::Signed(2).into(),
+ 1u32.encode(),
+ 4,
+ None,
+ 127,
+ call
+ ),
BadOrigin
);
- assert_noop!(Scheduler::schedule(system::RawOrigin::Signed(2).into(), 4, None, 127, call2), BadOrigin);
+ assert_noop!(
+ Scheduler::schedule(system::RawOrigin::Signed(2).into(), 4, None, 127, call2),
+ BadOrigin
+ );
});
}
@@ -1367,22 +1582,48 @@
new_test_ext().execute_with(|| {
let call = Box::new(Call::Logger(logger::Call::log_without_filter(69, 1000)));
let call2 = Box::new(Call::Logger(logger::Call::log_without_filter(42, 1000)));
- assert_ok!(
- Scheduler::schedule_named(system::RawOrigin::Signed(1).into(), 1u32.encode(), 4, None, 127, call)
- );
- assert_ok!(Scheduler::schedule(system::RawOrigin::Signed(1).into(), 4, None, 127, call2));
+ assert_ok!(Scheduler::schedule_named(
+ system::RawOrigin::Signed(1).into(),
+ 1u32.encode(),
+ 4,
+ None,
+ 127,
+ call
+ ));
+ assert_ok!(Scheduler::schedule(
+ system::RawOrigin::Signed(1).into(),
+ 4,
+ None,
+ 127,
+ call2
+ ));
run_to_block(3);
// Scheduled calls are in the agenda.
assert_eq!(Agenda::<Test>::get(4).len(), 2);
assert!(logger::log().is_empty());
- assert_noop!(Scheduler::cancel_named(system::RawOrigin::Signed(2).into(), 1u32.encode()), BadOrigin);
- assert_noop!(Scheduler::cancel(system::RawOrigin::Signed(2).into(), 4, 1), BadOrigin);
- assert_noop!(Scheduler::cancel_named(system::RawOrigin::Root.into(), 1u32.encode()), BadOrigin);
- assert_noop!(Scheduler::cancel(system::RawOrigin::Root.into(), 4, 1), BadOrigin);
+ assert_noop!(
+ Scheduler::cancel_named(system::RawOrigin::Signed(2).into(), 1u32.encode()),
+ BadOrigin
+ );
+ assert_noop!(
+ Scheduler::cancel(system::RawOrigin::Signed(2).into(), 4, 1),
+ BadOrigin
+ );
+ assert_noop!(
+ Scheduler::cancel_named(system::RawOrigin::Root.into(), 1u32.encode()),
+ BadOrigin
+ );
+ assert_noop!(
+ Scheduler::cancel(system::RawOrigin::Root.into(), 4, 1),
+ BadOrigin
+ );
run_to_block(5);
assert_eq!(
logger::log(),
- vec![(system::RawOrigin::Signed(1).into(), 69u32), (system::RawOrigin::Signed(1).into(), 42u32)]
+ vec![
+ (system::RawOrigin::Signed(1).into(), 69u32),
+ (system::RawOrigin::Signed(1).into(), 42u32)
+ ]
);
});
}
@@ -1407,85 +1648,84 @@
maybe_periodic: Some((456u64, 10)),
}),
];
- frame_support::migration::put_storage_value(
- b"Scheduler",
- b"Agenda",
- &k,
- old,
- );
+ frame_support::migration::put_storage_value(b"Scheduler", b"Agenda", &k, old);
}
assert_eq!(StorageVersion::get(), Releases::V1);
assert!(Scheduler::migrate_v1_to_t2());
- assert_eq_uvec!(Agenda::<Test>::iter().collect::<Vec<_>>(), vec![
- (
- 0,
- vec![
- Some(ScheduledV2 {
- maybe_id: None,
- priority: 10,
- call: Call::Logger(logger::Call::log(96, 100)),
- maybe_periodic: None,
- origin: root(),
- _phantom: PhantomData::<u64>::default(),
- }),
- None,
- Some(ScheduledV2 {
- maybe_id: Some(b"test".to_vec()),
- priority: 123,
- call: Call::Logger(logger::Call::log(69, 1000)),
- maybe_periodic: Some((456u64, 10)),
- origin: root(),
- _phantom: PhantomData::<u64>::default(),
- }),
- ]),
- (
- 1,
- vec![
- Some(ScheduledV2 {
- maybe_id: None,
- priority: 11,
- call: Call::Logger(logger::Call::log(96, 100)),
- maybe_periodic: None,
- origin: root(),
- _phantom: PhantomData::<u64>::default(),
- }),
- None,
- Some(ScheduledV2 {
- maybe_id: Some(b"test".to_vec()),
- priority: 123,
- call: Call::Logger(logger::Call::log(69, 1000)),
- maybe_periodic: Some((456u64, 10)),
- origin: root(),
- _phantom: PhantomData::<u64>::default(),
- }),
- ]
- ),
- (
- 2,
- vec![
- Some(ScheduledV2 {
- maybe_id: None,
- priority: 12,
- call: Call::Logger(logger::Call::log(96, 100)),
- maybe_periodic: None,
- origin: root(),
- _phantom: PhantomData::<u64>::default(),
- }),
- None,
- Some(ScheduledV2 {
- maybe_id: Some(b"test".to_vec()),
- priority: 123,
- call: Call::Logger(logger::Call::log(69, 1000)),
- maybe_periodic: Some((456u64, 10)),
- origin: root(),
- _phantom: PhantomData::<u64>::default(),
- }),
- ]
- )
- ]);
+ assert_eq_uvec!(
+ Agenda::<Test>::iter().collect::<Vec<_>>(),
+ vec![
+ (
+ 0,
+ vec![
+ Some(ScheduledV2 {
+ maybe_id: None,
+ priority: 10,
+ call: Call::Logger(logger::Call::log(96, 100)),
+ maybe_periodic: None,
+ origin: root(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ None,
+ Some(ScheduledV2 {
+ maybe_id: Some(b"test".to_vec()),
+ priority: 123,
+ call: Call::Logger(logger::Call::log(69, 1000)),
+ maybe_periodic: Some((456u64, 10)),
+ origin: root(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ ]
+ ),
+ (
+ 1,
+ vec![
+ Some(ScheduledV2 {
+ maybe_id: None,
+ priority: 11,
+ call: Call::Logger(logger::Call::log(96, 100)),
+ maybe_periodic: None,
+ origin: root(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ None,
+ Some(ScheduledV2 {
+ maybe_id: Some(b"test".to_vec()),
+ priority: 123,
+ call: Call::Logger(logger::Call::log(69, 1000)),
+ maybe_periodic: Some((456u64, 10)),
+ origin: root(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ ]
+ ),
+ (
+ 2,
+ vec![
+ Some(ScheduledV2 {
+ maybe_id: None,
+ priority: 12,
+ call: Call::Logger(logger::Call::log(96, 100)),
+ maybe_periodic: None,
+ origin: root(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ None,
+ Some(ScheduledV2 {
+ maybe_id: Some(b"test".to_vec()),
+ priority: 123,
+ call: Call::Logger(logger::Call::log(69, 1000)),
+ maybe_periodic: Some((456u64, 10)),
+ origin: root(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ ]
+ )
+ ]
+ );
assert_eq!(StorageVersion::get(), Releases::V2);
});
@@ -1515,93 +1755,92 @@
_phantom: Default::default(),
}),
];
- frame_support::migration::put_storage_value(
- b"Scheduler",
- b"Agenda",
- &k,
- old,
- );
+ frame_support::migration::put_storage_value(b"Scheduler", b"Agenda", &k, old);
}
- impl Into<OriginCaller> for u32 {
- fn into(self) -> OriginCaller {
- match self {
- 3u32 => system::RawOrigin::Root.into(),
- 2u32 => system::RawOrigin::None.into(),
- _ => unreachable!("test make no use of it"),
+ impl From<u32> for OriginCaller {
+ fn from(value: u32) -> Self {
+ match value {
+ 3 => system::RawOrigin::Root.into(),
+ 2 => system::RawOrigin::None.into(),
+ _ => unimplemented!(),
}
}
}
Scheduler::migrate_origin::<u32>();
- assert_eq_uvec!(Agenda::<Test>::iter().collect::<Vec<_>>(), vec![
- (
- 0,
- vec![
- Some(ScheduledV2::<_, _, OriginCaller, u64> {
- maybe_id: None,
- priority: 10,
- call: Call::Logger(logger::Call::log(96, 100)),
- maybe_periodic: None,
- origin: system::RawOrigin::Root.into(),
- _phantom: PhantomData::<u64>::default(),
- }),
- None,
- Some(ScheduledV2 {
- maybe_id: Some(b"test".to_vec()),
- priority: 123,
- call: Call::Logger(logger::Call::log(69, 1000)),
- maybe_periodic: Some((456u64, 10)),
- origin: system::RawOrigin::None.into(),
- _phantom: PhantomData::<u64>::default(),
- }),
- ]),
- (
- 1,
- vec![
- Some(ScheduledV2 {
- maybe_id: None,
- priority: 11,
- call: Call::Logger(logger::Call::log(96, 100)),
- maybe_periodic: None,
- origin: system::RawOrigin::Root.into(),
- _phantom: PhantomData::<u64>::default(),
- }),
- None,
- Some(ScheduledV2 {
- maybe_id: Some(b"test".to_vec()),
- priority: 123,
- call: Call::Logger(logger::Call::log(69, 1000)),
- maybe_periodic: Some((456u64, 10)),
- origin: system::RawOrigin::None.into(),
- _phantom: PhantomData::<u64>::default(),
- }),
- ]
- ),
- (
- 2,
- vec![
- Some(ScheduledV2 {
- maybe_id: None,
- priority: 12,
- call: Call::Logger(logger::Call::log(96, 100)),
- maybe_periodic: None,
- origin: system::RawOrigin::Root.into(),
- _phantom: PhantomData::<u64>::default(),
- }),
- None,
- Some(ScheduledV2 {
- maybe_id: Some(b"test".to_vec()),
- priority: 123,
- call: Call::Logger(logger::Call::log(69, 1000)),
- maybe_periodic: Some((456u64, 10)),
- origin: system::RawOrigin::None.into(),
- _phantom: PhantomData::<u64>::default(),
- }),
- ]
- )
- ]);
+ assert_eq_uvec!(
+ Agenda::<Test>::iter().collect::<Vec<_>>(),
+ vec![
+ (
+ 0,
+ vec![
+ Some(ScheduledV2::<_, _, OriginCaller, u64> {
+ maybe_id: None,
+ priority: 10,
+ call: Call::Logger(logger::Call::log(96, 100)),
+ maybe_periodic: None,
+ origin: system::RawOrigin::Root.into(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ None,
+ Some(ScheduledV2 {
+ maybe_id: Some(b"test".to_vec()),
+ priority: 123,
+ call: Call::Logger(logger::Call::log(69, 1000)),
+ maybe_periodic: Some((456u64, 10)),
+ origin: system::RawOrigin::None.into(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ ]
+ ),
+ (
+ 1,
+ vec![
+ Some(ScheduledV2 {
+ maybe_id: None,
+ priority: 11,
+ call: Call::Logger(logger::Call::log(96, 100)),
+ maybe_periodic: None,
+ origin: system::RawOrigin::Root.into(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ None,
+ Some(ScheduledV2 {
+ maybe_id: Some(b"test".to_vec()),
+ priority: 123,
+ call: Call::Logger(logger::Call::log(69, 1000)),
+ maybe_periodic: Some((456u64, 10)),
+ origin: system::RawOrigin::None.into(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ ]
+ ),
+ (
+ 2,
+ vec![
+ Some(ScheduledV2 {
+ maybe_id: None,
+ priority: 12,
+ call: Call::Logger(logger::Call::log(96, 100)),
+ maybe_periodic: None,
+ origin: system::RawOrigin::Root.into(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ None,
+ Some(ScheduledV2 {
+ maybe_id: Some(b"test".to_vec()),
+ priority: 123,
+ call: Call::Logger(logger::Call::log(69, 1000)),
+ maybe_periodic: Some((456u64, 10)),
+ origin: system::RawOrigin::None.into(),
+ _phantom: PhantomData::<u64>::default(),
+ }),
+ ]
+ )
+ ]
+ );
});
}
}
pallets/scheduler/src/weights.rsdiffbeforeafterboth--- a/pallets/scheduler/src/weights.rs
+++ b/pallets/scheduler/src/weights.rs
@@ -34,85 +34,76 @@
// --output=./frame/scheduler/src/weights.rs
// --template=./.maintain/frame-weight-template.hbs
-
#![allow(unused_parens)]
#![allow(unused_imports)]
-use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
+use frame_support::{
+ traits::Get,
+ weights::{Weight, constants::RocksDbWeight},
+};
use sp_std::marker::PhantomData;
/// Weight functions needed for pallet_scheduler.
pub trait WeightInfo {
- fn schedule(s: u32, ) -> Weight;
- fn cancel(s: u32, ) -> Weight;
- fn schedule_named(s: u32, ) -> Weight;
- fn cancel_named(s: u32, ) -> Weight;
-
+ fn schedule(s: u32) -> Weight;
+ fn cancel(s: u32) -> Weight;
+ fn schedule_named(s: u32) -> Weight;
+ fn cancel_named(s: u32) -> Weight;
}
/// Weights for pallet_scheduler using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
- fn schedule(s: u32, ) -> Weight {
- (35_029_000 as Weight)
- .saturating_add((77_000 as Weight).saturating_mul(s as Weight))
- .saturating_add(T::DbWeight::get().reads(1 as Weight))
- .saturating_add(T::DbWeight::get().writes(1 as Weight))
-
+ fn schedule(s: u32) -> Weight {
+ 35_029_000_u64
+ .saturating_add(77_000_u64.saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(1_u64))
+ .saturating_add(T::DbWeight::get().writes(1_u64))
}
- fn cancel(s: u32, ) -> Weight {
- (31_419_000 as Weight)
- .saturating_add((4_015_000 as Weight).saturating_mul(s as Weight))
- .saturating_add(T::DbWeight::get().reads(1 as Weight))
- .saturating_add(T::DbWeight::get().writes(2 as Weight))
-
+ fn cancel(s: u32) -> Weight {
+ 31_419_000_u64
+ .saturating_add(4_015_000_u64.saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(1_u64))
+ .saturating_add(T::DbWeight::get().writes(2_u64))
}
- fn schedule_named(s: u32, ) -> Weight {
- (44_752_000 as Weight)
- .saturating_add((123_000 as Weight).saturating_mul(s as Weight))
- .saturating_add(T::DbWeight::get().reads(2 as Weight))
- .saturating_add(T::DbWeight::get().writes(2 as Weight))
-
+ fn schedule_named(s: u32) -> Weight {
+ 44_752_000_u64
+ .saturating_add(123_000_u64.saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2_u64))
+ .saturating_add(T::DbWeight::get().writes(2_u64))
}
- fn cancel_named(s: u32, ) -> Weight {
- (35_712_000 as Weight)
- .saturating_add((4_008_000 as Weight).saturating_mul(s as Weight))
- .saturating_add(T::DbWeight::get().reads(2 as Weight))
- .saturating_add(T::DbWeight::get().writes(2 as Weight))
-
+ fn cancel_named(s: u32) -> Weight {
+ 35_712_000_u64
+ .saturating_add(4_008_000_u64.saturating_mul(s as Weight))
+ .saturating_add(T::DbWeight::get().reads(2_u64))
+ .saturating_add(T::DbWeight::get().writes(2_u64))
}
-
}
// For backwards compatibility and tests
impl WeightInfo for () {
- fn schedule(s: u32, ) -> Weight {
- (35_029_000 as Weight)
- .saturating_add((77_000 as Weight).saturating_mul(s as Weight))
- .saturating_add(RocksDbWeight::get().reads(1 as Weight))
- .saturating_add(RocksDbWeight::get().writes(1 as Weight))
-
+ fn schedule(s: u32) -> Weight {
+ 35_029_000_u64
+ .saturating_add(77_000_u64.saturating_mul(s as Weight))
+ .saturating_add(RocksDbWeight::get().reads(1_u64))
+ .saturating_add(RocksDbWeight::get().writes(1_u64))
}
- fn cancel(s: u32, ) -> Weight {
- (31_419_000 as Weight)
- .saturating_add((4_015_000 as Weight).saturating_mul(s as Weight))
- .saturating_add(RocksDbWeight::get().reads(1 as Weight))
- .saturating_add(RocksDbWeight::get().writes(2 as Weight))
-
+ fn cancel(s: u32) -> Weight {
+ 31_419_000_u64
+ .saturating_add(4_015_000_u64.saturating_mul(s as Weight))
+ .saturating_add(RocksDbWeight::get().reads(1_u64))
+ .saturating_add(RocksDbWeight::get().writes(2_u64))
}
- fn schedule_named(s: u32, ) -> Weight {
- (44_752_000 as Weight)
- .saturating_add((123_000 as Weight).saturating_mul(s as Weight))
- .saturating_add(RocksDbWeight::get().reads(2 as Weight))
- .saturating_add(RocksDbWeight::get().writes(2 as Weight))
-
+ fn schedule_named(s: u32) -> Weight {
+ 44_752_000_u64
+ .saturating_add(123_000_u64.saturating_mul(s as Weight))
+ .saturating_add(RocksDbWeight::get().reads(2_u64))
+ .saturating_add(RocksDbWeight::get().writes(2_u64))
}
- fn cancel_named(s: u32, ) -> Weight {
- (35_712_000 as Weight)
- .saturating_add((4_008_000 as Weight).saturating_mul(s as Weight))
- .saturating_add(RocksDbWeight::get().reads(2 as Weight))
- .saturating_add(RocksDbWeight::get().writes(2 as Weight))
-
+ fn cancel_named(s: u32) -> Weight {
+ 35_712_000_u64
+ .saturating_add(4_008_000_u64.saturating_mul(s as Weight))
+ .saturating_add(RocksDbWeight::get().reads(2_u64))
+ .saturating_add(RocksDbWeight::get().writes(2_u64))
}
-
}
primitives/nft/Cargo.tomldiffbeforeafterboth--- a/primitives/nft/Cargo.toml
+++ b/primitives/nft/Cargo.toml
@@ -11,11 +11,11 @@
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ['derive'] }
serde = { version = "1.0.119", features = ['derive'], default-features = false }
-frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-pallet-contracts = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-core = { version = "3.0.0", default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
-sp-runtime = { version = "3.0.0", default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.3' }
+frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+pallet-contracts = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-core = { version = "3.0.0", default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
+sp-runtime = { version = "3.0.0", default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.7' }
[features]
default = ["std"]
primitives/nft/src/lib.rsdiffbeforeafterboth--- a/primitives/nft/src/lib.rs
+++ b/primitives/nft/src/lib.rs
@@ -1,26 +1,23 @@
-
#![cfg_attr(not(feature = "std"), no_std)]
pub use serde::{Serialize, Deserialize};
-use frame_system;
use sp_runtime::sp_std::prelude::Vec;
use codec::{Decode, Encode};
pub use frame_support::{
- construct_runtime, decl_event, decl_module, decl_storage, decl_error,
- dispatch::DispatchResult,
- ensure, fail, parameter_types,
- traits::{
- Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
- Randomness, IsSubType, WithdrawReasons,
- },
- weights::{
- constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
- DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
- WeightToFeePolynomial, DispatchClass,
- },
- StorageValue,
- transactional,
+ construct_runtime, decl_event, decl_module, decl_storage, decl_error,
+ dispatch::DispatchResult,
+ ensure, fail, parameter_types,
+ traits::{
+ Currency, ExistenceRequirement, Get, Imbalance, KeyOwnerProofSystem, OnUnbalanced,
+ Randomness, IsSubType, WithdrawReasons,
+ },
+ weights::{
+ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+ DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
+ WeightToFeePolynomial, DispatchClass,
+ },
+ StorageValue, transactional,
};
pub const MAX_DECIMAL_POINTS: DecimalPoints = 30;
@@ -35,251 +32,245 @@
#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum CollectionMode {
- Invalid,
- NFT,
- // decimal points
- Fungible(DecimalPoints),
- ReFungible,
+ Invalid,
+ NFT,
+ // decimal points
+ Fungible(DecimalPoints),
+ ReFungible,
}
impl Default for CollectionMode {
- fn default() -> Self {
- Self::Invalid
- }
+ fn default() -> Self {
+ Self::Invalid
+ }
}
-impl Into<u8> for CollectionMode {
- fn into(self) -> u8 {
- match self {
- CollectionMode::Invalid => 0,
- CollectionMode::NFT => 1,
- CollectionMode::Fungible(_) => 2,
- CollectionMode::ReFungible => 3,
- }
- }
+impl CollectionMode {
+ pub fn id(&self) -> u8 {
+ match self {
+ CollectionMode::Invalid => 0,
+ CollectionMode::NFT => 1,
+ CollectionMode::Fungible(_) => 2,
+ CollectionMode::ReFungible => 3,
+ }
+ }
}
pub trait SponsoringResolve<AccountId, Call> {
- fn resolve(
- who: &AccountId,
- call: &Call) -> Option<AccountId>;
+ fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>;
}
#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum AccessMode {
- Normal,
- WhiteList,
+ Normal,
+ WhiteList,
}
impl Default for AccessMode {
- fn default() -> Self {
- Self::Normal
- }
+ fn default() -> Self {
+ Self::Normal
+ }
}
#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum SchemaVersion {
- ImageURL,
- Unique,
+ ImageURL,
+ Unique,
}
impl Default for SchemaVersion {
- fn default() -> Self {
- Self::ImageURL
- }
+ fn default() -> Self {
+ Self::ImageURL
+ }
}
#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct Ownership<AccountId> {
- pub owner: AccountId,
- pub fraction: u128,
+ pub owner: AccountId,
+ pub fraction: u128,
}
#[derive(Encode, Decode, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum SponsorshipState<AccountId> {
- /// The fees are applied to the transaction sender
- Disabled,
- Unconfirmed(AccountId),
- /// Transactions are sponsored by specified account
- Confirmed(AccountId),
+ /// The fees are applied to the transaction sender
+ Disabled,
+ Unconfirmed(AccountId),
+ /// Transactions are sponsored by specified account
+ Confirmed(AccountId),
}
impl<AccountId> SponsorshipState<AccountId> {
- pub fn sponsor(&self) -> Option<&AccountId> {
- match self {
- Self::Confirmed(sponsor) => Some(sponsor),
- _ => None,
- }
- }
+ pub fn sponsor(&self) -> Option<&AccountId> {
+ match self {
+ Self::Confirmed(sponsor) => Some(sponsor),
+ _ => None,
+ }
+ }
- pub fn pending_sponsor(&self) -> Option<&AccountId> {
- match self {
- Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),
- _ => None,
- }
- }
+ pub fn pending_sponsor(&self) -> Option<&AccountId> {
+ match self {
+ Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),
+ _ => None,
+ }
+ }
- pub fn confirmed(&self) -> bool {
- matches!(self, Self::Confirmed(_))
- }
+ pub fn confirmed(&self) -> bool {
+ matches!(self, Self::Confirmed(_))
+ }
}
impl<T> Default for SponsorshipState<T> {
- fn default() -> Self {
- Self::Disabled
- }
+ fn default() -> Self {
+ Self::Disabled
+ }
}
#[derive(Encode, Decode, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct Collection<T: frame_system::Config> {
- pub owner: T::AccountId,
- pub mode: CollectionMode,
- pub access: AccessMode,
- pub decimal_points: DecimalPoints,
- pub name: Vec<u16>, // 64 include null escape char
- pub description: Vec<u16>, // 256 include null escape char
- pub token_prefix: Vec<u8>, // 16 include null escape char
- pub mint_mode: bool,
- pub offchain_schema: Vec<u8>,
- pub schema_version: SchemaVersion,
- pub sponsorship: SponsorshipState<T::AccountId>,
- pub limits: CollectionLimits<T::BlockNumber>, // Collection private restrictions
- pub variable_on_chain_schema: Vec<u8>, //
- pub const_on_chain_schema: Vec<u8>, //
+ pub owner: T::AccountId,
+ pub mode: CollectionMode,
+ pub access: AccessMode,
+ pub decimal_points: DecimalPoints,
+ pub name: Vec<u16>, // 64 include null escape char
+ pub description: Vec<u16>, // 256 include null escape char
+ pub token_prefix: Vec<u8>, // 16 include null escape char
+ pub mint_mode: bool,
+ pub offchain_schema: Vec<u8>,
+ pub schema_version: SchemaVersion,
+ pub sponsorship: SponsorshipState<T::AccountId>,
+ pub limits: CollectionLimits<T::BlockNumber>, // Collection private restrictions
+ pub variable_on_chain_schema: Vec<u8>, //
+ pub const_on_chain_schema: Vec<u8>, //
}
#[derive(Encode, Decode, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct NftItemType<AccountId> {
- pub owner: AccountId,
- pub const_data: Vec<u8>,
- pub variable_data: Vec<u8>,
+ pub owner: AccountId,
+ pub const_data: Vec<u8>,
+ pub variable_data: Vec<u8>,
}
#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct FungibleItemType {
- pub value: u128,
+ pub value: u128,
}
#[derive(Encode, Decode, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct ReFungibleItemType<AccountId> {
- pub owner: Vec<Ownership<AccountId>>,
- pub const_data: Vec<u8>,
- pub variable_data: Vec<u8>,
+ pub owner: Vec<Ownership<AccountId>>,
+ pub const_data: Vec<u8>,
+ pub variable_data: Vec<u8>,
}
-
#[derive(Encode, Decode, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct CollectionLimits<BlockNumber: Encode + Decode> {
- pub account_token_ownership_limit: u32,
- pub sponsored_data_size: u32,
- /// None - setVariableMetadata is not sponsored
- /// Some(v) - setVariableMetadata is sponsored
- /// if there is v block between txs
- pub sponsored_data_rate_limit: Option<BlockNumber>,
- pub token_limit: u32,
+ pub account_token_ownership_limit: u32,
+ pub sponsored_data_size: u32,
+ /// None - setVariableMetadata is not sponsored
+ /// Some(v) - setVariableMetadata is sponsored
+ /// if there is v block between txs
+ pub sponsored_data_rate_limit: Option<BlockNumber>,
+ pub token_limit: u32,
- // Timeouts for item types in passed blocks
- pub sponsor_transfer_timeout: u32,
- pub owner_can_transfer: bool,
- pub owner_can_destroy: bool,
+ // Timeouts for item types in passed blocks
+ pub sponsor_transfer_timeout: u32,
+ pub owner_can_transfer: bool,
+ pub owner_can_destroy: bool,
}
impl<BlockNumber: Encode + Decode> Default for CollectionLimits<BlockNumber> {
- fn default() -> Self {
- Self {
- account_token_ownership_limit: 10_000_000,
- token_limit: u32::max_value(),
- sponsored_data_size: u32::MAX,
- sponsored_data_rate_limit: None,
- sponsor_transfer_timeout: 14400,
- owner_can_transfer: true,
- owner_can_destroy: true
- }
- }
+ fn default() -> Self {
+ Self {
+ account_token_ownership_limit: 10_000_000,
+ token_limit: u32::max_value(),
+ sponsored_data_size: u32::MAX,
+ sponsored_data_rate_limit: None,
+ sponsor_transfer_timeout: 14400,
+ owner_can_transfer: true,
+ owner_can_destroy: true,
+ }
+ }
}
#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct ChainLimits {
- pub collection_numbers_limit: u32,
- pub account_token_ownership_limit: u32,
- pub collections_admins_limit: u64,
- pub custom_data_limit: u32,
+ pub collection_numbers_limit: u32,
+ pub account_token_ownership_limit: u32,
+ pub collections_admins_limit: u64,
+ pub custom_data_limit: u32,
- // Timeouts for item types in passed blocks
- pub nft_sponsor_transfer_timeout: u32,
- pub fungible_sponsor_transfer_timeout: u32,
- pub refungible_sponsor_transfer_timeout: u32,
+ // Timeouts for item types in passed blocks
+ pub nft_sponsor_transfer_timeout: u32,
+ pub fungible_sponsor_transfer_timeout: u32,
+ pub refungible_sponsor_transfer_timeout: u32,
- // Schema limits
- pub offchain_schema_limit: u32,
- pub variable_on_chain_schema_limit: u32,
- pub const_on_chain_schema_limit: u32,
+ // Schema limits
+ pub offchain_schema_limit: u32,
+ pub variable_on_chain_schema_limit: u32,
+ pub const_on_chain_schema_limit: u32,
}
-
#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct CreateNftData {
- pub const_data: Vec<u8>,
- pub variable_data: Vec<u8>,
+ pub const_data: Vec<u8>,
+ pub variable_data: Vec<u8>,
}
#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct CreateFungibleData {
- pub value: u128,
+ pub value: u128,
}
#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct CreateReFungibleData {
- pub const_data: Vec<u8>,
- pub variable_data: Vec<u8>,
- pub pieces: u128,
+ pub const_data: Vec<u8>,
+ pub variable_data: Vec<u8>,
+ pub pieces: u128,
}
#[derive(Encode, Decode, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum CreateItemData {
- NFT(CreateNftData),
- Fungible(CreateFungibleData),
- ReFungible(CreateReFungibleData),
+ NFT(CreateNftData),
+ Fungible(CreateFungibleData),
+ ReFungible(CreateReFungibleData),
}
impl CreateItemData {
- pub fn len(&self) -> usize {
- let len = match self {
- CreateItemData::NFT(data) => data.variable_data.len() + data.const_data.len(),
- CreateItemData::ReFungible(data) => data.variable_data.len() + data.const_data.len(),
- _ => 0
- };
-
- return len;
- }
+ pub fn data_size(&self) -> usize {
+ match self {
+ CreateItemData::NFT(data) => data.variable_data.len() + data.const_data.len(),
+ CreateItemData::ReFungible(data) => data.variable_data.len() + data.const_data.len(),
+ _ => 0,
+ }
+ }
}
impl From<CreateNftData> for CreateItemData {
- fn from(item: CreateNftData) -> Self {
- CreateItemData::NFT(item)
- }
+ fn from(item: CreateNftData) -> Self {
+ CreateItemData::NFT(item)
+ }
}
impl From<CreateReFungibleData> for CreateItemData {
- fn from(item: CreateReFungibleData) -> Self {
- CreateItemData::ReFungible(item)
- }
+ fn from(item: CreateReFungibleData) -> Self {
+ CreateItemData::ReFungible(item)
+ }
}
impl From<CreateFungibleData> for CreateItemData {
- fn from(item: CreateFungibleData) -> Self {
- CreateItemData::Fungible(item)
- }
+ fn from(item: CreateFungibleData) -> Self {
+ CreateItemData::Fungible(item)
+ }
}
runtime/Cargo.tomldiffbeforeafterboth--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -95,38 +95,38 @@
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-executive]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-system-benchmarking]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
optional = true
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.frame-system-rpc-runtime-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.hex-literal]
@@ -142,152 +142,152 @@
[dependencies.pallet-aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
# Contracts specific packages
[dependencies.pallet-contracts]
git = 'https://github.com/paritytech/substrate.git'
default-features = false
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-contracts-primitives]
git = 'https://github.com/paritytech/substrate.git'
default-features = false
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-contracts-rpc-runtime-api]
git = 'https://github.com/paritytech/substrate.git'
default-features = false
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-randomness-collective-flip]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-sudo]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-timestamp]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-transaction-payment]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-transaction-payment-rpc-runtime-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-treasury]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.pallet-vesting]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-arithmetic]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-block-builder]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-consensus-aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.9.0'
[dependencies.sp-inherents]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-offchain]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-session]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-transaction-pool]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.sp-version]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '3.0.0'
[dependencies.smallvec]
@@ -299,42 +299,47 @@
[dependencies.parachain-info]
default-features = false
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
version = '0.1.0'
[dependencies.cumulus-pallet-aura-ext]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
default-features = false
[dependencies.cumulus-pallet-parachain-system]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
default-features = false
[dependencies.cumulus-primitives-core]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
default-features = false
[dependencies.cumulus-pallet-xcm]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
default-features = false
[dependencies.cumulus-pallet-dmp-queue]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
default-features = false
[dependencies.cumulus-pallet-xcmp-queue]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
default-features = false
[dependencies.cumulus-primitives-utility]
git = 'https://github.com/paritytech/cumulus.git'
-branch = 'polkadot-v0.9.3'
+branch = 'polkadot-v0.9.7'
+default-features = false
+
+[dependencies.cumulus-primitives-timestamp]
+git = 'https://github.com/paritytech/cumulus.git'
+branch = 'polkadot-v0.9.7'
default-features = false
################################################################################
@@ -342,27 +347,27 @@
[dependencies.polkadot-parachain]
git = 'https://github.com/paritytech/polkadot'
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
default-features = false
[dependencies.xcm]
git = 'https://github.com/paritytech/polkadot'
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
default-features = false
[dependencies.xcm-builder]
git = 'https://github.com/paritytech/polkadot'
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
default-features = false
[dependencies.xcm-executor]
git = 'https://github.com/paritytech/polkadot'
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
default-features = false
[dependencies.pallet-xcm]
git = 'https://github.com/paritytech/polkadot'
-branch = 'release-v0.9.3'
+branch = 'release-v0.9.7'
default-features = false
@@ -379,8 +384,8 @@
pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' }
pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' }
-pallet-evm = { default-features = false, version = "4.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
-pallet-ethereum = { default-features = false, version = "2.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
+pallet-evm = { default-features = false, version = "5.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
+pallet-ethereum = { default-features = false, version = "3.0.0-dev", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
fp-rpc = { default-features = false, version = "2.0.0", git = "https://github.com/usetech-llc/frontier.git", branch = "injected-transactions-parachain" }
################################################################################
runtime/build.rsdiffbeforeafterboth--- a/runtime/build.rs
+++ b/runtime/build.rs
@@ -1,9 +1,9 @@
use substrate_wasm_builder::WasmBuilder;
fn main() {
- WasmBuilder::new()
- .with_current_project()
- .import_memory()
- .export_heap_base()
- .build()
-}
\ No newline at end of file
+ WasmBuilder::new()
+ .with_current_project()
+ .import_memory()
+ .export_heap_base()
+ .build()
+}
runtime/src/chain_extension.rsdiffbeforeafterboth--- a/runtime/src/chain_extension.rs
+++ b/runtime/src/chain_extension.rs
@@ -9,7 +9,7 @@
pub use pallet_contracts::chain_extension::RetVal;
use pallet_contracts::chain_extension::{
- ChainExtension, Environment, Ext, InitState, SysConfig, UncheckedFrom,
+ ChainExtension, Environment, Ext, InitState, SysConfig, UncheckedFrom,
};
pub use frame_support::debug;
@@ -25,56 +25,56 @@
/// Create item parameters
#[derive(Debug, PartialEq, Encode, Decode)]
pub struct NFTExtCreateItem<E: Ext> {
- pub owner: <E::T as SysConfig>::AccountId,
- pub collection_id: u32,
- pub data: CreateItemData,
+ pub owner: <E::T as SysConfig>::AccountId,
+ pub collection_id: u32,
+ pub data: CreateItemData,
}
/// Transfer parameters
#[derive(Debug, PartialEq, Encode, Decode)]
pub struct NFTExtTransfer<E: Ext> {
- pub recipient: <E::T as SysConfig>::AccountId,
- pub collection_id: u32,
- pub token_id: u32,
- pub amount: u128,
+ pub recipient: <E::T as SysConfig>::AccountId,
+ pub collection_id: u32,
+ pub token_id: u32,
+ pub amount: u128,
}
#[derive(Debug, PartialEq, Encode, Decode)]
pub struct NFTExtCreateMultipleItems<E: Ext> {
- pub owner: <E::T as SysConfig>::AccountId,
- pub collection_id: u32,
- pub data: Vec<CreateItemData>,
+ pub owner: <E::T as SysConfig>::AccountId,
+ pub collection_id: u32,
+ pub data: Vec<CreateItemData>,
}
#[derive(Debug, PartialEq, Encode, Decode)]
pub struct NFTExtApprove<E: Ext> {
- pub spender: <E::T as SysConfig>::AccountId,
- pub collection_id: u32,
- pub item_id: u32,
- pub amount: u128,
+ pub spender: <E::T as SysConfig>::AccountId,
+ pub collection_id: u32,
+ pub item_id: u32,
+ pub amount: u128,
}
#[derive(Debug, PartialEq, Encode, Decode)]
pub struct NFTExtTransferFrom<E: Ext> {
- pub owner: <E::T as SysConfig>::AccountId,
- pub recipient: <E::T as SysConfig>::AccountId,
- pub collection_id: u32,
- pub item_id: u32,
- pub amount: u128,
+ pub owner: <E::T as SysConfig>::AccountId,
+ pub recipient: <E::T as SysConfig>::AccountId,
+ pub collection_id: u32,
+ pub item_id: u32,
+ pub amount: u128,
}
#[derive(Debug, PartialEq, Encode, Decode)]
pub struct NFTExtSetVariableMetaData {
- pub collection_id: u32,
- pub item_id: u32,
- pub data: Vec<u8>,
+ pub collection_id: u32,
+ pub item_id: u32,
+ pub data: Vec<u8>,
}
#[derive(Debug, PartialEq, Encode, Decode)]
pub struct NFTExtToggleWhiteList<E: Ext> {
- pub collection_id: u32,
- pub address: <E::T as SysConfig>::AccountId,
- pub whitelisted: bool,
+ pub collection_id: u32,
+ pub address: <E::T as SysConfig>::AccountId,
+ pub whitelisted: bool,
}
/// The chain Extension of NFT pallet
@@ -83,150 +83,146 @@
pub type NftWeightInfoOf<C> = <C as pallet_nft::Config>::WeightInfo;
impl<C: Config + pallet_contracts::Config> ChainExtension<C> for NFTExtension {
- fn call<E: Ext>(func_id: u32, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>
- where
- E: Ext<T = C>,
- C: pallet_nft::Config,
- <E::T as SysConfig>::AccountId: UncheckedFrom<<E::T as SysConfig>::Hash> + AsRef<[u8]>,
- {
- // The memory of the vm stores buf in scale-codec
- match func_id {
- 0 => {
- let mut env = env.buf_in_buf_out();
- let input: NFTExtTransfer<E> = env.read_as()?;
- env.charge_weight(NftWeightInfoOf::<C>::transfer())?;
+ fn call<E: Ext>(func_id: u32, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>
+ where
+ E: Ext<T = C>,
+ C: pallet_nft::Config,
+ <E::T as SysConfig>::AccountId: UncheckedFrom<<E::T as SysConfig>::Hash> + AsRef<[u8]>,
+ {
+ // The memory of the vm stores buf in scale-codec
+ match func_id {
+ 0 => {
+ let mut env = env.buf_in_buf_out();
+ let input: NFTExtTransfer<E> = env.read_as()?;
+ env.charge_weight(NftWeightInfoOf::<C>::transfer())?;
- let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+ let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
- pallet_nft::Module::<C>::transfer_internal(
- &C::CrossAccountId::from_sub(env.ext().address().clone()),
- &C::CrossAccountId::from_sub(input.recipient),
- &collection,
- input.token_id,
- input.amount,
- )?;
+ pallet_nft::Module::<C>::transfer_internal(
+ &C::CrossAccountId::from_sub(env.ext().address().clone()),
+ &C::CrossAccountId::from_sub(input.recipient),
+ &collection,
+ input.token_id,
+ input.amount,
+ )?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
- Ok(RetVal::Converging(0))
- },
- 1 => {
- // Create Item
- let mut env = env.buf_in_buf_out();
- let input: NFTExtCreateItem<E> = env.read_as()?;
- env.charge_weight(NftWeightInfoOf::<C>::create_item(input.data.len()))?;
+ pallet_nft::Module::<C>::submit_logs(collection)?;
+ Ok(RetVal::Converging(0))
+ }
+ 1 => {
+ // Create Item
+ let mut env = env.buf_in_buf_out();
+ let input: NFTExtCreateItem<E> = env.read_as()?;
+ env.charge_weight(NftWeightInfoOf::<C>::create_item(input.data.data_size()))?;
- let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+ let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
- pallet_nft::Module::<C>::create_item_internal(
- &C::CrossAccountId::from_sub(env.ext().address().clone()),
- &collection,
- &C::CrossAccountId::from_sub(input.owner),
- input.data,
- )?;
+ pallet_nft::Module::<C>::create_item_internal(
+ &C::CrossAccountId::from_sub(env.ext().address().clone()),
+ &collection,
+ &C::CrossAccountId::from_sub(input.owner),
+ input.data,
+ )?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
- Ok(RetVal::Converging(0))
- },
- 2 => {
- // Create multiple items
- let mut env = env.buf_in_buf_out();
- let input: NFTExtCreateMultipleItems<E> = env.read_as()?;
- env.charge_weight(NftWeightInfoOf::<C>::create_item(
- input.data.iter()
- .map(|i| i.len())
- .sum()
- ))?;
+ pallet_nft::Module::<C>::submit_logs(collection)?;
+ Ok(RetVal::Converging(0))
+ }
+ 2 => {
+ // Create multiple items
+ let mut env = env.buf_in_buf_out();
+ let input: NFTExtCreateMultipleItems<E> = env.read_as()?;
+ env.charge_weight(NftWeightInfoOf::<C>::create_item(
+ input.data.iter().map(|i| i.data_size()).sum(),
+ ))?;
- let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+ let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
- pallet_nft::Module::<C>::create_multiple_items_internal(
- &C::CrossAccountId::from_sub(env.ext().address().clone()),
- &collection,
- &C::CrossAccountId::from_sub(input.owner),
- input.data,
- )?;
+ pallet_nft::Module::<C>::create_multiple_items_internal(
+ &C::CrossAccountId::from_sub(env.ext().address().clone()),
+ &collection,
+ &C::CrossAccountId::from_sub(input.owner),
+ input.data,
+ )?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
- Ok(RetVal::Converging(0))
- },
- 3 => {
- // Approve
- let mut env = env.buf_in_buf_out();
- let input: NFTExtApprove<E> = env.read_as()?;
- env.charge_weight(NftWeightInfoOf::<C>::approve())?;
+ pallet_nft::Module::<C>::submit_logs(collection)?;
+ Ok(RetVal::Converging(0))
+ }
+ 3 => {
+ // Approve
+ let mut env = env.buf_in_buf_out();
+ let input: NFTExtApprove<E> = env.read_as()?;
+ env.charge_weight(NftWeightInfoOf::<C>::approve())?;
- let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+ let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
- pallet_nft::Module::<C>::approve_internal(
- &C::CrossAccountId::from_sub(env.ext().address().clone()),
- &C::CrossAccountId::from_sub(input.spender),
- &collection,
- input.item_id,
- input.amount,
- )?;
+ pallet_nft::Module::<C>::approve_internal(
+ &C::CrossAccountId::from_sub(env.ext().address().clone()),
+ &C::CrossAccountId::from_sub(input.spender),
+ &collection,
+ input.item_id,
+ input.amount,
+ )?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
- Ok(RetVal::Converging(0))
- },
- 4 => {
- // Transfer from
- let mut env = env.buf_in_buf_out();
- let input: NFTExtTransferFrom<E> = env.read_as()?;
- env.charge_weight(NftWeightInfoOf::<C>::transfer_from())?;
+ pallet_nft::Module::<C>::submit_logs(collection)?;
+ Ok(RetVal::Converging(0))
+ }
+ 4 => {
+ // Transfer from
+ let mut env = env.buf_in_buf_out();
+ let input: NFTExtTransferFrom<E> = env.read_as()?;
+ env.charge_weight(NftWeightInfoOf::<C>::transfer_from())?;
- let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+ let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
- pallet_nft::Module::<C>::transfer_from_internal(
- &C::CrossAccountId::from_sub(env.ext().address().clone()),
- &C::CrossAccountId::from_sub(input.owner),
- &C::CrossAccountId::from_sub(input.recipient),
- &collection,
- input.item_id,
- input.amount
- )?;
+ pallet_nft::Module::<C>::transfer_from_internal(
+ &C::CrossAccountId::from_sub(env.ext().address().clone()),
+ &C::CrossAccountId::from_sub(input.owner),
+ &C::CrossAccountId::from_sub(input.recipient),
+ &collection,
+ input.item_id,
+ input.amount,
+ )?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
- Ok(RetVal::Converging(0))
- },
- 5 => {
- // Set variable metadata
- let mut env = env.buf_in_buf_out();
- let input: NFTExtSetVariableMetaData = env.read_as()?;
- env.charge_weight(NftWeightInfoOf::<C>::set_variable_meta_data())?;
+ pallet_nft::Module::<C>::submit_logs(collection)?;
+ Ok(RetVal::Converging(0))
+ }
+ 5 => {
+ // Set variable metadata
+ let mut env = env.buf_in_buf_out();
+ let input: NFTExtSetVariableMetaData = env.read_as()?;
+ env.charge_weight(NftWeightInfoOf::<C>::set_variable_meta_data())?;
- let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+ let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
- pallet_nft::Module::<C>::set_variable_meta_data_internal(
- &C::CrossAccountId::from_sub(env.ext().address().clone()),
- &collection,
- input.item_id,
- input.data,
- )?;
+ pallet_nft::Module::<C>::set_variable_meta_data_internal(
+ &C::CrossAccountId::from_sub(env.ext().address().clone()),
+ &collection,
+ input.item_id,
+ input.data,
+ )?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
- Ok(RetVal::Converging(0))
- },
- 6 => {
- // Toggle whitelist
- let mut env = env.buf_in_buf_out();
- let input: NFTExtToggleWhiteList<E> = env.read_as()?;
- env.charge_weight(NftWeightInfoOf::<C>::add_to_white_list())?;
+ pallet_nft::Module::<C>::submit_logs(collection)?;
+ Ok(RetVal::Converging(0))
+ }
+ 6 => {
+ // Toggle whitelist
+ let mut env = env.buf_in_buf_out();
+ let input: NFTExtToggleWhiteList<E> = env.read_as()?;
+ env.charge_weight(NftWeightInfoOf::<C>::add_to_white_list())?;
- let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
+ let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
- pallet_nft::Module::<C>::toggle_white_list_internal(
- &C::CrossAccountId::from_sub(env.ext().address().clone()),
- &collection,
- &C::CrossAccountId::from_sub(input.address),
- input.whitelisted,
- )?;
+ pallet_nft::Module::<C>::toggle_white_list_internal(
+ &C::CrossAccountId::from_sub(env.ext().address().clone()),
+ &collection,
+ &C::CrossAccountId::from_sub(input.address),
+ input.whitelisted,
+ )?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
- Ok(RetVal::Converging(0))
- }
- _ => {
- Err(DispatchError::Other("unknown chain_extension func_id"))
- }
- }
- }
+ pallet_nft::Module::<C>::submit_logs(collection)?;
+ Ok(RetVal::Converging(0))
+ }
+ _ => Err(DispatchError::Other("unknown chain_extension func_id")),
+ }
+ }
}
runtime/src/lib.rsdiffbeforeafterboth--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -8,25 +8,25 @@
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "1024"]
-
+#![allow(clippy::from_over_into, clippy::identity_op)]
+#![allow(clippy::fn_to_numeric_cast_with_truncation)]
// Make the WASM binary available.
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
use sp_api::impl_runtime_apis;
-use sp_core::{ crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160 };
+use sp_core::{crypto::KeyTypeId, OpaqueMetadata, H256, U256, H160};
// #[cfg(any(feature = "std", test))]
// pub use sp_runtime::BuildStorage;
use sp_runtime::{
- Permill, Perbill, Percent,
- create_runtime_str, generic, impl_opaque_keys,
- traits::{
- AccountIdLookup, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount,
- Verify, AccountIdConversion,
- },
- transaction_validity::{TransactionSource, TransactionValidity},
- ApplyExtrinsicResult, MultiSignature,
+ Permill, Perbill, Percent, create_runtime_str, generic, impl_opaque_keys,
+ traits::{
+ AccountIdLookup, ConvertInto, BlakeTwo256, Block as BlockT, IdentifyAccount, Verify,
+ AccountIdConversion,
+ },
+ transaction_validity::{TransactionSource, TransactionValidity},
+ ApplyExtrinsicResult, MultiSignature,
};
use sp_std::prelude::*;
@@ -34,48 +34,45 @@
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
-pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo};
+pub use pallet_transaction_payment::{
+ Multiplier, TargetedFeeAdjustment, FeeDetails, RuntimeDispatchInfo,
+};
// A few exports that help ease life for downstream crates.
pub use pallet_balances::Call as BalancesCall;
pub use pallet_evm::{EnsureAddressTruncated, HashedAddressMapping, Runner};
pub use frame_support::{
- construct_runtime,
- match_type,
- dispatch::DispatchResult,
- PalletId,
- parameter_types,
- StorageValue,
- ConsensusEngineId,
- traits::{
- All, Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier, OnUnbalanced, Randomness, FindAuthor
- },
- weights::{
- constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
- DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
- WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients
- },
+ construct_runtime, match_type,
+ dispatch::DispatchResult,
+ PalletId, parameter_types, StorageValue, ConsensusEngineId,
+ traits::{
+ All, Currency, ExistenceRequirement, Get, IsInVec, KeyOwnerProofSystem, LockIdentifier,
+ OnUnbalanced, Randomness, FindAuthor,
+ },
+ weights::{
+ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+ DispatchClass, DispatchInfo, GetDispatchInfo, IdentityFee, Pays, PostDispatchInfo, Weight,
+ WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients,
+ },
};
use nft_data_structs::*;
use pallet_contracts::weights::WeightInfo;
// #[cfg(any(feature = "std", test))]
use frame_system::{
- self as system,
- EnsureRoot, EnsureSigned,
+ self as system, EnsureRoot, EnsureSigned,
limits::{BlockWeights, BlockLength},
};
-use sp_arithmetic::{traits::{BaseArithmetic, Unsigned}};
+use sp_arithmetic::{
+ traits::{BaseArithmetic, Unsigned},
+};
use smallvec::smallvec;
use codec::{Encode, Decode};
use pallet_evm::{Account as EVMAccount, FeeCalculator, OnMethodCall};
use fp_rpc::TransactionStatus;
use sp_core::crypto::Public;
use sp_runtime::{
- traits::{
- Dispatchable,
- },
+ traits::{Dispatchable},
};
use pallet_contracts::chain_extension::UncheckedFrom;
-
pub use pallet_timestamp::Call as TimestampCall;
pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;
@@ -94,9 +91,8 @@
};
use xcm_executor::{Config, XcmExecutor};
-
mod chain_extension;
-use crate::chain_extension::{ NFTExtension, Imbalance };
+use crate::chain_extension::{NFTExtension, Imbalance};
/// Re-export a nft pallet
/// TODO: Check this re-export. Is this safe and good style?
@@ -144,16 +140,16 @@
pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;
- /// Opaque block type.
- pub type Block = generic::Block<Header, UncheckedExtrinsic>;
+ /// Opaque block type.
+ pub type Block = generic::Block<Header, UncheckedExtrinsic>;
- pub type SessionHandlers = ();
+ pub type SessionHandlers = ();
impl_opaque_keys! {
- pub struct SessionKeys {
+ pub struct SessionKeys {
pub aura: Aura,
}
- }
+ }
}
/// This runtime version.
@@ -178,8 +174,8 @@
#[derive(codec::Encode, codec::Decode)]
pub enum XCMPMessage<XAccountId, XBalance> {
- /// Transfer tokens to the given account from the Parachain account.
- TransferToken(XAccountId, XBalance),
+ /// Transfer tokens to the given account from the Parachain account.
+ TransferToken(XAccountId, XBalance),
}
/// The version information used to identify this runtime when compiled natively.
@@ -195,7 +191,7 @@
pub struct DealWithFees;
impl OnUnbalanced<NegativeImbalance> for DealWithFees {
- fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {
+ fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance>) {
if let Some(fees) = fees_then_tips.next() {
// for fees, 100% to treasury
let mut split = fees.ration(100, 0);
@@ -245,7 +241,6 @@
pub const Version: RuntimeVersion = VERSION;
pub const SS58Prefix: u8 = 42;
}
-
parameter_types! {
pub const ChainId: u64 = 8888;
@@ -255,6 +250,7 @@
type BlockGasLimit = BlockGasLimit;
type FeeCalculator = ();
type GasWeightMapping = ();
+ type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping;
type CallOrigin = EnsureAddressTruncated;
type WithdrawOrigin = EnsureAddressTruncated;
type AddressMapping = HashedAddressMapping<Self::Hashing>;
@@ -268,10 +264,10 @@
}
pub struct EthereumFindAuthor<F>(core::marker::PhantomData<F>);
-impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F>
-{
- fn find_author<'a, I>(digests: I) -> Option<H160> where
- I: 'a + IntoIterator<Item=(ConsensusEngineId, &'a [u8])>
+impl<F: FindAuthor<u32>> FindAuthor<H160> for EthereumFindAuthor<F> {
+ fn find_author<'a, I>(digests: I) -> Option<H160>
+ where
+ I: 'a + IntoIterator<Item = (ConsensusEngineId, &'a [u8])>,
{
if let Some(author_index) = F::find_author(digests) {
let authority_id = Aura::authorities()[author_index as usize].clone();
@@ -292,52 +288,54 @@
type EvmSubmitLog = pallet_evm::Pallet<Runtime>;
}
+impl pallet_randomness_collective_flip::Config for Runtime {}
+
impl system::Config for Runtime {
- /// The data to be stored in an account.
- type AccountData = pallet_balances::AccountData<Balance>;
- /// The identifier used to distinguish between accounts.
- type AccountId = AccountId;
- /// The basic call filter to use in dispatchable.
- type BaseCallFilter = ();
- /// Maximum number of block number to block hash mappings to keep (oldest pruned first).
- type BlockHashCount = BlockHashCount;
- /// The maximum length of a block (in bytes).
+ /// The data to be stored in an account.
+ type AccountData = pallet_balances::AccountData<Balance>;
+ /// The identifier used to distinguish between accounts.
+ type AccountId = AccountId;
+ /// The basic call filter to use in dispatchable.
+ type BaseCallFilter = ();
+ /// Maximum number of block number to block hash mappings to keep (oldest pruned first).
+ type BlockHashCount = BlockHashCount;
+ /// The maximum length of a block (in bytes).
type BlockLength = RuntimeBlockLength;
- /// The index type for blocks.
- type BlockNumber = BlockNumber;
- /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.
+ /// The index type for blocks.
+ type BlockNumber = BlockNumber;
+ /// The weight of the overhead invoked on the block import process, independent of the extrinsics included in that block.
type BlockWeights = RuntimeBlockWeights;
- /// The aggregated dispatch type that is available for extrinsics.
- type Call = Call;
- /// The weight of database operations that the runtime can invoke.
- type DbWeight = RocksDbWeight;
- /// The ubiquitous event type.
- type Event = Event;
- /// The type for hashing blocks and tries.
- type Hash = Hash;
+ /// The aggregated dispatch type that is available for extrinsics.
+ type Call = Call;
+ /// The weight of database operations that the runtime can invoke.
+ type DbWeight = RocksDbWeight;
+ /// The ubiquitous event type.
+ type Event = Event;
+ /// The type for hashing blocks and tries.
+ type Hash = Hash;
/// The hashing algorithm used.
- type Hashing = BlakeTwo256;
- /// The header type.
- type Header = generic::Header<BlockNumber, BlakeTwo256>;
- /// The index type for storing how many extrinsics an account has signed.
- type Index = Index;
- /// The lookup mechanism to get account ID from whatever is passed in dispatchers.
- type Lookup = AccountIdLookup<AccountId, ()>;
- /// What to do if an account is fully reaped from the system.
- type OnKilledAccount = ();
- /// What to do if a new account is created.
- type OnNewAccount = ();
- type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
- /// The ubiquitous origin type.
- type Origin = Origin;
- /// This type is being generated by `construct_runtime!`.
- type PalletInfo = PalletInfo;
- /// This is used as an identifier of the chain. 42 is the generic substrate prefix.
+ type Hashing = BlakeTwo256;
+ /// The header type.
+ type Header = generic::Header<BlockNumber, BlakeTwo256>;
+ /// The index type for storing how many extrinsics an account has signed.
+ type Index = Index;
+ /// The lookup mechanism to get account ID from whatever is passed in dispatchers.
+ type Lookup = AccountIdLookup<AccountId, ()>;
+ /// What to do if an account is fully reaped from the system.
+ type OnKilledAccount = ();
+ /// What to do if a new account is created.
+ type OnNewAccount = ();
+ type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
+ /// The ubiquitous origin type.
+ type Origin = Origin;
+ /// This type is being generated by `construct_runtime!`.
+ type PalletInfo = PalletInfo;
+ /// This is used as an identifier of the chain. 42 is the generic substrate prefix.
type SS58Prefix = SS58Prefix;
/// Weight information for the extrinsics of this pallet.
- type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;
- /// Version of the runtime.
- type Version = Version;
+ type SystemWeightInfo = system::weights::SubstrateWeight<Runtime>;
+ /// Version of the runtime.
+ type Version = Version;
}
parameter_types! {
@@ -360,6 +358,8 @@
impl pallet_balances::Config for Runtime {
type MaxLocks = MaxLocks;
+ type MaxReserves = ();
+ type ReserveIdentifier = [u8; 8];
/// The type for recording an account's balance.
type Balance = Balance;
/// The ubiquitous event type.
@@ -373,7 +373,7 @@
pub const MICROUNIQUE: Balance = 1_000_000_000;
pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;
pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;
-pub const UNIQUE: Balance = 100 * CENTIUNIQUE;
+pub const UNIQUE: Balance = 100 * CENTIUNIQUE;
pub const fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE
@@ -437,8 +437,9 @@
/// Linear implementor of `WeightToFeePolynomial`
pub struct LinearFee<T>(sp_std::marker::PhantomData<T>);
-impl<T> WeightToFeePolynomial for LinearFee<T> where
- T: BaseArithmetic + From<u32> + Copy + Unsigned
+impl<T> WeightToFeePolynomial for LinearFee<T>
+where
+ T: BaseArithmetic + From<u32> + Copy + Unsigned,
{
type Balance = T;
@@ -622,12 +623,12 @@
type AssetTransactor = LocalAssetTransactor;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
type IsReserve = NativeAsset;
- type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of ROC
+ type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of ROC
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
type Weigher = FixedWeightBounds<UnitWeightCost, Call>;
type Trader = UsingComponents<IdentityFee<Balance>, RelayLocation, AccountId, Balances, ()>;
- type ResponseHandler = (); // Don't handle responses for now.
+ type ResponseHandler = (); // Don't handle responses for now.
}
// parameter_types! {
@@ -689,7 +690,6 @@
type Event = Event;
type WeightInfo = nft_weights::WeightInfo;
- type EvmWithdrawOrigin = EnsureAddressTruncated;
type EvmBackwardsAddressMapping = pallet_nft::MapBackwardsAddressTruncated;
type EvmAddressMapping = HashedAddressMapping<Self::Hashing>;
type CrossAccountId = pallet_nft::BasicCrossAccountId<Self>;
@@ -721,14 +721,13 @@
pub struct Sponsoring;
impl SponsoringResolve<AccountId, Call> for Sponsoring {
-
- fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>
- where
- Call: Dispatchable<Info=DispatchInfo>,
- Call: IsSubType<pallet_nft::Call<Runtime>>,
+ fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>
+ where
+ Call: Dispatchable<Info = DispatchInfo>,
+ Call: IsSubType<pallet_nft::Call<Runtime>>,
Call: IsSubType<pallet_contracts::Call<Runtime>>,
AccountId: AsRef<[u8]>,
- AccountId: UncheckedFrom<Hash>
+ AccountId: UncheckedFrom<Hash>,
{
pallet_nft_transaction_payment::Module::<Runtime>::withdraw_type(who, call)
}
@@ -736,7 +735,7 @@
type SponsorshipHandler = (
pallet_nft::NftSponsorshipHandler<Runtime>,
- pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,
+ pallet_contract_helpers::ContractSponsorshipHandler<Runtime>,
);
impl pallet_scheduler::Config for Runtime {
@@ -760,20 +759,20 @@
impl pallet_contract_helpers::Config for Runtime {}
construct_runtime!(
- pub enum Runtime where
- Block = Block,
- NodeBlock = opaque::Block,
- UncheckedExtrinsic = UncheckedExtrinsic
- {
+ pub enum Runtime where
+ Block = Block,
+ NodeBlock = opaque::Block,
+ UncheckedExtrinsic = UncheckedExtrinsic
+ {
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
- Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>},
+ Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>},
Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>},
System: system::{Pallet, Call, Storage, Config, Event<T>},
- Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>},
+ Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>},
ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
@@ -793,28 +792,36 @@
// Unique Pallets
- Inflation: pallet_inflation::{Pallet, Call, Storage},
+ Inflation: pallet_inflation::{Pallet, Call, Storage},
Nft: pallet_nft::{Pallet, Call, Config<T>, Storage, Event<T>},
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>},
NftPayment: pallet_nft_transaction_payment::{Pallet, Call, Storage},
Charging: pallet_nft_charge_transaction::{Pallet, Call, Storage },
ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage},
- }
+ }
);
pub struct TransactionConverter;
impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {
fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic {
- UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::<Runtime>::transact(transaction).into())
+ UncheckedExtrinsic::new_unsigned(
+ pallet_ethereum::Call::<Runtime>::transact(transaction).into(),
+ )
}
}
impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter {
- fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic {
- let extrinsic = UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::<Runtime>::transact(transaction).into());
+ fn convert_transaction(
+ &self,
+ transaction: pallet_ethereum::Transaction,
+ ) -> opaque::UncheckedExtrinsic {
+ let extrinsic = UncheckedExtrinsic::new_unsigned(
+ pallet_ethereum::Call::<Runtime>::transact(transaction).into(),
+ );
let encoded = extrinsic.encode();
- opaque::UncheckedExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid")
+ opaque::UncheckedExtrinsic::decode(&mut &encoded[..])
+ .expect("Encoded extrinsic is always valid")
}
}
@@ -830,13 +837,13 @@
pub type BlockId = generic::BlockId<Block>;
/// The SignedExtension to the basic transaction logic.
pub type SignedExtra = (
- system::CheckSpecVersion<Runtime>,
- // system::CheckTxVersion<Runtime>,
- system::CheckGenesis<Runtime>,
- system::CheckEra<Runtime>,
- system::CheckNonce<Runtime>,
- system::CheckWeight<Runtime>,
- pallet_nft_charge_transaction::ChargeTransactionPayment<Runtime>,
+ system::CheckSpecVersion<Runtime>,
+ // system::CheckTxVersion<Runtime>,
+ system::CheckGenesis<Runtime>,
+ system::CheckEra<Runtime>,
+ system::CheckNonce<Runtime>,
+ system::CheckWeight<Runtime>,
+ pallet_nft_charge_transaction::ChargeTransactionPayment<Runtime>,
pallet_contract_helpers::ContractHelpersExtension<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
@@ -845,11 +852,11 @@
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
- Runtime,
- Block,
- frame_system::ChainContext<Runtime>,
- Runtime,
- AllPallets,
+ Runtime,
+ Block,
+ frame_system::ChainContext<Runtime>,
+ Runtime,
+ AllPallets,
>;
impl_opaque_keys! {
@@ -867,59 +874,59 @@
}
}
- impl sp_api::Core<Block> for Runtime {
- fn version() -> RuntimeVersion {
- VERSION
- }
+ impl sp_api::Core<Block> for Runtime {
+ fn version() -> RuntimeVersion {
+ VERSION
+ }
- fn execute_block(block: Block) {
- Executive::execute_block(block)
- }
+ fn execute_block(block: Block) {
+ Executive::execute_block(block)
+ }
- fn initialize_block(header: &<Block as BlockT>::Header) {
- Executive::initialize_block(header)
- }
- }
+ fn initialize_block(header: &<Block as BlockT>::Header) {
+ Executive::initialize_block(header)
+ }
+ }
- impl sp_api::Metadata<Block> for Runtime {
- fn metadata() -> OpaqueMetadata {
- Runtime::metadata().into()
- }
- }
+ impl sp_api::Metadata<Block> for Runtime {
+ fn metadata() -> OpaqueMetadata {
+ Runtime::metadata().into()
+ }
+ }
- impl sp_block_builder::BlockBuilder<Block> for Runtime {
- fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
- Executive::apply_extrinsic(extrinsic)
- }
+ impl sp_block_builder::BlockBuilder<Block> for Runtime {
+ fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
+ Executive::apply_extrinsic(extrinsic)
+ }
- fn finalize_block() -> <Block as BlockT>::Header {
- Executive::finalize_block()
- }
+ fn finalize_block() -> <Block as BlockT>::Header {
+ Executive::finalize_block()
+ }
- fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
- data.create_extrinsics()
- }
+ fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {
+ data.create_extrinsics()
+ }
- fn check_inherents(
- block: Block,
- data: sp_inherents::InherentData,
- ) -> sp_inherents::CheckInherentsResult {
- data.check_extrinsics(&block)
- }
+ fn check_inherents(
+ block: Block,
+ data: sp_inherents::InherentData,
+ ) -> sp_inherents::CheckInherentsResult {
+ data.check_extrinsics(&block)
+ }
- // fn random_seed() -> <Block as BlockT>::Hash {
- // RandomnessCollectiveFlip::random_seed().0
- // }
- }
+ // fn random_seed() -> <Block as BlockT>::Hash {
+ // RandomnessCollectiveFlip::random_seed().0
+ // }
+ }
- impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
- fn validate_transaction(
- source: TransactionSource,
- tx: <Block as BlockT>::Extrinsic,
- ) -> TransactionValidity {
- Executive::validate_transaction(source, tx)
- }
- }
+ impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {
+ fn validate_transaction(
+ source: TransactionSource,
+ tx: <Block as BlockT>::Extrinsic,
+ ) -> TransactionValidity {
+ Executive::validate_transaction(source, tx)
+ }
+ }
impl sp_offchain::OffchainWorkerApi<Block> for Runtime {
fn offchain_worker(header: &<Block as BlockT>::Header) {
@@ -980,7 +987,7 @@
gas_limit.low_u64(),
gas_price,
nonce,
- config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config()),
+ config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),
).map_err(|err| err.into())
}
@@ -1008,7 +1015,7 @@
gas_limit.low_u64(),
gas_price,
nonce,
- config.as_ref().unwrap_or(<Runtime as pallet_evm::Config>::config()),
+ config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),
).map_err(|err| err.into())
}
@@ -1119,7 +1126,7 @@
}
}
- #[cfg(feature = "runtime-benchmarks")]
+ #[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
@@ -1151,7 +1158,31 @@
}
}
+struct CheckInherents;
+
+impl cumulus_pallet_parachain_system::CheckInherents<Block> for CheckInherents {
+ fn check_inherents(
+ block: &Block,
+ relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof,
+ ) -> sp_inherents::CheckInherentsResult {
+ let relay_chain_slot = relay_state_proof
+ .read_slot()
+ .expect("Could not read the relay chain slot from the proof");
+
+ let inherent_data =
+ cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration(
+ relay_chain_slot,
+ sp_std::time::Duration::from_secs(6),
+ )
+ .create_inherent_data()
+ .expect("Could not create the timestamp inherent data");
+
+ inherent_data.check_extrinsics(&block)
+ }
+}
+
cumulus_pallet_parachain_system::register_validate_block!(
- Runtime,
- cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
+ Runtime = Runtime,
+ BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
+ CheckInherents = CheckInherents,
);
runtime/src/nft_weights.rsdiffbeforeafterboth--- a/runtime/src/nft_weights.rs
+++ b/runtime/src/nft_weights.rs
@@ -8,154 +8,154 @@
pub struct WeightInfo;
impl pallet_nft::WeightInfo for WeightInfo {
fn create_collection() -> Weight {
- (70_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(7 as Weight))
- .saturating_add(DbWeight::get().writes(5 as Weight))
+ 70_000_000_u64
+ .saturating_add(DbWeight::get().reads(7_u64))
+ .saturating_add(DbWeight::get().writes(5_u64))
}
fn destroy_collection() -> Weight {
- (90_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(5 as Weight))
+ 90_000_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(5_u64))
}
fn add_to_white_list() -> Weight {
- (30_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn remove_from_white_list() -> Weight {
- (35_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 30_000_000_u64
+ .saturating_add(DbWeight::get().reads(3_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn remove_from_white_list() -> Weight {
+ 35_000_000_u64
+ .saturating_add(DbWeight::get().reads(3_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn set_public_access_mode() -> Weight {
- (27_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 27_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn set_mint_permission() -> Weight {
- (27_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 27_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn change_collection_owner() -> Weight {
- (27_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 27_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn add_collection_admin() -> Weight {
- (32_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
+ 32_000_000_u64
+ .saturating_add(DbWeight::get().reads(3_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
}
fn remove_collection_admin() -> Weight {
- (50_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_collection_sponsor() -> Weight {
- (32_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn confirm_sponsorship() -> Weight {
- (22_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn remove_collection_sponsor() -> Weight {
- (24_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn create_item(s: usize, ) -> Weight {
- (130_000_000 as Weight)
- .saturating_add((2135 as Weight).saturating_mul(s as Weight).saturating_mul(500 as Weight)) // 500 is temparary multiplier, fee for storage
- .saturating_add(DbWeight::get().reads(10 as Weight))
- .saturating_add(DbWeight::get().writes(8 as Weight))
- }
- fn burn_item() -> Weight {
- (170_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(9 as Weight))
- .saturating_add(DbWeight::get().writes(7 as Weight))
- }
- fn transfer() -> Weight {
- (125_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(7 as Weight))
- .saturating_add(DbWeight::get().writes(7 as Weight))
- }
- fn approve() -> Weight {
- (45_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(3 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn transfer_from() -> Weight {
- (150_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(9 as Weight))
- .saturating_add(DbWeight::get().writes(8 as Weight))
- }
- fn set_offchain_schema() -> Weight {
- (33_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_const_on_chain_schema() -> Weight {
- (11_100_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_variable_on_chain_schema() -> Weight {
- (11_100_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_variable_meta_data() -> Weight {
- (17_500_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn enable_contract_sponsoring() -> Weight {
- (13_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_schema_version() -> Weight {
- (8_500_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_chain_limits() -> Weight {
- (1_300_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
- fn set_contract_sponsoring_rate_limit() -> Weight {
- (3_500_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn set_variable_meta_data_sponsoring_rate_limit() -> Weight {
- (3_500_000 as Weight)
- .saturating_add(DbWeight::get().reads(1 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn toggle_contract_white_list() -> Weight {
- (3_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn add_to_contract_white_list() -> Weight {
- (3_000_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn remove_from_contract_white_list() -> Weight {
- (3_200_000 as Weight)
- .saturating_add(DbWeight::get().reads(0 as Weight))
- .saturating_add(DbWeight::get().writes(2 as Weight))
- }
- fn set_collection_limits() -> Weight {
- (8_900_000 as Weight)
- .saturating_add(DbWeight::get().reads(2 as Weight))
- .saturating_add(DbWeight::get().writes(1 as Weight))
- }
+ 50_000_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_collection_sponsor() -> Weight {
+ 32_000_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn confirm_sponsorship() -> Weight {
+ 22_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn remove_collection_sponsor() -> Weight {
+ 24_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn create_item(s: usize) -> Weight {
+ 130_000_000_u64
+ .saturating_add(2135_u64.saturating_mul(s as Weight).saturating_mul(500_u64)) // 500 is temparary multiplier, fee for storage
+ .saturating_add(DbWeight::get().reads(10_u64))
+ .saturating_add(DbWeight::get().writes(8_u64))
+ }
+ fn burn_item() -> Weight {
+ 170_000_000_u64
+ .saturating_add(DbWeight::get().reads(9_u64))
+ .saturating_add(DbWeight::get().writes(7_u64))
+ }
+ fn transfer() -> Weight {
+ 125_000_000_u64
+ .saturating_add(DbWeight::get().reads(7_u64))
+ .saturating_add(DbWeight::get().writes(7_u64))
+ }
+ fn approve() -> Weight {
+ 45_000_000_u64
+ .saturating_add(DbWeight::get().reads(3_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn transfer_from() -> Weight {
+ 150_000_000_u64
+ .saturating_add(DbWeight::get().reads(9_u64))
+ .saturating_add(DbWeight::get().writes(8_u64))
+ }
+ fn set_offchain_schema() -> Weight {
+ 33_000_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_const_on_chain_schema() -> Weight {
+ 11_100_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_variable_on_chain_schema() -> Weight {
+ 11_100_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_variable_meta_data() -> Weight {
+ 17_500_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn enable_contract_sponsoring() -> Weight {
+ 13_000_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_schema_version() -> Weight {
+ 8_500_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_chain_limits() -> Weight {
+ 1_300_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
+ fn set_contract_sponsoring_rate_limit() -> Weight {
+ 3_500_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn set_variable_meta_data_sponsoring_rate_limit() -> Weight {
+ 3_500_000_u64
+ .saturating_add(DbWeight::get().reads(1_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn toggle_contract_white_list() -> Weight {
+ 3_000_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn add_to_contract_white_list() -> Weight {
+ 3_000_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn remove_from_contract_white_list() -> Weight {
+ 3_200_000_u64
+ .saturating_add(DbWeight::get().reads(0_u64))
+ .saturating_add(DbWeight::get().writes(2_u64))
+ }
+ fn set_collection_limits() -> Weight {
+ 8_900_000_u64
+ .saturating_add(DbWeight::get().reads(2_u64))
+ .saturating_add(DbWeight::get().writes(1_u64))
+ }
}
runtime_types.jsondiffbeforeafterboth--- a/runtime_types.json
+++ b/runtime_types.json
@@ -11,6 +11,10 @@
"WhiteList"
]
},
+ "CallSpec": {
+ "Module": "u32",
+ "Method": "u32"
+ },
"DecimalPoints": "u8",
"CollectionMode": {
"_enum": {
tests/.eslintrc.jsondiffbeforeafterboth--- /dev/null
+++ b/tests/.eslintrc.json
@@ -0,0 +1,68 @@
+{
+ "env": {
+ "browser": true,
+ "es2020": true
+ },
+ "extends": [
+ "eslint:recommended",
+ "plugin:@typescript-eslint/recommended"
+ ],
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "ecmaVersion": 11,
+ "sourceType": "module"
+ },
+ "plugins": [
+ "@typescript-eslint"
+ ],
+ "rules": {
+ "indent": [
+ "error",
+ 2,
+ {
+ "SwitchCase": 1
+ }
+ ],
+ "function-call-argument-newline": [
+ "error",
+ "consistent"
+ ],
+ "function-paren-newline": [
+ "error",
+ "multiline"
+ ],
+ "linebreak-style": [
+ "error",
+ "unix"
+ ],
+ "quotes": [
+ "error",
+ "single",
+ {
+ "avoidEscape": true
+ }
+ ],
+ "semi": [
+ "error",
+ "always"
+ ],
+ "@typescript-eslint/explicit-module-boundary-types": "off",
+ "comma-dangle": [
+ "error",
+ "always-multiline"
+ ],
+ "no-unused-vars": "off",
+ "@typescript-eslint/no-empty-function": "off",
+ "@typescript-eslint/no-non-null-assertion": "off",
+ "@typescript-eslint/no-explicit-any": "off",
+ "@typescript-eslint/no-unused-vars": "warn",
+ "no-async-promise-executor": "warn",
+ "@typescript-eslint/no-empty-interface": "off",
+ "prefer-const": [
+ "error",
+ {
+ "destructuring": "all"
+ }
+ ]
+ }
+}
\ No newline at end of file
tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -14,14 +14,20 @@
"mocha": "^8.3.2",
"ts-node": "^9.1.1",
"tslint": "^6.1.3",
- "typescript": "^4.2.4"
+ "typescript": "^4.2.4",
+ "eslint": "^7.28.0",
+ "@types/node": "^14.14.12",
+ "@typescript-eslint/eslint-plugin": "^3.4.0",
+ "@typescript-eslint/parser": "^3.4.0"
},
"scripts": {
+ "lint": "eslint --ext .ts,.js src/",
+ "fix": "eslint --ext .ts,.js src/ --fix",
"test": "mocha --timeout 9999999 -r ts-node/register ./**/*.test.ts",
"testEth": "mocha --timeout 9999999 -r ts-node/register ./**/eth/**/*.test.ts",
"load": "mocha --timeout 9999999 -r ts-node/register ./**/*.load.ts",
"loadTransfer": "ts-node src/transfer.nload.ts",
- "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",
+ "testCollision": "mocha --timeout 9999999 -r ts-node/register ./src/collision-tests/*.test.ts",
"testAddCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/addCollectionAdmin.test.ts",
"testSetSchemaVersion": "mocha --timeout 9999999 -r ts-node/register ./**/setSchemaVersion.test.ts",
"testSetVariableMetaData": "mocha --timeout 9999999 -r ts-node/register ./**/setVariableMetaData.test.ts",
tests/src/addToContractWhiteList.test.tsdiffbeforeafterboth--- a/tests/src/addToContractWhiteList.test.ts
+++ b/tests/src/addToContractWhiteList.test.ts
@@ -3,25 +3,25 @@
// file 'LICENSE', which is part of this source code package.
//
-import chai from "chai";
+import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import privateKey from "./substrate/privateKey";
+import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import privateKey from './substrate/privateKey';
import {
- deployFlipper
-} from "./util/contracthelpers";
+ deployFlipper,
+} from './util/contracthelpers';
import {
- getGenericResult, normalizeAccountId
-} from "./util/helpers"
+ getGenericResult,
+} from './util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
describe('Integration Test addToContractWhiteList', () => {
- it(`Add an address to a contract white list`, async () => {
+ it('Add an address to a contract white list', async () => {
await usingApi(async api => {
- const bob = privateKey("//Bob");
+ const bob = privateKey('//Bob');
const [contract, deployer] = await deployFlipper(api);
const whiteListedBefore = (await api.query.nft.contractWhiteList(contract.address, bob.address)).toJSON();
@@ -35,9 +35,9 @@
});
});
- it(`Adding same address to white list repeatedly should not produce errors`, async () => {
+ it('Adding same address to white list repeatedly should not produce errors', async () => {
await usingApi(async api => {
- const bob = privateKey("//Bob");
+ const bob = privateKey('//Bob');
const [contract, deployer] = await deployFlipper(api);
const whiteListedBefore = (await api.query.nft.contractWhiteList(contract.address, bob.address)).toJSON();
@@ -58,11 +58,11 @@
describe('Negative Integration Test addToContractWhiteList', () => {
- it(`Add an address to a white list of a non-contract`, async () => {
+ it('Add an address to a white list of a non-contract', async () => {
await usingApi(async api => {
- const alice = privateKey("//Bob");
- const bob = privateKey("//Bob");
- const charlieGuineaPig = privateKey("//Charlie");
+ const alice = privateKey('//Bob');
+ const bob = privateKey('//Bob');
+ const charlieGuineaPig = privateKey('//Charlie');
const whiteListedBefore = (await api.query.nft.contractWhiteList(charlieGuineaPig.address, bob.address)).toJSON();
const addTx = api.tx.nft.addToContractWhiteList(charlieGuineaPig.address, bob.address);
@@ -74,10 +74,10 @@
});
});
- it(`Add to a contract white list using a non-owner address`, async () => {
+ it('Add to a contract white list using a non-owner address', async () => {
await usingApi(async api => {
- const bob = privateKey("//Bob");
- const [contract, deployer] = await deployFlipper(api);
+ const bob = privateKey('//Bob');
+ const [contract] = await deployFlipper(api);
const whiteListedBefore = (await api.query.nft.contractWhiteList(contract.address, bob.address)).toJSON();
const addTx = api.tx.nft.addToContractWhiteList(contract.address, bob.address);
tests/src/addToWhiteList.test.tsdiffbeforeafterboth--- a/tests/src/addToWhiteList.test.ts
+++ b/tests/src/addToWhiteList.test.ts
@@ -1,87 +1,87 @@
-//
-// This file is subject to the terms and conditions defined in
-// file 'LICENSE', which is part of this source code package.
-//
-
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
-import usingApi, { submitTransactionExpectFailAsync } from './substrate/substrate-api';
-import {
- addToWhiteListExpectSuccess,
- createCollectionExpectSuccess,
- createItemExpectSuccess,
- destroyCollectionExpectSuccess,
- enablePublicMintingExpectSuccess,
- enableWhiteListExpectSuccess,
- normalizeAccountId,
-} from './util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-
-describe('Integration Test ext. addToWhiteList()', () => {
-
- before(async () => {
- await usingApi(async (api) => {
- Alice = privateKey('//Alice');
- Bob = privateKey('//Bob');
- });
- });
-
- it('Execute the extrinsic with parameters: Collection ID and address to add to the white list', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
- });
-
- it('Whitelisted minting: list restrictions', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
- await enableWhiteListExpectSuccess(Alice, collectionId);
- await enablePublicMintingExpectSuccess(Alice, collectionId);
- await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);
- });
-});
-
-describe('Negative Integration Test ext. addToWhiteList()', () => {
-
- it('White list an address in the collection that does not exist', async () => {
- await usingApi(async (api) => {
- // tslint:disable-next-line: no-bitwise
- const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
- const Bob = privateKey('//Bob');
-
- const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(Bob.address));
- await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
- });
- });
-
- it('White list an address in the collection that was destroyed', async () => {
- await usingApi(async (api) => {
- const Alice = privateKey('//Alice');
- const Bob = privateKey('//Bob');
- // tslint:disable-next-line: no-bitwise
- const collectionId = await createCollectionExpectSuccess();
- await destroyCollectionExpectSuccess(collectionId);
- const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(Bob.address));
- await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
- });
- });
-
- it('White list an address in the collection that does not have white list access enabled', async () => {
- await usingApi(async (api) => {
- const Alice = privateKey('//Alice');
- const Ferdie = privateKey('//Ferdie');
- const collectionId = await createCollectionExpectSuccess();
- await enableWhiteListExpectSuccess(Alice, collectionId);
- await enablePublicMintingExpectSuccess(Alice, collectionId);
- const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(Ferdie.address), 'NFT');
- await expect(submitTransactionExpectFailAsync(Ferdie, tx)).to.be.rejected;
- });
- });
-
-});
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from './substrate/privateKey';
+import usingApi, { submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import {
+ addToWhiteListExpectSuccess,
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+ destroyCollectionExpectSuccess,
+ enablePublicMintingExpectSuccess,
+ enableWhiteListExpectSuccess,
+ normalizeAccountId,
+} from './util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+
+describe('Integration Test ext. addToWhiteList()', () => {
+
+ before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ });
+ });
+
+ it('Execute the extrinsic with parameters: Collection ID and address to add to the white list', async () => {
+ const collectionId = await createCollectionExpectSuccess();
+ await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
+ });
+
+ it('Whitelisted minting: list restrictions', async () => {
+ const collectionId = await createCollectionExpectSuccess();
+ await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
+ await enableWhiteListExpectSuccess(Alice, collectionId);
+ await enablePublicMintingExpectSuccess(Alice, collectionId);
+ await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);
+ });
+});
+
+describe('Negative Integration Test ext. addToWhiteList()', () => {
+
+ it('White list an address in the collection that does not exist', async () => {
+ await usingApi(async (api) => {
+ // tslint:disable-next-line: no-bitwise
+ const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+ const Bob = privateKey('//Bob');
+
+ const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(Bob.address));
+ await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
+ });
+ });
+
+ it('White list an address in the collection that was destroyed', async () => {
+ await usingApi(async (api) => {
+ const Alice = privateKey('//Alice');
+ const Bob = privateKey('//Bob');
+ // tslint:disable-next-line: no-bitwise
+ const collectionId = await createCollectionExpectSuccess();
+ await destroyCollectionExpectSuccess(collectionId);
+ const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(Bob.address));
+ await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
+ });
+ });
+
+ it('White list an address in the collection that does not have white list access enabled', async () => {
+ await usingApi(async (api) => {
+ const Alice = privateKey('//Alice');
+ const Ferdie = privateKey('//Ferdie');
+ const collectionId = await createCollectionExpectSuccess();
+ await enableWhiteListExpectSuccess(Alice, collectionId);
+ await enablePublicMintingExpectSuccess(Alice, collectionId);
+ const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(Ferdie.address), 'NFT');
+ await expect(submitTransactionExpectFailAsync(Ferdie, tx)).to.be.rejected;
+ });
+ });
+
+});
tests/src/approve.test.tsdiffbeforeafterboth--- a/tests/src/approve.test.ts
+++ b/tests/src/approve.test.ts
@@ -82,7 +82,7 @@
let Charlie: IKeyringPair;
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
Alice = privateKey('//Alice');
Bob = privateKey('//Bob');
Charlie = privateKey('//Charlie');
tests/src/block-production.test.tsdiffbeforeafterboth--- a/tests/src/block-production.test.ts
+++ b/tests/src/block-production.test.ts
@@ -3,14 +3,15 @@
// file 'LICENSE', which is part of this source code package.
//
-import usingApi from "./substrate/substrate-api";
-import { expect } from "chai";
-import { ApiPromise } from "@polkadot/api";
+import usingApi from './substrate/substrate-api';
+import { expect } from 'chai';
+import { ApiPromise } from '@polkadot/api';
const BlockTimeMs = 12000;
const ToleranceMs = 1000;
-async function getBlocks(api: ApiPromise): Promise<number[]> {
+/* eslint no-async-promise-executor: "off" */
+function getBlocks(api: ApiPromise): Promise<number[]> {
return new Promise<number[]>(async (resolve, reject) => {
const blockNumbers: number[] = [];
setTimeout(() => reject('Block production test failed due to timeout.'), BlockTimeMs + ToleranceMs);
@@ -27,7 +28,7 @@
describe('Block Production smoke test', () => {
it('Node produces new blocks', async () => {
await usingApi(async (api) => {
- let blocks: number[] | undefined = await getBlocks(api);
+ const blocks: number[] | undefined = await getBlocks(api);
expect(blocks[0]).to.be.lessThan(blocks[1]);
});
});
tests/src/burnItem.test.tsdiffbeforeafterboth--- a/tests/src/burnItem.test.ts
+++ b/tests/src/burnItem.test.ts
@@ -4,16 +4,15 @@
//
import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
import {
createCollectionExpectSuccess,
createItemExpectSuccess,
getGenericResult,
destroyCollectionExpectSuccess,
- normalizeAccountId
+ normalizeAccountId,
} from './util/helpers';
-import { nullPublicKey } from "./accounts";
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
@@ -25,10 +24,10 @@
describe('integration test: ext. burnItem():', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
- alice = keyring.addFromUri(`//Alice`);
- bob = keyring.addFromUri(`//Bob`);
+ alice = keyring.addFromUri('//Alice');
+ bob = keyring.addFromUri('//Bob');
});
});
@@ -139,10 +138,10 @@
describe('Negative integration test: ext. burnItem():', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
- alice = keyring.addFromUri(`//Alice`);
- bob = keyring.addFromUri(`//Bob`);
+ alice = keyring.addFromUri('//Alice');
+ bob = keyring.addFromUri('//Bob');
});
});
tests/src/change-collection-owner.test.tsdiffbeforeafterboth--- a/tests/src/change-collection-owner.test.ts
+++ b/tests/src/change-collection-owner.test.ts
@@ -6,8 +6,8 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import privateKey from './substrate/privateKey';
-import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import { createCollectionExpectSuccess, createCollectionExpectFailure, normalizeAccountId } from "./util/helpers";
+import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import { createCollectionExpectSuccess, normalizeAccountId } from './util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -32,7 +32,7 @@
});
describe('Negative Integration Test changeCollectionOwner(collection_id, new_owner):', () => {
- it(`Not owner can't change owner.`, async () => {
+ it('Not owner can\'t change owner.', async () => {
await usingApi(async api => {
const collectionId = await createCollectionExpectSuccess();
const alice = privateKey('//Alice');
@@ -48,7 +48,7 @@
await createCollectionExpectSuccess();
});
});
- it(`Can't change owner of not existing collection.`, async () => {
+ it('Can\'t change owner of not existing collection.', async () => {
await usingApi(async api => {
const collectionId = (1<<32) - 1;
const alice = privateKey('//Alice');
tests/src/check-event/createItemEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/createItemEvent.test.ts
+++ b/tests/src/check-event/createItemEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage } from '../util/helpers';
+import { createCollectionExpectSuccess, nftEventMessage } from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
tests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth--- a/tests/src/check-event/createMultipleItemsEvent.test.ts
+++ b/tests/src/check-event/createMultipleItemsEvent.test.ts
@@ -10,7 +10,7 @@
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage } from '../util/helpers';
+import { createCollectionExpectSuccess, nftEventMessage } from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
tests/src/collision-tests/admVsOwnerChanges.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/admVsOwnerChanges.test.ts
+++ b/tests/src/collision-tests/admVsOwnerChanges.test.ts
@@ -1,55 +1,50 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, bobsPublicKey } from '../accounts';
-import getBalance from '../substrate/get-balance';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
- createCollectionExpectSuccess,
- createItemExpectSuccess,
- setCollectionSponsorExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
- await usingApi(async () => {
- Alice = privateKey('//Alice');
- Bob = privateKey('//Bob');
- Ferdie = privateKey('//Ferdie');
- });
-});
-
-describe('Admin vs Owner changes token: ', () => {
- // tslint:disable-next-line: max-line-length
- it('The collection admin changes the owner of the token and in the same block the current owner transfers the token to another address ', async () => {
- await usingApi(async (api) => {
- const collectionId = await createCollectionExpectSuccess();
- const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
- await submitTransactionAsync(Alice, changeAdminTxBob);
- const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
- const changeAdminTxFerdie = api.tx.nft.addCollectionAdmin(collectionId, Ferdie.address);
- await submitTransactionAsync(Bob, changeAdminTxFerdie);
- const itemId = await createItemExpectSuccess(Ferdie, collectionId, 'NFT');
- //
- const changeOwner = api.tx.nft.transferFrom(Ferdie.address, Bob.address, collectionId, itemId, 1);
- const approve = api.tx.nft.approve(Bob.address, collectionId, itemId, 1);
- const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
- await Promise.all
- ([
- changeOwner.signAndSend(Alice),
- approve.signAndSend(Bob),
- sendItem.signAndSend(Ferdie),
- ]);
- const itemBefore: any = await api.query.nft.nftItemList(collectionId, itemId);
- expect(itemBefore.Owner).not.to.be.eq(Bob.address);
- await timeoutPromise(20000);
- });
- });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Admin vs Owner changes token: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('The collection admin changes the owner of the token and in the same block the current owner transfers the token to another address ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTxBob);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ const changeAdminTxFerdie = api.tx.nft.addCollectionAdmin(collectionId, Ferdie.address);
+ await submitTransactionAsync(Bob, changeAdminTxFerdie);
+ const itemId = await createItemExpectSuccess(Ferdie, collectionId, 'NFT');
+ //
+ const changeOwner = api.tx.nft.transferFrom(Ferdie.address, Bob.address, collectionId, itemId, 1);
+ const approve = api.tx.nft.approve(Bob.address, collectionId, itemId, 1);
+ const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
+ await Promise.all([
+ changeOwner.signAndSend(Alice),
+ approve.signAndSend(Bob),
+ sendItem.signAndSend(Ferdie),
+ ]);
+ const itemBefore: any = await api.query.nft.nftItemList(collectionId, itemId);
+ expect(itemBefore.Owner).not.to.be.eq(Bob.address);
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/admVsOwnerData.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/admVsOwnerData.test.ts
+++ b/tests/src/collision-tests/admVsOwnerData.test.ts
@@ -1,54 +1,47 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, bobsPublicKey } from '../accounts';
-import getBalance from '../substrate/get-balance';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
- createCollectionExpectSuccess,
- createItemExpectSuccess,
- setCollectionSponsorExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
- await usingApi(async () => {
- Alice = privateKey('//Alice');
- Bob = privateKey('//Bob');
- Ferdie = privateKey('//Ferdie');
- });
-});
-
-describe('Admin vs Owner changes the data in the token: ', () => {
- it('The collection admin changes the data in the token and in the same block the token owner also changes the data in it ', async () => {
- await usingApi(async (api) => {
- const AliceData = 1;
- const BobData = 2;
- const collectionId = await createCollectionExpectSuccess();
- const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
- await submitTransactionAsync(Alice, changeAdminTx);
- const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
- const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
- //
- // tslint:disable-next-line: max-line-length
- const AliceTx = api.tx.nft.setVariableMetaData(collectionId, itemId, AliceData.toString());
- // tslint:disable-next-line: max-line-length
- const BobTx = api.tx.nft.setVariableMetaData(collectionId, itemId, BobData.toString());
- await Promise.all
- ([
- AliceTx.signAndSend(Alice),
- BobTx.signAndSend(Bob),
- ]);
- const item: any = await api.query.nft.nftItemList(collectionId, itemId);
- expect(item.VariableData).not.to.be.eq(null); // Pseudo-random selection of one of two values
- await timeoutPromise(20000);
- });
- });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ });
+});
+
+describe('Admin vs Owner changes the data in the token: ', () => {
+ it('The collection admin changes the data in the token and in the same block the token owner also changes the data in it ', async () => {
+ await usingApi(async (api) => {
+ const AliceData = 1;
+ const BobData = 2;
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTx);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+ //
+ // tslint:disable-next-line: max-line-length
+ const AliceTx = api.tx.nft.setVariableMetaData(collectionId, itemId, AliceData.toString());
+ // tslint:disable-next-line: max-line-length
+ const BobTx = api.tx.nft.setVariableMetaData(collectionId, itemId, BobData.toString());
+ await Promise.all([
+ AliceTx.signAndSend(Alice),
+ BobTx.signAndSend(Bob),
+ ]);
+ const item: any = await api.query.nft.nftItemList(collectionId, itemId);
+ expect(item.VariableData).not.to.be.eq(null); // Pseudo-random selection of one of two values
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/admVsOwnerTake.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/admVsOwnerTake.test.ts
+++ b/tests/src/collision-tests/admVsOwnerTake.test.ts
@@ -1,54 +1,49 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, bobsPublicKey } from '../accounts';
-import getBalance from '../substrate/get-balance';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
- createCollectionExpectSuccess,
- createItemExpectSuccess,
- setCollectionSponsorExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
- await usingApi(async () => {
- Alice = privateKey('//Alice');
- Bob = privateKey('//Bob');
- Ferdie = privateKey('//Ferdie');
- });
-});
-
-describe('Admin vs Owner take token: ', () => {
- // tslint:disable-next-line: max-line-length
- it('The collection admin burns the token and in the same block the token owner performs a transaction on it ', async () => {
- await usingApi(async (api) => {
- const collectionId = await createCollectionExpectSuccess();
- const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
- await submitTransactionAsync(Alice, changeAdminTx);
- const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
- const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
- //
- const sendItem = api.tx.nft.transfer(Ferdie.address, collectionId, itemId, 1);
- const burnItem = api.tx.nft.burnItem(collectionId, itemId, 1);
- await Promise.all
- ([
- sendItem.signAndSend(Bob),
- burnItem.signAndSend(Alice),
- ]);
- await timeoutPromise(10000);
- let itemBurn: boolean = false;
- itemBurn = (await (api.query.nft.nftItemList(collectionId, itemId))).toJSON() as boolean;
- // tslint:disable-next-line: no-unused-expression
- expect(itemBurn).to.be.null;
- await timeoutPromise(20000);
- });
- });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Admin vs Owner take token: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('The collection admin burns the token and in the same block the token owner performs a transaction on it ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTx);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+ //
+ const sendItem = api.tx.nft.transfer(Ferdie.address, collectionId, itemId, 1);
+ const burnItem = api.tx.nft.burnItem(collectionId, itemId, 1);
+ await Promise.all([
+ sendItem.signAndSend(Bob),
+ burnItem.signAndSend(Alice),
+ ]);
+ await timeoutPromise(10000);
+ let itemBurn = false;
+ itemBurn = (await (api.query.nft.nftItemList(collectionId, itemId))).toJSON() as boolean;
+ // tslint:disable-next-line: no-unused-expression
+ expect(itemBurn).to.be.null;
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/adminDestroyCollection.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/adminDestroyCollection.test.ts
+++ b/tests/src/collision-tests/adminDestroyCollection.test.ts
@@ -1,35 +1,23 @@
import { IKeyringPair } from '@polkadot/types/types';
-import BN from 'bn.js';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
import {
createCollectionExpectSuccess,
} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
-interface ITokenDataType {
- Owner: number[];
- ConstData: number[];
- VariableData: number[];
-}
let Alice: IKeyringPair;
let Bob: IKeyringPair;
let Ferdie: IKeyringPair;
-let Charlie: IKeyringPair;
-let Eve: IKeyringPair;
-let Dave: IKeyringPair;
before(async () => {
await usingApi(async () => {
Alice = privateKey('//Alice');
Bob = privateKey('//Bob');
Ferdie = privateKey('//Ferdie');
- Charlie = privateKey('//Charlie');
- Eve = privateKey('//Eve');
- Dave = privateKey('//Dave');
});
});
@@ -45,13 +33,12 @@
//
const addWhitelistAdm = api.tx.nft.addToWhiteList(collectionId, Ferdie.address);
const destroyCollection = api.tx.nft.destroyCollection(collectionId);
- await Promise.all
- ([
+ await Promise.all([
addWhitelistAdm.signAndSend(Bob),
destroyCollection.signAndSend(Alice),
]);
await timeoutPromise(10000);
- let whiteList: boolean = false;
+ let whiteList = false;
whiteList = (await api.query.nft.whiteList(collectionId, Ferdie.address)).toJSON() as boolean;
// tslint:disable-next-line: no-unused-expression
expect(whiteList).to.be.false;
tests/src/collision-tests/adminLimitsOff.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/adminLimitsOff.test.ts
+++ b/tests/src/collision-tests/adminLimitsOff.test.ts
@@ -10,11 +10,6 @@
chai.use(chaiAsPromised);
const expect = chai.expect;
-interface ITokenDataType {
- Owner: number[];
- ConstData: number[];
- VariableData: number[];
-}
let Alice: IKeyringPair;
let Bob: IKeyringPair;
let Ferdie: IKeyringPair;
@@ -51,11 +46,9 @@
await submitTransactionAsync(Alice, changeAdminTx3);
const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
- //
const addAdmOne = api.tx.nft.addCollectionAdmin(collectionId, Ferdie.address);
const addAdmTwo = api.tx.nft.addCollectionAdmin(collectionId, Charlie.address);
- await Promise.all
- ([
+ await Promise.all([
addAdmOne.signAndSend(Bob),
addAdmTwo.signAndSend(Alice),
]);
tests/src/collision-tests/adminRightsOff.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/adminRightsOff.test.ts
+++ b/tests/src/collision-tests/adminRightsOff.test.ts
@@ -3,33 +3,20 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
import {
createCollectionExpectSuccess,
} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
-interface ITokenDataType {
- Owner: number[];
- ConstData: number[];
- VariableData: number[];
-}
let Alice: IKeyringPair;
let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-let Charlie: IKeyringPair;
-let Eve: IKeyringPair;
-let Dave: IKeyringPair;
before(async () => {
await usingApi(async () => {
Alice = privateKey('//Alice');
Bob = privateKey('//Bob');
- Ferdie = privateKey('//Ferdie');
- Charlie = privateKey('//Charlie');
- Eve = privateKey('//Eve');
- Dave = privateKey('//Dave');
});
});
@@ -42,12 +29,10 @@
await submitTransactionAsync(Alice, changeAdminTx);
const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
await timeoutPromise(10000);
- //
const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];
const addItemAdm = api.tx.nft.createMultipleItems(collectionId, Bob.address, args);
const removeAdm = api.tx.nft.removeCollectionAdmin(collectionId, Bob.address);
- await Promise.all
- ([
+ await Promise.all([
addItemAdm.signAndSend(Bob),
removeAdm.signAndSend(Alice),
]);
tests/src/collision-tests/setSponsorNewOwner.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/setSponsorNewOwner.test.ts
+++ b/tests/src/collision-tests/setSponsorNewOwner.test.ts
@@ -1,20 +1,14 @@
import { IKeyringPair } from '@polkadot/types/types';
-import BN from 'bn.js';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import usingApi from '../substrate/substrate-api';
import {
- createCollectionExpectSuccess, createItemExpectSuccess, setCollectionSponsorExpectSuccess,
+ createCollectionExpectSuccess, setCollectionSponsorExpectSuccess,
} from '../util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
-interface ITokenDataType {
- Owner: number[];
- ConstData: number[];
- VariableData: number[];
-}
let Alice: IKeyringPair;
let Bob: IKeyringPair;
let Ferdie: IKeyringPair;
@@ -35,11 +29,9 @@
await setCollectionSponsorExpectSuccess(collectionId, Bob.address);
const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
await timeoutPromise(10000);
- //
const confirmSponsorship = api.tx.nft.confirmSponsorship(collectionId);
const changeCollectionOwner = api.tx.nft.changeCollectionOwner(collectionId, Ferdie.address);
- await Promise.all
- ([
+ await Promise.all([
confirmSponsorship.signAndSend(Bob),
changeCollectionOwner.signAndSend(Alice),
]);
tests/src/collision-tests/sponsorPayments.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/sponsorPayments.test.ts
+++ b/tests/src/collision-tests/sponsorPayments.test.ts
@@ -1,58 +1,54 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, bobsPublicKey } from '../accounts';
-import getBalance from '../substrate/get-balance';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
- confirmSponsorshipExpectSuccess,
- createCollectionExpectSuccess,
- createItemExpectSuccess,
- setCollectionSponsorExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
- await usingApi(async () => {
- Alice = privateKey('//Alice');
- Bob = privateKey('//Bob');
- Ferdie = privateKey('//Ferdie');
- });
-});
-
-describe('Payment of commission if one block: ', () => {
- // tslint:disable-next-line: max-line-length
- it('Payment of commission if one block contains transactions for payment from the sponsor\'s balance and his (sponsor\'s) exclusion from the collection ', async () => {
- await usingApi(async (api) => {
- const collectionId = await createCollectionExpectSuccess();
- const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
- await submitTransactionAsync(Alice, changeAdminTxBob);
- const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
- const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
- await setCollectionSponsorExpectSuccess(collectionId, Bob.address);
- await confirmSponsorshipExpectSuccess(collectionId, '//Bob');
- //
- const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
- const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
- const revokeSponsor = api.tx.nft.removeCollectionSponsor(collectionId);
- await Promise.all
- ([
- sendItem.signAndSend(Bob),
- revokeSponsor.signAndSend(Alice),
- ]);
- const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
- // tslint:disable-next-line:no-unused-expression
- expect(alicesBalanceAfter === alicesBalanceBefore).to.be.true;
- // tslint:disable-next-line:no-unused-expression
- expect(bobsBalanceAfter === bobsBalanceBefore).to.be.true;
- await timeoutPromise(20000);
- });
- });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import { alicesPublicKey, bobsPublicKey } from '../accounts';
+import getBalance from '../substrate/get-balance';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+ confirmSponsorshipExpectSuccess,
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+ setCollectionSponsorExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ });
+});
+
+describe('Payment of commission if one block: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('Payment of commission if one block contains transactions for payment from the sponsor\'s balance and his (sponsor\'s) exclusion from the collection ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+ await submitTransactionAsync(Alice, changeAdminTxBob);
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+ await setCollectionSponsorExpectSuccess(collectionId, Bob.address);
+ await confirmSponsorshipExpectSuccess(collectionId, '//Bob');
+
+ const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
+ const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
+ const revokeSponsor = api.tx.nft.removeCollectionSponsor(collectionId);
+ await Promise.all([
+ sendItem.signAndSend(Bob),
+ revokeSponsor.signAndSend(Alice),
+ ]);
+ const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
+ // tslint:disable-next-line:no-unused-expression
+ expect(alicesBalanceAfter === alicesBalanceBefore).to.be.true;
+ // tslint:disable-next-line:no-unused-expression
+ expect(bobsBalanceAfter === bobsBalanceBefore).to.be.true;
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/collision-tests/tokenLimitsOff.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/tokenLimitsOff.test.ts
+++ b/tests/src/collision-tests/tokenLimitsOff.test.ts
@@ -13,11 +13,6 @@
chai.use(chaiAsPromised);
const expect = chai.expect;
-interface ITokenDataType {
- Owner: number[];
- ConstData: number[];
- VariableData: number[];
-}
let Alice: IKeyringPair;
let Bob: IKeyringPair;
let Ferdie: IKeyringPair;
@@ -63,14 +58,13 @@
expect(subTxTesult.success).to.be.true;
const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
await timeoutPromise(10000);
- //
+
const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];
const mintItemOne = api.tx.nft
.createMultipleItems(collectionId, Ferdie.address, args);
const mintItemTwo = api.tx.nft
.createMultipleItems(collectionId, Bob.address, args);
- await Promise.all
- ([
+ await Promise.all([
mintItemOne.signAndSend(Ferdie),
mintItemTwo.signAndSend(Bob),
]);
tests/src/collision-tests/turnsOffMinting.test.tsdiffbeforeafterboth--- a/tests/src/collision-tests/turnsOffMinting.test.ts
+++ b/tests/src/collision-tests/turnsOffMinting.test.ts
@@ -1,50 +1,46 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
- addToWhiteListExpectSuccess,
- createCollectionExpectSuccess,
- setMintPermissionExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
- await usingApi(async () => {
- Alice = privateKey('//Alice');
- Bob = privateKey('//Bob');
- Ferdie = privateKey('//Ferdie');
- });
-});
-
-describe('Turns off minting mode: ', () => {
- // tslint:disable-next-line: max-line-length
- it('The collection owner turns off minting mode and there are minting transactions in the same block ', async () => {
- await usingApi(async (api) => {
- const collectionId = await createCollectionExpectSuccess();
- const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
- await setMintPermissionExpectSuccess(Alice, collectionId, true);
- await addToWhiteListExpectSuccess(Alice, collectionId, Ferdie.address);
- //
- const mintItem = api.tx.nft.createItem(collectionId, Ferdie.address, 'NFT');
- const offMinting = api.tx.nft.setMintPermission(collectionId, false);
- await Promise.all
- ([
- mintItem.signAndSend(Ferdie),
- offMinting.signAndSend(Alice),
- ]);
- let itemList: boolean = false;
- itemList = (await (api.query.nft.nftItemList(collectionId, mintItem))).toJSON() as boolean;
- // tslint:disable-next-line: no-unused-expression
- expect(itemList).to.be.null;
- await timeoutPromise(20000);
- });
- });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi from '../substrate/substrate-api';
+import {
+ addToWhiteListExpectSuccess,
+ createCollectionExpectSuccess,
+ setMintPermissionExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Ferdie = privateKey('//Ferdie');
+ });
+});
+
+describe('Turns off minting mode: ', () => {
+ // tslint:disable-next-line: max-line-length
+ it('The collection owner turns off minting mode and there are minting transactions in the same block ', async () => {
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+ await setMintPermissionExpectSuccess(Alice, collectionId, true);
+ await addToWhiteListExpectSuccess(Alice, collectionId, Ferdie.address);
+
+ const mintItem = api.tx.nft.createItem(collectionId, Ferdie.address, 'NFT');
+ const offMinting = api.tx.nft.setMintPermission(collectionId, false);
+ await Promise.all([
+ mintItem.signAndSend(Ferdie),
+ offMinting.signAndSend(Alice),
+ ]);
+ let itemList = false;
+ itemList = (await (api.query.nft.nftItemList(collectionId, mintItem))).toJSON() as boolean;
+ // tslint:disable-next-line: no-unused-expression
+ expect(itemList).to.be.null;
+ await timeoutPromise(20000);
+ });
+ });
+});
tests/src/config.tsdiffbeforeafterboth--- a/tests/src/config.ts
+++ b/tests/src/config.ts
@@ -6,7 +6,7 @@
import process from 'process';
const config = {
- substrateUrl: process.env.substrateUrl || 'ws://127.0.0.1:9944'
-}
+ substrateUrl: process.env.substrateUrl || 'ws://127.0.0.1:9844',
+};
export default config;
\ No newline at end of file
tests/src/config_docker.tsdiffbeforeafterboth--- a/tests/src/config_docker.ts
+++ b/tests/src/config_docker.ts
@@ -6,7 +6,7 @@
import process from 'process';
const config = {
- substrateUrl: process.env.substrateUrl || 'ws://172.17.0.1:9944'
-}
+ substrateUrl: process.env.substrateUrl || 'ws://172.17.0.1:9944',
+};
export default config;
\ No newline at end of file
tests/src/confirmSponsorship.test.tsdiffbeforeafterboth--- a/tests/src/confirmSponsorship.test.ts
+++ b/tests/src/confirmSponsorship.test.ts
@@ -5,12 +5,11 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
+import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
import {
createCollectionExpectSuccess,
setCollectionSponsorExpectSuccess,
destroyCollectionExpectSuccess,
- setCollectionSponsorExpectFailure,
confirmSponsorshipExpectSuccess,
confirmSponsorshipExpectFailure,
createItemExpectSuccess,
@@ -20,10 +19,9 @@
enablePublicMintingExpectSuccess,
addToWhiteListExpectSuccess,
normalizeAccountId,
-} from "./util/helpers";
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
-import type { AccountId } from '@polkadot/types/interfaces';
+} from './util/helpers';
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
import { BigNumber } from 'bignumber.js';
chai.use(chaiAsPromised);
@@ -36,11 +34,11 @@
describe('integration test: ext. confirmSponsorship():', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
- alice = keyring.addFromUri(`//Alice`);
- bob = keyring.addFromUri(`//Bob`);
- charlie = keyring.addFromUri(`//Charlie`);
+ alice = keyring.addFromUri('//Alice');
+ bob = keyring.addFromUri('//Bob');
+ charlie = keyring.addFromUri('//Charlie');
});
});
@@ -163,7 +161,7 @@
await addToWhiteListExpectSuccess(alice, collectionId, zeroBalance.address);
// Mint token using unused address as signer
- const tokenId = await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address);
+ await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address);
const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
@@ -195,7 +193,7 @@
const badTransaction = async function () {
await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
};
- await expect(badTransaction()).to.be.rejectedWith("Inability to pay some fees");
+ await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');
const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
// Try again after Zero gets some balance - now it should succeed
@@ -228,11 +226,7 @@
const result1 = getGenericResult(events1);
const AsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
-
- const badTransaction = async function () {
- await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
- };
-
+ await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
// Try again after Zero gets some balance - now it should succeed
@@ -271,7 +265,7 @@
const badTransaction = async function () {
await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
};
- await expect(badTransaction()).to.be.rejectedWith("Inability to pay some fees");
+ await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');
const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
// Try again after Zero gets some balance - now it should succeed
@@ -317,7 +311,7 @@
const badTransaction = async function () {
await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address);
};
- await expect(badTransaction()).to.be.rejectedWith("Inability to pay some fees");
+ await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');
console.error = consoleError;
console.log = consoleLog;
const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
@@ -335,19 +329,19 @@
describe('(!negative test!) integration test: ext. removeCollectionSponsor():', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
- alice = keyring.addFromUri(`//Alice`);
- bob = keyring.addFromUri(`//Bob`);
- charlie = keyring.addFromUri(`//Charlie`);
+ alice = keyring.addFromUri('//Alice');
+ bob = keyring.addFromUri('//Bob');
+ charlie = keyring.addFromUri('//Charlie');
});
});
it('(!negative test!) Confirm sponsorship for a collection that never existed', async () => {
// Find the collection that never existed
- const collectionId = 0;
+ let collectionId = 0;
await usingApi(async (api) => {
- const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+ collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
});
await confirmSponsorshipExpectFailure(collectionId, '//Bob');
tests/src/connection.test.tsdiffbeforeafterboth--- a/tests/src/connection.test.ts
+++ b/tests/src/connection.test.ts
@@ -3,7 +3,7 @@
// file 'LICENSE', which is part of this source code package.
//
-import usingApi from "./substrate/substrate-api";
+import usingApi from './substrate/substrate-api';
import { WsProvider } from '@polkadot/api';
import * as chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
@@ -29,7 +29,7 @@
const neverConnectProvider = new WsProvider('ws://255.255.255.255:9944');
await expect((async () => {
await usingApi(async api => {
- const health = await api.rpc.system.health();
+ await api.rpc.system.health();
}, { provider: neverConnectProvider });
})()).to.be.eventually.rejected;
tests/src/contracts.test.tsdiffbeforeafterboth--- a/tests/src/contracts.test.ts
+++ b/tests/src/contracts.test.ts
@@ -3,17 +3,17 @@
// file 'LICENSE', which is part of this source code package.
//
-import chai from "chai";
+import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import fs from "fs";
-import { Abi, ContractPromise as Contract } from "@polkadot/api-contract";
-import privateKey from "./substrate/privateKey";
+import usingApi, { submitTransactionAsync } from './substrate/substrate-api';
+import fs from 'fs';
+import { Abi, ContractPromise as Contract } from '@polkadot/api-contract';
+import privateKey from './substrate/privateKey';
import {
deployFlipper,
getFlipValue,
deployTransferContract,
-} from "./util/contracthelpers";
+} from './util/contracthelpers';
import {
addToWhiteListExpectSuccess,
@@ -25,8 +25,8 @@
getGenericResult,
normalizeAccountId,
isWhitelisted,
- transferFromExpectSuccess
-} from "./util/helpers";
+ transferFromExpectSuccess,
+} from './util/helpers';
chai.use(chaiAsPromised);
@@ -37,12 +37,12 @@
const marketContractAddress = '5CYN9j3YvRkqxewoxeSvRbhAym4465C57uMmX5j4yz99L5H6';
describe('Contracts', () => {
- it(`Can deploy smart contract Flipper, instantiate it and call it's get and flip messages.`, async () => {
+ it('Can deploy smart contract Flipper, instantiate it and call it\'s get and flip messages.', async () => {
await usingApi(async api => {
const [contract, deployer] = await deployFlipper(api);
const initialGetResponse = await getFlipValue(contract, deployer);
- const bob = privateKey("//Bob");
+ const bob = privateKey('//Bob');
const flip = contract.tx.flip(value, gasLimit);
await submitTransactionAsync(bob, flip);
@@ -65,13 +65,13 @@
describe.only('Chain extensions', () => {
it('Transfer CE', async () => {
await usingApi(async api => {
- const alice = privateKey("//Alice");
- const bob = privateKey("//Bob");
+ const alice = privateKey('//Alice');
+ const bob = privateKey('//Bob');
// Prep work
const collectionId = await createCollectionExpectSuccess();
const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');
- const [contract, deployer] = await deployTransferContract(api);
+ const [contract] = await deployTransferContract(api);
const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, contract.address);
await submitTransactionAsync(alice, changeAdminTx);
@@ -96,7 +96,7 @@
const bob = privateKey('//Bob');
const collectionId = await createCollectionExpectSuccess();
- const [contract, deployer] = await deployTransferContract(api);
+ const [contract] = await deployTransferContract(api);
await enablePublicMintingExpectSuccess(alice, collectionId);
await enableWhiteListExpectSuccess(alice, collectionId);
await addToWhiteListExpectSuccess(alice, collectionId, contract.address);
@@ -124,7 +124,7 @@
const bob = privateKey('//Bob');
const collectionId = await createCollectionExpectSuccess();
- const [contract, deployer] = await deployTransferContract(api);
+ const [contract] = await deployTransferContract(api);
await enablePublicMintingExpectSuccess(alice, collectionId);
await enableWhiteListExpectSuccess(alice, collectionId);
await addToWhiteListExpectSuccess(alice, collectionId, contract.address);
@@ -133,7 +133,7 @@
const transferTx = contract.tx.createMultipleItems(value, gasLimit, bob.address, collectionId, [
{ Nft: { const_data: '0x010203', variable_data: '0x020304' } },
{ Nft: { const_data: '0x010204', variable_data: '0x020305' } },
- { Nft: { const_data: '0x010205', variable_data: '0x020306' } }
+ { Nft: { const_data: '0x010205', variable_data: '0x020306' } },
]);
const events = await submitTransactionAsync(alice, transferTx);
const result = getGenericResult(events);
@@ -169,7 +169,7 @@
const charlie = privateKey('//Charlie');
const collectionId = await createCollectionExpectSuccess();
- const [contract, deployer] = await deployTransferContract(api);
+ const [contract] = await deployTransferContract(api);
const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', contract.address.toString());
const transferTx = contract.tx.approve(value, gasLimit, bob.address, collectionId, tokenId, 1);
@@ -188,7 +188,7 @@
const charlie = privateKey('//Charlie');
const collectionId = await createCollectionExpectSuccess();
- const [contract, deployer] = await deployTransferContract(api);
+ const [contract] = await deployTransferContract(api);
const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);
await approveExpectSuccess(collectionId, tokenId, bob, contract.address.toString(), 1);
@@ -197,7 +197,7 @@
const result = getGenericResult(events);
expect(result.success).to.be.true;
- const token: any = (await api.query.nft.nftItemList(collectionId, tokenId) as any).unwrap()
+ const token: any = (await api.query.nft.nftItemList(collectionId, tokenId) as any).unwrap();
expect(token.Owner.toString()).to.be.equal(charlie.address);
});
});
@@ -207,7 +207,7 @@
const alice = privateKey('//Alice');
const collectionId = await createCollectionExpectSuccess();
- const [contract, deployer] = await deployTransferContract(api);
+ const [contract] = await deployTransferContract(api);
const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', contract.address.toString());
const transferTx = contract.tx.setVariableMetaData(value, gasLimit, collectionId, tokenId, '0x121314');
@@ -215,7 +215,7 @@
const result = getGenericResult(events);
expect(result.success).to.be.true;
- const token: any = (await api.query.nft.nftItemList(collectionId, tokenId) as any).unwrap()
+ const token: any = (await api.query.nft.nftItemList(collectionId, tokenId) as any).unwrap();
expect(token.VariableData.toString()).to.be.equal('0x121314');
});
});
@@ -226,7 +226,7 @@
const bob = privateKey('//Bob');
const collectionId = await createCollectionExpectSuccess();
- const [contract, deployer] = await deployTransferContract(api);
+ const [contract] = await deployTransferContract(api);
const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, contract.address);
await submitTransactionAsync(alice, changeAdminTx);
tests/src/createItem.test.tsdiffbeforeafterboth--- a/tests/src/createItem.test.ts
+++ b/tests/src/createItem.test.ts
@@ -1,39 +1,39 @@
-//
-// This file is subject to the terms and conditions defined in
-// file 'LICENSE', which is part of this source code package.
-//
-
-import { default as usingApi } from './substrate/substrate-api';
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
-import {
- createCollectionExpectSuccess,
- createItemExpectSuccess
-} from './util/helpers';
-
-let alice: IKeyringPair;
-
-describe('integration test: ext. createItem():', () => {
- before(async () => {
- await usingApi(async (api) => {
- const keyring = new Keyring({ type: 'sr25519' });
- alice = keyring.addFromUri(`//Alice`);
- });
- });
-
- it('Create new item in NFT collection', async () => {
- const createMode = 'NFT';
- const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
- await createItemExpectSuccess(alice, newCollectionID, createMode);
- });
- it('Create new item in Fungible collection', async () => {
- const createMode = 'Fungible';
- const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}});
- await createItemExpectSuccess(alice, newCollectionID, createMode);
- });
- it('Create new item in ReFungible collection', async () => {
- const createMode = 'ReFungible';
- const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
- await createItemExpectSuccess(alice, newCollectionID, createMode);
- });
-});
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { default as usingApi } from './substrate/substrate-api';
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
+import {
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+} from './util/helpers';
+
+let alice: IKeyringPair;
+
+describe('integration test: ext. createItem():', () => {
+ before(async () => {
+ await usingApi(async () => {
+ const keyring = new Keyring({ type: 'sr25519' });
+ alice = keyring.addFromUri('//Alice');
+ });
+ });
+
+ it('Create new item in NFT collection', async () => {
+ const createMode = 'NFT';
+ const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
+ await createItemExpectSuccess(alice, newCollectionID, createMode);
+ });
+ it('Create new item in Fungible collection', async () => {
+ const createMode = 'Fungible';
+ const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}});
+ await createItemExpectSuccess(alice, newCollectionID, createMode);
+ });
+ it('Create new item in ReFungible collection', async () => {
+ const createMode = 'ReFungible';
+ const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
+ await createItemExpectSuccess(alice, newCollectionID, createMode);
+ });
+});
tests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth--- a/tests/src/creditFeesToTreasury.test.ts
+++ b/tests/src/creditFeesToTreasury.test.ts
@@ -5,16 +5,16 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import { alicesPublicKey, bobsPublicKey } from "./accounts";
-import privateKey from "./substrate/privateKey";
+import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import { alicesPublicKey, bobsPublicKey } from './accounts';
+import privateKey from './substrate/privateKey';
import { BigNumber } from 'bignumber.js';
import { IKeyringPair } from '@polkadot/types/types';
import {
createCollectionExpectSuccess,
createItemExpectSuccess,
getGenericResult,
- transferExpectSuccess
+ transferExpectSuccess,
} from './util/helpers';
import { default as waitNewBlocks } from './substrate/wait-new-blocks';
@@ -23,7 +23,7 @@
chai.use(chaiAsPromised);
const expect = chai.expect;
-const Treasury = "5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z";
+const Treasury = '5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z';
const saneMinimumFee = 0.05;
const saneMaximumFee = 0.5;
const createCollectionDeposit = 100;
@@ -33,8 +33,9 @@
// Skip the inflation block pauses if the block is close to inflation block
// until the inflation happens
+/*eslint no-async-promise-executor: "off"*/
function skipInflationBlock(api: ApiPromise): Promise<void> {
- const promise = new Promise<void>(async (resolve, reject) => {
+ const promise = new Promise<void>(async (resolve) => {
const blockInterval = parseInt((await api.consts.inflation.inflationBlockInterval).toString());
const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
const currentBlock = parseInt(head.number.toString());
@@ -52,7 +53,7 @@
describe('integration test: Fees must be credited to Treasury:', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
alice = privateKey('//Alice');
bob = privateKey('//Bob');
});
tests/src/destroyCollection.test.tsdiffbeforeafterboth--- a/tests/src/destroyCollection.test.ts
+++ b/tests/src/destroyCollection.test.ts
@@ -7,8 +7,8 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import privateKey from './substrate/privateKey';
-import { default as usingApi } from "./substrate/substrate-api";
-import { createCollectionExpectSuccess, destroyCollectionExpectSuccess, destroyCollectionExpectFailure, setCollectionLimitsExpectSuccess } from "./util/helpers";
+import { default as usingApi } from './substrate/substrate-api';
+import { createCollectionExpectSuccess, destroyCollectionExpectSuccess, destroyCollectionExpectFailure, setCollectionLimitsExpectSuccess } from './util/helpers';
chai.use(chaiAsPromised);
@@ -31,7 +31,7 @@
let alice: IKeyringPair;
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
alice = privateKey('//Alice');
});
});
tests/src/enableContractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/enableContractSponsoring.test.ts
+++ b/tests/src/enableContractSponsoring.test.ts
@@ -81,7 +81,7 @@
it('fails when called by non-owning user', async () => {
await usingApi(async (api) => {
- const [flipper, _] = await deployFlipper(api);
+ const [flipper] = await deployFlipper(api);
await enableContractSponsoringExpectFailure(alice, flipper.address, true);
});
tests/src/eth/fungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/fungible.test.ts
+++ b/tests/src/eth/fungible.test.ts
@@ -1,289 +1,294 @@
-import privateKey from "../substrate/privateKey";
-import { approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess } from "../util/helpers";
-import { collectionIdToAddress, createEthAccount, itWeb3, normalizeEvents, recordEvents, subToEth, transferBalanceToEth } from "./util/helpers"
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import privateKey from '../substrate/privateKey';
+import { approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess } from '../util/helpers';
+import { collectionIdToAddress, createEthAccount, itWeb3, normalizeEvents, recordEvents, subToEth, transferBalanceToEth } from './util/helpers';
import fungibleAbi from './fungibleAbi.json';
-import { expect } from "chai";
+import { expect } from 'chai';
describe('Information getting', () => {
- itWeb3('totalSupply', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- name: 'token name',
- mode: { type: 'Fungible', decimalPoints: 0 }
- });
- const alice = privateKey('//Alice');
+ itWeb3('totalSupply', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ name: 'token name',
+ mode: { type: 'Fungible', decimalPoints: 0 },
+ });
+ const alice = privateKey('//Alice');
- await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { substrate: alice.address });
+ await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { substrate: alice.address });
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleAbi as any, address);
- const totalSupply = await contract.methods.totalSupply().call();
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ const totalSupply = await contract.methods.totalSupply().call();
+
+ // FIXME: always equals to 0, because this method is not implemented
+ expect(totalSupply).to.equal('0');
+ });
- // FIXME: always equals to 0, because this method is not implemented
- expect(totalSupply).to.equal('0');
+ itWeb3('balanceOf', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ name: 'token name',
+ mode: { type: 'Fungible', decimalPoints: 0 },
});
+ const alice = privateKey('//Alice');
- itWeb3('balanceOf', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- name: 'token name',
- mode: { type: 'Fungible', decimalPoints: 0 }
- });
- const alice = privateKey('//Alice');
+ const caller = createEthAccount(web3);
+ await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: caller });
- const caller = createEthAccount(web3);
- await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: caller });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ const balance = await contract.methods.balanceOf(caller).call();
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleAbi as any, address);
- const balance = await contract.methods.balanceOf(caller).call();
-
- expect(balance).to.equal('200');
- });
+ expect(balance).to.equal('200');
+ });
});
describe('Plain calls', () => {
- itWeb3('Can perform approve()', async ({ web3, api }) => {
- const collection = await createCollectionExpectSuccess({
- name: 'token name',
- mode: { type: 'Fungible', decimalPoints: 0 }
- });
- const alice = privateKey('//Alice');
+ itWeb3('Can perform approve()', async ({ web3, api }) => {
+ const collection = await createCollectionExpectSuccess({
+ name: 'token name',
+ mode: { type: 'Fungible', decimalPoints: 0 },
+ });
+ const alice = privateKey('//Alice');
- const owner = createEthAccount(web3);
- await transferBalanceToEth(api, alice, owner, 999999999999999);
+ const owner = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, owner, 999999999999999);
- await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
+ await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
- const spender = createEthAccount(web3);
+ const spender = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleAbi as any, address);
+
+ {
+ const result = await contract.methods.approve(spender, 100).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+ const events = normalizeEvents(result.events);
+ expect(events).to.be.deep.equal([
{
- const result = await contract.methods.approve(spender, 100).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
- const events = normalizeEvents(result.events);
+ address,
+ event: 'Approval',
+ args: {
+ owner,
+ spender,
+ value: '100',
+ },
+ },
+ ]);
+ }
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Approval',
- args: {
- owner,
- spender,
- value: '100',
- }
- }
- ]);
- }
+ {
+ const allowance = await contract.methods.allowance(owner, spender).call();
+ expect(+allowance).to.equal(100);
+ }
+ });
- {
- const allowance = await contract.methods.allowance(owner, spender).call();
- expect(+allowance).to.equal(100);
- }
+ itWeb3('Can perform transferFrom()', async ({ web3, api }) => {
+ const collection = await createCollectionExpectSuccess({
+ name: 'token name',
+ mode: { type: 'Fungible', decimalPoints: 0 },
});
+ const alice = privateKey('//Alice');
- itWeb3('Can perform transferFrom()', async ({ web3, api }) => {
- const collection = await createCollectionExpectSuccess({
- name: 'token name',
- mode: { type: 'Fungible', decimalPoints: 0 }
- });
- const alice = privateKey('//Alice');
-
- const owner = createEthAccount(web3);
- await transferBalanceToEth(api, alice, owner, 999999999999999);
+ const owner = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, owner, 999999999999999);
- await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
+ await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
- const spender = createEthAccount(web3);
- await transferBalanceToEth(api, alice, spender, 999999999999999);
+ const spender = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, spender, 999999999999999);
- const receiver = createEthAccount(web3);
+ const receiver = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleAbi as any, address);
- await contract.methods.approve(spender, 100).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+ await contract.methods.approve(spender, 100).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+ {
+ const result = await contract.methods.transferFrom(owner, receiver, 49).send({ from: spender, gas: '0x1000000', gasPrice: '0x01' });
+ const events = normalizeEvents(result.events);
+ expect(events).to.be.deep.equal([
{
- const result = await contract.methods.transferFrom(owner, receiver, 49).send({ from: spender, gas: '0x1000000', gasPrice: '0x01' });
- const events = normalizeEvents(result.events);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Transfer',
- args: {
- from: owner,
- to: receiver,
- value: '49',
- }
- },
- {
- address,
- event: 'Approval',
- args: {
- owner,
- spender,
- value: '51',
- }
- }
- ]);
- }
-
+ address,
+ event: 'Transfer',
+ args: {
+ from: owner,
+ to: receiver,
+ value: '49',
+ },
+ },
{
- const balance = await contract.methods.balanceOf(receiver).call();
- expect(+balance).to.equal(49);
- }
+ address,
+ event: 'Approval',
+ args: {
+ owner,
+ spender,
+ value: '51',
+ },
+ },
+ ]);
+ }
- {
- const balance = await contract.methods.balanceOf(owner).call();
- expect(+balance).to.equal(151);
- }
- });
+ {
+ const balance = await contract.methods.balanceOf(receiver).call();
+ expect(+balance).to.equal(49);
+ }
- itWeb3('Can perform transfer()', async ({ web3, api }) => {
- const collection = await createCollectionExpectSuccess({
- name: 'token name',
- mode: { type: 'Fungible', decimalPoints: 0 }
- });
- const alice = privateKey('//Alice');
+ {
+ const balance = await contract.methods.balanceOf(owner).call();
+ expect(+balance).to.equal(151);
+ }
+ });
- const owner = createEthAccount(web3);
- await transferBalanceToEth(api, alice, owner, 999999999999999);
+ itWeb3('Can perform transfer()', async ({ web3, api }) => {
+ const collection = await createCollectionExpectSuccess({
+ name: 'token name',
+ mode: { type: 'Fungible', decimalPoints: 0 },
+ });
+ const alice = privateKey('//Alice');
- await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
+ const owner = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, owner, 999999999999999);
- const receiver = createEthAccount(web3);
- await transferBalanceToEth(api, alice, receiver, 999999999999999);
+ await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ const receiver = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, receiver, 999999999999999);
- {
- const result = await contract.methods.transfer(receiver, 50).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
- const events = normalizeEvents(result.events);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Transfer',
- args: {
- from: owner,
- to: receiver,
- value: '50',
- }
- },
- ])
- }
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ {
+ const result = await contract.methods.transfer(receiver, 50).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+ const events = normalizeEvents(result.events);
+ expect(events).to.be.deep.equal([
{
- const balance = await contract.methods.balanceOf(owner).call();
- expect(+balance).to.equal(150);
- }
+ address,
+ event: 'Transfer',
+ args: {
+ from: owner,
+ to: receiver,
+ value: '50',
+ },
+ },
+ ]);
+ }
+
+ {
+ const balance = await contract.methods.balanceOf(owner).call();
+ expect(+balance).to.equal(150);
+ }
- {
- const balance = await contract.methods.balanceOf(receiver).call();
- expect(+balance).to.equal(50);
- }
- });
+ {
+ const balance = await contract.methods.balanceOf(receiver).call();
+ expect(+balance).to.equal(50);
+ }
+ });
});
describe('Substrate calls', () => {
- itWeb3('Events emitted for approve()', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'Fungible', decimalPoints: 0 }
- });
- const alice = privateKey('//Alice');
-
- const receiver = createEthAccount(web3);
+ itWeb3('Events emitted for approve()', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'Fungible', decimalPoints: 0 },
+ });
+ const alice = privateKey('//Alice');
- await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
+ const receiver = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
- const events = await recordEvents(contract, async () => {
- await approveExpectSuccess(collection, 1, alice, { ethereum: receiver }, 100);
- });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleAbi as any, address);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Approval',
- args: {
- owner: subToEth(alice.address),
- spender: receiver,
- value: '100',
- }
- }
- ]);
+ const events = await recordEvents(contract, async () => {
+ await approveExpectSuccess(collection, 1, alice, { ethereum: receiver }, 100);
});
- itWeb3('Events emitted for transferFrom()', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'Fungible', decimalPoints: 0 }
- });
- const alice = privateKey('//Alice');
- const bob = privateKey('//Bob');
+ expect(events).to.be.deep.equal([
+ {
+ address,
+ event: 'Approval',
+ args: {
+ owner: subToEth(alice.address),
+ spender: receiver,
+ value: '100',
+ },
+ },
+ ]);
+ });
- const receiver = createEthAccount(web3);
+ itWeb3('Events emitted for transferFrom()', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'Fungible', decimalPoints: 0 },
+ });
+ const alice = privateKey('//Alice');
+ const bob = privateKey('//Bob');
- await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
- await approveExpectSuccess(collection, 1, alice, bob, 100);
+ const receiver = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
+ await approveExpectSuccess(collection, 1, alice, bob, 100);
- const events = await recordEvents(contract, async () => {
- await transferFromExpectSuccess(collection, 1, bob, alice, { ethereum: receiver }, 51, 'Fungible');
- });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleAbi as any, address);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Transfer',
- args: {
- from: subToEth(alice.address),
- to: receiver,
- value: '51',
- }
- },
- {
- address,
- event: 'Approval',
- args: {
- owner: subToEth(alice.address),
- spender: subToEth(bob.address),
- value: '49',
- }
- }
- ]);
+ const events = await recordEvents(contract, async () => {
+ await transferFromExpectSuccess(collection, 1, bob, alice, { ethereum: receiver }, 51, 'Fungible');
});
- itWeb3('Events emitted for transfer()', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'Fungible', decimalPoints: 0 }
- });
- const alice = privateKey('//Alice');
+ expect(events).to.be.deep.equal([
+ {
+ address,
+ event: 'Transfer',
+ args: {
+ from: subToEth(alice.address),
+ to: receiver,
+ value: '51',
+ },
+ },
+ {
+ address,
+ event: 'Approval',
+ args: {
+ owner: subToEth(alice.address),
+ spender: subToEth(bob.address),
+ value: '49',
+ },
+ },
+ ]);
+ });
- const receiver = createEthAccount(web3);
+ itWeb3('Events emitted for transfer()', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'Fungible', decimalPoints: 0 },
+ });
+ const alice = privateKey('//Alice');
- await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
+ const receiver = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleAbi as any, address);
+ await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
- const events = await recordEvents(contract, async () => {
- await transferExpectSuccess(collection, 1, alice, { ethereum: receiver }, 51, 'Fungible');
- });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleAbi as any, address);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Transfer',
- args: {
- from: subToEth(alice.address),
- to: receiver,
- value: '51',
- }
- },
- ]);
+ const events = await recordEvents(contract, async () => {
+ await transferExpectSuccess(collection, 1, alice, { ethereum: receiver }, 51, 'Fungible');
});
+
+ expect(events).to.be.deep.equal([
+ {
+ address,
+ event: 'Transfer',
+ args: {
+ from: subToEth(alice.address),
+ to: receiver,
+ value: '51',
+ },
+ },
+ ]);
+ });
});
\ No newline at end of file
tests/src/eth/metadata.test.tsdiffbeforeafterboth--- a/tests/src/eth/metadata.test.ts
+++ b/tests/src/eth/metadata.test.ts
@@ -1,53 +1,58 @@
-import { expect } from "chai";
-import privateKey from "../substrate/privateKey";
-import { createCollectionExpectSuccess } from "../util/helpers";
-import { collectionIdToAddress, createEthAccount, itWeb3, transferBalanceToEth } from "./util/helpers";
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { expect } from 'chai';
+import privateKey from '../substrate/privateKey';
+import { createCollectionExpectSuccess } from '../util/helpers';
+import { collectionIdToAddress, createEthAccount, itWeb3, transferBalanceToEth } from './util/helpers';
import fungibleMetadataAbi from './fungibleMetadataAbi.json';
describe('Common metadata', () => {
- itWeb3('Returns collection name', async ({ api, web3 }) => {
- const collection = await createCollectionExpectSuccess({
- name: 'token name',
- mode: { type: 'NFT' }
- });
- const caller = createEthAccount(web3);
- await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
-
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
- const name = await contract.methods.name().call({ from: caller });
-
- expect(name).to.equal('token name');
+ itWeb3('Returns collection name', async ({ api, web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ name: 'token name',
+ mode: { type: 'NFT' },
});
+ const caller = createEthAccount(web3);
+ await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
- itWeb3('Returns symbol name', async ({ api, web3 }) => {
- const collection = await createCollectionExpectSuccess({
- tokenPrefix: 'TOK',
- mode: { type: 'NFT' }
- });
- const caller = createEthAccount(web3);
- await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
+ const name = await contract.methods.name().call({ from: caller });
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
- const symbol = await contract.methods.symbol().call({ from: caller });
+ expect(name).to.equal('token name');
+ });
- expect(symbol).to.equal('TOK');
+ itWeb3('Returns symbol name', async ({ api, web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ tokenPrefix: 'TOK',
+ mode: { type: 'NFT' },
});
+ const caller = createEthAccount(web3);
+ await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
+
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
+ const symbol = await contract.methods.symbol().call({ from: caller });
+
+ expect(symbol).to.equal('TOK');
+ });
});
describe('Fungible metadata', () => {
- itWeb3('Returns fungible decimals', async ({ api, web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'Fungible', decimalPoints: 6 }
- });
- const caller = createEthAccount(web3);
- await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
+ itWeb3('Returns fungible decimals', async ({ api, web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'Fungible', decimalPoints: 6 },
+ });
+ const caller = createEthAccount(web3);
+ await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
- const decimals = await contract.methods.decimals().call({ from: caller });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
+ const decimals = await contract.methods.decimals().call({ from: caller });
- expect(+decimals).to.equal(6);
- })
-})
\ No newline at end of file
+ expect(+decimals).to.equal(6);
+ });
+});
\ No newline at end of file
tests/src/eth/nonFungible.test.tsdiffbeforeafterboth--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -1,280 +1,285 @@
-import privateKey from "../substrate/privateKey";
-import { approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess } from "../util/helpers";
-import { collectionIdToAddress, createEthAccount, itWeb3, normalizeEvents, recordEvents, subToEth, transferBalanceToEth } from "./util/helpers"
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import privateKey from '../substrate/privateKey';
+import { approveExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess } from '../util/helpers';
+import { collectionIdToAddress, createEthAccount, itWeb3, normalizeEvents, recordEvents, subToEth, transferBalanceToEth } from './util/helpers';
import nonFungibleAbi from './nonFungibleAbi.json';
-import { expect } from "chai";
+import { expect } from 'chai';
describe('Information getting', () => {
- itWeb3('totalSupply', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
+ itWeb3('totalSupply', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
+ });
+ const alice = privateKey('//Alice');
+
+ await createItemExpectSuccess(alice, collection, 'NFT', { substrate: alice.address });
- await createItemExpectSuccess(alice, collection, 'NFT', { substrate: alice.address });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const totalSupply = await contract.methods.totalSupply().call();
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
- const totalSupply = await contract.methods.totalSupply().call();
+ // FIXME: always equals to 0, because this method is not implemented
+ expect(totalSupply).to.equal('0');
+ });
- // FIXME: always equals to 0, because this method is not implemented
- expect(totalSupply).to.equal('0');
+ itWeb3('balanceOf', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
});
+ const alice = privateKey('//Alice');
- itWeb3('balanceOf', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
+ const caller = createEthAccount(web3);
+ await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
+ await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
+ await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
- const caller = createEthAccount(web3);
- await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
- await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
- await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const balance = await contract.methods.balanceOf(caller).call();
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
- const balance = await contract.methods.balanceOf(caller).call();
+ expect(balance).to.equal('3');
+ });
- expect(balance).to.equal('3');
+ itWeb3('ownerOf', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
});
+ const alice = privateKey('//Alice');
- itWeb3('ownerOf', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
+ const caller = createEthAccount(web3);
+ const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
- const caller = createEthAccount(web3);
- const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const owner = await contract.methods.ownerOf(tokenId).call();
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
- const owner = await contract.methods.ownerOf(tokenId).call();
-
- expect(owner).to.equal(caller);
- });
+ expect(owner).to.equal(caller);
+ });
});
describe.only('Plain calls', () => {
- itWeb3('Can perform approve()', async ({ web3, api }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
+ itWeb3('Can perform approve()', async ({ web3, api }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
+ });
+ const alice = privateKey('//Alice');
- const owner = createEthAccount(web3);
- await transferBalanceToEth(api, alice, owner, 999999999999999);
+ const owner = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, owner, 999999999999999);
- const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
+ const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
- const spender = createEthAccount(web3);
+ const spender = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ {
+ const result = await contract.methods.approve(spender, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+ const events = normalizeEvents(result.events);
+
+ expect(events).to.be.deep.equal([
{
- const result = await contract.methods.approve(spender, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
- const events = normalizeEvents(result.events);
+ address,
+ event: 'Approval',
+ args: {
+ owner,
+ approved: spender,
+ tokenId: tokenId.toString(),
+ },
+ },
+ ]);
+ }
+ });
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Approval',
- args: {
- owner,
- approved: spender,
- tokenId: tokenId.toString(),
- }
- }
- ]);
- }
+ itWeb3('Can perform transferFrom()', async ({ web3, api }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
});
-
- itWeb3('Can perform transferFrom()', async ({ web3, api }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
+ const alice = privateKey('//Alice');
- const owner = createEthAccount(web3);
- await transferBalanceToEth(api, alice, owner, 999999999999999);
+ const owner = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, owner, 999999999999999);
- const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
+ const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
- const spender = createEthAccount(web3);
- await transferBalanceToEth(api, alice, spender, 999999999999999);
+ const spender = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, spender, 999999999999999);
- const receiver = createEthAccount(web3);
+ const receiver = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
- await contract.methods.approve(spender, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+ await contract.methods.approve(spender, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+ {
+ const result = await contract.methods.transferFrom(owner, receiver, tokenId).send({ from: spender, gas: '0x1000000', gasPrice: '0x01' });
+ const events = normalizeEvents(result.events);
+ expect(events).to.be.deep.equal([
{
- const result = await contract.methods.transferFrom(owner, receiver, tokenId).send({ from: spender, gas: '0x1000000', gasPrice: '0x01' });
- const events = normalizeEvents(result.events);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Transfer',
- args: {
- from: owner,
- to: receiver,
- tokenId: tokenId.toString(),
- },
- },
- ]);
- }
+ address,
+ event: 'Transfer',
+ args: {
+ from: owner,
+ to: receiver,
+ tokenId: tokenId.toString(),
+ },
+ },
+ ]);
+ }
- {
- const balance = await contract.methods.balanceOf(receiver).call();
- expect(+balance).to.equal(1);
- }
+ {
+ const balance = await contract.methods.balanceOf(receiver).call();
+ expect(+balance).to.equal(1);
+ }
- {
- const balance = await contract.methods.balanceOf(owner).call();
- expect(+balance).to.equal(0);
- }
- });
+ {
+ const balance = await contract.methods.balanceOf(owner).call();
+ expect(+balance).to.equal(0);
+ }
+ });
- itWeb3('Can perform transfer()', async ({ web3, api }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
+ itWeb3('Can perform transfer()', async ({ web3, api }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
+ });
+ const alice = privateKey('//Alice');
- const owner = createEthAccount(web3);
- await transferBalanceToEth(api, alice, owner, 999999999999999);
+ const owner = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, owner, 999999999999999);
- const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
+ const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
- const receiver = createEthAccount(web3);
- await transferBalanceToEth(api, alice, receiver, 999999999999999);
+ const receiver = createEthAccount(web3);
+ await transferBalanceToEth(api, alice, receiver, 999999999999999);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ {
+ const result = await contract.methods.transfer(receiver, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+ console.log(result);
+ const events = normalizeEvents(result.events);
+ expect(events).to.be.deep.equal([
{
- const result = await contract.methods.transfer(receiver, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
- console.log(result);
- const events = normalizeEvents(result.events);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Transfer',
- args: {
- from: owner,
- to: receiver,
- tokenId: tokenId.toString(),
- }
- },
- ])
- }
+ address,
+ event: 'Transfer',
+ args: {
+ from: owner,
+ to: receiver,
+ tokenId: tokenId.toString(),
+ },
+ },
+ ]);
+ }
- {
- const balance = await contract.methods.balanceOf(owner).call();
- expect(+balance).to.equal(0);
- }
+ {
+ const balance = await contract.methods.balanceOf(owner).call();
+ expect(+balance).to.equal(0);
+ }
- {
- const balance = await contract.methods.balanceOf(receiver).call();
- expect(+balance).to.equal(1);
- }
- });
+ {
+ const balance = await contract.methods.balanceOf(receiver).call();
+ expect(+balance).to.equal(1);
+ }
+ });
});
describe('Substrate calls', () => {
- itWeb3('Events emitted for approve()', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
-
- const receiver = createEthAccount(web3);
+ itWeb3('Events emitted for approve()', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
+ });
+ const alice = privateKey('//Alice');
- const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
+ const receiver = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
- const events = await recordEvents(contract, async () => {
- await approveExpectSuccess(collection, tokenId, alice, { ethereum: receiver }, 1);
- });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Approval',
- args: {
- owner: subToEth(alice.address),
- approved: receiver,
- tokenId: tokenId.toString(),
- }
- }
- ]);
+ const events = await recordEvents(contract, async () => {
+ await approveExpectSuccess(collection, tokenId, alice, { ethereum: receiver }, 1);
});
- itWeb3('Events emitted for transferFrom()', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
- const bob = privateKey('//Bob');
+ expect(events).to.be.deep.equal([
+ {
+ address,
+ event: 'Approval',
+ args: {
+ owner: subToEth(alice.address),
+ approved: receiver,
+ tokenId: tokenId.toString(),
+ },
+ },
+ ]);
+ });
- const receiver = createEthAccount(web3);
+ itWeb3('Events emitted for transferFrom()', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
+ });
+ const alice = privateKey('//Alice');
+ const bob = privateKey('//Bob');
- const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
- await approveExpectSuccess(collection, tokenId, alice, bob, 1);
+ const receiver = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
+ await approveExpectSuccess(collection, tokenId, alice, bob, 1);
- const events = await recordEvents(contract, async () => {
- await transferFromExpectSuccess(collection, tokenId, bob, alice, { ethereum: receiver }, 1, 'NFT');
- });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Transfer',
- args: {
- from: subToEth(alice.address),
- to: receiver,
- tokenId: tokenId.toString(),
- }
- },
- ]);
+ const events = await recordEvents(contract, async () => {
+ await transferFromExpectSuccess(collection, tokenId, bob, alice, { ethereum: receiver }, 1, 'NFT');
});
- itWeb3('Events emitted for transfer()', async ({ web3 }) => {
- const collection = await createCollectionExpectSuccess({
- mode: { type: 'NFT' }
- });
- const alice = privateKey('//Alice');
+ expect(events).to.be.deep.equal([
+ {
+ address,
+ event: 'Transfer',
+ args: {
+ from: subToEth(alice.address),
+ to: receiver,
+ tokenId: tokenId.toString(),
+ },
+ },
+ ]);
+ });
- const receiver = createEthAccount(web3);
+ itWeb3('Events emitted for transfer()', async ({ web3 }) => {
+ const collection = await createCollectionExpectSuccess({
+ mode: { type: 'NFT' },
+ });
+ const alice = privateKey('//Alice');
- const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
+ const receiver = createEthAccount(web3);
- const address = collectionIdToAddress(collection);
- const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+ const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
- const events = await recordEvents(contract, async () => {
- await transferExpectSuccess(collection, tokenId, alice, { ethereum: receiver }, 1, 'NFT');
- });
+ const address = collectionIdToAddress(collection);
+ const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
- expect(events).to.be.deep.equal([
- {
- address,
- event: 'Transfer',
- args: {
- from: subToEth(alice.address),
- to: receiver,
- tokenId: tokenId.toString(),
- }
- },
- ]);
+ const events = await recordEvents(contract, async () => {
+ await transferExpectSuccess(collection, tokenId, alice, { ethereum: receiver }, 1, 'NFT');
});
+
+ expect(events).to.be.deep.equal([
+ {
+ address,
+ event: 'Transfer',
+ args: {
+ from: subToEth(alice.address),
+ to: receiver,
+ tokenId: tokenId.toString(),
+ },
+ },
+ ]);
+ });
});
\ No newline at end of file
tests/src/eth/util/helpers.tsdiffbeforeafterboth--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -1,70 +1,75 @@
-import { ApiPromise } from "@polkadot/api";
-import { addressToEvm, evmToAddress } from "@polkadot/util-crypto";
-import Web3 from "web3";
-import usingApi, { submitTransactionAsync } from "../../substrate/substrate-api";
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { ApiPromise } from '@polkadot/api';
+import { addressToEvm, evmToAddress } from '@polkadot/util-crypto';
+import Web3 from 'web3';
+import usingApi, { submitTransactionAsync } from '../../substrate/substrate-api';
import { IKeyringPair } from '@polkadot/types/types';
-import { expect } from "chai";
-import { getGenericResult } from "../../util/helpers";
+import { expect } from 'chai';
+import { getGenericResult } from '../../util/helpers';
let web3Connected = false;
export async function usingWeb3<T>(cb: (web3: Web3) => Promise<T> | T): Promise<T> {
- if (web3Connected) throw new Error('do not nest usingWeb3 calls');
- web3Connected = true;
+ if (web3Connected) throw new Error('do not nest usingWeb3 calls');
+ web3Connected = true;
- const provider = new Web3.providers.WebsocketProvider("http://localhost:9944");
- const web3 = new Web3(provider);
+ const provider = new Web3.providers.WebsocketProvider('http://localhost:9944');
+ const web3 = new Web3(provider);
- try {
- return await cb(web3);
- } finally {
- // provider.disconnect(3000, 'normal disconnect');
- provider.connection.close();
- web3Connected = false;
- }
+ try {
+ return await cb(web3);
+ } finally {
+ // provider.disconnect(3000, 'normal disconnect');
+ provider.connection.close();
+ web3Connected = false;
+ }
}
export function collectionIdToAddress(address: number): string {
- if (address >= 0xffffffff || address < 0) throw new Error('id overflow');
- const buf = Buffer.from([0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e,
- address >> 24,
- (address >> 16) & 0xff,
- (address >> 8) & 0xff,
- address & 0xff,
- ]);
- return Web3.utils.toChecksumAddress('0x' + buf.toString('hex'));
+ if (address >= 0xffffffff || address < 0) throw new Error('id overflow');
+ const buf = Buffer.from([0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e,
+ address >> 24,
+ (address >> 16) & 0xff,
+ (address >> 8) & 0xff,
+ address & 0xff,
+ ]);
+ return Web3.utils.toChecksumAddress('0x' + buf.toString('hex'));
}
export function createEthAccount(web3: Web3) {
- const account = web3.eth.accounts.create();
- web3.eth.accounts.wallet.add(account.privateKey);
- return account.address;
+ const account = web3.eth.accounts.create();
+ web3.eth.accounts.wallet.add(account.privateKey);
+ return account.address;
}
export async function transferBalanceToEth(api: ApiPromise, source: IKeyringPair, target: string, amount: number) {
- const tx = api.tx.balances.transfer(evmToAddress(target), amount);
- const events = await submitTransactionAsync(source, tx);
- const result = getGenericResult(events);
- expect(result.success).to.be.true;
+ const tx = api.tx.balances.transfer(evmToAddress(target), amount);
+ const events = await submitTransactionAsync(source, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
}
export async function itWeb3(name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any, opts: { only?: boolean, skip?: boolean } = {}) {
- let i: any = it;
- if (opts.only) i = i.only;
- else if (opts.skip) i = i.skip;
- i(name, async () => {
- await usingApi(async api => {
- await usingWeb3(async web3 => {
- await cb({ api, web3 });
- });
- });
+ let i: any = it;
+ if (opts.only) i = i.only;
+ else if (opts.skip) i = i.skip;
+ i(name, async () => {
+ await usingApi(async api => {
+ await usingWeb3(async web3 => {
+ await cb({ api, web3 });
+ });
});
+ });
}
itWeb3.only = (name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any) => itWeb3(name, cb, { only: true });
itWeb3.skip = (name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any) => itWeb3(name, cb, { skip: true });
export async function generateSubstrateEthPair(web3: Web3) {
- let account = web3.eth.accounts.create();
- const evm = evmToAddress(account.address);
+ const account = web3.eth.accounts.create();
+ evmToAddress(account.address);
}
type NormalizedEvent = {
@@ -74,43 +79,43 @@
};
export function normalizeEvents(events: any): NormalizedEvent[] {
- const output = [];
- for (let key of Object.keys(events)) {
- if (key.match(/^[0-9]+$/)) {
- output.push(events[key]);
- } else if (Array.isArray(events[key])) {
- output.push(...events[key]);
- } else {
- output.push(events[key]);
- }
+ const output = [];
+ for (const key of Object.keys(events)) {
+ if (key.match(/^[0-9]+$/)) {
+ output.push(events[key]);
+ } else if (Array.isArray(events[key])) {
+ output.push(...events[key]);
+ } else {
+ output.push(events[key]);
}
- output.sort((a, b) => a.logIndex - b.logIndex);
- return output.map(({ address, event, returnValues }) => {
- const args: { [key: string]: string } = {};
- for (let key of Object.keys(returnValues)) {
- if (!key.match(/^[0-9]+$/)) {
- args[key] = returnValues[key];
- }
- }
- return {
- address,
- event,
- args,
- };
- });
+ }
+ output.sort((a, b) => a.logIndex - b.logIndex);
+ return output.map(({ address, event, returnValues }) => {
+ const args: { [key: string]: string } = {};
+ for (const key of Object.keys(returnValues)) {
+ if (!key.match(/^[0-9]+$/)) {
+ args[key] = returnValues[key];
+ }
+ }
+ return {
+ address,
+ event,
+ args,
+ };
+ });
}
export async function recordEvents(contract: any, action: () => Promise<void>): Promise<NormalizedEvent[]> {
- const out: any = [];
- contract.events.allEvents((_: any, event: any) => {
- out.push(event);
- });
- await action();
- return normalizeEvents(out);
+ const out: any = [];
+ contract.events.allEvents((_: any, event: any) => {
+ out.push(event);
+ });
+ await action();
+ return normalizeEvents(out);
}
export function subToEth(eth: string): string {
- const bytes = addressToEvm(eth);
- const string = '0x' + Buffer.from(bytes).toString('hex');
- return Web3.utils.toChecksumAddress(string);
+ const bytes = addressToEvm(eth);
+ const string = '0x' + Buffer.from(bytes).toString('hex');
+ return Web3.utils.toChecksumAddress(string);
}
\ No newline at end of file
tests/src/inflation.test.tsdiffbeforeafterboth--- a/tests/src/inflation.test.ts
+++ b/tests/src/inflation.test.ts
@@ -5,25 +5,13 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi } from "./substrate/substrate-api";
-import privateKey from "./substrate/privateKey";
+import { default as usingApi } from './substrate/substrate-api';
import { BigNumber } from 'bignumber.js';
-import { IKeyringPair } from '@polkadot/types/types';
chai.use(chaiAsPromised);
const expect = chai.expect;
-
-let alice: IKeyringPair;
-let bob: IKeyringPair;
describe('integration test: Inflation', () => {
- before(async () => {
- await usingApi(async (api) => {
- alice = privateKey('//Alice');
- bob = privateKey('//Bob');
- });
- });
-
it('First year inflation is 10%', async () => {
await usingApi(async (api) => {
tests/src/overflow.test.tsdiffbeforeafterboth--- a/tests/src/overflow.test.ts
+++ b/tests/src/overflow.test.ts
@@ -3,65 +3,65 @@
// file 'LICENSE', which is part of this source code package.
//
-import { IKeyringPair } from "@polkadot/types/types";
+import { IKeyringPair } from '@polkadot/types/types';
import chai from 'chai';
-import chaiAsPromised from "chai-as-promised";
-import privateKey from "./substrate/privateKey";
-import usingApi from "./substrate/substrate-api";
-import { approveExpectFail, approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getFungibleBalance, transferExpectFail, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX } from "./util/helpers";
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from './substrate/privateKey';
+import usingApi from './substrate/substrate-api';
+import { approveExpectFail, approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getFungibleBalance, transferExpectFail, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX } from './util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
describe('Integration Test fungible overflows', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
- let charlie: IKeyringPair;
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+ let charlie: IKeyringPair;
- before(async () => {
- await usingApi(async () => {
- alice = privateKey('//Alice');
- bob = privateKey('//Bob');
- charlie = privateKey('//Charlie');
- });
+ before(async () => {
+ await usingApi(async () => {
+ alice = privateKey('//Alice');
+ bob = privateKey('//Bob');
+ charlie = privateKey('//Charlie');
});
+ });
- it('fails when overflows on transfer', async () => {
- const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
+ it('fails when overflows on transfer', async () => {
+ const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
- await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
- await transferExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX, 'Fungible');
+ await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
+ await transferExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX, 'Fungible');
- await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: 1n });
- await transferExpectFail(fungibleCollectionId, 0, alice, bob, 1, 'Fungible');
+ await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: 1n });
+ await transferExpectFail(fungibleCollectionId, 0, alice, bob, 1, 'Fungible');
- expect(await getFungibleBalance(fungibleCollectionId, alice.address)).to.equal(1n);
- expect(await getFungibleBalance(fungibleCollectionId, bob.address)).to.equal(U128_MAX);
- });
+ expect(await getFungibleBalance(fungibleCollectionId, alice.address)).to.equal(1n);
+ expect(await getFungibleBalance(fungibleCollectionId, bob.address)).to.equal(U128_MAX);
+ });
- it('fails on allowance overflow', async () => {
- const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
+ it('fails on allowance overflow', async () => {
+ const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
- await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
- await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX);
- await approveExpectFail(fungibleCollectionId, 0, alice, bob, U128_MAX);
- });
+ await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
+ await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX);
+ await approveExpectFail(fungibleCollectionId, 0, alice, bob, U128_MAX);
+ });
- it('fails when overflows on transferFrom', async () => {
- const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
+ it('fails when overflows on transferFrom', async () => {
+ const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
- await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
- await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX);
- await transferFromExpectSuccess(fungibleCollectionId, 0, bob, alice, charlie, U128_MAX, 'Fungible');
+ await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
+ await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX);
+ await transferFromExpectSuccess(fungibleCollectionId, 0, bob, alice, charlie, U128_MAX, 'Fungible');
- expect(await getFungibleBalance(fungibleCollectionId, charlie.address)).to.equal(U128_MAX);
- expect((await getAllowance(fungibleCollectionId, 0, alice.address, bob.address)).toString()).to.equal('0');
+ expect(await getFungibleBalance(fungibleCollectionId, charlie.address)).to.equal(U128_MAX);
+ expect((await getAllowance(fungibleCollectionId, 0, alice.address, bob.address)).toString()).to.equal('0');
- await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
- await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, 1n);
- await transferFromExpectFail(fungibleCollectionId, 0, bob, alice, charlie, 1);
+ await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
+ await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, 1n);
+ await transferFromExpectFail(fungibleCollectionId, 0, bob, alice, charlie, 1);
- expect(await getFungibleBalance(fungibleCollectionId, charlie.address)).to.equal(U128_MAX);
- expect((await getAllowance(fungibleCollectionId, 0, alice.address, bob.address)).toString()).to.equal('1');
- });
+ expect(await getFungibleBalance(fungibleCollectionId, charlie.address)).to.equal(U128_MAX);
+ expect((await getAllowance(fungibleCollectionId, 0, alice.address, bob.address)).toString()).to.equal('1');
+ });
});
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -3,9 +3,9 @@
// file 'LICENSE', which is part of this source code package.
//
-import { ApiPromise } from "@polkadot/api";
-import { expect } from "chai";
-import usingApi from "./substrate/substrate-api";
+import { ApiPromise } from '@polkadot/api';
+import { expect } from 'chai';
+import usingApi from './substrate/substrate-api';
function getModuleNames(api: ApiPromise): string[] {
return api.runtimeMetadata.asLatest.modules.map(m => m.name.toString().toLowerCase());
@@ -14,12 +14,12 @@
// Pallets that must always be present
const requiredPallets = [
'nft', 'inflation', 'balances', 'contracts', 'randomnesscollectiveflip', 'system', 'timestamp', 'transactionpayment', 'treasury', 'vesting', 'evm', 'ethereum',
- 'scheduler', 'nftpayment', 'charging'
+ 'scheduler', 'nftpayment', 'charging',
];
// Pallets that depend on consensus and governance configuration
const consensusPallets = [
- 'sudo', 'aura'
+ 'sudo', 'aura',
];
describe('Pallet presence', () => {
tests/src/removeCollectionSponsor.test.tsdiffbeforeafterboth--- a/tests/src/removeCollectionSponsor.test.ts
+++ b/tests/src/removeCollectionSponsor.test.ts
@@ -5,27 +5,21 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
+import { default as usingApi, submitTransactionExpectFailAsync } from './substrate/substrate-api';
import {
createCollectionExpectSuccess,
setCollectionSponsorExpectSuccess,
destroyCollectionExpectSuccess,
- setCollectionSponsorExpectFailure,
confirmSponsorshipExpectSuccess,
confirmSponsorshipExpectFailure,
createItemExpectSuccess,
findUnusedAddress,
- getGenericResult,
- enableWhiteListExpectSuccess,
- enablePublicMintingExpectSuccess,
- addToWhiteListExpectSuccess,
removeCollectionSponsorExpectSuccess,
removeCollectionSponsorExpectFailure,
normalizeAccountId,
-} from "./util/helpers";
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
-import type { AccountId } from '@polkadot/types/interfaces';
+} from './util/helpers';
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
import { BigNumber } from 'bignumber.js';
chai.use(chaiAsPromised);
@@ -33,16 +27,14 @@
let alice: IKeyringPair;
let bob: IKeyringPair;
-let charlie: IKeyringPair;
describe('integration test: ext. removeCollectionSponsor():', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
- alice = keyring.addFromUri(`//Alice`);
- bob = keyring.addFromUri(`//Bob`);
- charlie = keyring.addFromUri(`//Charlie`);
+ alice = keyring.addFromUri('//Alice');
+ bob = keyring.addFromUri('//Bob');
});
});
@@ -65,7 +57,7 @@
const badTransaction = async function () {
await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
};
- await expect(badTransaction()).to.be.rejectedWith("Inability to pay some fees");
+ await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');
const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
expect(BsponsorBalance.isEqualTo(AsponsorBalance)).to.be.true;
@@ -95,19 +87,18 @@
describe('(!negative test!) integration test: ext. removeCollectionSponsor():', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
- alice = keyring.addFromUri(`//Alice`);
- bob = keyring.addFromUri(`//Bob`);
- charlie = keyring.addFromUri(`//Charlie`);
+ alice = keyring.addFromUri('//Alice');
+ bob = keyring.addFromUri('//Bob');
});
});
it('(!negative test!) Remove sponsor for a collection that never existed', async () => {
// Find the collection that never existed
- const collectionId = 0;
+ let collectionId = 0;
await usingApi(async (api) => {
- const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+ collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
});
await removeCollectionSponsorExpectFailure(collectionId);
tests/src/removeFromContractWhiteList.test.tsdiffbeforeafterboth--- a/tests/src/removeFromContractWhiteList.test.ts
+++ b/tests/src/removeFromContractWhiteList.test.ts
@@ -3,79 +3,79 @@
// file 'LICENSE', which is part of this source code package.
//
-import privateKey from "./substrate/privateKey";
-import usingApi from "./substrate/substrate-api";
-import { deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess } from "./util/contracthelpers";
-import { addToContractWhiteListExpectSuccess, isWhitelistedInContract, removeFromContractWhiteListExpectFailure, removeFromContractWhiteListExpectSuccess, toggleContractWhitelistExpectSuccess } from "./util/helpers";
+import privateKey from './substrate/privateKey';
+import usingApi from './substrate/substrate-api';
+import { deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess } from './util/contracthelpers';
+import { addToContractWhiteListExpectSuccess, isWhitelistedInContract, removeFromContractWhiteListExpectFailure, removeFromContractWhiteListExpectSuccess, toggleContractWhitelistExpectSuccess } from './util/helpers';
import { IKeyringPair } from '@polkadot/types/types';
-import { expect } from "chai";
+import { expect } from 'chai';
describe('Integration Test removeFromContractWhiteList', () => {
- let bob: IKeyringPair;
+ let bob: IKeyringPair;
- before(async () => {
- await usingApi(async () => {
- bob = privateKey('//Bob');
- });
+ before(async () => {
+ await usingApi(async () => {
+ bob = privateKey('//Bob');
});
+ });
- it('user is no longer whitelisted after removal', async () => {
- await usingApi(async (api) => {
- const [flipper, deployer] = await deployFlipper(api);
+ it('user is no longer whitelisted after removal', async () => {
+ await usingApi(async (api) => {
+ const [flipper, deployer] = await deployFlipper(api);
- await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
- await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+ await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+ await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
- expect(await isWhitelistedInContract(flipper.address, bob.address)).to.be.false;
- });
+ expect(await isWhitelistedInContract(flipper.address, bob.address)).to.be.false;
});
+ });
- it('user can\'t execute contract after removal', async () => {
- await usingApi(async (api) => {
- const [flipper, deployer] = await deployFlipper(api);
- await toggleContractWhitelistExpectSuccess(deployer, flipper.address.toString(), true);
+ it('user can\'t execute contract after removal', async () => {
+ await usingApi(async (api) => {
+ const [flipper, deployer] = await deployFlipper(api);
+ await toggleContractWhitelistExpectSuccess(deployer, flipper.address.toString(), true);
- await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
- await toggleFlipValueExpectSuccess(bob, flipper);
+ await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+ await toggleFlipValueExpectSuccess(bob, flipper);
- await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
- await toggleFlipValueExpectFailure(bob, flipper);
- });
+ await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+ await toggleFlipValueExpectFailure(bob, flipper);
});
+ });
- it('can be called twice', async () => {
- await usingApi(async (api) => {
- const [flipper, deployer] = await deployFlipper(api);
+ it('can be called twice', async () => {
+ await usingApi(async (api) => {
+ const [flipper, deployer] = await deployFlipper(api);
- await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
- await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
- await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
- });
+ await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+ await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+ await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
});
+ });
});
describe('Negative Integration Test removeFromContractWhiteList', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
- before(async () => {
- await usingApi(async () => {
- alice = privateKey('//Alice');
- bob = privateKey('//Bob');
- });
+ before(async () => {
+ await usingApi(async () => {
+ alice = privateKey('//Alice');
+ bob = privateKey('//Bob');
});
+ });
- it('fails when called with non-contract address', async () => {
- await usingApi(async () => {
- await removeFromContractWhiteListExpectFailure(alice, alice.address, bob.address);
- });
+ it('fails when called with non-contract address', async () => {
+ await usingApi(async () => {
+ await removeFromContractWhiteListExpectFailure(alice, alice.address, bob.address);
});
+ });
- it('fails when executed by non owner', async () => {
- await usingApi(async (api) => {
- const [flipper, _] = await deployFlipper(api);
+ it('fails when executed by non owner', async () => {
+ await usingApi(async (api) => {
+ const [flipper] = await deployFlipper(api);
- await removeFromContractWhiteListExpectFailure(alice, flipper.address.toString(), bob.address);
- });
+ await removeFromContractWhiteListExpectFailure(alice, flipper.address.toString(), bob.address);
});
+ });
});
tests/src/removeFromWhiteList.test.tsdiffbeforeafterboth--- a/tests/src/removeFromWhiteList.test.ts
+++ b/tests/src/removeFromWhiteList.test.ts
@@ -16,7 +16,7 @@
findNotExistingCollection,
removeFromWhiteListExpectFailure,
disableWhiteListExpectSuccess,
- normalizeAccountId
+ normalizeAccountId,
} from './util/helpers';
import { IKeyringPair } from '@polkadot/types/types';
import privateKey from './substrate/privateKey';
@@ -29,7 +29,7 @@
let bob: IKeyringPair;
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
alice = privateKey('//Alice');
bob = privateKey('//Bob');
});
@@ -63,7 +63,7 @@
let bob: IKeyringPair;
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
alice = privateKey('//Alice');
bob = privateKey('//Bob');
});
tests/src/rpc.load.tsdiffbeforeafterboth--- a/tests/src/rpc.load.ts
+++ b/tests/src/rpc.load.ts
@@ -3,24 +3,22 @@
// file 'LICENSE', which is part of this source code package.
//
-import { expect, assert } from "chai";
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import { IKeyringPair } from "@polkadot/types/types";
-import { Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract } from "@polkadot/api-contract";
-import { ApiPromise, Keyring } from "@polkadot/api";
-import { ApiTypes, SubmittableExtrinsic } from "@polkadot/api/types";
+import usingApi, { submitTransactionAsync } from './substrate/substrate-api';
+import { IKeyringPair } from '@polkadot/types/types';
+import { Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract } from '@polkadot/api-contract';
+import { ApiPromise, Keyring } from '@polkadot/api';
import { BigNumber } from 'bignumber.js';
-import { findUnusedAddress } from './util/helpers'
-import fs from "fs";
-import privateKey from "./substrate/privateKey";
+import { findUnusedAddress } from './util/helpers';
+import fs from 'fs';
+import privateKey from './substrate/privateKey';
const value = 0;
const gasLimit = 500000n * 1000000n;
-const endowment = `1000000000000000`;
-
+const endowment = '1000000000000000';
+/*eslint no-async-promise-executor: "off"*/
function deployBlueprint(alice: IKeyringPair, code: CodePromise): Promise<Blueprint> {
- return new Promise<Blueprint>(async (resolve, reject) => {
+ return new Promise<Blueprint>(async (resolve) => {
const unsub = await code
.createBlueprint()
.signAndSend(alice, (result) => {
@@ -29,20 +27,21 @@
resolve(result.blueprint);
unsub();
}
- })
+ });
});
}
+/*eslint no-async-promise-executor: "off"*/
function deployContract(alice: IKeyringPair, blueprint: Blueprint) : Promise<any> {
- return new Promise<any>(async (resolve, reject) => {
+ return new Promise<any>(async (resolve) => {
const unsub = await blueprint.tx
- .new(endowment, gasLimit)
- .signAndSend(alice, (result) => {
- if (result.status.isInBlock || result.status.isFinalized) {
- unsub();
- resolve(result);
- }
- });
+ .new(endowment, gasLimit)
+ .signAndSend(alice, (result) => {
+ if (result.status.isInBlock || result.status.isFinalized) {
+ unsub();
+ resolve(result);
+ }
+ });
});
}
@@ -52,7 +51,7 @@
// Transfer balance to it
const keyring = new Keyring({ type: 'sr25519' });
- const alice = keyring.addFromUri(`//Alice`);
+ const alice = keyring.addFromUri('//Alice');
let amount = new BigNumber(endowment);
amount = amount.plus(1e15);
const tx = api.tx.balances.transfer(deployer.address, amount.toFixed());
@@ -81,7 +80,7 @@
const result = await contract.query.get(deployer.address, value, gasLimit);
if(!result.result.isSuccess) {
- throw `Failed to get value`;
+ throw 'Failed to get value';
}
return result.result.asSuccess.data;
}
@@ -95,6 +94,8 @@
let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000;
let rate = 0;
const checkPoint = 1000;
+
+ /* eslint no-constant-condition: "off" */
while (true) {
await api.rpc.system.chain();
count++;
@@ -102,7 +103,7 @@
if (count % checkPoint == 0) {
hrTime = process.hrtime();
- let microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000;
+ const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000;
rate = 1000000*checkPoint/(microsec2 - microsec1);
microsec1 = microsec2;
}
@@ -117,7 +118,7 @@
const [contract, deployer] = await deployLoadTester(api);
// Fill smart contract up with data
- const bob = privateKey("//Bob");
+ const bob = privateKey('//Bob');
const tx = contract.tx.bloat(value, gasLimit, 200);
await submitTransactionAsync(bob, tx);
@@ -127,6 +128,8 @@
let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000;
let rate = 0;
const checkPoint = 10;
+
+ /* eslint no-constant-condition: "off" */
while (true) {
await getScData(contract, deployer);
count++;
@@ -134,7 +137,7 @@
if (count % checkPoint == 0) {
hrTime = process.hrtime();
- let microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000;
+ const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000;
rate = 1000000*checkPoint/(microsec2 - microsec1);
microsec1 = microsec2;
}
tests/src/scheduler.test.tsdiffbeforeafterboth--- a/tests/src/scheduler.test.ts
+++ b/tests/src/scheduler.test.ts
@@ -3,7 +3,6 @@
// file 'LICENSE', which is part of this source code package.
//
-import { IKeyringPair } from '@polkadot/types/types';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import privateKey from './substrate/privateKey';
@@ -11,34 +10,16 @@
import {
createItemExpectSuccess,
createCollectionExpectSuccess,
- destroyCollectionExpectSuccess,
- findNotExistingCollection,
- queryCollectionExpectSuccess,
- setOffchainSchemaExpectFailure,
- setOffchainSchemaExpectSuccess,
- transferExpectSuccess,
scheduleTransferExpectSuccess,
setCollectionSponsorExpectSuccess,
- confirmSponsorshipExpectSuccess
+ confirmSponsorshipExpectSuccess,
} from './util/helpers';
-
chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-const DATA = [1, 2, 3, 4];
describe('Integration Test scheduler base transaction', () => {
- let alice: IKeyringPair;
-
- before(async () => {
+ it('User can transfer owned token with delay (scheduler)', async () => {
await usingApi(async () => {
- alice = privateKey('//Alice');
- });
- });
-
- it('User can transfer owned token with delay (scheduler)', async () => {
- await usingApi(async (api) => {
const Alice = privateKey('//Alice');
const Bob = privateKey('//Bob');
// nft
@@ -50,45 +31,4 @@
await scheduleTransferExpectSuccess(nftCollectionId, newNftTokenId, Alice, Bob, 1, 'NFT');
});
});
-
-
});
-
-// describe('Negative Integration Test setOffchainSchema', () => {
-// let alice: IKeyringPair;
-// let bob: IKeyringPair;
-
-// let validCollectionId: number;
-
-// before(async () => {
-// await usingApi(async () => {
-// alice = privateKey('//Alice');
-// bob = privateKey('//Bob');
-
-// validCollectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
-// });
-// });
-
-// it('fails on not existing collection id', async () => {
-// const nonExistingCollectionId = await usingApi(findNotExistingCollection);
-
-// await setOffchainSchemaExpectFailure(alice, nonExistingCollectionId, DATA);
-// });
-
-// it('fails on destroyed collection id', async () => {
-// const destroyedCollectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
-// await destroyCollectionExpectSuccess(destroyedCollectionId);
-
-// await setOffchainSchemaExpectFailure(alice, destroyedCollectionId, DATA);
-// });
-
-// it('fails on too long data', async () => {
-// const tooLongData = new Array(4097).fill(0xff);
-
-// await setOffchainSchemaExpectFailure(alice, validCollectionId, tooLongData);
-// });
-
-// it('fails on execution by non-owner', async () => {
-// await setOffchainSchemaExpectFailure(bob, validCollectionId, DATA);
-// });
-// });
tests/src/setCollectionLimits.test.tsdiffbeforeafterboth--- a/tests/src/setCollectionLimits.test.ts
+++ b/tests/src/setCollectionLimits.test.ts
@@ -50,7 +50,7 @@
TokenLimit: tokenLimit,
SponsorTimeout: sponsorTimeout,
OwnerCanTransfer: true,
- OwnerCanDestroy: true
+ OwnerCanDestroy: true,
},
);
const events = await submitTransactionAsync(alice, tx);
@@ -73,13 +73,13 @@
it('Set the same token limit twice', async () => {
await usingApi(async (api: ApiPromise) => {
- let collectionLimits = {
+ const collectionLimits = {
AccountTokenOwnershipLimit: accountTokenOwnershipLimit,
SponsoredMintSize: sponsoredDataSize,
TokenLimit: tokenLimit,
SponsorTimeout: sponsorTimeout,
OwnerCanTransfer: true,
- OwnerCanDestroy: true
+ OwnerCanDestroy: true,
};
// The first time
@@ -173,7 +173,7 @@
TokenLimit: tokenLimit,
SponsorTimeout: sponsorTimeout,
OwnerCanTransfer: false,
- OwnerCanDestroy: true
+ OwnerCanDestroy: true,
});
await setCollectionLimitsExpectFailure(alice, collectionId, {
AccountTokenOwnershipLimit: accountTokenOwnershipLimit,
@@ -181,7 +181,7 @@
TokenLimit: tokenLimit,
SponsorTimeout: sponsorTimeout,
OwnerCanTransfer: true,
- OwnerCanDestroy: true
+ OwnerCanDestroy: true,
});
});
@@ -193,7 +193,7 @@
TokenLimit: tokenLimit,
SponsorTimeout: sponsorTimeout,
OwnerCanTransfer: true,
- OwnerCanDestroy: false
+ OwnerCanDestroy: false,
});
await setCollectionLimitsExpectFailure(alice, collectionId, {
AccountTokenOwnershipLimit: accountTokenOwnershipLimit,
@@ -201,21 +201,21 @@
TokenLimit: tokenLimit,
SponsorTimeout: sponsorTimeout,
OwnerCanTransfer: true,
- OwnerCanDestroy: true
+ OwnerCanDestroy: true,
});
});
it('Setting the higher token limit fails', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
const collectionId = await createCollectionExpectSuccess();
- let collectionLimits = {
+ const collectionLimits = {
AccountTokenOwnershipLimit: accountTokenOwnershipLimit,
SponsoredMintSize: sponsoredDataSize,
TokenLimit: tokenLimit,
SponsorTimeout: sponsorTimeout,
OwnerCanTransfer: true,
- OwnerCanDestroy: true
+ OwnerCanDestroy: true,
};
// The first time
tests/src/setCollectionSponsor.test.tsdiffbeforeafterboth--- a/tests/src/setCollectionSponsor.test.ts
+++ b/tests/src/setCollectionSponsor.test.ts
@@ -5,22 +5,21 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi } from "./substrate/substrate-api";
-import { createCollectionExpectSuccess, setCollectionSponsorExpectSuccess, destroyCollectionExpectSuccess, setCollectionSponsorExpectFailure } from "./util/helpers";
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
+import { default as usingApi } from './substrate/substrate-api';
+import { createCollectionExpectSuccess, setCollectionSponsorExpectSuccess, destroyCollectionExpectSuccess, setCollectionSponsorExpectFailure } from './util/helpers';
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
chai.use(chaiAsPromised);
-const expect = chai.expect;
let bob: IKeyringPair;
describe('integration test: ext. setCollectionSponsor():', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
- bob = keyring.addFromUri(`//Bob`);
+ bob = keyring.addFromUri('//Bob');
});
});
@@ -46,7 +45,7 @@
const collectionId = await createCollectionExpectSuccess();
const keyring = new Keyring({ type: 'sr25519' });
- const charlie = keyring.addFromUri(`//Charlie`);
+ const charlie = keyring.addFromUri('//Charlie');
await setCollectionSponsorExpectSuccess(collectionId, bob.address);
await setCollectionSponsorExpectSuccess(collectionId, charlie.address);
});
@@ -54,9 +53,9 @@
describe('(!negative test!) integration test: ext. setCollectionSponsor():', () => {
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
- bob = keyring.addFromUri(`//Bob`);
+ bob = keyring.addFromUri('//Bob');
});
});
@@ -66,9 +65,9 @@
});
it('(!negative test!) Add sponsor to a collection that never existed', async () => {
// Find the collection that never existed
- const collectionId = 0;
+ let collectionId = 0;
await usingApi(async (api) => {
- const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+ collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
});
await setCollectionSponsorExpectFailure(collectionId, bob.address);
tests/src/setConstOnChainSchema.test.tsdiffbeforeafterboth--- a/tests/src/setConstOnChainSchema.test.ts
+++ b/tests/src/setConstOnChainSchema.test.ts
@@ -23,7 +23,7 @@
let largeShema: any;
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
Alice = keyring.addFromUri('//Alice');
Bob = keyring.addFromUri('//Bob');
@@ -35,7 +35,7 @@
describe('Integration Test ext. setConstOnChainSchema()', () => {
it('Run extrinsic with parameters of the collection id, set the scheme', async () => {
- await usingApi(async (api) => {
+ await usingApi(async (api) => {
const collectionId = await createCollectionExpectSuccess();
const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
expect(collection.Owner).to.be.deep.eq(normalizeAccountId(Alice.address));
@@ -45,12 +45,12 @@
});
it('Checking collection data using the ConstOnChainSchema parameter', async () => {
- await usingApi(async (api) => {
- const collectionId = await createCollectionExpectSuccess();
- const setShema = api.tx.nft.setConstOnChainSchema(collectionId, Shema);
- await submitTransactionAsync(Alice, setShema);
- const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
- expect(collection.ConstOnChainSchema.toString()).to.be.eq(Shema);
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const setShema = api.tx.nft.setConstOnChainSchema(collectionId, Shema);
+ await submitTransactionAsync(Alice, setShema);
+ const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
+ expect(collection.ConstOnChainSchema.toString()).to.be.eq(Shema);
});
});
tests/src/setContractSponsoringRateLimit.test.tsdiffbeforeafterboth--- a/tests/src/setContractSponsoringRateLimit.test.ts
+++ b/tests/src/setContractSponsoringRateLimit.test.ts
@@ -59,7 +59,7 @@
it('fails when called by non-owning user', async () => {
await usingApi(async (api) => {
- const [flipper, _] = await deployFlipper(api);
+ const [flipper] = await deployFlipper(api);
await setContractSponsoringRateLimitExpectFailure(alice, flipper.address, 1);
});
tests/src/setPublicAccessMode.test.tsdiffbeforeafterboth--- a/tests/src/setPublicAccessMode.test.ts
+++ b/tests/src/setPublicAccessMode.test.ts
@@ -1,95 +1,94 @@
-//
-// This file is subject to the terms and conditions defined in
-// file 'LICENSE', which is part of this source code package.
-//
-
-// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion
-import { ApiPromise, Keyring } from '@polkadot/api';
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
-import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api';
-import {
- addToWhiteListExpectSuccess,
- createCollectionExpectSuccess,
- createItemExpectSuccess,
- destroyCollectionExpectSuccess,
- enablePublicMintingExpectSuccess,
- enableWhiteListExpectSuccess,
- normalizeAccountId,
-} from './util/helpers';
-import { utf16ToStr } from './util/util';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-
-describe('Integration Test setPublicAccessMode(): ', () => {
- before(async () => {
- await usingApi(async (api) => {
- Alice = privateKey('//Alice');
- Bob = privateKey('//Bob');
- });
- });
-
- it('Run extrinsic with collection id parameters, set the whitelist mode for the collection', async () => {
- await usingApi(async (api: ApiPromise) => {
- const collectionId: number = await createCollectionExpectSuccess();
- await enableWhiteListExpectSuccess(Alice, collectionId);
- await enablePublicMintingExpectSuccess(Alice, collectionId);
- await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
- await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);
- });
- });
-
- it('Whitelisted collection limits', async () => {
- await usingApi(async (api: ApiPromise) => {
- const collectionId = await createCollectionExpectSuccess();
- await enableWhiteListExpectSuccess(Alice, collectionId);
- await enablePublicMintingExpectSuccess(Alice, collectionId);
- const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(Bob.address), 'NFT');
- await expect(submitTransactionExpectFailAsync(Bob, tx)).to.be.rejected;
- });
- });
-});
-
-describe('Negative Integration Test ext. setPublicAccessMode(): ', () => {
- it('Set a non-existent collection', async () => {
- await usingApi(async (api: ApiPromise) => {
- // tslint:disable-next-line: radix
- const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
- const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
- await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
- });
- });
-
- it('Set the collection that has been deleted', async () => {
- await usingApi(async (api: ApiPromise) => {
- // tslint:disable-next-line: no-bitwise
- const collectionId = await createCollectionExpectSuccess();
- await destroyCollectionExpectSuccess(collectionId);
- const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
- await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
- });
- });
-
- it('Re-set the list mode already set in quantity', async () => {
- await usingApi(async (api: ApiPromise) => {
- const collectionId: number = await createCollectionExpectSuccess();
- await enableWhiteListExpectSuccess(Alice, collectionId);
- await enableWhiteListExpectSuccess(Alice, collectionId);
- });
- });
-
- it('Execute method not on behalf of the collection owner', async () => {
- await usingApi(async (api: ApiPromise) => {
- // tslint:disable-next-line: no-bitwise
- const collectionId = await createCollectionExpectSuccess();
- const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
- await expect(submitTransactionExpectFailAsync(Bob, tx)).to.be.rejected;
- });
- });
-});
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion
+import { ApiPromise } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from './substrate/privateKey';
+import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api';
+import {
+ addToWhiteListExpectSuccess,
+ createCollectionExpectSuccess,
+ createItemExpectSuccess,
+ destroyCollectionExpectSuccess,
+ enablePublicMintingExpectSuccess,
+ enableWhiteListExpectSuccess,
+ normalizeAccountId,
+} from './util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+
+describe('Integration Test setPublicAccessMode(): ', () => {
+ before(async () => {
+ await usingApi(async () => {
+ Alice = privateKey('//Alice');
+ Bob = privateKey('//Bob');
+ });
+ });
+
+ it('Run extrinsic with collection id parameters, set the whitelist mode for the collection', async () => {
+ await usingApi(async () => {
+ const collectionId: number = await createCollectionExpectSuccess();
+ await enableWhiteListExpectSuccess(Alice, collectionId);
+ await enablePublicMintingExpectSuccess(Alice, collectionId);
+ await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
+ await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);
+ });
+ });
+
+ it('Whitelisted collection limits', async () => {
+ await usingApi(async (api: ApiPromise) => {
+ const collectionId = await createCollectionExpectSuccess();
+ await enableWhiteListExpectSuccess(Alice, collectionId);
+ await enablePublicMintingExpectSuccess(Alice, collectionId);
+ const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(Bob.address), 'NFT');
+ await expect(submitTransactionExpectFailAsync(Bob, tx)).to.be.rejected;
+ });
+ });
+});
+
+describe('Negative Integration Test ext. setPublicAccessMode(): ', () => {
+ it('Set a non-existent collection', async () => {
+ await usingApi(async (api: ApiPromise) => {
+ // tslint:disable-next-line: radix
+ const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+ const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
+ await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
+ });
+ });
+
+ it('Set the collection that has been deleted', async () => {
+ await usingApi(async (api: ApiPromise) => {
+ // tslint:disable-next-line: no-bitwise
+ const collectionId = await createCollectionExpectSuccess();
+ await destroyCollectionExpectSuccess(collectionId);
+ const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
+ await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
+ });
+ });
+
+ it('Re-set the list mode already set in quantity', async () => {
+ await usingApi(async () => {
+ const collectionId: number = await createCollectionExpectSuccess();
+ await enableWhiteListExpectSuccess(Alice, collectionId);
+ await enableWhiteListExpectSuccess(Alice, collectionId);
+ });
+ });
+
+ it('Execute method not on behalf of the collection owner', async () => {
+ await usingApi(async (api: ApiPromise) => {
+ // tslint:disable-next-line: no-bitwise
+ const collectionId = await createCollectionExpectSuccess();
+ const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
+ await expect(submitTransactionExpectFailAsync(Bob, tx)).to.be.rejected;
+ });
+ });
+});
tests/src/setSchemaVersion.test.tsdiffbeforeafterboth--- a/tests/src/setSchemaVersion.test.ts
+++ b/tests/src/setSchemaVersion.test.ts
@@ -103,7 +103,7 @@
it('execute setSchemaVersion with not correct schema version', async () => {
await usingApi(async (api: ApiPromise) => {
const consoleError = console.error;
- console.error = (message: string) => {};
+ console.error = () => {};
try {
tx = api.tx.nft.setSchemaVersion(collectionIdForTesting, 'Test');
await submitTransactionAsync(alice, tx);
tests/src/setVariableMetaData.test.tsdiffbeforeafterboth--- a/tests/src/setVariableMetaData.test.ts
+++ b/tests/src/setVariableMetaData.test.ts
@@ -49,7 +49,7 @@
});
describe('Negative Integration Test setVariableMetaData', () => {
- let data = [1];
+ const data = [1];
let alice: IKeyringPair;
let bob: IKeyringPair;
@@ -69,7 +69,7 @@
it('fails on not existing collection id', async () => {
await usingApi(async api => {
- let nonExistingCollectionId = await findNotExistingCollection(api);
+ const nonExistingCollectionId = await findNotExistingCollection(api);
await setVariableMetaDataExpectFailure(alice, nonExistingCollectionId, 1, data);
});
});
tests/src/setVariableOnChainSchema.test.tsdiffbeforeafterboth--- a/tests/src/setVariableOnChainSchema.test.ts
+++ b/tests/src/setVariableOnChainSchema.test.ts
@@ -23,7 +23,7 @@
let largeSchema: any;
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const keyring = new Keyring({ type: 'sr25519' });
Alice = keyring.addFromUri('//Alice');
Bob = keyring.addFromUri('//Bob');
@@ -35,7 +35,7 @@
describe('Integration Test ext. setVariableOnChainSchema()', () => {
it('Run extrinsic with parameters of the collection id, set the scheme', async () => {
- await usingApi(async (api) => {
+ await usingApi(async (api) => {
const collectionId = await createCollectionExpectSuccess();
const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
expect(collection.Owner).to.be.deep.eq(normalizeAccountId(Alice.address));
@@ -45,12 +45,12 @@
});
it('Checking collection data using the setVariableOnChainSchema parameter', async () => {
- await usingApi(async (api) => {
- const collectionId = await createCollectionExpectSuccess();
- const setSchema = api.tx.nft.setVariableOnChainSchema(collectionId, Schema);
- await submitTransactionAsync(Alice, setSchema);
- const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
- expect(collection.VariableOnChainSchema.toString()).to.be.eq(Schema);
+ await usingApi(async (api) => {
+ const collectionId = await createCollectionExpectSuccess();
+ const setSchema = api.tx.nft.setVariableOnChainSchema(collectionId, Schema);
+ await submitTransactionAsync(Alice, setSchema);
+ const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
+ expect(collection.VariableOnChainSchema.toString()).to.be.eq(Schema);
});
});
tests/src/substrate/privateKey.tsdiffbeforeafterboth--- a/tests/src/substrate/privateKey.ts
+++ b/tests/src/substrate/privateKey.ts
@@ -3,8 +3,8 @@
// file 'LICENSE', which is part of this source code package.
//
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
export default function privateKey(account: string): IKeyringPair {
const keyring = new Keyring({ type: 'sr25519' });
tests/src/substrate/promisify-substrate.tsdiffbeforeafterboth--- a/tests/src/substrate/promisify-substrate.ts
+++ b/tests/src/substrate/promisify-substrate.ts
@@ -3,7 +3,7 @@
// file 'LICENSE', which is part of this source code package.
//
-import { ApiPromise } from "@polkadot/api";
+import { ApiPromise } from '@polkadot/api';
type PromiseType<T> = T extends PromiseLike<infer TInner> ? TInner : T;
tests/src/substrate/substrate-api.tsdiffbeforeafterboth--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -3,32 +3,39 @@
// file 'LICENSE', which is part of this source code package.
//
-import { WsProvider, ApiPromise } from "@polkadot/api";
+import { WsProvider, ApiPromise } from '@polkadot/api';
import { EventRecord } from '@polkadot/types/interfaces/system/types';
import { ExtrinsicStatus } from '@polkadot/types/interfaces/author/types';
-import { IKeyringPair } from "@polkadot/types/types";
+import { IKeyringPair } from '@polkadot/types/types';
-import config from "../config";
-import promisifySubstrate from "./promisify-substrate";
-import { ApiOptions, SubmittableExtrinsic, ApiTypes } from "@polkadot/api/types";
-import rtt from "../../../runtime_types.json";
+import config from '../config';
+import promisifySubstrate from './promisify-substrate';
+import { ApiOptions, SubmittableExtrinsic, ApiTypes } from '@polkadot/api/types';
+import rtt from '../../../runtime_types.json';
function defaultApiOptions(): ApiOptions {
const wsProvider = new WsProvider(config.substrateUrl);
- return { provider: wsProvider, types: rtt };
+ return {
+ provider: wsProvider, types: rtt, signedExtensions: {
+ ContractHelpers: {
+ extrinsic: {},
+ payload: {},
+ },
+ },
+ };
}
export default async function usingApi<T = void>(action: (api: ApiPromise) => Promise<T>, settings: ApiOptions | undefined = undefined): Promise<T> {
settings = settings || defaultApiOptions();
- let api: ApiPromise = new ApiPromise(settings);
+ const api: ApiPromise = new ApiPromise(settings);
let result: T = null as unknown as T;
// TODO: Remove, this is temporary: Filter unneeded API output
// (Jaco promised it will be removed in the next version)
const consoleErr = console.error;
console.error = (message: string) => {
- if (message.includes("StorageChangeSet:: WebSocket is not connected") || message.includes("2021-")) {}
- else consoleErr(message);
+ if (!message.includes('StorageChangeSet:: WebSocket is not connected') || message.includes('2021-'))
+ consoleErr(message);
};
try {
@@ -72,6 +79,7 @@
export function
submitTransactionAsync(sender: IKeyringPair, transaction: SubmittableExtrinsic<ApiTypes>): Promise<EventRecord[]> {
+ /* eslint no-async-promise-executor: "off" */
return new Promise(async (resolve, reject) => {
try {
await transaction.signAndSend(sender, ({ events = [], status }) => {
@@ -97,6 +105,7 @@
console.error = () => {};
console.log = () => {};
+ /* eslint no-async-promise-executor: "off" */
return new Promise<EventRecord[]>(async function(res, rej) {
const resolve = (rec: EventRecord[]) => {
setTimeout(() => {
tests/src/substrate/wait-new-blocks.tsdiffbeforeafterboth--- a/tests/src/substrate/wait-new-blocks.ts
+++ b/tests/src/substrate/wait-new-blocks.ts
@@ -3,15 +3,16 @@
// file 'LICENSE', which is part of this source code package.
//
-import { ApiPromise } from "@polkadot/api";
+import { ApiPromise } from '@polkadot/api';
-export default function waitNewBlocks(api: ApiPromise, blocksCount: number = 1): Promise<void> {
- const promise = new Promise<void>(async (resolve, reject) => {
+/* eslint no-async-promise-executor: "off" */
+export default function waitNewBlocks(api: ApiPromise, blocksCount = 1): Promise<void> {
+ const promise = new Promise<void>(async (resolve) => {
- const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
- if(blocksCount > 0) {
+ const unsubscribe = await api.rpc.chain.subscribeNewHeads(() => {
+ if (blocksCount > 0) {
blocksCount--;
- }else {
+ } else {
unsubscribe();
resolve();
}
tests/src/toggleContractWhiteList.test.tsdiffbeforeafterboth--- a/tests/src/toggleContractWhiteList.test.ts
+++ b/tests/src/toggleContractWhiteList.test.ts
@@ -3,17 +3,17 @@
// file 'LICENSE', which is part of this source code package.
//
-import chai from "chai";
+import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import privateKey from "./substrate/privateKey";
+import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import privateKey from './substrate/privateKey';
import {
deployFlipper,
- getFlipValue
-} from "./util/contracthelpers";
+ getFlipValue,
+} from './util/contracthelpers';
import {
- getGenericResult
-} from "./util/helpers"
+ getGenericResult,
+} from './util/helpers';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -23,7 +23,7 @@
describe('Integration Test toggleContractWhiteList', () => {
- it(`Enable white list contract mode`, async () => {
+ it('Enable white list contract mode', async () => {
await usingApi(async api => {
const [contract, deployer] = await deployFlipper(api);
@@ -38,9 +38,9 @@
});
});
- it(`Only whitelisted account can call contract`, async () => {
+ it('Only whitelisted account can call contract', async () => {
await usingApi(async api => {
- const bob = privateKey("//Bob");
+ const bob = privateKey('//Bob');
const [contract, deployer] = await deployFlipper(api);
@@ -48,59 +48,59 @@
const flip = contract.tx.flip(value, gasLimit);
await submitTransactionAsync(bob, flip);
const flipValueAfter = await getFlipValue(contract,deployer);
- expect(flipValueAfter).to.be.eq(!flipValueBefore, `Anyone can call new contract.`);
+ expect(flipValueAfter).to.be.eq(!flipValueBefore, 'Anyone can call new contract.');
const deployerCanFlip = async () => {
- let flipValueBefore = await getFlipValue(contract, deployer);
+ const flipValueBefore = await getFlipValue(contract, deployer);
const deployerFlip = contract.tx.flip(value, gasLimit);
await submitTransactionAsync(deployer, deployerFlip);
const aliceFlip1Response = await getFlipValue(contract, deployer);
- expect(aliceFlip1Response).to.be.eq(!flipValueBefore, `Deployer always can flip.`);
+ expect(aliceFlip1Response).to.be.eq(!flipValueBefore, 'Deployer always can flip.');
};
await deployerCanFlip();
flipValueBefore = await getFlipValue(contract, deployer);
const enableWhiteListTx = api.tx.nft.toggleContractWhiteList(contract.address, true);
- const enableResult = await submitTransactionAsync(deployer, enableWhiteListTx);
+ await submitTransactionAsync(deployer, enableWhiteListTx);
const flipWithEnabledWhiteList = contract.tx.flip(value, gasLimit);
await expect(submitTransactionExpectFailAsync(bob, flipWithEnabledWhiteList)).to.be.rejected;
const flipValueAfterEnableWhiteList = await getFlipValue(contract, deployer);
- expect(flipValueAfterEnableWhiteList).to.be.eq(flipValueBefore, `Enabling whitelist doesn't make it possible to call contract for everyone.`);
+ expect(flipValueAfterEnableWhiteList).to.be.eq(flipValueBefore, 'Enabling whitelist doesn\'t make it possible to call contract for everyone.');
await deployerCanFlip();
flipValueBefore = await getFlipValue(contract, deployer);
const addBobToWhiteListTx = api.tx.nft.addToContractWhiteList(contract.address, bob.address);
- const addBobResult = await submitTransactionAsync(deployer, addBobToWhiteListTx);
+ await submitTransactionAsync(deployer, addBobToWhiteListTx);
const flipWithWhitelistedBob = contract.tx.flip(value, gasLimit);
await submitTransactionAsync(bob, flipWithWhitelistedBob);
const flipAfterWhiteListed = await getFlipValue(contract,deployer);
- expect(flipAfterWhiteListed).to.be.eq(!flipValueBefore, `Bob was whitelisted, now he can flip.`);
+ expect(flipAfterWhiteListed).to.be.eq(!flipValueBefore, 'Bob was whitelisted, now he can flip.');
await deployerCanFlip();
flipValueBefore = await getFlipValue(contract, deployer);
const removeBobFromWhiteListTx = api.tx.nft.removeFromContractWhiteList(contract.address, bob.address);
- const removeBobResult = await submitTransactionAsync(deployer, removeBobFromWhiteListTx);
+ await submitTransactionAsync(deployer, removeBobFromWhiteListTx);
const bobRemoved = contract.tx.flip(value, gasLimit);
await expect(submitTransactionExpectFailAsync(bob, bobRemoved)).to.be.rejected;
const afterBobRemoved = await getFlipValue(contract, deployer);
- expect(afterBobRemoved).to.be.eq(flipValueBefore, `Bob can't call contract, now when he is removeed from white list.`);
+ expect(afterBobRemoved).to.be.eq(flipValueBefore, 'Bob can\'t call contract, now when he is removeed from white list.');
await deployerCanFlip();
flipValueBefore = await getFlipValue(contract, deployer);
const disableWhiteListTx = api.tx.nft.toggleContractWhiteList(contract.address, false);
- const disableWhiteListResult = await submitTransactionAsync(deployer, disableWhiteListTx);
+ await submitTransactionAsync(deployer, disableWhiteListTx);
const whiteListDisabledFlip = contract.tx.flip(value, gasLimit);
await submitTransactionAsync(bob, whiteListDisabledFlip);
const afterWhiteListDisabled = await getFlipValue(contract,deployer);
- expect(afterWhiteListDisabled).to.be.eq(!flipValueBefore, `Anyone can call contract with disabled whitelist.`);
+ expect(afterWhiteListDisabled).to.be.eq(!flipValueBefore, 'Anyone can call contract with disabled whitelist.');
});
});
- it(`Enabling white list repeatedly should not produce errors`, async () => {
+ it('Enabling white list repeatedly should not produce errors', async () => {
await usingApi(async api => {
const [contract, deployer] = await deployFlipper(api);
@@ -123,10 +123,10 @@
describe('Negative Integration Test toggleContractWhiteList', () => {
- it(`Enable white list for a non-contract`, async () => {
+ it('Enable white list for a non-contract', async () => {
await usingApi(async api => {
- const alice = privateKey("//Alice");
- const bobGuineaPig = privateKey("//Bob");
+ const alice = privateKey('//Alice');
+ const bobGuineaPig = privateKey('//Bob');
const enabledBefore = (await api.query.nft.contractWhiteListEnabled(bobGuineaPig.address)).toJSON();
const enableWhiteListTx = api.tx.nft.toggleContractWhiteList(bobGuineaPig.address, true);
@@ -138,10 +138,10 @@
});
});
- it(`Enable white list using a non-owner address`, async () => {
+ it('Enable white list using a non-owner address', async () => {
await usingApi(async api => {
- const bob = privateKey("//Bob");
- const [contract, deployer] = await deployFlipper(api);
+ const bob = privateKey('//Bob');
+ const [contract] = await deployFlipper(api);
const enabledBefore = (await api.query.nft.contractWhiteListEnabled(contract.address)).toJSON();
const enableWhiteListTx = api.tx.nft.toggleContractWhiteList(contract.address, true);
tests/src/transfer.nload.tsdiffbeforeafterboth--- a/tests/src/transfer.nload.ts
+++ b/tests/src/transfer.nload.ts
@@ -1,9 +1,14 @@
-import { ApiPromise } from "@polkadot/api";
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { ApiPromise } from '@polkadot/api';
import { IKeyringPair } from '@polkadot/types/types';
-import privateKey from "./substrate/privateKey";
-import usingApi, { submitTransactionAsync } from "./substrate/substrate-api";
-import waitNewBlocks from "./substrate/wait-new-blocks";
-import { findUnusedAddresses } from "./util/helpers";
+import privateKey from './substrate/privateKey';
+import usingApi, { submitTransactionAsync } from './substrate/substrate-api';
+import waitNewBlocks from './substrate/wait-new-blocks';
+import { findUnusedAddresses } from './util/helpers';
import * as cluster from 'cluster';
import os from 'os';
@@ -12,102 +17,102 @@
let counters: { [key: string]: number } = {};
function increaseCounter(name: string, amount: number) {
- if (!counters[name]) {
- counters[name] = 0;
- }
- counters[name] += amount;
+ if (!counters[name]) {
+ counters[name] = 0;
+ }
+ counters[name] += amount;
}
function flushCounterToMaster() {
- if (Object.keys(counters).length === 0) {
- return;
- }
+ if (Object.keys(counters).length === 0) {
+ return;
+ }
process.send!(counters);
counters = {};
}
async function distributeBalance(source: IKeyringPair, api: ApiPromise, totalAmount: bigint, stages: number) {
- let accounts = [source];
- // we don't need source in output array
- const failedAccounts = [0];
+ const accounts = [source];
+ // we don't need source in output array
+ const failedAccounts = [0];
- const finalUserAmount = 2 ** stages - 1;
- accounts.push(...await findUnusedAddresses(api, finalUserAmount));
- // findUnusedAddresses produces at least 1 request per user
- increaseCounter('requests', finalUserAmount);
+ const finalUserAmount = 2 ** stages - 1;
+ accounts.push(...await findUnusedAddresses(api, finalUserAmount));
+ // findUnusedAddresses produces at least 1 request per user
+ increaseCounter('requests', finalUserAmount);
- for (let stage = 0; stage < stages; stage++) {
- let usersWithBalance = 2 ** stage;
- let amount = totalAmount / (2n ** BigInt(stage)) - FEE * BigInt(stage);
- // console.log(`Stage ${stage}/${stages}, ${usersWithBalance} => ${usersWithBalance * 2} = ${amount}`);
- let txs = [];
- for (let i = 0; i < usersWithBalance; i++) {
- let newUser = accounts[i + usersWithBalance];
- // console.log(`${accounts[i].address} => ${newUser.address} = ${amountToSplit}`);
- const tx = api.tx.balances.transfer(newUser.address, amount);
- txs.push(submitTransactionAsync(accounts[i], tx).catch(e => {
- failedAccounts.push(i + usersWithBalance);
- increaseCounter('txFailed', 1);
- }));
- increaseCounter('tx', 1);
- }
- await Promise.all(txs);
+ for (let stage = 0; stage < stages; stage++) {
+ const usersWithBalance = 2 ** stage;
+ const amount = totalAmount / (2n ** BigInt(stage)) - FEE * BigInt(stage);
+ // console.log(`Stage ${stage}/${stages}, ${usersWithBalance} => ${usersWithBalance * 2} = ${amount}`);
+ const txs = [];
+ for (let i = 0; i < usersWithBalance; i++) {
+ const newUser = accounts[i + usersWithBalance];
+ // console.log(`${accounts[i].address} => ${newUser.address} = ${amountToSplit}`);
+ const tx = api.tx.balances.transfer(newUser.address, amount);
+ txs.push(submitTransactionAsync(accounts[i], tx).catch(() => {
+ failedAccounts.push(i + usersWithBalance);
+ increaseCounter('txFailed', 1);
+ }));
+ increaseCounter('tx', 1);
}
+ await Promise.all(txs);
+ }
- for (let account of failedAccounts.reverse()) {
- accounts.splice(account, 1);
- }
- return accounts;
+ for (const account of failedAccounts.reverse()) {
+ accounts.splice(account, 1);
+ }
+ return accounts;
}
if (cluster.isMaster) {
- let testDone = false;
- usingApi(async (api) => {
- let prevCounters: { [key: string]: number } = {};
- while (!testDone) {
- for (let name in counters) {
- if (!(name in prevCounters)) {
- prevCounters[name] = 0;
- }
- if(counters[name] === prevCounters[name]) {
- continue;
- }
- console.log(`${name.padEnd(15)} = ${counters[name] - prevCounters[name]}`);
- prevCounters[name] = counters[name];
- }
- await waitNewBlocks(api, 1);
+ let testDone = false;
+ usingApi(async (api) => {
+ const prevCounters: { [key: string]: number } = {};
+ while (!testDone) {
+ for (const name in counters) {
+ if (!(name in prevCounters)) {
+ prevCounters[name] = 0;
+ }
+ if(counters[name] === prevCounters[name]) {
+ continue;
}
- });
- let waiting: Promise<void>[] = [];
- console.log(`Starting ${os.cpus().length} workers`);
- usingApi(async (api) => {
- const alice = privateKey('//Alice');
- for (let id in os.cpus()) {
- const WORKER_NAME = `//LoadWorker${id}_${Date.now()}`;
- const workerAccount = privateKey(WORKER_NAME);
- const tx = api.tx.balances.transfer(workerAccount.address, 400n * 10n ** 23n);
- await submitTransactionAsync(alice, tx);
+ console.log(`${name.padEnd(15)} = ${counters[name] - prevCounters[name]}`);
+ prevCounters[name] = counters[name];
+ }
+ await waitNewBlocks(api, 1);
+ }
+ });
+ const waiting: Promise<void>[] = [];
+ console.log(`Starting ${os.cpus().length} workers`);
+ usingApi(async (api) => {
+ const alice = privateKey('//Alice');
+ for (const id in os.cpus()) {
+ const WORKER_NAME = `//LoadWorker${id}_${Date.now()}`;
+ const workerAccount = privateKey(WORKER_NAME);
+ const tx = api.tx.balances.transfer(workerAccount.address, 400n * 10n ** 23n);
+ await submitTransactionAsync(alice, tx);
- let worker = cluster.fork({
- WORKER_NAME,
- STAGES: id + 2
- });
- worker.on('message', msg => {
- for (let key in msg) {
- increaseCounter(key, msg[key]);
- }
- });
- waiting.push(new Promise(res => worker.on('exit', res)));
+ const worker = cluster.fork({
+ WORKER_NAME,
+ STAGES: id + 2,
+ });
+ worker.on('message', msg => {
+ for (const key in msg) {
+ increaseCounter(key, msg[key]);
}
- await Promise.all(waiting);
- testDone = true;
- })
+ });
+ waiting.push(new Promise(res => worker.on('exit', res)));
+ }
+ await Promise.all(waiting);
+ testDone = true;
+ });
} else {
- increaseCounter('startedWorkers', 1);
- usingApi(async (api) => {
- await distributeBalance(privateKey(process.env.WORKER_NAME as string), api, 400n * 10n ** 22n, 10);
- });
- const interval = setInterval(() => {
- flushCounterToMaster();
- }, 100);
- interval.unref();
+ increaseCounter('startedWorkers', 1);
+ usingApi(async (api) => {
+ await distributeBalance(privateKey(process.env.WORKER_NAME as string), api, 400n * 10n ** 22n, 10);
+ });
+ const interval = setInterval(() => {
+ flushCounterToMaster();
+ }, 100);
+ interval.unref();
}
\ No newline at end of file
tests/src/transfer.test.tsdiffbeforeafterboth--- a/tests/src/transfer.test.ts
+++ b/tests/src/transfer.test.ts
@@ -64,7 +64,7 @@
});
it('User can transfer owned token', async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
const Alice = privateKey('//Alice');
const Bob = privateKey('//Bob');
// nft
@@ -77,17 +77,23 @@
await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, Alice, Bob, 1, 'Fungible');
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
- await transferExpectSuccess(reFungibleCollectionId,
- newReFungibleTokenId, Alice, Bob, 100, 'ReFungible');
+ await transferExpectSuccess(
+ reFungibleCollectionId,
+ newReFungibleTokenId,
+ Alice,
+ Bob,
+ 100,
+ 'ReFungible',
+ );
});
});
});
describe('Negative Integration Test Transfer(recipient, collection_id, item_id, value)', () => {
before(async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
Alice = privateKey('//Alice');
Bob = privateKey('//Bob');
Charlie = privateKey('//Charlie');
@@ -119,11 +125,17 @@
await transferExpectFail(fungibleCollectionId, newFungibleTokenId, Alice, Bob, 1, 'Fungible');
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
await destroyCollectionExpectSuccess(reFungibleCollectionId);
- await transferExpectFail(reFungibleCollectionId,
- newReFungibleTokenId, Alice, Bob, 1, 'ReFungible');
+ await transferExpectFail(
+ reFungibleCollectionId,
+ newReFungibleTokenId,
+ Alice,
+ Bob,
+ 1,
+ 'ReFungible',
+ );
});
it('Transfer with not existed item_id', async () => {
// nft
@@ -134,9 +146,15 @@
await transferExpectFail(fungibleCollectionId, 2, Alice, Bob, 1, 'Fungible');
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
- await transferExpectFail(reFungibleCollectionId,
- 2, Alice, Bob, 1, 'ReFungible');
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ await transferExpectFail(
+ reFungibleCollectionId,
+ 2,
+ Alice,
+ Bob,
+ 1,
+ 'ReFungible',
+ );
});
it('Transfer with deleted item_id', async () => {
// nft
@@ -151,11 +169,17 @@
await transferExpectFail(fungibleCollectionId, newFungibleTokenId, Alice, Bob, 1, 'Fungible');
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
await burnItemExpectSuccess(Alice, reFungibleCollectionId, newReFungibleTokenId, 1);
- await transferExpectFail(reFungibleCollectionId,
- newReFungibleTokenId, Alice, Bob, 1, 'ReFungible');
+ await transferExpectFail(
+ reFungibleCollectionId,
+ newReFungibleTokenId,
+ Alice,
+ Bob,
+ 1,
+ 'ReFungible',
+ );
});
it('Transfer with recipient that is not owner', async () => {
// nft
@@ -168,9 +192,15 @@
await transferExpectFail(fungibleCollectionId, newFungibleTokenId, Charlie, Bob, 1, 'Fungible');
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
- await transferExpectFail(reFungibleCollectionId,
- newReFungibleTokenId, Charlie, Bob, 1, 'ReFungible');
+ await transferExpectFail(
+ reFungibleCollectionId,
+ newReFungibleTokenId,
+ Charlie,
+ Bob,
+ 1,
+ 'ReFungible',
+ );
});
});
tests/src/transferFrom.test.tsdiffbeforeafterboth--- a/tests/src/transferFrom.test.ts
+++ b/tests/src/transferFrom.test.ts
@@ -14,7 +14,6 @@
createCollectionExpectSuccess,
createFungibleItemExpectSuccess,
createItemExpectSuccess,
- destroyCollectionExpectSuccess,
getAllowance,
transferFromExpectFail,
transferFromExpectSuccess,
@@ -31,7 +30,7 @@
let Charlie: IKeyringPair;
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
Alice = privateKey('//Alice');
Bob = privateKey('//Bob');
Charlie = privateKey('//Charlie');
@@ -39,7 +38,7 @@
});
it('Execute the extrinsic and check nftItemList - owner of token', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
// nft
const nftCollectionId = await createCollectionExpectSuccess();
const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -52,13 +51,21 @@
const newFungibleTokenId = await createItemExpectSuccess(Alice, fungibleCollectionId, 'Fungible');
await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, Alice, Bob);
await transferFromExpectSuccess(fungibleCollectionId, newFungibleTokenId, Bob, Alice, Charlie, 1, 'Fungible');
+
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, Alice, Bob, 100);
- await transferFromExpectSuccess(reFungibleCollectionId,
- newReFungibleTokenId, Bob, Alice, Charlie, 100, 'ReFungible');
+ await transferFromExpectSuccess(
+ reFungibleCollectionId,
+ newReFungibleTokenId,
+ Bob,
+ Alice,
+ Charlie,
+ 100,
+ 'ReFungible',
+ );
});
});
@@ -92,7 +99,7 @@
let Charlie: IKeyringPair;
before(async () => {
- await usingApi(async (api) => {
+ await usingApi(async () => {
Alice = privateKey('//Alice');
Bob = privateKey('//Bob');
Charlie = privateKey('//Charlie');
@@ -139,7 +146,7 @@
}); */
it('transferFrom for not approved address', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
// nft
const nftCollectionId = await createCollectionExpectSuccess();
const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -152,15 +159,21 @@
await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, Bob, Alice, Charlie, 1);
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
- await transferFromExpectFail(reFungibleCollectionId,
- newReFungibleTokenId, Bob, Alice, Charlie, 1);
+ await transferFromExpectFail(
+ reFungibleCollectionId,
+ newReFungibleTokenId,
+ Bob,
+ Alice,
+ Charlie,
+ 1,
+ );
});
});
it('transferFrom incorrect token count', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
// nft
const nftCollectionId = await createCollectionExpectSuccess();
const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -175,16 +188,22 @@
await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, Bob, Alice, Charlie, 2);
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, Alice, Bob);
- await transferFromExpectFail(reFungibleCollectionId,
- newReFungibleTokenId, Bob, Alice, Charlie, 2);
+ await transferFromExpectFail(
+ reFungibleCollectionId,
+ newReFungibleTokenId,
+ Bob,
+ Alice,
+ Charlie,
+ 2,
+ );
});
});
it('execute transferFrom from account that is not owner of collection', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
const Dave = privateKey('//Dave');
// nft
const nftCollectionId = await createCollectionExpectSuccess();
@@ -211,7 +230,7 @@
}
// reFungible
const reFungibleCollectionId = await
- createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+ createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
try {
await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, Dave, Bob);
@@ -223,7 +242,7 @@
});
});
it( 'transferFrom burnt token before approve NFT', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
// nft
const nftCollectionId = await createCollectionExpectSuccess();
const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -233,7 +252,7 @@
});
});
it( 'transferFrom burnt token before approve Fungible', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
const newFungibleTokenId = await createItemExpectSuccess(Alice, fungibleCollectionId, 'Fungible');
await burnItemExpectSuccess(Alice, fungibleCollectionId, 1, 10);
@@ -243,7 +262,7 @@
});
});
it( 'transferFrom burnt token before approve ReFungible', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
await burnItemExpectSuccess(Alice, reFungibleCollectionId, newReFungibleTokenId, 1);
@@ -254,7 +273,7 @@
});
it( 'transferFrom burnt token after approve NFT', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
// nft
const nftCollectionId = await createCollectionExpectSuccess();
const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -264,7 +283,7 @@
});
});
it( 'transferFrom burnt token after approve Fungible', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
const newFungibleTokenId = await createItemExpectSuccess(Alice, fungibleCollectionId, 'Fungible');
await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, Alice, Bob);
@@ -274,7 +293,7 @@
});
});
it( 'transferFrom burnt token after approve ReFungible', async () => {
- await usingApi(async (api: ApiPromise) => {
+ await usingApi(async () => {
const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, Alice, Bob);
tests/src/util/contracthelpers.tsdiffbeforeafterboth--- a/tests/src/util/contracthelpers.ts
+++ b/tests/src/util/contracthelpers.ts
@@ -3,13 +3,13 @@
// file 'LICENSE', which is part of this source code package.
//
-import chai from "chai";
+import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import { submitTransactionAsync, submitTransactionExpectFailAsync } from "../substrate/substrate-api";
-import fs from "fs";
-import { Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract } from "@polkadot/api-contract";
-import { IKeyringPair } from "@polkadot/types/types";
-import { ApiPromise, Keyring } from "@polkadot/api";
+import { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import fs from 'fs';
+import { Abi, CodePromise, ContractPromise as Contract } from '@polkadot/api-contract';
+import { IKeyringPair } from '@polkadot/types/types';
+import { ApiPromise, Keyring } from '@polkadot/api';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -20,8 +20,9 @@
const gasLimit = '200000000000';
const endowment = '100000000000000000';
-function deployContract(alice: IKeyringPair, code: CodePromise, constructor: string = 'default', ...args: any[]): Promise<Contract> {
- return new Promise<Contract>(async (resolve, reject) => {
+/* eslint no-async-promise-executor: "off" */
+function deployContract(alice: IKeyringPair, code: CodePromise, constructor = 'default', ...args: any[]): Promise<Contract> {
+ return new Promise<Contract>(async (resolve) => {
const unsub = await (code as any)
.tx[constructor]({value: endowment, gasLimit}, ...args)
.signAndSend(alice, (result: any) => {
@@ -30,7 +31,7 @@
resolve((result as any).contract);
unsub();
}
- })
+ });
});
}
@@ -40,7 +41,7 @@
// Transfer balance to it
const keyring = new Keyring({ type: 'sr25519' });
- const alice = keyring.addFromUri(`//Alice`);
+ const alice = keyring.addFromUri('//Alice');
let amount = new BigNumber(endowment);
amount = amount.plus(100e15);
const tx = api.tx.balances.transfer(deployer.address, amount.toFixed());
@@ -71,7 +72,7 @@
const result = await contract.query.get(deployer.address, value, gasLimit);
if(!result.result.isOk) {
- throw `Failed to get flipper value`;
+ throw 'Failed to get flipper value';
}
return (result.result.asOk.data[0] == 0x00) ? false : true;
}
@@ -87,19 +88,6 @@
export async function toggleFlipValueExpectFailure(sender: IKeyringPair, contract: Contract) {
const tx = contract.tx.flip(value, gasLimit);
await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;
-}
-
-function instantiateTransferContract(alice: IKeyringPair, blueprint: Blueprint) : Promise<any> {
- return new Promise<any>(async (resolve, reject) => {
- const unsub = await blueprint.tx
- .default(endowment, gasLimit)
- .signAndSend(alice, (result) => {
- if (result.status.isInBlock || result.status.isFinalized) {
- unsub();
- resolve(result);
- }
- });
- });
}
export async function deployTransferContract(api: ApiPromise): Promise<[Contract, IKeyringPair]> {
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -4,22 +4,18 @@
//
import { ApiPromise, Keyring } from '@polkadot/api';
-import { Enum, Struct } from '@polkadot/types/codec';
-import type { AccountId, BlockNumber, Call, EventRecord } from '@polkadot/types/interfaces';
-import { u128 } from '@polkadot/types/primitive';
+import type { AccountId, EventRecord } from '@polkadot/types/interfaces';
import { IKeyringPair } from '@polkadot/types/types';
import { evmToAddress } from '@polkadot/util-crypto';
import { BigNumber } from 'bignumber.js';
import BN from 'bn.js';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, nullPublicKey } from '../accounts';
+import { alicesPublicKey } from '../accounts';
import privateKey from '../substrate/privateKey';
import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
import { ICollectionInterface } from '../types';
import { hexToStr, strToUTF16, utf16ToStr } from './util';
-import { Compact, Option, Raw, Vec } from '@polkadot/types/codec';
-// import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, DispatchClass, DispatchInfo, DispatchInfoTo190, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV1, ExtrinsicPayloadV2, ExtrinsicPayloadV3, ExtrinsicPayloadV4, ExtrinsicSignatureV1, ExtrinsicSignatureV2, ExtrinsicSignatureV3, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV1, ExtrinsicV2, ExtrinsicV3, ExtrinsicV4, Hash, Header, ImmortalEra, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, Moment, MortalEra, MultiSignature, Origin, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Seal, SealV0, Signature, SignedBlock, SignerPayload, Sr25519Signature, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
chai.use(chaiAsPromised);
const expect = chai.expect;
@@ -44,7 +40,7 @@
}
// AccountId
- return {substrate: input.toString()}
+ return {substrate: input.toString()};
}
export function toSubstrateAddress(input: string | CrossAccountId | IKeyringPair): string {
input = normalizeAccountId(input);
@@ -91,10 +87,6 @@
Owner: number[];
ConstData: number[];
VariableData: number[];
-}
-
-interface IFungibleTokenDataType {
- Value: BN;
}
interface IGetMessage {
@@ -110,9 +102,9 @@
}
export function nftEventMessage(events: EventRecord[]): IGetMessage {
- let checkMsgNftMethod: string = '';
- let checkMsgTrsMethod: string = '';
- let checkMsgSysMethod: string = '';
+ let checkMsgNftMethod = '';
+ let checkMsgTrsMethod = '';
+ let checkMsgSysMethod = '';
events.forEach(({ event: { method, section } }) => {
if (section === 'nft') {
checkMsgNftMethod = method;
@@ -134,7 +126,7 @@
const result: GenericResult = {
success: false,
};
- events.forEach(({ phase, event: { data, method, section } }) => {
+ events.forEach(({ event: { method } }) => {
// console.log(` ${phase}: ${section}.${method}:: ${data}`);
if (method === 'ExtrinsicSuccess') {
result.success = true;
@@ -147,8 +139,8 @@
export function getCreateCollectionResult(events: EventRecord[]): CreateCollectionResult {
let success = false;
- let collectionId: number = 0;
- events.forEach(({ phase, event: { data, method, section } }) => {
+ let collectionId = 0;
+ events.forEach(({ event: { data, method, section } }) => {
// console.log(` ${phase}: ${section}.${method}:: ${data}`);
if (method == 'ExtrinsicSuccess') {
success = true;
@@ -165,10 +157,10 @@
export function getCreateItemResult(events: EventRecord[]): CreateItemResult {
let success = false;
- let collectionId: number = 0;
- let itemId: number = 0;
+ let collectionId = 0;
+ let itemId = 0;
let recipient;
- events.forEach(({ phase, event: { data, method, section } }) => {
+ events.forEach(({ event: { data, method, section } }) => {
// console.log(` ${phase}: ${section}.${method}:: ${data}`);
if (method == 'ExtrinsicSuccess') {
success = true;
@@ -241,12 +233,12 @@
mode: { type: 'NFT' },
name: 'name',
tokenPrefix: 'prefix',
-}
+};
export async function createCollectionExpectSuccess(params: Partial<CreateCollectionParams> = {}): Promise<number> {
const { name, description, mode, tokenPrefix } = { ...defaultCreateCollectionParams, ...params };
- let collectionId: number = 0;
+ let collectionId = 0;
await usingApi(async (api) => {
// Get number of collections before the transaction
const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString(), 10);
@@ -357,9 +349,8 @@
}
function getDestroyResult(events: EventRecord[]): boolean {
- let success: boolean = false;
- events.forEach(({ phase, event: { data, method, section } }) => {
- // console.log(` ${phase}: ${section}.${method}:: ${data}`);
+ let success = false;
+ events.forEach(({ event: { method } }) => {
if (method == 'ExtrinsicSuccess') {
success = true;
}
@@ -367,7 +358,7 @@
return success;
}
-export async function destroyCollectionExpectFailure(collectionId: number, senderSeed: string = '//Alice') {
+export async function destroyCollectionExpectFailure(collectionId: number, senderSeed = '//Alice') {
await usingApi(async (api) => {
// Run the DestroyCollection transaction
const alicePrivateKey = privateKey(senderSeed);
@@ -376,7 +367,7 @@
});
}
-export async function destroyCollectionExpectSuccess(collectionId: number, senderSeed: string = '//Alice') {
+export async function destroyCollectionExpectSuccess(collectionId: number, senderSeed = '//Alice') {
await usingApi(async (api) => {
// Run the DestroyCollection transaction
const alicePrivateKey = privateKey(senderSeed);
@@ -471,7 +462,7 @@
});
}
-export async function setCollectionSponsorExpectFailure(collectionId: number, sponsor: string, senderSeed: string = '//Alice') {
+export async function setCollectionSponsorExpectFailure(collectionId: number, sponsor: string, senderSeed = '//Alice') {
await usingApi(async (api) => {
// Run the transaction
@@ -481,7 +472,7 @@
});
}
-export async function confirmSponsorshipExpectSuccess(collectionId: number, senderSeed: string = '//Alice') {
+export async function confirmSponsorshipExpectSuccess(collectionId: number, senderSeed = '//Alice') {
await usingApi(async (api) => {
// Run the transaction
@@ -502,7 +493,7 @@
}
-export async function confirmSponsorshipExpectFailure(collectionId: number, senderSeed: string = '//Alice') {
+export async function confirmSponsorshipExpectFailure(collectionId: number, senderSeed = '//Alice') {
await usingApi(async (api) => {
// Run the transaction
@@ -552,7 +543,7 @@
});
}
-export async function toggleContractWhitelistExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, enabled: boolean) {
+export async function toggleContractWhitelistExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string) {
await usingApi(async (api) => {
const tx = api.tx.nft.toggleContractWhiteList(contractAddress, true);
const events = await submitTransactionAsync(sender, tx);
@@ -563,7 +554,7 @@
}
export async function isWhitelistedInContract(contractAddress: AccountId | string, user: string) {
- let whitelisted: boolean = false;
+ let whitelisted = false;
await usingApi(async (api) => {
whitelisted = (await api.query.nft.contractWhiteList(contractAddress, user)).toJSON() as boolean;
});
@@ -665,8 +656,10 @@
}
export async function
- approveExpectSuccess(collectionId: number,
- tokenId: number, owner: IKeyringPair, approved: IKeyringPair | CrossAccountId | string, amount: number | bigint = 1) {
+approveExpectSuccess(
+ collectionId: number,
+ tokenId: number, owner: IKeyringPair, approved: IKeyringPair | CrossAccountId | string, amount: number | bigint = 1,
+) {
await usingApi(async (api: ApiPromise) => {
approved = normalizeAccountId(approved);
const allowanceBefore =
@@ -683,21 +676,22 @@
}
export async function
- transferFromExpectSuccess(collectionId: number,
- tokenId: number,
- accountApproved: IKeyringPair,
- accountFrom: IKeyringPair | CrossAccountId,
- accountTo: IKeyringPair | CrossAccountId,
- value: number | bigint = 1,
- type: string = 'NFT') {
+transferFromExpectSuccess(
+ collectionId: number,
+ tokenId: number,
+ accountApproved: IKeyringPair,
+ accountFrom: IKeyringPair | CrossAccountId,
+ accountTo: IKeyringPair | CrossAccountId,
+ value: number | bigint = 1,
+ type = 'NFT',
+) {
await usingApi(async (api: ApiPromise) => {
const to = normalizeAccountId(accountTo);
let balanceBefore = new BN(0);
if (type === 'Fungible') {
balanceBefore = await api.query.nft.balance(collectionId, toSubstrateAddress(to)) as unknown as BN;
}
- const transferFromTx = api.tx.nft.transferFrom(
- normalizeAccountId(accountFrom), to, collectionId, tokenId, value);
+ const transferFromTx = api.tx.nft.transferFrom(normalizeAccountId(accountFrom), to, collectionId, tokenId, value);
const events = await submitTransactionAsync(accountApproved, transferFromTx);
const result = getCreateItemResult(events);
// tslint:disable-next-line:no-unused-expression
@@ -720,15 +714,16 @@
}
export async function
- transferFromExpectFail(collectionId: number,
- tokenId: number,
- accountApproved: IKeyringPair,
- accountFrom: IKeyringPair,
- accountTo: IKeyringPair,
- value: number | bigint = 1) {
+transferFromExpectFail(
+ collectionId: number,
+ tokenId: number,
+ accountApproved: IKeyringPair,
+ accountFrom: IKeyringPair,
+ accountTo: IKeyringPair,
+ value: number | bigint = 1,
+) {
await usingApi(async (api: ApiPromise) => {
- const transferFromTx = api.tx.nft.transferFrom(
- normalizeAccountId(accountFrom.address), normalizeAccountId(accountTo.address), collectionId, tokenId, value);
+ const transferFromTx = api.tx.nft.transferFrom(normalizeAccountId(accountFrom.address), normalizeAccountId(accountTo.address), collectionId, tokenId, value);
const events = await expect(submitTransactionExpectFailAsync(accountApproved, transferFromTx)).to.be.rejected;
const result = getCreateCollectionResult(events);
// tslint:disable-next-line:no-unused-expression
@@ -736,36 +731,34 @@
});
}
+/* eslint no-async-promise-executor: "off" */
async function getBlockNumber(api: ApiPromise): Promise<number> {
- return new Promise<number>(async (resolve, reject) => {
+ return new Promise<number>(async (resolve) => {
const unsubscribe = await api.rpc.chain.subscribeNewHeads((head) => {
- unsubscribe();
- resolve(head.number.toNumber());
+ unsubscribe();
+ resolve(head.number.toNumber());
});
});
}
export async function
-scheduleTransferExpectSuccess(collectionId: number,
- tokenId: number,
- sender: IKeyringPair,
- recipient: IKeyringPair,
- value: number | bigint = 1,
- type: string = 'NFT') {
+scheduleTransferExpectSuccess(
+ collectionId: number,
+ tokenId: number,
+ sender: IKeyringPair,
+ recipient: IKeyringPair,
+ value: number | bigint = 1,
+) {
await usingApi(async (api: ApiPromise) => {
- let balanceBefore = new BN(0);
-
-
- let blockNumber: number | undefined = await getBlockNumber(api);
- let expectedBlockNumber = blockNumber + 2;
+ const blockNumber: number | undefined = await getBlockNumber(api);
+ const expectedBlockNumber = blockNumber + 2;
expect(blockNumber).to.be.greaterThan(0);
const transferTx = await api.tx.nft.transfer(recipient.address, collectionId, tokenId, value);
const scheduleTx = await api.tx.scheduler.schedule(expectedBlockNumber, null, 0, transferTx);
- const events = await submitTransactionAsync(sender, scheduleTx);
+ await submitTransactionAsync(sender, scheduleTx);
- const sponsorBalanceBefore = new BigNumber((await api.query.system.account(sender.address)).data.free.toString());
const recipientBalanceBefore = new BigNumber((await api.query.system.account(recipient.address)).data.free.toString());
const nftItemDataBefore = (await api.query.nft.nftItemList(collectionId, tokenId)).toJSON() as unknown as ITokenDataType;
@@ -774,7 +767,6 @@
// sleep for 2 blocks
await new Promise(resolve => setTimeout(resolve, 6000 * 2));
- const sponsorBalanceAfter = new BigNumber((await api.query.system.account(sender.address)).data.free.toString());
const recipientBalanceAfter = new BigNumber((await api.query.system.account(recipient.address)).data.free.toString());
const nftItemData = (await api.query.nft.nftItemList(collectionId, tokenId)).toJSON() as unknown as ITokenDataType;
@@ -785,12 +777,14 @@
export async function
- transferExpectSuccess(collectionId: number,
- tokenId: number,
- sender: IKeyringPair,
- recipient: IKeyringPair | CrossAccountId,
- value: number | bigint = 1,
- type: string = 'NFT') {
+transferExpectSuccess(
+ collectionId: number,
+ tokenId: number,
+ sender: IKeyringPair,
+ recipient: IKeyringPair | CrossAccountId,
+ value: number | bigint = 1,
+ type = 'NFT',
+) {
await usingApi(async (api: ApiPromise) => {
const to = normalizeAccountId(recipient);
@@ -826,12 +820,13 @@
}
export async function
- transferExpectFail(collectionId: number,
- tokenId: number,
- sender: IKeyringPair,
- recipient: IKeyringPair,
- value: number | bigint = 1,
- type: string = 'NFT') {
+transferExpectFail(
+ collectionId: number,
+ tokenId: number,
+ sender: IKeyringPair,
+ recipient: IKeyringPair,
+ value: number | bigint = 1,
+) {
await usingApi(async (api: ApiPromise) => {
const transferTx = api.tx.nft.transfer(normalizeAccountId(recipient.address), collectionId, tokenId, value);
const events = await expect(submitTransactionExpectFailAsync(sender, transferTx)).to.be.rejected;
@@ -844,8 +839,10 @@
}
export async function
- approveExpectFail(collectionId: number,
- tokenId: number, owner: IKeyringPair, approved: IKeyringPair, amount: number | bigint = 1) {
+approveExpectFail(
+ collectionId: number,
+ tokenId: number, owner: IKeyringPair, approved: IKeyringPair, amount: number | bigint = 1,
+) {
await usingApi(async (api: ApiPromise) => {
const approveNftTx = api.tx.nft.approve(normalizeAccountId(approved.address), collectionId, tokenId, amount);
const events = await expect(submitTransactionExpectFailAsync(owner, approveNftTx)).to.be.rejected;
@@ -882,9 +879,8 @@
});
}
-export async function createItemExpectSuccess(
- sender: IKeyringPair, collectionId: number, createMode: string, owner: CrossAccountId | string = sender.address) {
- let newItemId: number = 0;
+export async function createItemExpectSuccess(sender: IKeyringPair, collectionId: number, createMode: string, owner: CrossAccountId | string = sender.address) {
+ let newItemId = 0;
await usingApi(async (api) => {
const to = normalizeAccountId(owner);
const AItemCount = parseInt((await api.query.nft.itemListIndex(collectionId)).toString(), 10);
@@ -925,8 +921,7 @@
return newItemId;
}
-export async function createItemExpectFailure(
- sender: IKeyringPair, collectionId: number, createMode: string, owner: string = sender.address) {
+export async function createItemExpectFailure(sender: IKeyringPair, collectionId: number, createMode: string, owner: string = sender.address) {
await usingApi(async (api) => {
const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(owner), createMode);
@@ -1000,7 +995,7 @@
}
export async function isWhitelisted(collectionId: number, address: string) {
- let whitelisted: boolean = false;
+ let whitelisted = false;
await usingApi(async (api) => {
whitelisted = (await api.query.nft.whiteList(collectionId, address)).toJSON() as unknown as boolean;
});
tests/src/util/util.tsdiffbeforeafterboth--- a/tests/src/util/util.ts
+++ b/tests/src/util/util.ts
@@ -4,7 +4,7 @@
//
export function strToUTF16(str: string): any {
- let buf: number[] = [];
+ const buf: number[] = [];
for (let i=0, strLen=str.length; i < strLen; i++) {
buf.push(str.charCodeAt(i));
}
@@ -12,7 +12,7 @@
}
export function utf16ToStr(buf: number[]): string {
- let str: string = "";
+ let str = '';
for (let i=0, strLen=buf.length; i < strLen; i++) {
if (buf[i] != 0) str += String.fromCharCode(buf[i]);
else break;
@@ -21,13 +21,13 @@
}
export function hexToStr(buf: string): string {
- let str: string = "";
- let hexStart = buf.indexOf("0x");
+ let str = '';
+ let hexStart = buf.indexOf('0x');
if (hexStart < 0) hexStart = 0;
else hexStart = 2;
for (let i=hexStart, strLen=buf.length; i < strLen; i+=2) {
- let ch = buf[i] + buf[i+1];
- let num = parseInt(ch, 16);
+ const ch = buf[i] + buf[i+1];
+ const num = parseInt(ch, 16);
if (num != 0) str += String.fromCharCode(num);
else break;
}