git.delta.rocks / unique-network / refs/commits / 3370e8a2ab3e

difftreelog

Merge pull request #12 from usetech-llc/feature/NFTPAR-116_substrate2_release

usetech-llc2020-10-29parents: #11a433f #4741769.patch.diff
in: master
Feature/nftpar 116 substrate2 release

18 files changed

modifiedCargo.lockdiffbeforeafterboth
16source = "registry+https://github.com/rust-lang/crates.io-index"16source = "registry+https://github.com/rust-lang/crates.io-index"
17checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"17checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"
18dependencies = [18dependencies = [
19 "gimli",19 "gimli 0.22.0",
20]20]
2121
22[[package]]22[[package]]
361 "cfg-if 1.0.0",361 "cfg-if 1.0.0",
362 "libc",362 "libc",
363 "miniz_oxide",363 "miniz_oxide",
364 "object",364 "object 0.21.1",
365 "rustc-demangle",365 "rustc-demangle",
366]366]
367367
383source = "registry+https://github.com/rust-lang/crates.io-index"383source = "registry+https://github.com/rust-lang/crates.io-index"
384checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"384checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
385
386[[package]]
387name = "bincode"
388version = "1.3.1"
389source = "registry+https://github.com/rust-lang/crates.io-index"
390checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d"
391dependencies = [
392 "byteorder 1.3.4",
393 "serde",
394]
385395
386[[package]]396[[package]]
387name = "bindgen"397name = "bindgen"
790source = "registry+https://github.com/rust-lang/crates.io-index"800source = "registry+https://github.com/rust-lang/crates.io-index"
791checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"801checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
802
803[[package]]
804name = "cranelift-bforest"
805version = "0.66.0"
806source = "registry+https://github.com/rust-lang/crates.io-index"
807checksum = "8dcc286b052ee24a1e5a222e7c1125e6010ad35b0f248709b9b3737a8fedcfdf"
808dependencies = [
809 "cranelift-entity",
810]
811
812[[package]]
813name = "cranelift-codegen"
814version = "0.66.0"
815source = "registry+https://github.com/rust-lang/crates.io-index"
816checksum = "9d9badfe36176cb653506091693bc2bb1970c9bddfcd6ec7fac404f7eaec6f38"
817dependencies = [
818 "byteorder 1.3.4",
819 "cranelift-bforest",
820 "cranelift-codegen-meta",
821 "cranelift-codegen-shared",
822 "cranelift-entity",
823 "gimli 0.21.0",
824 "log",
825 "regalloc",
826 "serde",
827 "smallvec 1.4.2",
828 "target-lexicon",
829 "thiserror",
830]
831
832[[package]]
833name = "cranelift-codegen-meta"
834version = "0.66.0"
835source = "registry+https://github.com/rust-lang/crates.io-index"
836checksum = "3c3f460031861e4f4ad510be62b2ae50bba6cc886b598a36f9c0a970feab9598"
837dependencies = [
838 "cranelift-codegen-shared",
839 "cranelift-entity",
840]
841
842[[package]]
843name = "cranelift-codegen-shared"
844version = "0.66.0"
845source = "registry+https://github.com/rust-lang/crates.io-index"
846checksum = "76ad12409e922e7697cd0bdc7dc26992f64a77c31880dfe5e3c7722f4710206d"
847
848[[package]]
849name = "cranelift-entity"
850version = "0.66.0"
851source = "registry+https://github.com/rust-lang/crates.io-index"
852checksum = "d97cdc58972ea065d107872cfb9079f4c92ade78a8af85aaff519a65b5d13f71"
853dependencies = [
854 "serde",
855]
856
857[[package]]
858name = "cranelift-frontend"
859version = "0.66.0"
860source = "registry+https://github.com/rust-lang/crates.io-index"
861checksum = "2ef419efb4f94ecc02e5d9fbcc910d2bb7f0040e2de570e63a454f883bc891d6"
862dependencies = [
863 "cranelift-codegen",
864 "log",
865 "smallvec 1.4.2",
866 "target-lexicon",
867]
868
869[[package]]
870name = "cranelift-native"
871version = "0.66.0"
872source = "registry+https://github.com/rust-lang/crates.io-index"
873checksum = "6e69d44d59826eef6794066ac2c0f4ad3975f02d97030c60dbc04e3886adf36e"
874dependencies = [
875 "cranelift-codegen",
876 "raw-cpuid",
877 "target-lexicon",
878]
879
880[[package]]
881name = "cranelift-wasm"
882version = "0.66.0"
883source = "registry+https://github.com/rust-lang/crates.io-index"
884checksum = "979df666b1304624abe99738e9e0e7c7479ee5523ba4b8b237df9ff49996acbb"
885dependencies = [
886 "cranelift-codegen",
887 "cranelift-entity",
888 "cranelift-frontend",
889 "log",
890 "serde",
891 "thiserror",
892 "wasmparser 0.59.0",
893]
792894
793[[package]]895[[package]]
794name = "crc32fast"896name = "crc32fast"
1078 "serde",1180 "serde",
1079]1181]
1182
1183[[package]]
1184name = "errno"
1185version = "0.2.6"
1186source = "registry+https://github.com/rust-lang/crates.io-index"
1187checksum = "6eab5ee3df98a279d9b316b1af6ac95422127b1290317e6d18c1743c99418b01"
1188dependencies = [
1189 "errno-dragonfly",
1190 "libc",
1191 "winapi 0.3.9",
1192]
1193
1194[[package]]
1195name = "errno-dragonfly"
1196version = "0.1.1"
1197source = "registry+https://github.com/rust-lang/crates.io-index"
1198checksum = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067"
1199dependencies = [
1200 "gcc",
1201 "libc",
1202]
10801203
1081[[package]]1204[[package]]
1082name = "event-listener"1205name = "event-listener"
1121source = "registry+https://github.com/rust-lang/crates.io-index"1244source = "registry+https://github.com/rust-lang/crates.io-index"
1122checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"1245checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
1246
1247[[package]]
1248name = "fallible-iterator"
1249version = "0.2.0"
1250source = "registry+https://github.com/rust-lang/crates.io-index"
1251checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
11231252
1124[[package]]1253[[package]]
1125name = "fastrand"1254name = "fastrand"
1139 "libc",1268 "libc",
1140]1269]
1270
1271[[package]]
1272name = "file-per-thread-logger"
1273version = "0.1.4"
1274source = "registry+https://github.com/rust-lang/crates.io-index"
1275checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126"
1276dependencies = [
1277 "env_logger",
1278 "log",
1279]
11411280
1142[[package]]1281[[package]]
1143name = "finality-grandpa"1282name = "finality-grandpa"
1217 "sp-storage",1356 "sp-storage",
1218]1357]
1358
1359[[package]]
1360name = "frame-benchmarking-cli"
1361version = "2.0.0"
1362source = "git+https://github.com/usetech-llc/substrate.git?branch=v2.0.0_release#a200cdb93c6af5763b9c7bf313fa708764ac88ca"
1363dependencies = [
1364 "frame-benchmarking",
1365 "parity-scale-codec",
1366 "sc-cli",
1367 "sc-client-db",
1368 "sc-executor",
1369 "sc-service",
1370 "sp-core",
1371 "sp-externalities",
1372 "sp-runtime",
1373 "sp-state-machine",
1374 "structopt",
1375]
12191376
1220[[package]]1377[[package]]
1221name = "frame-executive"1378name = "frame-executive"
1318 "sp-version",1475 "sp-version",
1319]1476]
1477
1478[[package]]
1479name = "frame-system-benchmarking"
1480version = "2.0.0"
1481source = "git+https://github.com/usetech-llc/substrate.git?branch=v2.0.0_release#a200cdb93c6af5763b9c7bf313fa708764ac88ca"
1482dependencies = [
1483 "frame-benchmarking",
1484 "frame-support",
1485 "frame-system",
1486 "parity-scale-codec",
1487 "sp-core",
1488 "sp-runtime",
1489 "sp-std",
1490]
13201491
1321[[package]]1492[[package]]
1322name = "frame-system-rpc-runtime-api"1493name = "frame-system-rpc-runtime-api"
1634 "polyval",1805 "polyval",
1635]1806]
1807
1808[[package]]
1809name = "gimli"
1810version = "0.21.0"
1811source = "registry+https://github.com/rust-lang/crates.io-index"
1812checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c"
1813dependencies = [
1814 "fallible-iterator",
1815 "indexmap",
1816 "stable_deref_trait",
1817]
16361818
1637[[package]]1819[[package]]
1638name = "gimli"1820name = "gimli"
2013dependencies = [2195dependencies = [
2014 "autocfg 1.0.1",2196 "autocfg 1.0.1",
2015 "hashbrown 0.9.1",2197 "hashbrown 0.9.1",
2198 "serde",
2016]2199]
20172200
2018[[package]]2201[[package]]
2073 "either",2256 "either",
2074]2257]
2258
2259[[package]]
2260name = "itertools"
2261version = "0.9.0"
2262source = "registry+https://github.com/rust-lang/crates.io-index"
2263checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
2264dependencies = [
2265 "either",
2266]
20752267
2076[[package]]2268[[package]]
2077name = "itoa"2269name = "itoa"
2295source = "registry+https://github.com/rust-lang/crates.io-index"2487source = "registry+https://github.com/rust-lang/crates.io-index"
2296checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"2488checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
2489
2490[[package]]
2491name = "leb128"
2492version = "0.2.4"
2493source = "registry+https://github.com/rust-lang/crates.io-index"
2494checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a"
22972495
2298[[package]]2496[[package]]
2299name = "libc"2497name = "libc"
2851source = "registry+https://github.com/rust-lang/crates.io-index"3049source = "registry+https://github.com/rust-lang/crates.io-index"
2852checksum = "adb241df5c4caeb888755363fc95f8a896618dc0d435e9e775f7930cb099beab"3050checksum = "adb241df5c4caeb888755363fc95f8a896618dc0d435e9e775f7930cb099beab"
3051
3052[[package]]
3053name = "mach"
3054version = "0.3.2"
3055source = "registry+https://github.com/rust-lang/crates.io-index"
3056checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa"
3057dependencies = [
3058 "libc",
3059]
28533060
2854[[package]]3061[[package]]
2855name = "matchers"3062name = "matchers"
3041 "winapi 0.3.9",3248 "winapi 0.3.9",
3042]3249]
3250
3251[[package]]
3252name = "more-asserts"
3253version = "0.2.1"
3254source = "registry+https://github.com/rust-lang/crates.io-index"
3255checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238"
30433256
3044[[package]]3257[[package]]
3045name = "multihash"3258name = "multihash"
3127name = "nft"3340name = "nft"
3128version = "2.0.0"3341version = "2.0.0"
3129dependencies = [3342dependencies = [
3343 "frame-benchmarking",
3344 "frame-benchmarking-cli",
3130 "futures 0.3.6",3345 "futures 0.3.6",
3131 "jsonrpc-core",3346 "jsonrpc-core",
3132 "log",3347 "log",
3165name = "nft-runtime"3380name = "nft-runtime"
3166version = "2.0.0"3381version = "2.0.0"
3167dependencies = [3382dependencies = [
3383 "frame-benchmarking",
3168 "frame-executive",3384 "frame-executive",
3169 "frame-support",3385 "frame-support",
3170 "frame-system",3386 "frame-system",
3387 "frame-system-benchmarking",
3171 "frame-system-rpc-runtime-api",3388 "frame-system-rpc-runtime-api",
3389 "hex-literal",
3172 "pallet-aura",3390 "pallet-aura",
3173 "pallet-balances",3391 "pallet-balances",
3174 "pallet-contracts",3392 "pallet-contracts",
3295 "libc",3513 "libc",
3296]3514]
3515
3516[[package]]
3517name = "object"
3518version = "0.19.0"
3519source = "registry+https://github.com/rust-lang/crates.io-index"
3520checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2"
3521
3522[[package]]
3523name = "object"
3524version = "0.20.0"
3525source = "registry+https://github.com/rust-lang/crates.io-index"
3526checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
3527dependencies = [
3528 "crc32fast",
3529 "indexmap",
3530 "wasmparser 0.57.0",
3531]
32973532
3298[[package]]3533[[package]]
3299name = "object"3534name = "object"
3498name = "pallet-nft"3733name = "pallet-nft"
3499version = "2.0.0"3734version = "2.0.0"
3500dependencies = [3735dependencies = [
3736 "frame-benchmarking",
3501 "frame-support",3737 "frame-support",
3502 "frame-system",3738 "frame-system",
3503 "log",3739 "log",
3569 "parity-scale-codec",3805 "parity-scale-codec",
3570 "serde",3806 "serde",
3571 "sp-inherents",3807 "sp-inherents",
3808 "sp-io",
3572 "sp-runtime",3809 "sp-runtime",
3573 "sp-std",3810 "sp-std",
3574 "sp-timestamp",3811 "sp-timestamp",
4098dependencies = [4335dependencies = [
4099 "bytes 0.5.6",4336 "bytes 0.5.6",
4100 "heck",4337 "heck",
4101 "itertools",4338 "itertools 0.8.2",
4102 "log",4339 "log",
4103 "multimap",4340 "multimap",
4104 "petgraph",4341 "petgraph",
4115checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72"4352checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72"
4116dependencies = [4353dependencies = [
4117 "anyhow",4354 "anyhow",
4118 "itertools",4355 "itertools 0.8.2",
4119 "proc-macro2",4356 "proc-macro2",
4120 "quote",4357 "quote",
4121 "syn",4358 "syn",
4367 "rand_core 0.3.1",4604 "rand_core 0.3.1",
4368]4605]
4606
4607[[package]]
4608name = "raw-cpuid"
4609version = "7.0.3"
4610source = "registry+https://github.com/rust-lang/crates.io-index"
4611checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf"
4612dependencies = [
4613 "bitflags",
4614 "cc",
4615 "rustc_version",
4616]
43694617
4370[[package]]4618[[package]]
4371name = "rawpointer"4619name = "rawpointer"
4444 "syn",4692 "syn",
4445]4693]
4694
4695[[package]]
4696name = "regalloc"
4697version = "0.0.27"
4698source = "registry+https://github.com/rust-lang/crates.io-index"
4699checksum = "b9ba8aaf5fe7cf307c6dbdaeed85478961d29e25e3bee5169e11b92fa9f027a8"
4700dependencies = [
4701 "log",
4702 "rustc-hash",
4703 "smallvec 1.4.2",
4704]
44464705
4447[[package]]4706[[package]]
4448name = "regex"4707name = "regex"
4472source = "registry+https://github.com/rust-lang/crates.io-index"4731source = "registry+https://github.com/rust-lang/crates.io-index"
4473checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c"4732checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c"
4733
4734[[package]]
4735name = "region"
4736version = "2.2.0"
4737source = "registry+https://github.com/rust-lang/crates.io-index"
4738checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0"
4739dependencies = [
4740 "bitflags",
4741 "libc",
4742 "mach",
4743 "winapi 0.3.9",
4744]
44744745
4475[[package]]4746[[package]]
4476name = "remove_dir_all"4747name = "remove_dir_all"
4895 "parking_lot 0.10.2",5166 "parking_lot 0.10.2",
4896 "sc-executor-common",5167 "sc-executor-common",
4897 "sc-executor-wasmi",5168 "sc-executor-wasmi",
5169 "sc-executor-wasmtime",
4898 "sp-api",5170 "sp-api",
4899 "sp-core",5171 "sp-core",
4900 "sp-externalities",5172 "sp-externalities",
4940 "wasmi",5212 "wasmi",
4941]5213]
5214
5215[[package]]
5216name = "sc-executor-wasmtime"
5217version = "0.8.0"
5218source = "git+https://github.com/usetech-llc/substrate.git?branch=v2.0.0_release#a200cdb93c6af5763b9c7bf313fa708764ac88ca"
5219dependencies = [
5220 "log",
5221 "parity-scale-codec",
5222 "parity-wasm",
5223 "pwasm-utils",
5224 "sc-executor-common",
5225 "scoped-tls",
5226 "sp-allocator",
5227 "sp-core",
5228 "sp-runtime-interface",
5229 "sp-wasm-interface",
5230 "wasmtime",
5231]
49425232
4943[[package]]5233[[package]]
4944name = "sc-finality-grandpa"5234name = "sc-finality-grandpa"
5413 "zeroize",5703 "zeroize",
5414]5704]
5705
5706[[package]]
5707name = "scoped-tls"
5708version = "1.0.0"
5709source = "registry+https://github.com/rust-lang/crates.io-index"
5710checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
54155711
5416[[package]]5712[[package]]
5417name = "scopeguard"5713name = "scopeguard"
5425source = "registry+https://github.com/rust-lang/crates.io-index"5721source = "registry+https://github.com/rust-lang/crates.io-index"
5426checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"5722checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
5723
5724[[package]]
5725name = "scroll"
5726version = "0.10.2"
5727source = "registry+https://github.com/rust-lang/crates.io-index"
5728checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec"
5729dependencies = [
5730 "scroll_derive",
5731]
5732
5733[[package]]
5734name = "scroll_derive"
5735version = "0.10.3"
5736source = "registry+https://github.com/rust-lang/crates.io-index"
5737checksum = "6dfde5d1531034db129e95c76ac857e2baecea3443579d493d02224950b0fb6d"
5738dependencies = [
5739 "proc-macro2",
5740 "quote",
5741 "syn",
5742]
54275743
5428[[package]]5744[[package]]
5429name = "sct"5745name = "sct"
6458[[package]]6774[[package]]
6459name = "substrate-wasm-builder-runner"6775name = "substrate-wasm-builder-runner"
6460version = "1.0.6"6776version = "1.0.6"
6461source = "git+https://github.com/usetech-llc/substrate.git?branch=v2.0.0_release#a200cdb93c6af5763b9c7bf313fa708764ac88ca"6777source = "registry+https://github.com/rust-lang/crates.io-index"
6778checksum = "d2a965994514ab35d3893e9260245f2947fd1981cdd4fffd2c6e6d1a9ce02e6a"
64626779
6463[[package]]6780[[package]]
6464name = "subtle"6781name = "subtle"
6501source = "registry+https://github.com/rust-lang/crates.io-index"6818source = "registry+https://github.com/rust-lang/crates.io-index"
6502checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"6819checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
6820
6821[[package]]
6822name = "target-lexicon"
6823version = "0.10.0"
6824source = "registry+https://github.com/rust-lang/crates.io-index"
6825checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d"
65036826
6504[[package]]6827[[package]]
6505name = "tempfile"6828name = "tempfile"
7324 "parity-wasm",7647 "parity-wasm",
7325]7648]
7649
7650[[package]]
7651name = "wasmparser"
7652version = "0.57.0"
7653source = "registry+https://github.com/rust-lang/crates.io-index"
7654checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6"
7655
7656[[package]]
7657name = "wasmparser"
7658version = "0.59.0"
7659source = "registry+https://github.com/rust-lang/crates.io-index"
7660checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9"
7661
7662[[package]]
7663name = "wasmtime"
7664version = "0.19.0"
7665source = "registry+https://github.com/rust-lang/crates.io-index"
7666checksum = "1cd3c4f449382779ef6e0a7c3ec6752ae614e20a42e4100000c3efdc973100e2"
7667dependencies = [
7668 "anyhow",
7669 "backtrace",
7670 "cfg-if 0.1.10",
7671 "lazy_static",
7672 "libc",
7673 "log",
7674 "region",
7675 "rustc-demangle",
7676 "smallvec 1.4.2",
7677 "target-lexicon",
7678 "wasmparser 0.59.0",
7679 "wasmtime-environ",
7680 "wasmtime-jit",
7681 "wasmtime-profiling",
7682 "wasmtime-runtime",
7683 "wat",
7684 "winapi 0.3.9",
7685]
7686
7687[[package]]
7688name = "wasmtime-debug"
7689version = "0.19.0"
7690source = "registry+https://github.com/rust-lang/crates.io-index"
7691checksum = "6e634af9067a3af6cf2c7d33dc3b84767ddaf5d010ba68e80eecbcea73d4a349"
7692dependencies = [
7693 "anyhow",
7694 "gimli 0.21.0",
7695 "more-asserts",
7696 "object 0.20.0",
7697 "target-lexicon",
7698 "thiserror",
7699 "wasmparser 0.59.0",
7700 "wasmtime-environ",
7701]
7702
7703[[package]]
7704name = "wasmtime-environ"
7705version = "0.19.0"
7706source = "registry+https://github.com/rust-lang/crates.io-index"
7707checksum = "08f85619a94ee4034bd5bb87fc3dcf71fd2237b81c840809da1201061eec9ab3"
7708dependencies = [
7709 "anyhow",
7710 "base64 0.12.3",
7711 "bincode",
7712 "cfg-if 0.1.10",
7713 "cranelift-codegen",
7714 "cranelift-entity",
7715 "cranelift-frontend",
7716 "cranelift-wasm",
7717 "directories",
7718 "errno",
7719 "file-per-thread-logger",
7720 "indexmap",
7721 "libc",
7722 "log",
7723 "more-asserts",
7724 "rayon",
7725 "serde",
7726 "sha2 0.8.2",
7727 "thiserror",
7728 "toml",
7729 "wasmparser 0.59.0",
7730 "winapi 0.3.9",
7731 "zstd",
7732]
7733
7734[[package]]
7735name = "wasmtime-jit"
7736version = "0.19.0"
7737source = "registry+https://github.com/rust-lang/crates.io-index"
7738checksum = "e914c013c7a9f15f4e429d5431f2830fb8adb56e40567661b69c5ec1d645be23"
7739dependencies = [
7740 "anyhow",
7741 "cfg-if 0.1.10",
7742 "cranelift-codegen",
7743 "cranelift-entity",
7744 "cranelift-frontend",
7745 "cranelift-native",
7746 "cranelift-wasm",
7747 "gimli 0.21.0",
7748 "log",
7749 "more-asserts",
7750 "object 0.20.0",
7751 "region",
7752 "target-lexicon",
7753 "thiserror",
7754 "wasmparser 0.59.0",
7755 "wasmtime-debug",
7756 "wasmtime-environ",
7757 "wasmtime-obj",
7758 "wasmtime-profiling",
7759 "wasmtime-runtime",
7760 "winapi 0.3.9",
7761]
7762
7763[[package]]
7764name = "wasmtime-obj"
7765version = "0.19.0"
7766source = "registry+https://github.com/rust-lang/crates.io-index"
7767checksum = "e81d8e02e9bc9fe2da9b6d48bbc217f96e089f7df613f11a28a3958abc44641e"
7768dependencies = [
7769 "anyhow",
7770 "more-asserts",
7771 "object 0.20.0",
7772 "target-lexicon",
7773 "wasmtime-debug",
7774 "wasmtime-environ",
7775]
7776
7777[[package]]
7778name = "wasmtime-profiling"
7779version = "0.19.0"
7780source = "registry+https://github.com/rust-lang/crates.io-index"
7781checksum = "1e8d4d1af8dd5f7096cfcc89dd668d358e52980c38cce199643372ffd6590e27"
7782dependencies = [
7783 "anyhow",
7784 "cfg-if 0.1.10",
7785 "gimli 0.21.0",
7786 "lazy_static",
7787 "libc",
7788 "object 0.19.0",
7789 "scroll",
7790 "serde",
7791 "target-lexicon",
7792 "wasmtime-environ",
7793 "wasmtime-runtime",
7794]
7795
7796[[package]]
7797name = "wasmtime-runtime"
7798version = "0.19.0"
7799source = "registry+https://github.com/rust-lang/crates.io-index"
7800checksum = "3a25f140bbbaadb07c531cba99ce1a966dba216138dc1b2a0ddecec851a01a93"
7801dependencies = [
7802 "backtrace",
7803 "cc",
7804 "cfg-if 0.1.10",
7805 "indexmap",
7806 "lazy_static",
7807 "libc",
7808 "log",
7809 "memoffset",
7810 "more-asserts",
7811 "region",
7812 "thiserror",
7813 "wasmtime-environ",
7814 "winapi 0.3.9",
7815]
7816
7817[[package]]
7818name = "wast"
7819version = "26.0.0"
7820source = "registry+https://github.com/rust-lang/crates.io-index"
7821checksum = "d54b3678343bfdf1768c16308a4b53823b70f7bb148d3d38225123d4306ec731"
7822dependencies = [
7823 "leb128",
7824]
7825
7826[[package]]
7827name = "wat"
7828version = "1.0.27"
7829source = "registry+https://github.com/rust-lang/crates.io-index"
7830checksum = "26b2dccbce4d0e14875091846e110a2369267b18ddd0d6423479b88dad914d71"
7831dependencies = [
7832 "wast",
7833]
73267834
7327[[package]]7835[[package]]
7328name = "web-sys"7836name = "web-sys"
7490 "synstructure",7998 "synstructure",
7491]7999]
8000
8001[[package]]
8002name = "zstd"
8003version = "0.5.3+zstd.1.4.5"
8004source = "registry+https://github.com/rust-lang/crates.io-index"
8005checksum = "01b32eaf771efa709e8308605bbf9319bf485dc1503179ec0469b611937c0cd8"
8006dependencies = [
8007 "zstd-safe",
8008]
8009
8010[[package]]
8011name = "zstd-safe"
8012version = "2.0.5+zstd.1.4.5"
8013source = "registry+https://github.com/rust-lang/crates.io-index"
8014checksum = "1cfb642e0d27f64729a639c52db457e0ae906e7bc6f5fe8f5c453230400f1055"
8015dependencies = [
8016 "libc",
8017 "zstd-sys",
8018]
8019
8020[[package]]
8021name = "zstd-sys"
8022version = "1.4.17+zstd.1.4.5"
8023source = "registry+https://github.com/rust-lang/crates.io-index"
8024checksum = "b89249644df056b522696b1bb9e7c18c87e8ffa3e2f0dc3b0155875d6498f01b"
8025dependencies = [
8026 "cc",
8027 "glob",
8028 "itertools 0.9.0",
8029 "libc",
8030]
74928031
modifiedREADME.mddiffbeforeafterboth
115115
116Additional CLI usage options are available and may be shown by running `cargo run -- --help`.116Additional CLI usage options are available and may be shown by running `cargo run -- --help`.
117117
118## Benchmarks
118119
120First of all, add rust toolchain and make it default.
121```bash
122rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-01
123```
124
125Then in "/node/src" run build command below
126```bash
127cargo +nightly-2020-10-01 build --release --features runtime-benchmarks
128```
129
130Run benchmark
131```bash
132target/release/nft benchmark --chain dev --pallet "pallet_nft" --extrinsic "*" --repeat 1
133```
134
119## UI custom types135## UI custom types
120```136```
121{137{
addeddoc/milestone_1.mddiffbeforeafterboth

no changes

modifiednode/Cargo.tomldiffbeforeafterboth
27structopt = '0.3.8'27structopt = '0.3.8'
28jsonrpc-core = '15.0.0'28jsonrpc-core = '15.0.0'
2929
30[dependencies.nft-runtime]30# Substrate dependencies
31path = '../runtime'31nft-runtime = { path = '../runtime', version = '2.0.0' }
32version = '2.0.0'32frame-benchmarking = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
3333frame-benchmarking-cli = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
34[dependencies.sc-basic-authorship]34pallet-transaction-payment-rpc = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
35git = 'https://github.com/usetech-llc/substrate.git'35sc-basic-authorship = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
36branch = 'v2.0.0_release'36sc-cli = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
37version = '0.8.0'37sc-client-api = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
3838sc-consensus = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
39[dependencies.sc-cli]39sc-consensus-aura = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
40git = 'https://github.com/usetech-llc/substrate.git'40sc-executor = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
41branch = 'v2.0.0_release'41sc-finality-grandpa = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
42version = '0.8.0'42sc-rpc = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
4343sc-rpc-api = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
44[dependencies.sc-client-api]44sc-service = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
45git = 'https://github.com/usetech-llc/substrate.git'45sc-transaction-pool = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
46branch = 'v2.0.0_release'46sp-api = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
47version = '2.0.0'47sp-block-builder = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
4848sp-blockchain = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
49[dependencies.sc-consensus]49sp-consensus = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
50git = 'https://github.com/usetech-llc/substrate.git'50sp-consensus-aura = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
51branch = 'v2.0.0_release'51sp-core = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
52version = '0.8.0'52sp-finality-grandpa = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
5353sp-inherents = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
54[dependencies.pallet-contracts-rpc]54sp-runtime = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
55git = 'https://github.com/usetech-llc/substrate.git'55sp-transaction-pool = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
56version = '0.8.0'56sc-network = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
57branch = 'v2.0.0_release'57substrate-frame-rpc-system = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
5858pallet-contracts-rpc = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release'}
59[dependencies.sc-rpc]
60git = 'https://github.com/usetech-llc/substrate.git'
61version = '2.0.0'
62branch = 'v2.0.0_release'
63
64[dependencies.sp-api]
65git = 'https://github.com/usetech-llc/substrate.git'
66version = '2.0.0'
67branch = 'v2.0.0_release'
68
69[dependencies.sp-blockchain]
70git = 'https://github.com/usetech-llc/substrate.git'
71version = '2.0.0'
72branch = 'v2.0.0_release'
73
74[dependencies.sp-block-builder]
75git = 'https://github.com/usetech-llc/substrate.git'
76version = '2.0.0'
77branch = 'v2.0.0_release'
78
79[dependencies.sc-rpc-api]
80git = 'https://github.com/usetech-llc/substrate.git'
81version = '0.8.0'
82branch = 'v2.0.0_release'
83
84[dependencies.substrate-frame-rpc-system]
85git = 'https://github.com/usetech-llc/substrate.git'
86version = '2.0.0'
87branch = 'v2.0.0_release'
88
89[dependencies.pallet-transaction-payment-rpc]
90git = 'https://github.com/usetech-llc/substrate.git'
91version = '2.0.0'
92branch = 'v2.0.0_release'
93
94[dependencies.sc-consensus-aura]
95git = 'https://github.com/usetech-llc/substrate.git'
96branch = 'v2.0.0_release'
97version = '0.8.0'
98
99[dependencies.sc-executor]
100git = 'https://github.com/usetech-llc/substrate.git'
101branch = 'v2.0.0_release'
102version = '0.8.0'
103
104[dependencies.sc-finality-grandpa]
105git = 'https://github.com/usetech-llc/substrate.git'
106branch = 'v2.0.0_release'
107version = '0.8.0'
108
109[dependencies.sc-network]
110git = 'https://github.com/usetech-llc/substrate.git'
111branch = 'v2.0.0_release'
112version = '0.8.0'
113
114[dependencies.sc-service]
115git = 'https://github.com/usetech-llc/substrate.git'
116branch = 'v2.0.0_release'
117version = '0.8.0'
118
119[dependencies.sc-transaction-pool]
120git = 'https://github.com/usetech-llc/substrate.git'
121branch = 'v2.0.0_release'
122version = '2.0.0'
123
124[dependencies.sp-consensus]
125git = 'https://github.com/usetech-llc/substrate.git'
126branch = 'v2.0.0_release'
127version = '0.8.0'
128
129[dependencies.sp-consensus-aura]
130git = 'https://github.com/usetech-llc/substrate.git'
131branch = 'v2.0.0_release'
132version = '0.8.0'
133
134[dependencies.sp-core]
135git = 'https://github.com/usetech-llc/substrate.git'
136branch = 'v2.0.0_release'
137version = '2.0.0'
138
139[dependencies.sp-finality-grandpa]
140git = 'https://github.com/usetech-llc/substrate.git'
141branch = 'v2.0.0_release'
142version = '2.0.0'
143
144[dependencies.sp-inherents]
145git = 'https://github.com/usetech-llc/substrate.git'
146branch = 'v2.0.0_release'
147version = '2.0.0'
148
149[dependencies.sp-runtime]
150git = 'https://github.com/usetech-llc/substrate.git'
151branch = 'v2.0.0_release'
152version = '2.0.0'
15359
154[dependencies.sp-transaction-pool]60[features]
155git = 'https://github.com/usetech-llc/substrate.git'61default = []
156branch = 'v2.0.0_release'62runtime-benchmarks = ['nft-runtime/runtime-benchmarks']
157version = '2.0.0'
15863
modifiednode/src/chain_spec.rsdiffbeforeafterboth
39}39}
4040
41pub fn development_config() -> Result<ChainSpec, String> {41pub fn development_config() -> Result<ChainSpec, String> {
42 let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
43
42 Ok(ChainSpec::from_genesis(44 Ok(ChainSpec::from_genesis(
45 // Name
43 "Development",46 "Development",
47 // ID
44 "dev",48 "dev",
45 ChainType::Development,49 ChainType::Development,
46 || {50 move || testnet_genesis(
47 testnet_genesis(51 wasm_binary,
52 // Initial PoA authorities
48 vec![authority_keys_from_seed("Alice")],53 vec![
54 authority_keys_from_seed("Alice"),
55 ],
56 // Sudo account
49 get_account_id_from_seed::<sr25519::Public>("Alice"),57 get_account_id_from_seed::<sr25519::Public>("Alice"),
58 // Pre-funded accounts
50 vec![59 vec![
51 get_account_id_from_seed::<sr25519::Public>("Alice"),60 get_account_id_from_seed::<sr25519::Public>("Alice"),
52 get_account_id_from_seed::<sr25519::Public>("Bob"),61 get_account_id_from_seed::<sr25519::Public>("Bob"),
55 ],64 ],
56 true,65 true,
57 )66 ),
58 },67 // Bootnodes
59 vec![],68 vec![],
69 // Telemetry
60 None,70 None,
71 // Protocol ID
61 None,72 None,
73 // Properties
62 None,74 None,
75 // Extensions
63 None,76 None,
64 ))77 ))
65}78}
6679
67pub fn local_testnet_config() -> Result<ChainSpec, String> {80pub fn local_testnet_config() -> Result<ChainSpec, String> {
81 let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
82
68 Ok(ChainSpec::from_genesis(83 Ok(ChainSpec::from_genesis(
84 // Name
69 "Local Testnet",85 "Local Testnet",
86 // ID
70 "local_testnet",87 "local_testnet",
71 ChainType::Local,88 ChainType::Local,
72 || {89 move || testnet_genesis(
73 testnet_genesis(90 wasm_binary,
91 // Initial PoA authorities
74 vec![92 vec![
75 authority_keys_from_seed("Alice"),93 authority_keys_from_seed("Alice"),
76 authority_keys_from_seed("Bob"),94 authority_keys_from_seed("Bob"),
77 ],95 ],
96 // Sudo account
78 get_account_id_from_seed::<sr25519::Public>("Alice"),97 get_account_id_from_seed::<sr25519::Public>("Alice"),
98 // Pre-funded accounts
79 vec![99 vec![
80 get_account_id_from_seed::<sr25519::Public>("Alice"),100 get_account_id_from_seed::<sr25519::Public>("Alice"),
81 get_account_id_from_seed::<sr25519::Public>("Bob"),101 get_account_id_from_seed::<sr25519::Public>("Bob"),
92 ],112 ],
93 true,113 true,
94 )114 ),
95 },115 // Bootnodes
96 vec![],116 vec![],
117 // Telemetry
97 None,118 None,
119 // Protocol ID
98 None,120 None,
121 // Properties
99 None,122 None,
123 // Extensions
100 None,124 None,
101 ))125 ))
102}126}
103127
104fn testnet_genesis(128fn testnet_genesis(
129 wasm_binary: &[u8],
105 initial_authorities: Vec<(AuraId, GrandpaId)>,130 initial_authorities: Vec<(AuraId, GrandpaId)>,
106 root_key: AccountId,131 root_key: AccountId,
107 endowed_accounts: Vec<AccountId>,132 endowed_accounts: Vec<AccountId>,
108 enable_println: bool,133 enable_println: bool,
109) -> GenesisConfig {134) -> GenesisConfig {
110 GenesisConfig {135 GenesisConfig {
111 system: Some(SystemConfig {136 system: Some(SystemConfig {
112 code: WASM_BINARY.to_vec(),137 code: wasm_binary.to_vec(),
113 changes_trie_config: Default::default(),138 changes_trie_config: Default::default(),
114 }),139 }),
115 balances: Some(BalancesConfig {140 pallet_balances: Some(BalancesConfig {
116 balances: endowed_accounts141 balances: endowed_accounts
117 .iter()142 .iter()
118 .cloned()143 .cloned()
119 .map(|k| (k, 1 << 100))144 .map(|k| (k, 1 << 100))
120 .collect(),145 .collect(),
121 }),146 }),
122 aura: Some(AuraConfig {147 pallet_aura: Some(AuraConfig {
123 authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),148 authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),
124 }),149 }),
125 grandpa: Some(GrandpaConfig {150 pallet_grandpa: Some(GrandpaConfig {
126 authorities: initial_authorities151 authorities: initial_authorities
127 .iter()152 .iter()
128 .map(|x| (x.1.clone(), 1))153 .map(|x| (x.1.clone(), 1))
129 .collect(),154 .collect(),
130 }),155 }),
131 sudo: Some(SudoConfig { key: root_key }),156 pallet_sudo: Some(SudoConfig { key: root_key }),
132 nft: Some(NftConfig {157 pallet_nft: Some(NftConfig {
133 collection: vec![(158 collection: vec![(
134 1,159 1,
135 CollectionType {160 CollectionType {
160 refungible_sponsor_transfer_timeout: 15,185 refungible_sponsor_transfer_timeout: 15,
161 },186 },
162 }),187 }),
163 contracts: Some(ContractsConfig {188 pallet_contracts: Some(ContractsConfig {
164 current_schedule: ContractsSchedule {189 current_schedule: ContractsSchedule {
165 enable_println,190 enable_println,
166 ..Default::default()191 ..Default::default()
modifiednode/src/cli.rsdiffbeforeafterboth
34 Revert(sc_cli::RevertCmd),34 Revert(sc_cli::RevertCmd),
3535
36 // The custom benchmark subcommmand benchmarking runtime pallets.36 // The custom benchmark subcommmand benchmarking runtime pallets.
37 // #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]37 #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
38 // Benchmark(frame_benchmarking_cli::BenchmarkCmd),38 Benchmark(frame_benchmarking_cli::BenchmarkCmd),
39}39}
4040
modifiednode/src/command.rsdiffbeforeafterboth
19use crate::cli::{Cli, Subcommand};19use crate::cli::{Cli, Subcommand};
20use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec};20use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec};
21use sc_service::PartialComponents;21use sc_service::PartialComponents;
22// use nft_runtime::Block;22use nft_runtime::Block;
2323
24impl SubstrateCli for Cli {24impl SubstrateCli for Cli {
25 fn impl_name() -> String {25 fn impl_name() -> String {
114 Ok((cmd.run(client, backend), task_manager))114 Ok((cmd.run(client, backend), task_manager))
115 })115 })
116 },116 },
117 // Some(Subcommand::Benchmark(cmd)) => {117 Some(Subcommand::Benchmark(cmd)) => {
118 // if cfg!(feature = "runtime-benchmarks") {118 if cfg!(feature = "runtime-benchmarks") {
119 // let runner = cli.create_runner(cmd)?;119 let runner = cli.create_runner(cmd)?;
120120
121 // runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))121 runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
122 // } else {122 } else {
123 // Err("Benchmarking wasn't enabled when building the node. \123 Err("Benchmarking wasn't enabled when building the node. \
124 // You can enable it with `--features runtime-benchmarks`.".into())124 You can enable it with `--features runtime-benchmarks`.".into())
125 // }125 }
126 // },126 },
127 None => {127 None => {
128 let runner = cli.create_runner(&cli.run)?;128 let runner = cli.create_runner(&cli.run)?;
129 runner.run_node_until_exit(|config| match config.role {129 runner.run_node_until_exit(|config| match config.role {
modifiednode/src/service.rsdiffbeforeafterboth
16 pub Executor,16 pub Executor,
17 nft_runtime::api::dispatch,17 nft_runtime::api::dispatch,
18 nft_runtime::native_version,18 nft_runtime::native_version,
19 // frame_benchmarking::benchmarking::HostFunctions,19 frame_benchmarking::benchmarking::HostFunctions,
20);20);
2121
22type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;22type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
modifiedpallets/nft/Cargo.tomldiffbeforeafterboth
1[package]
2authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
3description = 'FRAME pallet nft'
4edition = '2018'
5homepage = 'https://substrate.io'
6license = 'Unlicense'
7name = 'pallet-nft'
8repository = 'https://github.com/substrate-developer-hub/nft/'
9version = '2.0.0'
10
11[package.metadata.docs.rs]
12targets = ['x86_64-unknown-linux-gnu']
13
14# alias "parity-scale-code" to "codec"
1[dependencies.codec]15[dependencies.codec]
2default-features = false16default-features = false
3features = ['derive']17features = ['derive']
4package = 'parity-scale-codec'18package = 'parity-scale-codec'
5version = '1.3.0'19version = '1.3.4'
620
7[dependencies.frame-support]21[dependencies.frame-support]
8default-features = false22default-features = false
51branch = 'v2.0.0_release'66branch = 'v2.0.0_release'
52version = '2.0.0'67version = '2.0.0'
5368
54[package]69[dependencies.frame-benchmarking]
55authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']70version = "2.0.0"
56description = 'FRAME pallet nft'71default-features = false
57edition = '2018'
58homepage = 'https://substrate.io'72git = 'https://github.com/usetech-llc/substrate.git'
59license = 'Unlicense'73branch = 'v2.0.0_release'
60name = 'pallet-nft'74optional = true
61repository = 'https://github.com/substrate-developer-hub/nft/'
62version = '2.0.0'
63[package.metadata.docs.rs]
64targets = ['x86_64-unknown-linux-gnu']
6575
66[features]76[features]
67default = ['std']77default = ['std']
70 "serde/std",80 "serde/std",
71 'frame-support/std',81 'frame-support/std',
72 'frame-system/std',82 'frame-system/std',
83 'sp-std/std',
73 'sp-runtime/std',84 'sp-runtime/std',
74 'sp-std/std',85 'frame-benchmarking/std',
75]86]
87runtime-benchmarks = ["frame-benchmarking"]
7688
addedpallets/nft/src/benchmarking.rsdiffbeforeafterboth

no changes

addedpallets/nft/src/default_weights.rsdiffbeforeafterboth

no changes

modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
22 },22 },
23 IsSubType, StorageValue,23 IsSubType, StorageValue,
24};24};
25// use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};
2526
26use frame_system::{self as system, ensure_signed, ensure_root};27use frame_system::{self as system, ensure_signed, ensure_root};
27use sp_runtime::sp_std::prelude::Vec;28use sp_runtime::sp_std::prelude::Vec;
43#[cfg(test)]44#[cfg(test)]
44mod tests;45mod tests;
46
47mod default_weights;
4548
46// Structs49// Structs
47// #region50// #region
181 pub refungible_sponsor_transfer_timeout: u32,184 pub refungible_sponsor_transfer_timeout: u32,
182}185}
186
187pub trait WeightInfo {
188 fn create_collection() -> Weight;
189 fn destroy_collection() -> Weight;
190 fn add_to_white_list() -> Weight;
191 fn remove_from_white_list() -> Weight;
192 fn set_public_access_mode() -> Weight;
193 fn set_mint_permission() -> Weight;
194 fn change_collection_owner() -> Weight;
195 fn add_collection_admin() -> Weight;
196 fn remove_collection_admin() -> Weight;
197 fn set_collection_sponsor() -> Weight;
198 fn confirm_sponsorship() -> Weight;
199 fn remove_collection_sponsor() -> Weight;
200 fn create_item(s: usize, ) -> Weight;
201 fn burn_item() -> Weight;
202 fn transfer() -> Weight;
203 fn approve() -> Weight;
204 fn transfer_from() -> Weight;
205 fn set_offchain_schema() -> Weight;
206}
183207
184pub trait Trait: system::Trait {208pub trait Trait: system::Trait + Sized {
185 type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;209 type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
210
211 /// Weight information for extrinsics in this pallet.
212 type WeightInfo: WeightInfo;
186}213}
214
215#[cfg(feature = "runtime-benchmarks")]
216mod benchmarking;
187217
188// #endregion218// #endregion
189219
322 /// 352 ///
323 /// * mode: [CollectionMode] collection type and type dependent data.353 /// * mode: [CollectionMode] collection type and type dependent data.
324 // returns collection ID354 // returns collection ID
325 #[weight = 0]355 #[weight = T::WeightInfo::create_collection()]
326 pub fn create_collection(origin,356 pub fn create_collection(origin,
327 collection_name: Vec<u16>,357 collection_name: Vec<u16>,
328 collection_description: Vec<u16>,358 collection_description: Vec<u16>,
418 /// # Arguments448 /// # Arguments
419 /// 449 ///
420 /// * collection_id: collection to destroy.450 /// * collection_id: collection to destroy.
421 #[weight = 0]451 #[weight = T::WeightInfo::destroy_collection()]
422 pub fn destroy_collection(origin, collection_id: u64) -> DispatchResult {452 pub fn destroy_collection(origin, collection_id: u64) -> DispatchResult {
423453
424 let sender = ensure_signed(origin)?;454 let sender = ensure_signed(origin)?;
465 /// * collection_id.495 /// * collection_id.
466 /// 496 ///
467 /// * address.497 /// * address.
468 #[weight = 0]498 #[weight = T::WeightInfo::add_to_white_list()]
469 pub fn add_to_white_list(origin, collection_id: u64, address: T::AccountId) -> DispatchResult{499 pub fn add_to_white_list(origin, collection_id: u64, address: T::AccountId) -> DispatchResult{
470500
471 let sender = ensure_signed(origin)?;501 let sender = ensure_signed(origin)?;
500 /// * collection_id.530 /// * collection_id.
501 /// 531 ///
502 /// * address.532 /// * address.
503 #[weight = 0]533 #[weight = T::WeightInfo::remove_from_white_list()]
504 pub fn remove_from_white_list(origin, collection_id: u64, address: T::AccountId) -> DispatchResult{534 pub fn remove_from_white_list(origin, collection_id: u64, address: T::AccountId) -> DispatchResult{
505535
506 let sender = ensure_signed(origin)?;536 let sender = ensure_signed(origin)?;
529 /// * collection_id.559 /// * collection_id.
530 /// 560 ///
531 /// * mode: [AccessMode]561 /// * mode: [AccessMode]
532 #[weight = 0]562 #[weight = T::WeightInfo::set_public_access_mode()]
533 pub fn set_public_access_mode(origin, collection_id: u64, mode: AccessMode) -> DispatchResult563 pub fn set_public_access_mode(origin, collection_id: u64, mode: AccessMode) -> DispatchResult
534 {564 {
535 let sender = ensure_signed(origin)?;565 let sender = ensure_signed(origin)?;
555 /// * collection_id.585 /// * collection_id.
556 /// 586 ///
557 /// * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.587 /// * mint_permission: Boolean parameter. If True, allows minting to Anyone with conditions above.
558 #[weight = 0]588 #[weight = T::WeightInfo::set_mint_permission()]
559 pub fn set_mint_permission(origin, collection_id: u64, mint_permission: bool) -> DispatchResult589 pub fn set_mint_permission(origin, collection_id: u64, mint_permission: bool) -> DispatchResult
560 {590 {
561 let sender = ensure_signed(origin)?;591 let sender = ensure_signed(origin)?;
579 /// * collection_id.609 /// * collection_id.
580 /// 610 ///
581 /// * new_owner.611 /// * new_owner.
582 #[weight = 0]612 #[weight = T::WeightInfo::change_collection_owner()]
583 pub fn change_collection_owner(origin, collection_id: u64, new_owner: T::AccountId) -> DispatchResult {613 pub fn change_collection_owner(origin, collection_id: u64, new_owner: T::AccountId) -> DispatchResult {
584614
585 let sender = ensure_signed(origin)?;615 let sender = ensure_signed(origin)?;
604 /// * collection_id: ID of the Collection to add admin for.634 /// * collection_id: ID of the Collection to add admin for.
605 /// 635 ///
606 /// * new_admin_id: Address of new admin to add.636 /// * new_admin_id: Address of new admin to add.
607 #[weight = 0]637 #[weight = T::WeightInfo::add_collection_admin()]
608 pub fn add_collection_admin(origin, collection_id: u64, new_admin_id: T::AccountId) -> DispatchResult {638 pub fn add_collection_admin(origin, collection_id: u64, new_admin_id: T::AccountId) -> DispatchResult {
609639
610 let sender = ensure_signed(origin)?;640 let sender = ensure_signed(origin)?;
638 /// * collection_id: ID of the Collection to remove admin for.668 /// * collection_id: ID of the Collection to remove admin for.
639 /// 669 ///
640 /// * account_id: Address of admin to remove.670 /// * account_id: Address of admin to remove.
641 #[weight = 0]671 #[weight = T::WeightInfo::remove_collection_admin()]
642 pub fn remove_collection_admin(origin, collection_id: u64, account_id: T::AccountId) -> DispatchResult {672 pub fn remove_collection_admin(origin, collection_id: u64, account_id: T::AccountId) -> DispatchResult {
643673
644 let sender = ensure_signed(origin)?;674 let sender = ensure_signed(origin)?;
663 /// * collection_id.693 /// * collection_id.
664 /// 694 ///
665 /// * new_sponsor.695 /// * new_sponsor.
666 #[weight = 0]696 #[weight = T::WeightInfo::set_collection_sponsor()]
667 pub fn set_collection_sponsor(origin, collection_id: u64, new_sponsor: T::AccountId) -> DispatchResult {697 pub fn set_collection_sponsor(origin, collection_id: u64, new_sponsor: T::AccountId) -> DispatchResult {
668698
669 let sender = ensure_signed(origin)?;699 let sender = ensure_signed(origin)?;
685 /// # Arguments715 /// # Arguments
686 /// 716 ///
687 /// * collection_id.717 /// * collection_id.
688 #[weight = 0]718 #[weight = T::WeightInfo::confirm_sponsorship()]
689 pub fn confirm_sponsorship(origin, collection_id: u64) -> DispatchResult {719 pub fn confirm_sponsorship(origin, collection_id: u64) -> DispatchResult {
690720
691 let sender = ensure_signed(origin)?;721 let sender = ensure_signed(origin)?;
710 /// # Arguments740 /// # Arguments
711 /// 741 ///
712 /// * collection_id.742 /// * collection_id.
713 #[weight = 0]743 #[weight = T::WeightInfo::remove_collection_sponsor()]
714 pub fn remove_collection_sponsor(origin, collection_id: u64) -> DispatchResult {744 pub fn remove_collection_sponsor(origin, collection_id: u64) -> DispatchResult {
715745
716 let sender = ensure_signed(origin)?;746 let sender = ensure_signed(origin)?;
743 /// * properties: Array of bytes that contains NFT properties. Since NFT Module is agnostic of properties meaning, it is treated purely as an array of bytes.773 /// * properties: Array of bytes that contains NFT properties. Since NFT Module is agnostic of properties meaning, it is treated purely as an array of bytes.
744 /// 774 ///
745 /// * owner: Address, initial owner of the NFT.775 /// * owner: Address, initial owner of the NFT.
776 // #[weight =
777 // (130_000_000 as Weight)
778 // .saturating_add((2135 as Weight).saturating_mul((properties.len() as u64) as Weight))
779 // .saturating_add(RocksDbWeight::get().reads(10 as Weight))
780 // .saturating_add(RocksDbWeight::get().writes(8 as Weight))]
781
746 #[weight = 0]782 #[weight = T::WeightInfo::create_item(properties.len())]
747 pub fn create_item(origin, collection_id: u64, properties: Vec<u8>, owner: T::AccountId) -> DispatchResult {783 pub fn create_item(origin, collection_id: u64, properties: Vec<u8>, owner: T::AccountId) -> DispatchResult {
748784
749 let sender = ensure_signed(origin)?;785 let sender = ensure_signed(origin)?;
826 /// * collection_id: ID of the collection.862 /// * collection_id: ID of the collection.
827 /// 863 ///
828 /// * item_id: ID of NFT to burn.864 /// * item_id: ID of NFT to burn.
829 #[weight = 0]865 #[weight = T::WeightInfo::burn_item()]
830 pub fn burn_item(origin, collection_id: u64, item_id: u64) -> DispatchResult {866 pub fn burn_item(origin, collection_id: u64, item_id: u64) -> DispatchResult {
831867
832 let sender = ensure_signed(origin)?;868 let sender = ensure_signed(origin)?;
879 /// * Non-Fungible Mode: Ignored915 /// * Non-Fungible Mode: Ignored
880 /// * Fungible Mode: Must specify transferred amount916 /// * Fungible Mode: Must specify transferred amount
881 /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)917 /// * Re-Fungible Mode: Must specify transferred portion (between 0 and 1)
882 #[weight = 0]918 #[weight = T::WeightInfo::transfer()]
883 pub fn transfer(origin, recipient: T::AccountId, collection_id: u64, item_id: u64, value: u64) -> DispatchResult {919 pub fn transfer(origin, recipient: T::AccountId, collection_id: u64, item_id: u64, value: u64) -> DispatchResult {
884920
885 let sender = ensure_signed(origin)?;921 let sender = ensure_signed(origin)?;
921 /// * collection_id.957 /// * collection_id.
922 /// 958 ///
923 /// * item_id: ID of the item.959 /// * item_id: ID of the item.
924 #[weight = 0]960 #[weight = T::WeightInfo::approve()]
925 pub fn approve(origin, approved: T::AccountId, collection_id: u64, item_id: u64) -> DispatchResult {961 pub fn approve(origin, approved: T::AccountId, collection_id: u64, item_id: u64) -> DispatchResult {
926962
927 let sender = ensure_signed(origin)?;963 let sender = ensure_signed(origin)?;
979 /// * item_id: ID of the item.1015 /// * item_id: ID of the item.
980 /// 1016 ///
981 /// * value: Amount to transfer.1017 /// * value: Amount to transfer.
982 #[weight = 0]1018 #[weight = T::WeightInfo::transfer_from()]
983 pub fn transfer_from(origin, from: T::AccountId, recipient: T::AccountId, collection_id: u64, item_id: u64, value: u64 ) -> DispatchResult {1019 pub fn transfer_from(origin, from: T::AccountId, recipient: T::AccountId, collection_id: u64, item_id: u64, value: u64 ) -> DispatchResult {
9841020
985 let sender = ensure_signed(origin)?;1021 let sender = ensure_signed(origin)?;
989 if <ApprovedList<T>>::contains_key(collection_id, (item_id, from.clone())) {1025 if <ApprovedList<T>>::contains_key(collection_id, (item_id, from.clone())) {
990 let list_itm = <ApprovedList<T>>::get(collection_id, (item_id, from.clone()));1026 let list_itm = <ApprovedList<T>>::get(collection_id, (item_id, from.clone()));
991 let opt_item = list_itm.iter().find(|i| i.approved == sender.clone());1027 let opt_item = list_itm.iter().find(|i| i.approved == sender.clone());
992 appoved_transfer = opt_item.is_some();1028 if opt_item.is_some()
1029 {
1030 appoved_transfer = true;
993 ensure!(opt_item.unwrap().amount >= value, "Requested value more than approved");1031 ensure!(opt_item.unwrap().amount >= value, "Requested value more than approved");
1032 }
994 }1033 }
9951034
996 // Transfer permissions check1035 // Transfer permissions check
1048 /// * collection_id.1087 /// * collection_id.
1049 /// 1088 ///
1050 /// * schema: String representing the offchain data schema.1089 /// * schema: String representing the offchain data schema.
1051 #[weight = 0]1090 #[weight = T::WeightInfo::set_offchain_schema()]
1052 pub fn set_offchain_schema(1091 pub fn set_offchain_schema(
1053 origin,1092 origin,
1054 collection_id: u64,1093 collection_id: u64,
modifiedpallets/nft/src/mock.rsdiffbeforeafterboth
35}35}
3636
37impl system::Trait for Test {37impl system::Trait for Test {
38 type BaseCallFilter = ();
38 type Origin = Origin;39 type Origin = Origin;
39 type Call = ();40 type Call = ();
40 type Index = u64;41 type Index = u64;
47 type Event = ();48 type Event = ();
48 type BlockHashCount = BlockHashCount;49 type BlockHashCount = BlockHashCount;
49 type MaximumBlockWeight = MaximumBlockWeight;50 type MaximumBlockWeight = MaximumBlockWeight;
50 type MaximumBlockLength = MaximumBlockLength;51 type DbWeight = ();
51 type AvailableBlockRatio = AvailableBlockRatio;52 type BlockExecutionWeight = ();
52 type BaseCallFilter = ();53 type ExtrinsicBaseWeight = ();
53 type DbWeight = RocksDbWeight;54 type MaximumExtrinsicWeight = MaximumBlockWeight;
54 type BlockExecutionWeight = BlockExecutionWeight;55 type MaximumBlockLength = MaximumBlockLength;
55 type ExtrinsicBaseWeight = ExtrinsicBaseWeight;56 type AvailableBlockRatio = AvailableBlockRatio;
56 type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
57 type Version = ();57 type Version = ();
58 type ModuleToIndex = ();58 type PalletInfo = ();
59 type AccountData = ();59 type AccountData = ();
60 type OnNewAccount = ();60 type OnNewAccount = ();
61 type OnKilledAccount = ();61 type OnKilledAccount = ();
62 type SystemWeightInfo = ();
62}63}
63impl Trait for Test {64impl Trait for Test {
64 type Event = ();65 type Event = ();
modifiedpallets/nft/src/tests.rsdiffbeforeafterboth
177 assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 1000);177 assert_eq!(TemplateModule::fungible_item_id(1, 1).value, 1000);
178 assert_eq!(TemplateModule::balance_count(1, 1), 0);178 assert_eq!(TemplateModule::balance_count(1, 1), 0);
179 assert_eq!(TemplateModule::balance_count(1, 2), 1000);179 assert_eq!(TemplateModule::balance_count(1, 2), 1000);
180 assert_eq!(TemplateModule::address_tokens(1, 1), []);180 // assert_eq!(TemplateModule::address_tokens(1, 1), []);
181 assert_eq!(TemplateModule::address_tokens(1, 2), [1]);181 assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
182182
183 // split item scenario183 // split item scenario
260 );260 );
261 assert_eq!(TemplateModule::balance_count(1, 1), 0);261 assert_eq!(TemplateModule::balance_count(1, 1), 0);
262 assert_eq!(TemplateModule::balance_count(1, 2), 1000);262 assert_eq!(TemplateModule::balance_count(1, 2), 1000);
263 assert_eq!(TemplateModule::address_tokens(1, 1), []);263 // assert_eq!(TemplateModule::address_tokens(1, 1), []);
264 assert_eq!(TemplateModule::address_tokens(1, 2), [1]);264 assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
265265
266 // split item scenario266 // split item scenario
350 assert_eq!(TemplateModule::nft_item_id(1, 1).owner, 2);350 assert_eq!(TemplateModule::nft_item_id(1, 1).owner, 2);
351 assert_eq!(TemplateModule::balance_count(1, 1), 0);351 assert_eq!(TemplateModule::balance_count(1, 1), 0);
352 assert_eq!(TemplateModule::balance_count(1, 2), 1);352 assert_eq!(TemplateModule::balance_count(1, 2), 1);
353 assert_eq!(TemplateModule::address_tokens(1, 1), []);353 // assert_eq!(TemplateModule::address_tokens(1, 1), []);
354 assert_eq!(TemplateModule::address_tokens(1, 2), [1]);354 assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
355 });355 });
356}356}
632 ));632 ));
633 assert_eq!(TemplateModule::balance_count(1, 1), 0);633 assert_eq!(TemplateModule::balance_count(1, 1), 0);
634 assert_eq!(TemplateModule::balance_count(1, 3), 1000);634 assert_eq!(TemplateModule::balance_count(1, 3), 1000);
635 assert_eq!(TemplateModule::address_tokens(1, 1), []);635 // assert_eq!(TemplateModule::address_tokens(1, 1), []);
636 assert_eq!(TemplateModule::address_tokens(1, 3), [2]);636 assert_eq!(TemplateModule::address_tokens(1, 3), [2]);
637637
638 assert_eq!(TemplateModule::approved(1, (1, 1)).len(), 0);638 assert_eq!(TemplateModule::approved(1, (1, 1)).len(), 0);
21622162
2163 assert_noop!(2163 assert_noop!(
2164 TemplateModule::create_item(origin2.clone(), 1, [1, 2, 3].to_vec(), 2),2164 TemplateModule::create_item(origin2.clone(), 1, [1, 2, 3].to_vec(), 2),
2165 "Collection is not in mint mode"2165 "Public minting is not allowed for this collection"
2166 );2166 );
2167 });2167 });
2168}2168}
22092209
2210 assert_noop!(2210 assert_noop!(
2211 TemplateModule::create_item(origin2.clone(), 1, [1, 2, 3].to_vec(), 2),2211 TemplateModule::create_item(origin2.clone(), 1, [1, 2, 3].to_vec(), 2),
2212 "Collection is not in mint mode"2212 "Public minting is not allowed for this collection"
2213 );2213 );
2214 });2214 });
2215}2215}
modifiedruntime/Cargo.tomldiffbeforeafterboth
1[dependencies.aura]
2default-features = false
3git = 'https://github.com/usetech-llc/substrate.git'
4package = 'pallet-aura'
5branch = 'v2.0.0_release'
6version = '2.0.0'
7
8[dependencies.balances]
9default-features = false
10git = 'https://github.com/usetech-llc/substrate.git'
11package = 'pallet-balances'
12branch = 'v2.0.0_release'
13version = '2.0.0'
14
15[dependencies.codec]
16default-features = false
17features = ['derive']
18package = 'parity-scale-codec'
19version = '1.3.0'
20
21[dependencies.contracts]
22git = 'https://github.com/usetech-llc/substrate.git'
23default-features = false
24package = 'pallet-contracts'
25branch = 'v2.0.0_release'
26version = '2.0.0'
27
28[dependencies.contracts-primitives]
29git = 'https://github.com/usetech-llc/substrate.git'
30default-features = false
31package = 'pallet-contracts-primitives'
32branch = 'v2.0.0_release'
33version = '2.0.0'
34
35[dependencies.contracts-rpc-runtime-api]
36git = 'https://github.com/usetech-llc/substrate.git'
37default-features = false
38package = 'pallet-contracts-rpc-runtime-api'
39version = '0.8.0'
40branch = 'v2.0.0_release'
41
42[dependencies.frame-executive]
43default-features = false
44git = 'https://github.com/usetech-llc/substrate.git'
45branch = 'v2.0.0_release'
46version = '2.0.0'
47
48[dependencies.frame-support]
49default-features = false
50git = 'https://github.com/usetech-llc/substrate.git'
51branch = 'v2.0.0_release'
52version = '2.0.0'
53
54[dependencies.grandpa]
55default-features = false
56git = 'https://github.com/usetech-llc/substrate.git'
57package = 'pallet-grandpa'
58branch = 'v2.0.0_release'
59version = '2.0.0'
60
61[dependencies.randomness-collective-flip]
62default-features = false
63git = 'https://github.com/usetech-llc/substrate.git'
64package = 'pallet-randomness-collective-flip'
65branch = 'v2.0.0_release'
66version = '2.0.0'
67
68[dependencies.serde]
69features = ['derive']
70optional = true
71version = '1.0.101'
72
73[dependencies.sp-api]
74default-features = false
75git = 'https://github.com/usetech-llc/substrate.git'
76branch = 'v2.0.0_release'
77version = '2.0.0'
78
79[dependencies.sp-block-builder]
80default-features = false
81git = 'https://github.com/usetech-llc/substrate.git'
82branch = 'v2.0.0_release'
83version = '2.0.0'
84
85[dependencies.sp-consensus-aura]
86default-features = false
87git = 'https://github.com/usetech-llc/substrate.git'
88branch = 'v2.0.0_release'
89version = '0.8.0'
90
91[dependencies.sp-core]
92default-features = false
93git = 'https://github.com/usetech-llc/substrate.git'
94branch = 'v2.0.0_release'
95version = '2.0.0'
96
97[dependencies.sp-inherents]
98default-features = false
99git = 'https://github.com/usetech-llc/substrate.git'
100branch = 'v2.0.0_release'
101version = '2.0.0'
102
103[dependencies.sp-offchain]
104default-features = false
105git = 'https://github.com/usetech-llc/substrate.git'
106branch = 'v2.0.0_release'
107version = '2.0.0'
108
109[dependencies.sp-runtime]
110default-features = false
111git = 'https://github.com/usetech-llc/substrate.git'
112branch = 'v2.0.0_release'
113version = '2.0.0'
114
115[dependencies.sp-session]
116default-features = false
117git = 'https://github.com/usetech-llc/substrate.git'
118branch = 'v2.0.0_release'
119version = '2.0.0'
120
121[dependencies.sp-std]
122default-features = false
123git = 'https://github.com/usetech-llc/substrate.git'
124branch = 'v2.0.0_release'
125version = '2.0.0'
126
127[dependencies.sp-transaction-pool]
128default-features = false
129git = 'https://github.com/usetech-llc/substrate.git'
130branch = 'v2.0.0_release'
131version = '2.0.0'
132
133[dependencies.sp-version]
134default-features = false
135git = 'https://github.com/usetech-llc/substrate.git'
136branch = 'v2.0.0_release'
137version = '2.0.0'
138
139[dependencies.sudo]
140default-features = false
141git = 'https://github.com/usetech-llc/substrate.git'
142package = 'pallet-sudo'
143branch = 'v2.0.0_release'
144version = '2.0.0'
145
146[dependencies.system]
147default-features = false
148git = 'https://github.com/usetech-llc/substrate.git'
149package = 'frame-system'
150branch = 'v2.0.0_release'
151version = '2.0.0'
152
153[dependencies.nft]
154default-features = false
155package = 'pallet-nft'
156path = '../pallets/nft'
157version = '2.0.0'
158
159[dependencies.timestamp]
160default-features = false
161git = 'https://github.com/usetech-llc/substrate.git'
162package = 'pallet-timestamp'
163branch = 'v2.0.0_release'
164version = '2.0.0'
165
166[dependencies.transaction-payment]
167default-features = false
168git = 'https://github.com/usetech-llc/substrate.git'
169package = 'pallet-transaction-payment'
170branch = 'v2.0.0_release'
171version = '2.0.0'
172
173[dependencies.frame-system-rpc-runtime-api]
174default-features = false
175git = 'https://github.com/usetech-llc/substrate.git'
176version = '2.0.0'
177branch = 'v2.0.0_release'
178
179[dependencies.transaction-payment-rpc-runtime-api]
180default-features = false
181git = 'https://github.com/usetech-llc/substrate.git'
182package = 'pallet-transaction-payment-rpc-runtime-api'
183version = '2.0.0'
184branch = 'v2.0.0_release'
185
186[build-dependencies.wasm-builder-runner]
187git = 'https://github.com/usetech-llc/substrate.git'
188package = 'substrate-wasm-builder-runner'
189version = '1.0.5'
190branch = 'v2.0.0_release'
191
192[package]1[package]
193authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']2authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
201[package.metadata.docs.rs]10[package.metadata.docs.rs]
202targets = ['x86_64-unknown-linux-gnu']11targets = ['x86_64-unknown-linux-gnu']
12
13[build-dependencies]
14wasm-builder-runner = { package = 'substrate-wasm-builder-runner', version = '1.0.5' }
15
16# alias "parity-scale-code" to "codec"
17[dependencies.codec]
18default-features = false
19features = ['derive']
20package = 'parity-scale-codec'
21version = '1.3.4'
22
23[dependencies]
24hex-literal = { optional = true, version = '0.3.1' }
25serde = { features = ['derive'], optional = true, version = '1.0.101' }
26
27# local dependencies
28pallet-nft = { path = '../pallets/nft', default-features = false, version = '2.0.0' }
29
30# Substrate dependencies
31frame-benchmarking = { default-features = false, optional = true, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
32frame-executive = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
33frame-support = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
34frame-system = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
35frame-system-benchmarking = { default-features = false, optional = true, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
36frame-system-rpc-runtime-api = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
37pallet-aura = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
38pallet-balances = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
39pallet-contracts = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
40pallet-contracts-primitives = { default-features = false, version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
41pallet-contracts-rpc-runtime-api = { default-features = false, version = '0.8.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
42pallet-grandpa = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
43pallet-randomness-collective-flip = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
44pallet-sudo = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
45pallet-timestamp = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
46pallet-transaction-payment = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
47pallet-transaction-payment-rpc-runtime-api = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
48sp-api = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
49sp-block-builder = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
50sp-consensus-aura = { default-features = false, version = '0.8.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
51sp-core = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
52sp-inherents = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
53sp-offchain = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
54sp-runtime = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
55sp-session = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
56sp-std = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
57sp-transaction-pool = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
58sp-version = { default-features = false, version = '2.0.0' , git = 'https://github.com/usetech-llc/substrate.git', branch = 'v2.0.0_release' }
20359
204[features]60[features]
205default = ['std']61default = ['std']
62runtime-benchmarks = [
63 'hex-literal',
64 'frame-benchmarking',
65 'frame-support/runtime-benchmarks',
66 'frame-system-benchmarking',
67 'frame-system/runtime-benchmarks',
68 'pallet-balances/runtime-benchmarks',
69 'pallet-timestamp/runtime-benchmarks',
70 'pallet-nft/runtime-benchmarks',
71 'sp-runtime/runtime-benchmarks',
72]
206std = [73std = [
207 'aura/std',
208 'balances/std',
209 'codec/std',74 'codec/std',
210 'contracts/std',75 'serde',
211 'contracts-primitives/std',
212 'contracts-rpc-runtime-api/std',
213 'frame-executive/std',76 'frame-executive/std',
214 'frame-support/std',77 'frame-support/std',
78 'frame-system/std',
215 'frame-system-rpc-runtime-api/std',79 'frame-system-rpc-runtime-api/std',
80 'pallet-aura/std',
81 'pallet-balances/std',
82 'pallet-contracts/std',
83 'pallet-contracts-primitives/std',
84 'pallet-contracts-rpc-runtime-api/std',
216 'grandpa/std',85 'pallet-grandpa/std',
217 'randomness-collective-flip/std',86 'pallet-randomness-collective-flip/std',
218 'serde',87 'pallet-sudo/std',
88 'pallet-timestamp/std',
89 'pallet-transaction-payment/std',
90 'pallet-transaction-payment-rpc-runtime-api/std',
91 'pallet-nft/std',
219 'sp-api/std',92 'sp-api/std',
220 'sp-block-builder/std',93 'sp-block-builder/std',
221 'sp-consensus-aura/std',94 'sp-consensus-aura/std',
227 'sp-std/std',100 'sp-std/std',
228 'sp-transaction-pool/std',101 'sp-transaction-pool/std',
229 'sp-version/std',102 'sp-version/std',
230 'sudo/std',
231 'system/std',
232 'timestamp/std',
233 'transaction-payment/std',
234 'transaction-payment-rpc-runtime-api/std',
235 'nft/std',
236]103]
237104
modifiedruntime/build.rsdiffbeforeafterboth
3fn main() {3fn main() {
4 WasmBuilder::new()4 WasmBuilder::new()
5 .with_current_project()5 .with_current_project()
6 .with_wasm_builder_from_crates("1.0.11")6 .with_wasm_builder_from_crates("2.0.0")
7 .export_heap_base()7 .export_heap_base()
8 .import_memory()8 .import_memory()
9 .build()9 .build()
modifiedruntime/src/lib.rsdiffbeforeafterboth
8#[cfg(feature = "std")]8#[cfg(feature = "std")]
9include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));9include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
1010
11use contracts_rpc_runtime_api::ContractExecResult;11use pallet_contracts_rpc_runtime_api::ContractExecResult;
12use grandpa::fg_primitives;12use pallet_grandpa::fg_primitives;
13use grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};13use pallet_grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
14use sp_api::impl_runtime_apis;14use sp_api::impl_runtime_apis;
15use sp_consensus_aura::sr25519::AuthorityId as AuraId;15use sp_consensus_aura::sr25519::AuthorityId as AuraId;
16use sp_core::{crypto::KeyTypeId, OpaqueMetadata};16use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
29use sp_version::RuntimeVersion;29use sp_version::RuntimeVersion;
3030
31// A few exports that help ease life for downstream crates.31// A few exports that help ease life for downstream crates.
32pub use balances::Call as BalancesCall;32pub use pallet_balances::Call as BalancesCall;
33pub use contracts::Schedule as ContractsSchedule;33pub use pallet_contracts::Schedule as ContractsSchedule;
34pub use frame_support::{34pub use frame_support::{
35 construct_runtime,35 construct_runtime,
36 dispatch::DispatchResult,36 dispatch::DispatchResult,
49#[cfg(any(feature = "std", test))]49#[cfg(any(feature = "std", test))]
50pub use sp_runtime::BuildStorage;50pub use sp_runtime::BuildStorage;
51use sp_runtime::Perbill;51use sp_runtime::Perbill;
52use system::{self as system};52use frame_system::{self as system};
5353
54pub use timestamp::Call as TimestampCall;54pub use pallet_timestamp::Call as TimestampCall;
5555
56/// Re-export a nft pallet56/// Re-export a nft pallet
57/// TODO: Check this re-export. Is this safe and good style?57/// TODO: Check this re-export. Is this safe and good style?
58extern crate nft;58extern crate pallet_nft;
59pub use nft::*;59pub use pallet_nft::*;
6060
61/// An index to a block.61/// An index to a block.
62pub type BlockNumber = u32;62pub type BlockNumber = u32;
84/// Digest item type.84/// Digest item type.
85pub type DigestItem = generic::DigestItem<Hash>;85pub type DigestItem = generic::DigestItem<Hash>;
86
87mod nft_weights;
8688
87/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know89/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
88/// the specifics of the runtime. They can then be made to be agnostic over specific formats90/// the specifics of the runtime. They can then be made to be agnostic over specific formats
201 /// What to do if an account is fully reaped from the system.203 /// What to do if an account is fully reaped from the system.
202 type OnKilledAccount = ();204 type OnKilledAccount = ();
203 /// The data to be stored in an account.205 /// The data to be stored in an account.
204 type AccountData = balances::AccountData<Balance>;206 type AccountData = pallet_balances::AccountData<Balance>;
205 /// Weight information for the extrinsics of this pallet.207 /// Weight information for the extrinsics of this pallet.
206 type SystemWeightInfo = ();208 type SystemWeightInfo = ();
207}209}
208210
209impl aura::Trait for Runtime {211impl pallet_aura::Trait for Runtime {
210 type AuthorityId = AuraId;212 type AuthorityId = AuraId;
211}213}
212214
213impl grandpa::Trait for Runtime {215impl pallet_grandpa::Trait for Runtime {
214 type Event = Event;216 type Event = Event;
215 type Call = Call;217 type Call = Call;
216218
233 pub const MinimumPeriod: u64 = SLOT_DURATION / 2;235 pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
234}236}
235237
236impl timestamp::Trait for Runtime {238impl pallet_timestamp::Trait for Runtime {
237 /// A timestamp: milliseconds since the unix epoch.239 /// A timestamp: milliseconds since the unix epoch.
238 type Moment = u64;240 type Moment = u64;
239 type OnTimestampSet = Aura;241 type OnTimestampSet = Aura;
247 pub const MaxLocks: u32 = 50;249 pub const MaxLocks: u32 = 50;
248}250}
249251
250impl balances::Trait for Runtime {252impl pallet_balances::Trait for Runtime {
251 type MaxLocks = MaxLocks;253 type MaxLocks = MaxLocks;
252 /// The type for recording an account's balance.254 /// The type for recording an account's balance.
253 type Balance = Balance;255 type Balance = Balance;
270 pub const SurchargeReward: Balance = 150 * MILLICENTS;272 pub const SurchargeReward: Balance = 150 * MILLICENTS;
271}273}
272274
273impl contracts::Trait for Runtime {275impl pallet_contracts::Trait for Runtime {
274 type Time = Timestamp;276 type Time = Timestamp;
275 type Randomness = RandomnessCollectiveFlip;277 type Randomness = RandomnessCollectiveFlip;
276 type Currency = Balances;278 type Currency = Balances;
277 type Event = Event;279 type Event = Event;
278 type DetermineContractAddress = contracts::SimpleAddressDeterminer<Runtime>;280 type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer<Runtime>;
279 type TrieIdGenerator = contracts::TrieIdFromParentCounter<Runtime>;281 type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter<Runtime>;
280 type RentPayment = ();282 type RentPayment = ();
281 type SignedClaimHandicap = contracts::DefaultSignedClaimHandicap;283 type SignedClaimHandicap = pallet_contracts::DefaultSignedClaimHandicap;
282 type TombstoneDeposit = TombstoneDeposit;284 type TombstoneDeposit = TombstoneDeposit;
283 type StorageSizeOffset = contracts::DefaultStorageSizeOffset;285 type StorageSizeOffset = pallet_contracts::DefaultStorageSizeOffset;
284 type RentByteFee = RentByteFee;286 type RentByteFee = RentByteFee;
285 type RentDepositOffset = RentDepositOffset;287 type RentDepositOffset = RentDepositOffset;
286 type SurchargeReward = SurchargeReward;288 type SurchargeReward = SurchargeReward;
287 type MaxDepth = contracts::DefaultMaxDepth;289 type MaxDepth = pallet_contracts::DefaultMaxDepth;
288 type MaxValueSize = contracts::DefaultMaxValueSize;290 type MaxValueSize = pallet_contracts::DefaultMaxValueSize;
289 type WeightPrice = transaction_payment::Module<Self>;291 type WeightPrice = pallet_transaction_payment::Module<Self>;
290}292}
291293
292parameter_types! {294parameter_types! {
293 pub const TransactionByteFee: Balance = 1;295 pub const TransactionByteFee: Balance = 10 * MILLICENTS;
294}296}
295297
296impl transaction_payment::Trait for Runtime {298impl pallet_transaction_payment::Trait for Runtime {
297 type Currency = balances::Module<Runtime>;299 type Currency = pallet_balances::Module<Runtime>;
298 type OnTransactionPayment = ();300 type OnTransactionPayment = ();
299 type TransactionByteFee = TransactionByteFee;301 type TransactionByteFee = TransactionByteFee;
300 type WeightToFee = IdentityFee<Balance>;302 type WeightToFee = IdentityFee<Balance>;
301 type FeeMultiplierUpdate = ();303 type FeeMultiplierUpdate = ();
302}304}
303305
304impl sudo::Trait for Runtime {306impl pallet_sudo::Trait for Runtime {
305 type Event = Event;307 type Event = Event;
306 type Call = Call;308 type Call = Call;
307}309}
308310
309/// Used for the module nft in `./nft.rs`311/// Used for the module nft in `./nft.rs`
310impl nft::Trait for Runtime {312impl pallet_nft::Trait for Runtime {
311 type Event = Event;313 type Event = Event;
314 type WeightInfo = nft_weights::WeightInfo;
312}315}
313316
314construct_runtime!(317construct_runtime!(
318 UncheckedExtrinsic = UncheckedExtrinsic321 UncheckedExtrinsic = UncheckedExtrinsic
319 {322 {
320 System: system::{Module, Call, Config, Storage, Event<T>},323 System: system::{Module, Call, Config, Storage, Event<T>},
321 RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},324 RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
322 Contracts: contracts::{Module, Call, Config, Storage, Event<T>},325 Contracts: pallet_contracts::{Module, Call, Config, Storage, Event<T>},
323 Timestamp: timestamp::{Module, Call, Storage, Inherent},326 Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
324 Aura: aura::{Module, Config<T>, Inherent},327 Aura: pallet_aura::{Module, Config<T>, Inherent},
325 Grandpa: grandpa::{Module, Call, Storage, Config, Event},328 Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
326 Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},329 Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
327 TransactionPayment: transaction_payment::{Module, Storage},330 TransactionPayment: pallet_transaction_payment::{Module, Storage},
328 Sudo: sudo::{Module, Call, Config<T>, Storage, Event<T>},331 Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
329 Nft: nft::{Module, Call, Config<T>, Storage, Event<T>},332 Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},
330 }333 }
331);334);
332335
348 system::CheckEra<Runtime>,351 system::CheckEra<Runtime>,
349 system::CheckNonce<Runtime>,352 system::CheckNonce<Runtime>,
350 system::CheckWeight<Runtime>,353 system::CheckWeight<Runtime>,
351 nft::ChargeTransactionPayment<Runtime>,354 pallet_nft::ChargeTransactionPayment<Runtime>,
352);355);
353/// Unchecked extrinsic type as expected by this runtime.356/// Unchecked extrinsic type as expected by this runtime.
354pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;357pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
360363
361impl_runtime_apis! {364impl_runtime_apis! {
362365
363 impl contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>366 impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber>
364 for Runtime367 for Runtime
365 {368 {
366 fn call(369 fn call(
385 fn get_storage(388 fn get_storage(
386 address: AccountId,389 address: AccountId,
387 key: [u8; 32],390 key: [u8; 32],
388 ) -> contracts_primitives::GetStorageResult {391 ) -> pallet_contracts_primitives::GetStorageResult {
389 Contracts::get_storage(address, key)392 Contracts::get_storage(address, key)
390 }393 }
391394
392 fn rent_projection(395 fn rent_projection(
393 address: AccountId,396 address: AccountId,
394 ) -> contracts_primitives::RentProjectionResult<BlockNumber> {397 ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {
395 Contracts::rent_projection(address)398 Contracts::rent_projection(address)
396 }399 }
397 }400 }
510 }513 }
511 }514 }
512515
513 impl transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {516 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {
514 fn query_info(517 fn query_info(
515 uxt: <Block as BlockT>::Extrinsic,518 uxt: <Block as BlockT>::Extrinsic,
516 len: u32,519 len: u32,
517 ) -> transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {520 ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {
518 TransactionPayment::query_info(uxt, len)521 TransactionPayment::query_info(uxt, len)
519 }522 }
520 }523 }
521524
525 #[cfg(feature = "runtime-benchmarks")]
526 impl frame_benchmarking::Benchmark<Block> for Runtime {
527 fn dispatch_benchmark(
528 config: frame_benchmarking::BenchmarkConfig
529 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
530 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
531
532 let whitelist: Vec<TrackedStorageKey> = vec![
533 // Alice account
534 hex_literal::hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d").to_vec().into(),
535 // // Total Issuance
536 // hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),
537 // // Execution Phase
538 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),
539 // // Event Count
540 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),
541 // // System Events
542 // hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
543 ];
544
545 let mut batches = Vec::<BenchmarkBatch>::new();
546 let params = (&config, &whitelist);
547
548 add_benchmark!(params, batches, pallet_nft, Nft);
549
550 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
551 Ok(batches)
552 }
553 }
522}554}
523555
addedruntime/src/nft_weights.rsdiffbeforeafterboth

no changes