diff --git a/Cargo.lock b/Cargo.lock index 014f3618..4d949c70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -108,6 +108,203 @@ dependencies = [ "num-traits", ] +[[package]] +name = "aquamarine" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +dependencies = [ + "include_dir", + "itertools", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-scale" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51bd73bb6ddb72630987d37fa963e99196896c0d0ea81b7c894567e74a2f83af" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ark-secret-scalar" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + [[package]] name = "array-bytes" version = "6.1.0" @@ -164,6 +361,27 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.1" +source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-serialize", + "ark-std", + "dleq_vrf", + "fflonk", + "merlin 3.0.0", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "ring", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "base16ct" version = "0.2.0" @@ -288,9 +506,12 @@ dependencies = [ [[package]] name = "bs58" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] [[package]] name = "bumpalo" @@ -364,6 +585,27 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "common" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof#edd1e90b847e560bf60fc2e8712235ccfa11a9a9" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "merlin 3.0.0", + "rand_chacha 0.3.1", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "const-oid" version = "0.9.5" @@ -396,6 +638,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "constcat" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" + [[package]] name = "core-foundation-sys" version = "0.8.4" @@ -512,6 +760,34 @@ dependencies = [ "zeroize", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "der" version = "0.7.8" @@ -522,6 +798,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive-syn-parse" version = "0.1.5" @@ -574,6 +861,50 @@ dependencies = [ "subtle", ] +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-scale", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.4", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "docify" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4235e9b248e2ba4b92007fe9c646f3adf0ffde16dc74713eacc92b8bc58d8d2f" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47020e12d7c7505670d1363dd53d6c23724f71a90a3ae32ff8eba40de8404626" +dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.38", + "termcolor", + "toml", + "walkdir", +] + [[package]] name = "dyn-clonable" version = "0.9.0" @@ -611,28 +942,30 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature 2.1.0", + "signature", "spki", ] [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "signature 1.6.4", + "pkcs8", + "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.1", "ed25519", - "sha2 0.9.9", + "serde", + "sha2 0.10.8", "zeroize", ] @@ -732,6 +1065,25 @@ dependencies = [ "subtle", ] +[[package]] +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#e141d4b6f42fb481aefe1b479788694945b6940d" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin 3.0.0", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a481586acf778f1b1455424c343f71124b048ffa5f4fc3f8f6ae9dc432dcb3c7" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -756,7 +1108,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "frame-support", "frame-support-procedural", @@ -793,9 +1145,11 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ + "aquamarine", "bitflags 1.3.2", + "docify", "environmental", "frame-metadata", "frame-support-procedural", @@ -807,27 +1161,31 @@ dependencies = [ "paste", "scale-info", "serde", + "serde_json", "smallvec", "sp-api", "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", "sp-debug-derive", + "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-metadata-ir", "sp-runtime", "sp-staking", "sp-state-machine", "sp-std", "sp-tracing", "sp-weights", + "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "Inflector", "cfg-expr", @@ -839,13 +1197,14 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", + "sp-core-hashing", "syn 2.0.38", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -857,7 +1216,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "proc-macro2", "quote", @@ -867,7 +1226,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "cfg-if", "frame-support", @@ -1208,6 +1567,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1421,9 +1799,9 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" dependencies = [ "macro_magic_core", "macro_magic_macros", @@ -1433,9 +1811,9 @@ dependencies = [ [[package]] name = "macro_magic_core" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" dependencies = [ "const-random", "derive-syn-parse", @@ -1447,9 +1825,9 @@ dependencies = [ [[package]] name = "macro_magic_core_macros" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d710e1214dffbab3b5dacb21475dde7d6ed84c69ff722b3a47a782668d44fbac" +checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", @@ -1458,9 +1836,9 @@ dependencies = [ [[package]] name = "macro_magic_macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", @@ -1531,6 +1909,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1573,6 +1963,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-complex" version = "0.4.4" @@ -1698,7 +2099,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "frame-benchmarking", "frame-support", @@ -1849,13 +2250,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", + "sp-std", ] [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -1866,13 +2269,14 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "sp-storage", "sp-timestamp", ] [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "frame-benchmarking", "frame-support", @@ -1992,6 +2396,12 @@ dependencies = [ "spki", ] +[[package]] +name = "platforms" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2021,11 +2431,35 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro-warning" -version = "0.4.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" dependencies = [ "proc-macro2", "quote", @@ -2225,6 +2659,22 @@ dependencies = [ "subtle", ] +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof#edd1e90b847e560bf60fc2e8712235ccfa11a9a9" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "blake2", + "common", + "fflonk", + "merlin 3.0.0", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -2243,6 +2693,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "0.36.17" @@ -2291,6 +2750,15 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scale-info" version = "2.10.0" @@ -2338,7 +2806,7 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.3", "getrandom 0.1.16", - "merlin", + "merlin 2.0.1", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", @@ -2393,6 +2861,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" + [[package]] name = "serde" version = "1.0.190" @@ -2424,6 +2898,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + [[package]] name = "sha2" version = "0.8.2" @@ -2479,12 +2962,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - [[package]] name = "signature" version = "2.1.0" @@ -2526,7 +3003,7 @@ checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "hash-db", "log", @@ -2547,7 +3024,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "Inflector", "blake2", @@ -2561,7 +3038,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "parity-scale-codec", "scale-info", @@ -2574,7 +3051,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "16.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "integer-sqrt", "num-traits", @@ -2588,9 +3065,10 @@ dependencies = [ [[package]] name = "sp-core" version = "21.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "array-bytes", + "bandersnatch_vrfs", "bitflags 1.3.2", "blake2", "bounded-collections", @@ -2604,7 +3082,7 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "merlin", + "merlin 2.0.1", "parity-scale-codec", "parking_lot", "paste", @@ -2627,13 +3105,14 @@ dependencies = [ "thiserror", "tiny-bip39", "tracing", + "w3f-bls", "zeroize", ] [[package]] name = "sp-core-hashing" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "blake2b_simd", "byteorder", @@ -2646,7 +3125,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "quote", "sp-core-hashing", @@ -2656,7 +3135,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "proc-macro2", "quote", @@ -2666,7 +3145,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.19.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "environmental", "parity-scale-codec", @@ -2674,10 +3153,21 @@ dependencies = [ "sp-storage", ] +[[package]] +name = "sp-genesis-builder" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" +dependencies = [ + "serde_json", + "sp-api", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -2691,10 +3181,9 @@ dependencies = [ [[package]] name = "sp-io" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "bytes", - "ed25519", "ed25519-dalek", "libsecp256k1", "log", @@ -2716,7 +3205,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.27.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "parity-scale-codec", "parking_lot", @@ -2728,7 +3217,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -2739,7 +3228,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "backtrace", "lazy_static", @@ -2749,7 +3238,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "either", "hash256-std-hasher", @@ -2771,7 +3260,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "17.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -2789,7 +3278,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "Inflector", "proc-macro-crate", @@ -2801,7 +3290,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -2815,7 +3304,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.28.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "hash-db", "log", @@ -2836,12 +3325,12 @@ dependencies = [ [[package]] name = "sp-std" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" [[package]] name = "sp-storage" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "impl-serde", "parity-scale-codec", @@ -2854,7 +3343,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "async-trait", "parity-scale-codec", @@ -2867,7 +3356,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "10.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "parity-scale-codec", "sp-std", @@ -2879,7 +3368,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "ahash 0.8.6", "hash-db", @@ -2889,6 +3378,7 @@ dependencies = [ "nohash-hasher", "parity-scale-codec", "parking_lot", + "rand 0.8.5", "scale-info", "schnellru", "sp-core", @@ -2902,7 +3392,7 @@ dependencies = [ [[package]] name = "sp-version" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "impl-serde", "parity-scale-codec", @@ -2919,7 +3409,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -2930,7 +3420,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "14.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -2943,7 +3433,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "20.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=v1.3.0-rc1#7c9fd83805cc446983a7698c7a3281677cf655c8" dependencies = [ "parity-scale-codec", "scale-info", @@ -3045,6 +3535,15 @@ version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +[[package]] +name = "termcolor" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.50" @@ -3118,11 +3617,26 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -3131,6 +3645,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.2", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -3212,9 +3728,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" +checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" dependencies = [ "hash-db", "hashbrown 0.13.2", @@ -3318,6 +3834,40 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "w3f-bls" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +dependencies = [ + "ark-bls12-377", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-serialize-derive", + "arrayref", + "constcat", + "digest 0.10.7", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.8", + "sha3", + "thiserror", + "zeroize", +] + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -3552,6 +4102,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/README.md b/README.md index 2959cf0d..5627ceea 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ An index is a short and easy-to-remember version of an address. Claiming an inde The Recovery pallet is an M-of-N social recovery tool for users to gain access to their accounts if the private key or other authentication mechanism is lost. Through this pallet, a user is able to make calls on-behalf-of another account which they have recovered. The recovery process is protected by trusted "friends" whom the original account owner chooses. A threshold (M) out of N friends are needed to give another account access to the recoverable account. -#### [Uniques (NFTs)](https://github.com/paritytech/substrate/tree/master/frame/uniques) +#### [Uniques (NFTs)](https://github.com/paritytech/polkadot-sdk/tree/master/frame/uniques) A simple, secure module for dealing with non-fungible assets. @@ -235,7 +235,7 @@ the following: ### Pallets The runtime in this project is constructed using many FRAME pallets that ship with the -[core Substrate repository](https://github.com/paritytech/substrate/tree/master/frame) and a +[core Substrate repository](https://github.com/paritytech/polkadot-sdk/tree/master/frame) and a template pallet that is [defined in the `pallets`](./pallets/template/src/lib.rs) directory. A FRAME pallet is compromised of a number of blockchain primitives: diff --git a/docs/learning-path.md b/docs/learning-path.md index f80e998f..e972e9f0 100644 --- a/docs/learning-path.md +++ b/docs/learning-path.md @@ -65,7 +65,7 @@ Now that you have an idea for the environment, dive deeper into both the Rust tr - [PolkaWallet Flutter SDK](https://github.com/polkawallet-io/sdk) - [Front End template](https://github.com/substrate-developer-hub/substrate-front-end-template) from Parity -2. Review tooling for data caching and query -[Useful API sidecar](https://github.com/paritytech/substrate-api-sidecar) from Parity -[Awesome Substrate tools section](https://substrate.io/ecosystem/resources/awesome-substrate/#tools) +2. Review tooling for data caching and query -[Useful API sidecar](https://github.com/paritytech/polkadot-sdk-api-sidecar) from Parity -[Awesome Substrate tools section](https://substrate.io/ecosystem/resources/awesome-substrate/#tools) ### Tools and Tips diff --git a/docs/pallets-review/fruniques.md b/docs/pallets-review/fruniques.md index ec425565..af71165b 100644 --- a/docs/pallets-review/fruniques.md +++ b/docs/pallets-review/fruniques.md @@ -2,34 +2,34 @@ ## Spawn mechanism -Taken from #1 +Taken from #1 `Fruniques` is a stateful pallet. It needs to store additional data to maintain various relationships and state. We need to design/build the data structure for this additional state, as described below. There are a few NFT protocols in the Polkadot ecosystem: https://wiki.polkadot.network/docs/learn-nft -Of these, we should build to the [`Uniques` ](https://wiki.polkadot.network/docs/learn-nft#uniques) patterns. It is the implementation from Parity and I believe the most recent. It is the only one compatible with Statemint/Statemine. We can build to multiple protocols if it makes sense, but let's start with `Uniques`. +Of these, we should build to the [`Uniques` ](https://wiki.polkadot.network/docs/learn-nft#uniques) patterns. It is the implementation from Parity and I believe the most recent. It is the only one compatible with Statemint/Statemine. We can build to multiple protocols if it makes sense, but let's start with `Uniques`. -In addition to a regular `Unique`, a [`Frunique`](https://hashed.systems/hashed-chain) needs to store a reference to the parent, a different `Unique`. There also needs to be a heuristic for specifying if metadata is inherited from the parent or not. It seems like Metadata is a set of Key:Value pairs that can be assigned at the `class` level (a group or collection of NFTs) and at the `instance` level (a single NFT). +In addition to a regular `Unique`, a [`Frunique`](https://hashed.systems/hashed-chain) needs to store a reference to the parent, a different `Unique`. There also needs to be a heuristic for specifying if metadata is inherited from the parent or not. It seems like Metadata is a set of Key:Value pairs that can be assigned at the `class` level (a group or collection of NFTs) and at the `instance` level (a single NFT). -Here's the function `set_attribute`: -https://github.com/paritytech/substrate/blob/master/frame/uniques/src/lib.rs#L959 +Here's the function `set_attribute`: +https://github.com/paritytech/polkadot-sdk/blob/master/frame/uniques/src/lib.rs#L959 -Let's map the cannabis lifecycle. +Let's map the cannabis lifecycle. > NOTE: the cannabis use case may be able to be implemented with a lighter weight protocol, but it seems like it might be handy to use the same structure -1. Seeds come from a vendor as a package with a count, e.g. 100 seeds in a bag. This bag is an `InstanceId` even though it actually contains 100 seeds. +1. Seeds come from a vendor as a package with a count, e.g. 100 seeds in a bag. This bag is an `InstanceId` even though it actually contains 100 seeds. 2. Seeds that germinate get cubed; others are scrapped. 3. When a seed is cubed, it receives its own `InstanceID` (I've been calling this a `spawn` function) for the first time. The count of seeds that did germinate should be tracked, but not individually, and they are scrapped. 4. Successful cubed seeds become mother plants; perhaps through some iteration or trial/error to discover most productive mother(s). 5. Mother plants produce clones (and may produce flower directly). -7. The parent-->child relationship is well represented as a [Directed Acyclic Graph](https://hazelcast.com/glossary/directed-acyclic-graph), which is what we are building on chain. +7. The parent-->child relationship is well represented as a [Directed Acyclic Graph](https://hazelcast.com/glossary/directed-acyclic-graph), which is what we are building on chain. 8. Clones may be sold directly to clone buyers. -7. Clones produce flower, measured in weight. When flower is harvested, the weight values of the material are recorded as continuous value. So the `InstanceId` would map this specific `bag of weed`, and there would also be a data element for weight. +7. Clones produce flower, measured in weight. When flower is harvested, the weight values of the material are recorded as continuous value. So the `InstanceId` would map this specific `bag of weed`, and there would also be a data element for weight. -The sum of this continuous value for all peers should always equal the continuous value of the parent. This is a critical feature that maintains the economic hierarchy of the NFTs. Tax credits can be subdivided based on this continuous value, but just like the weed, none can be lost or compromised along the way. This feature - the `NFT Rollup` enables many use cases. +The sum of this continuous value for all peers should always equal the continuous value of the parent. This is a critical feature that maintains the economic hierarchy of the NFTs. Tax credits can be subdivided based on this continuous value, but just like the weed, none can be lost or compromised along the way. This feature - the `NFT Rollup` enables many use cases. 9. Flower gets tested, and results are implied across that entire harvest/mother? The test results include a set of files and also a set of values. We need a structure to assign this data/metadata across the appropriate `InstanceIds`. -10. Flower is sold to dispensaries. +10. Flower is sold to dispensaries. - [ ] Research and prototype a pallet data storage mapping to hold the appropriate data to maintain the hierarchy and enforce the aggregation rules. diff --git a/pallets/afloat/Cargo.toml b/pallets/afloat/Cargo.toml index 6def8a88..e344d424 100644 --- a/pallets/afloat/Cargo.toml +++ b/pallets/afloat/Cargo.toml @@ -17,25 +17,26 @@ log = "0.4" codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } serde = { version = "1.0.140", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = [ - "derive" + "derive", ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false, optional = true } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +pallet-uniques = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } pallet-fruniques = { path = "../fruniques", default-features = false, version = "0.1.0-dev" } pallet-rbac = { path = "../rbac/", default-features = false, version = "4.0.0-dev" } pallet-gated-marketplace = { path = "../gated-marketplace/", default-features = false, version = "4.0.0-dev" } pallet-mapped-assets = { path = "../mapped-assets/", default-features = false, version = "4.0.0-dev" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } +sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } +sp-std = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } [features] default = ["std"] diff --git a/pallets/afloat/src/functions.rs b/pallets/afloat/src/functions.rs index c9711dcf..5b3fffde 100644 --- a/pallets/afloat/src/functions.rs +++ b/pallets/afloat/src/functions.rs @@ -7,9 +7,10 @@ use pallet_gated_marketplace::types::{Marketplace, MarketplaceRole}; use sp_runtime::{traits::StaticLookup, Permill}; // use frame_support::traits::OriginTrait; use core::convert::TryInto; -use frame_support::{sp_io::hashing::blake2_256, traits::Time}; +use frame_support::traits::Time; use pallet_rbac::types::{IdOrVec, RoleBasedAccessControl, RoleId}; use scale_info::prelude::vec; +use sp_io::hashing::blake2_256; use sp_runtime::{ sp_std::{str, vec::Vec}, traits::Zero, diff --git a/pallets/afloat/src/lib.rs b/pallets/afloat/src/lib.rs index 23cf5d40..d08de702 100644 --- a/pallets/afloat/src/lib.rs +++ b/pallets/afloat/src/lib.rs @@ -20,7 +20,7 @@ pub mod pallet { use frame_system::{pallet_prelude::*, RawOrigin}; use pallet_fruniques::types::{Attributes, CollectionDescription, FruniqueRole, ParentInfo}; use pallet_gated_marketplace::types::*; - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); use crate::types::*; use pallet_rbac::types::RoleBasedAccessControl; diff --git a/pallets/afloat/src/mock.rs b/pallets/afloat/src/mock.rs index be49cce7..a3c3696a 100644 --- a/pallets/afloat/src/mock.rs +++ b/pallets/afloat/src/mock.rs @@ -1,7 +1,7 @@ -use crate as pallet_afloat; +use crate::{self as pallet_afloat, types::InitialSetupArgs}; use frame_support::{ parameter_types, - traits::{AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Currency}, + traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, Currency}, }; use frame_system as system; use sp_core::H256; @@ -167,6 +167,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxHolds = (); type MaxFreezes = (); + type RuntimeFreezeReason = (); } parameter_types! { @@ -207,9 +208,13 @@ pub trait AssetsCallback { pub struct AssetsCallbackHandle; impl pallet_mapped_assets::AssetsCallback for AssetsCallbackHandle { - fn created(_id: &AssetId, _owner: &u64) -> Result<(), ()> {} + fn created(_id: &AssetId, _owner: &u64) -> Result<(), ()> { + Ok(()) + } - fn destroyed(_id: &AssetId) -> Result<(), ()> {} + fn destroyed(_id: &AssetId) -> Result<(), ()> { + Ok(()) + } } impl pallet_mapped_assets::Config for Test { diff --git a/pallets/afloat/src/types.rs b/pallets/afloat/src/types.rs index 8eb5d8c1..4b5dc017 100644 --- a/pallets/afloat/src/types.rs +++ b/pallets/afloat/src/types.rs @@ -1,6 +1,7 @@ use super::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256}; +use frame_support::pallet_prelude::*; use pallet_fruniques::types::FruniqueRole; +use sp_io::hashing::blake2_256; use sp_runtime::sp_std::vec::Vec; pub type ShortString = BoundedVec>; diff --git a/pallets/bitcoin-vaults/Cargo.toml b/pallets/bitcoin-vaults/Cargo.toml index 08811172..ff18ca2a 100644 --- a/pallets/bitcoin-vaults/Cargo.toml +++ b/pallets/bitcoin-vaults/Cargo.toml @@ -18,19 +18,19 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = serde = { version = "1.0.140", default-features = false, features = ["derive"] } lite-json = { version = "0.2", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = [ - "derive" + "derive", ] } -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } -sp-core = { version = "21.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-io = { version = "23.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-runtime = { version = "24.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-std = { version = "8.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false, optional = true } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false, optional = true } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [features] default = ["std"] diff --git a/pallets/bitcoin-vaults/src/functions.rs b/pallets/bitcoin-vaults/src/functions.rs index 613af6a3..de6546fe 100644 --- a/pallets/bitcoin-vaults/src/functions.rs +++ b/pallets/bitcoin-vaults/src/functions.rs @@ -1,6 +1,6 @@ use super::*; use crate::types::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256}; +use frame_support::pallet_prelude::*; use frame_system::{ offchain::{SendUnsignedTransaction, Signer}, pallet_prelude::BlockNumberFor, @@ -9,6 +9,7 @@ use lite_json::{ json::{JsonValue, NumberValue}, parse_json, Serialize as jsonSerialize, }; +use sp_io::hashing::blake2_256; use sp_runtime::{ offchain::{http, Duration}, sp_std::{str, vec::Vec}, diff --git a/pallets/bitcoin-vaults/src/lib.rs b/pallets/bitcoin-vaults/src/lib.rs index 4f80e0ab..6c66f641 100644 --- a/pallets/bitcoin-vaults/src/lib.rs +++ b/pallets/bitcoin-vaults/src/lib.rs @@ -20,11 +20,12 @@ pub mod pallet { //#[cfg(feature = "std")] //use frame_support::serde::{Deserialize, Serialize}; use crate::types::*; - use frame_support::{pallet_prelude::BoundedVec, sp_io::hashing::blake2_256, traits::Get}; + use frame_support::{pallet_prelude::BoundedVec, traits::Get}; use frame_system::{ offchain::{AppCrypto, CreateSignedTransaction, SignedPayload, Signer}, pallet_prelude::*, }; + use sp_io::hashing::blake2_256; use sp_runtime::{ offchain::{ storage_lock::{BlockAndTime, StorageLock}, @@ -34,9 +35,10 @@ pub mod pallet { transaction_validity::{InvalidTransaction, TransactionValidity, ValidTransaction}, }; - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); /* --- Genesis Structs Section --- */ + #[pallet::genesis_config] pub struct GenesisConfig { pub bdk_services_url: Vec, diff --git a/pallets/bitcoin-vaults/src/mock.rs b/pallets/bitcoin-vaults/src/mock.rs index d9b909f4..d37cd5ef 100644 --- a/pallets/bitcoin-vaults/src/mock.rs +++ b/pallets/bitcoin-vaults/src/mock.rs @@ -42,6 +42,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxHolds = (); type MaxFreezes = (); + type RuntimeFreezeReason = (); } parameter_types! { diff --git a/pallets/bitcoin-vaults/src/types.rs b/pallets/bitcoin-vaults/src/types.rs index 7eb20b73..3e247687 100644 --- a/pallets/bitcoin-vaults/src/types.rs +++ b/pallets/bitcoin-vaults/src/types.rs @@ -1,7 +1,8 @@ use super::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256}; +use frame_support::pallet_prelude::*; use frame_system::offchain::{SignedPayload, SigningTypes}; use sp_core::crypto::KeyTypeId; +use sp_io::hashing::blake2_256; use sp_runtime::sp_std::vec::Vec; pub type Description = BoundedVec::VaultDescriptionMaxLen>; diff --git a/pallets/confidential-docs/Cargo.toml b/pallets/confidential-docs/Cargo.toml index 8407bce9..c0dc16e0 100644 --- a/pallets/confidential-docs/Cargo.toml +++ b/pallets/confidential-docs/Cargo.toml @@ -15,16 +15,17 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = [ - "derive" + "derive", ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false, optional = true } +sp-io = { version = "23.0.0", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [features] default = ["std"] diff --git a/pallets/confidential-docs/src/functions.rs b/pallets/confidential-docs/src/functions.rs index 1d239d28..78dcbd20 100644 --- a/pallets/confidential-docs/src/functions.rs +++ b/pallets/confidential-docs/src/functions.rs @@ -1,5 +1,6 @@ use super::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256}; +use frame_support::pallet_prelude::*; +use sp_io::hashing::blake2_256; //use frame_system::pallet_prelude::*; use crate::types::*; diff --git a/pallets/confidential-docs/src/lib.rs b/pallets/confidential-docs/src/lib.rs index 2bdae371..a4d7c0b3 100644 --- a/pallets/confidential-docs/src/lib.rs +++ b/pallets/confidential-docs/src/lib.rs @@ -24,7 +24,7 @@ pub mod pallet { use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); #[pallet::config] pub trait Config: frame_system::Config { diff --git a/pallets/confidential-docs/src/tests.rs b/pallets/confidential-docs/src/tests.rs index 6e4c072d..7d5abbf8 100644 --- a/pallets/confidential-docs/src/tests.rs +++ b/pallets/confidential-docs/src/tests.rs @@ -1,7 +1,8 @@ use crate::{mock::*, types::*, Error, Event}; use codec::Encode; -use frame_support::{assert_noop, assert_ok, sp_io::hashing::blake2_256}; +use frame_support::{assert_noop, assert_ok}; use frame_system as system; +use sp_io::hashing::blake2_256; fn generate_user_id(id: &str) -> UserId { format!("user id: {}", id).using_encoded(blake2_256) diff --git a/pallets/fruniques/Cargo.toml b/pallets/fruniques/Cargo.toml index e6809d56..4a83df0c 100644 --- a/pallets/fruniques/Cargo.toml +++ b/pallets/fruniques/Cargo.toml @@ -16,19 +16,20 @@ targets = ["x86_64-unknown-linux-gnu"] log = { version = "0.4.17", default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { default-features = false, version = "2.5.0", features = [ - "derive" + "derive", ] } -frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } -sp-runtime = { version = "24.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-uniques = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +frame-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1", optional = true } +sp-runtime = { version = "24.0.0", default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +pallet-uniques = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +pallet-balances = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } pallet-rbac = { path = "../rbac/", default-features = false, version = "4.0.0-dev" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [dev-dependencies] -sp-core = { version = "21.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-io = { version = "23.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-core = { version = "21.0.0", default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +sp-io = { version = "23.0.0", default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } [features] default = ["std"] diff --git a/pallets/fruniques/src/functions.rs b/pallets/fruniques/src/functions.rs index 843fd403..a19a516f 100644 --- a/pallets/fruniques/src/functions.rs +++ b/pallets/fruniques/src/functions.rs @@ -1,9 +1,10 @@ use super::*; use crate::types::*; -use frame_support::{sp_io::hashing::blake2_256, traits::tokens::nonfungibles::Inspect}; +use frame_support::traits::tokens::nonfungibles::Inspect; use frame_system::pallet_prelude::*; use scale_info::prelude::string::String; +use sp_io::hashing::blake2_256; use pallet_rbac::types::*; diff --git a/pallets/fruniques/src/lib.rs b/pallets/fruniques/src/lib.rs index b862cfa1..30b1c3ea 100644 --- a/pallets/fruniques/src/lib.rs +++ b/pallets/fruniques/src/lib.rs @@ -24,7 +24,7 @@ pub mod pallet { // use frame_support::PalletId; - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); use pallet_rbac::types::RoleBasedAccessControl; /// Configure the pallet by specifying the parameters and types on which it depends. diff --git a/pallets/fruniques/src/mock.rs b/pallets/fruniques/src/mock.rs index 75f73bee..0201f318 100644 --- a/pallets/fruniques/src/mock.rs +++ b/pallets/fruniques/src/mock.rs @@ -106,6 +106,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxHolds = (); type MaxFreezes = (); + type RuntimeFreezeReason = (); } parameter_types! { diff --git a/pallets/fruniques/src/types.rs b/pallets/fruniques/src/types.rs index 93a2ea93..bc2ca6c5 100644 --- a/pallets/fruniques/src/types.rs +++ b/pallets/fruniques/src/types.rs @@ -2,7 +2,7 @@ use super::*; use frame_support::pallet_prelude::*; -use frame_support::sp_io::hashing::blake2_256; +use sp_io::hashing::blake2_256; use sp_runtime::{sp_std::vec::Vec, Permill}; pub type AttributeKey = BoundedVec::KeyLimit>; diff --git a/pallets/fund-admin-records/Cargo.toml b/pallets/fund-admin-records/Cargo.toml index a8353867..d24e30a9 100644 --- a/pallets/fund-admin-records/Cargo.toml +++ b/pallets/fund-admin-records/Cargo.toml @@ -16,17 +16,18 @@ targets = ["x86_64-unknown-linux-gnu"] log = "0.4" codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ - "derive" + "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-timestamp = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-support = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +frame-system = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1", optional = true } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +pallet-timestamp = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } [features] default = ["std"] @@ -36,7 +37,7 @@ std = [ "frame-support/std", "frame-system/std", "frame-benchmarking/std", - "pallet-timestamp/std" + "pallet-timestamp/std", ] runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/fund-admin-records/src/functions.rs b/pallets/fund-admin-records/src/functions.rs index 71617654..e8941cc6 100644 --- a/pallets/fund-admin-records/src/functions.rs +++ b/pallets/fund-admin-records/src/functions.rs @@ -1,5 +1,6 @@ use super::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256, traits::Time}; +use frame_support::{pallet_prelude::*, traits::Time}; +use sp_io::hashing::blake2_256; use crate::types::*; diff --git a/pallets/fund-admin-records/src/lib.rs b/pallets/fund-admin-records/src/lib.rs index d5490756..e065b242 100644 --- a/pallets/fund-admin-records/src/lib.rs +++ b/pallets/fund-admin-records/src/lib.rs @@ -21,7 +21,7 @@ pub mod pallet { use sp_runtime::traits::Scale; use crate::types::*; - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); #[pallet::config] pub trait Config: frame_system::Config { diff --git a/pallets/fund-admin-records/src/tests.rs b/pallets/fund-admin-records/src/tests.rs index af157994..39f0b886 100644 --- a/pallets/fund-admin-records/src/tests.rs +++ b/pallets/fund-admin-records/src/tests.rs @@ -1,5 +1,6 @@ use crate::{mock::*, types::*, Error, Records}; -use frame_support::{assert_noop, assert_ok, bounded_vec}; +use frame_support::{assert_noop, assert_ok}; +use sp_core::bounded_vec; fn make_project_id(v: &str) -> ProjectId { let v: ProjectId = v.as_bytes().to_vec().try_into().unwrap_or_default(); diff --git a/pallets/fund-admin/Cargo.toml b/pallets/fund-admin/Cargo.toml index f78e9bc3..9fe0a40c 100644 --- a/pallets/fund-admin/Cargo.toml +++ b/pallets/fund-admin/Cargo.toml @@ -16,19 +16,20 @@ targets = ["x86_64-unknown-linux-gnu"] log = "0.4" codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.0.1", default-features = false, features = [ - "derive" + "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-timestamp = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-support = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +frame-system = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1", optional = true } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +pallet-timestamp = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } pallet-rbac = { default-features = false, version = "4.0.0-dev", path = "../rbac/" } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } +sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.3.0-rc1" } [features] default = ["std"] diff --git a/pallets/fund-admin/src/functions.rs b/pallets/fund-admin/src/functions.rs index 5faf71f5..16d00168 100644 --- a/pallets/fund-admin/src/functions.rs +++ b/pallets/fund-admin/src/functions.rs @@ -1,5 +1,6 @@ use super::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256}; +use frame_support::{pallet_prelude::*}; +use sp_io::hashing::blake2_256; use scale_info::prelude::vec; use sp_runtime::sp_std::vec::Vec; // vec primitive // vec![] macro diff --git a/pallets/fund-admin/src/migration.rs b/pallets/fund-admin/src/migration.rs index 9adde220..2dc1ec66 100644 --- a/pallets/fund-admin/src/migration.rs +++ b/pallets/fund-admin/src/migration.rs @@ -3,8 +3,9 @@ use super::*; const LOG_TARGET: &str = "\nFund Admin pallet migration "; use crate::types::*; -use frame_support::{log, pallet_prelude::*, storage_alias, traits::OnRuntimeUpgrade, Identity}; -use sp_runtime::{sp_std::vec::Vec, Saturating}; +use frame_support::{pallet_prelude::*, storage_alias, traits::OnRuntimeUpgrade, Identity}; +use log; +use sp_runtime::Saturating; mod v0 { use super::*; diff --git a/pallets/fund-admin/src/mock.rs b/pallets/fund-admin/src/mock.rs index fe0f7611..1bac50bf 100644 --- a/pallets/fund-admin/src/mock.rs +++ b/pallets/fund-admin/src/mock.rs @@ -36,6 +36,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxHolds = (); type MaxFreezes = (); + type RuntimeFreezeReason = (); } parameter_types! { diff --git a/pallets/fund-admin/src/tests.rs b/pallets/fund-admin/src/tests.rs index c9d233f7..40283513 100644 --- a/pallets/fund-admin/src/tests.rs +++ b/pallets/fund-admin/src/tests.rs @@ -5,8 +5,18 @@ use crate::{ TransactionsByRevenue, TransactionsInfo, UsersByProject, UsersInfo, }; use frame_support::{ - assert_noop, assert_ok, bounded_vec, error::BadOrigin, traits::ConstU32, BoundedVec, + assert_noop, assert_ok, + error::BadOrigin, + traits::{ + tokens::{ + fungible::Mutate, + Preservation::{Expendable, Preserve, Protect}, + }, + ConstU32, + }, + BoundedVec, }; +use sp_core::bounded_vec; use sp_runtime::DispatchResult; type RbacErr = pallet_rbac::Error; @@ -644,12 +654,8 @@ fn balances_an_administrator_goes_out_of_balance_should_fail() { let admin_free_balance = Balances::free_balance(1); assert_eq!(admin_free_balance, InitialAdminBalance::get() - TransferAmount::get()); - Balances::transfer( - RuntimeOrigin::signed(1), - 2, - admin_free_balance - TransferAmount::get() / 2, - ) - .unwrap(); + Balances::transfer(&1, &2, admin_free_balance - TransferAmount::get() / 2, Expendable) + .unwrap(); assert_noop!( FundAdmin::users( @@ -684,7 +690,7 @@ fn balances_an_administrator_does_not_have_anough_free_balance_to_perform_a_user let admin_free_balance = Balances::free_balance(1); assert_eq!(admin_free_balance, InitialAdminBalance::get() - TransferAmount::get()); - Balances::transfer(RuntimeOrigin::signed(1), 2, admin_free_balance).unwrap(); + Balances::transfer(&1, &2, admin_free_balance, Expendable).unwrap(); assert_noop!( FundAdmin::users( diff --git a/pallets/fund-admin/src/types.rs b/pallets/fund-admin/src/types.rs index e95b3584..294f84fb 100644 --- a/pallets/fund-admin/src/types.rs +++ b/pallets/fund-admin/src/types.rs @@ -1,5 +1,6 @@ use super::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256}; +use frame_support::pallet_prelude::*; +use sp_io::hashing::blake2_256; use sp_runtime::sp_std::vec::Vec; pub type FieldName = BoundedVec>; diff --git a/pallets/gated-marketplace/Cargo.toml b/pallets/gated-marketplace/Cargo.toml index 024c5abe..061dfbce 100644 --- a/pallets/gated-marketplace/Cargo.toml +++ b/pallets/gated-marketplace/Cargo.toml @@ -17,23 +17,24 @@ log = "0.4" codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } serde = { version = "1.0.140", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = [ - "derive" + "derive", ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -pallet-uniques = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false, optional = true } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +pallet-uniques = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } pallet-fruniques = { path = "../fruniques", default-features = false, version = "0.1.0-dev" } pallet-rbac = { path = "../rbac/", default-features = false, version = "4.0.0-dev" } pallet-mapped-assets = { path = "../mapped-assets/", default-features = false, version = "4.0.0-dev" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [features] default = ["std"] @@ -49,7 +50,7 @@ std = [ "pallet-fruniques/std", "pallet-timestamp/std", "pallet-rbac/std", - "pallet-mapped-assets/std" + "pallet-mapped-assets/std", ] runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/gated-marketplace/src/functions.rs b/pallets/gated-marketplace/src/functions.rs index a97da208..04a496f0 100644 --- a/pallets/gated-marketplace/src/functions.rs +++ b/pallets/gated-marketplace/src/functions.rs @@ -1,6 +1,7 @@ use super::*; use crate::types::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256, traits::Time}; +use frame_support::{pallet_prelude::*, traits::Time}; +use sp_io::hashing::blake2_256; use frame_system::{pallet_prelude::*, RawOrigin}; use pallet_rbac::types::*; use scale_info::prelude::vec; // vec![] macro diff --git a/pallets/gated-marketplace/src/lib.rs b/pallets/gated-marketplace/src/lib.rs index 756fcd99..edca593b 100644 --- a/pallets/gated-marketplace/src/lib.rs +++ b/pallets/gated-marketplace/src/lib.rs @@ -20,7 +20,7 @@ pub mod pallet { use frame_system::pallet_prelude::*; use sp_runtime::{traits::Scale, Permill}; - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); use crate::types::*; use pallet_rbac::types::RoleBasedAccessControl; diff --git a/pallets/gated-marketplace/src/mock.rs b/pallets/gated-marketplace/src/mock.rs index 0ae7a47c..bc6e916f 100644 --- a/pallets/gated-marketplace/src/mock.rs +++ b/pallets/gated-marketplace/src/mock.rs @@ -158,6 +158,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxHolds = (); type MaxFreezes = (); + type RuntimeFreezeReason = (); } parameter_types! { diff --git a/pallets/gated-marketplace/src/types.rs b/pallets/gated-marketplace/src/types.rs index a3efd6ca..5623d4fd 100644 --- a/pallets/gated-marketplace/src/types.rs +++ b/pallets/gated-marketplace/src/types.rs @@ -1,7 +1,7 @@ use super::*; use frame_support::pallet_prelude::*; //use frame_system::pallet_prelude::*; -use frame_support::sp_io::hashing::blake2_256; +use sp_io::hashing::blake2_256; use sp_runtime::sp_std::vec::Vec; pub type Fields = BoundedVec<(FieldName, Cid), ::MaxFiles>; diff --git a/pallets/mapped-assets/Cargo.toml b/pallets/mapped-assets/Cargo.toml index 8f647e4a..9c259a03 100644 --- a/pallets/mapped-assets/Cargo.toml +++ b/pallets/mapped-assets/Cargo.toml @@ -16,23 +16,24 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = [ - "derive" + "derive", ] } -sp-std = { version = "8.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-std = { version = "8.0.0", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } # Needed for various traits. In our case, `OnFinalize`. -sp-runtime = { version = "24.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-runtime = { version = "24.0.0", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } # Needed for type-safe access to storage DB. -frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } # `system` module provides us with all sorts of useful stuff and macros depend on it being around. -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } -sp-core = { version = "21.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false, optional = true } +sp-core = { version = "21.0.0", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } pallet-rbac = { default-features = false, version = "4.0.0-dev", path = "../rbac/" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [dev-dependencies] -sp-std = { version = "8.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-io = { version = "23.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-std = { version = "8.0.0", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-io = { version = "23.0.0", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } [features] default = ["std"] diff --git a/pallets/mapped-assets/src/functions.rs b/pallets/mapped-assets/src/functions.rs index a86c518a..125d8558 100644 --- a/pallets/mapped-assets/src/functions.rs +++ b/pallets/mapped-assets/src/functions.rs @@ -19,10 +19,11 @@ use super::*; use codec::Encode; -use frame_support::{defensive, sp_io::hashing::blake2_256, traits::Get, BoundedVec}; +use frame_support::{defensive, traits::Get, BoundedVec}; use pallet_rbac::types::{IdOrVec, RoleBasedAccessControl}; use scale_info::prelude::vec; -use sp_runtime::sp_std::vec::Vec; +use sp_io::hashing::blake2_256; +use sp_runtime::{sp_std::vec::Vec, DispatchError}; #[must_use] pub(super) enum DeadConsequence { diff --git a/pallets/mapped-assets/src/impl_fungibles.rs b/pallets/mapped-assets/src/impl_fungibles.rs index a7df3d15..b94f2b11 100644 --- a/pallets/mapped-assets/src/impl_fungibles.rs +++ b/pallets/mapped-assets/src/impl_fungibles.rs @@ -27,6 +27,8 @@ use frame_support::{ }, }; +use sp_runtime::DispatchError; + use super::*; impl, I: 'static> fungibles::Inspect<::AccountId> for Pallet { diff --git a/pallets/mapped-assets/src/impl_stored_map.rs b/pallets/mapped-assets/src/impl_stored_map.rs index a7a5a085..7592e1cf 100644 --- a/pallets/mapped-assets/src/impl_stored_map.rs +++ b/pallets/mapped-assets/src/impl_stored_map.rs @@ -18,6 +18,7 @@ //! Assets pallet's `StoredMap` implementation. use super::*; +use sp_runtime::DispatchError; impl, I: 'static> StoredMap<(T::AssetId, T::AccountId), T::Extra> for Pallet { fn get(id_who: &(T::AssetId, T::AccountId)) -> T::Extra { diff --git a/pallets/mapped-assets/src/lib.rs b/pallets/mapped-assets/src/lib.rs index 2cdb2e5c..e5622ad1 100644 --- a/pallets/mapped-assets/src/lib.rs +++ b/pallets/mapped-assets/src/lib.rs @@ -142,7 +142,6 @@ #[cfg(feature = "runtime-benchmarks")] mod benchmarking; -pub mod migration; #[cfg(test)] pub mod mock; #[cfg(test)] @@ -165,7 +164,7 @@ use sp_runtime::{ use sp_std::prelude::*; use frame_support::{ - dispatch::{DispatchError, DispatchResult}, + dispatch::DispatchResult, ensure, pallet_prelude::DispatchResultWithPostInfo, storage::KeyPrefixIterator, @@ -210,7 +209,7 @@ pub mod pallet { use frame_system::pallet_prelude::*; /// The current storage version. - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] diff --git a/pallets/mapped-assets/src/migration.rs b/pallets/mapped-assets/src/migration.rs deleted file mode 100644 index d854a64a..00000000 --- a/pallets/mapped-assets/src/migration.rs +++ /dev/null @@ -1,137 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use super::*; -use frame_support::{log, traits::OnRuntimeUpgrade}; - -#[cfg(feature = "try-runtime")] -use sp_runtime::TryRuntimeError; - -pub mod v1 { - use frame_support::{pallet_prelude::*, weights::Weight}; - - use super::*; - - #[derive(Decode)] - pub struct OldAssetDetails { - pub owner: AccountId, - pub issuer: AccountId, - pub admin: AccountId, - pub freezer: AccountId, - pub supply: Balance, - pub deposit: DepositBalance, - pub min_balance: Balance, - pub is_sufficient: bool, - pub accounts: u32, - pub sufficients: u32, - pub approvals: u32, - pub is_frozen: bool, - } - - impl OldAssetDetails { - fn migrate_to_v1(self) -> AssetDetails { - let status = if self.is_frozen { AssetStatus::Frozen } else { AssetStatus::Live }; - - AssetDetails { - owner: self.owner, - issuer: self.issuer, - admin: self.admin, - freezer: self.freezer, - supply: self.supply, - deposit: self.deposit, - min_balance: self.min_balance, - is_sufficient: self.is_sufficient, - accounts: self.accounts, - sufficients: self.sufficients, - approvals: self.approvals, - status, - } - } - } - - pub struct MigrateToV1(sp_std::marker::PhantomData); - impl OnRuntimeUpgrade for MigrateToV1 { - fn on_runtime_upgrade() -> Weight { - let current_version = Pallet::::current_storage_version(); - let onchain_version = Pallet::::on_chain_storage_version(); - if onchain_version == 0 && current_version == 1 { - let mut translated = 0u64; - Asset::::translate::< - OldAssetDetails>, - _, - >(|_key, old_value| { - translated.saturating_inc(); - Some(old_value.migrate_to_v1()) - }); - current_version.put::>(); - log::info!( - target: LOG_TARGET, - "Upgraded {} pools, storage to version {:?}", - translated, - current_version - ); - T::DbWeight::get().reads_writes(translated + 1, translated + 1) - } else { - log::info!( - target: LOG_TARGET, - "Migration did not execute. This probably should be removed" - ); - T::DbWeight::get().reads(1) - } - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, TryRuntimeError> { - frame_support::ensure!( - Pallet::::on_chain_storage_version() == 0, - "must upgrade linearly" - ); - let prev_count = Asset::::iter().count(); - Ok((prev_count as u32).encode()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(prev_count: Vec) -> Result<(), TryRuntimeError> { - let prev_count: u32 = Decode::decode(&mut prev_count.as_slice()).expect( - "the state parameter should be something that was generated by pre_upgrade", - ); - let post_count = Asset::::iter().count() as u32; - ensure!( - prev_count == post_count, - "the asset count before and after the migration should be the same" - ); - - let current_version = Pallet::::current_storage_version(); - let onchain_version = Pallet::::on_chain_storage_version(); - - frame_support::ensure!(current_version == 1, "must_upgrade"); - ensure!( - current_version == onchain_version, - "after migration, the current_version and onchain_version should be the same" - ); - - Asset::::iter().try_for_each(|(_id, asset)| -> Result<(), TryRuntimeError> { - ensure!( - asset.status == AssetStatus::Live || asset.status == AssetStatus::Frozen, - "assets should only be live or frozen. None should be in destroying status, or undefined state" - ); - Ok(()) - })?; - Ok(()) - } - } -} diff --git a/pallets/mapped-assets/src/mock.rs b/pallets/mapped-assets/src/mock.rs index 09074099..9590913b 100644 --- a/pallets/mapped-assets/src/mock.rs +++ b/pallets/mapped-assets/src/mock.rs @@ -110,6 +110,7 @@ impl pallet_balances::Config for Test { type FreezeIdentifier = (); type MaxHolds = (); type MaxFreezes = (); + type RuntimeFreezeReason = (); } pub struct AssetsCallbackHandle; @@ -245,7 +246,7 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { config.assimilate_storage(&mut storage).unwrap(); let mut ext: sp_io::TestExternalities = storage.into(); - // Clear thread local vars for https://github.com/paritytech/substrate/issues/10479. + // Clear thread local vars for https://github.com/paritytech/polkadot-sdk/issues/10479. ext.execute_with(|| take_hooks()); ext.execute_with(|| System::set_block_number(1)); ext diff --git a/pallets/mapped-assets/src/types.rs b/pallets/mapped-assets/src/types.rs index 04c98896..6726066e 100644 --- a/pallets/mapped-assets/src/types.rs +++ b/pallets/mapped-assets/src/types.rs @@ -20,9 +20,9 @@ use super::*; use frame_support::{ pallet_prelude::*, - sp_io::hashing::blake2_256, traits::{fungible, tokens::ConversionToAssetBalance}, }; +use sp_io::hashing::blake2_256; use sp_runtime::{traits::Convert, FixedPointNumber, FixedPointOperand, FixedU128}; pub(super) type DepositBalanceOf = diff --git a/pallets/rbac/Cargo.toml b/pallets/rbac/Cargo.toml index 9e47b2f6..193d2d70 100644 --- a/pallets/rbac/Cargo.toml +++ b/pallets/rbac/Cargo.toml @@ -16,16 +16,18 @@ targets = ["x86_64-unknown-linux-gnu"] log = "0.4" codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = [ - "derive" + "derive", ] } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false, optional = true } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false, optional = true } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [dev-dependencies] -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", default-features = false } [features] default = ["std"] diff --git a/pallets/rbac/src/functions.rs b/pallets/rbac/src/functions.rs index 95cab53b..23c164a5 100644 --- a/pallets/rbac/src/functions.rs +++ b/pallets/rbac/src/functions.rs @@ -1,8 +1,9 @@ use super::*; use frame_support::pallet_prelude::*; //use frame_system::pallet_prelude::*; -use frame_support::{sp_io::hashing::blake2_256, sp_std::borrow::ToOwned}; +use sp_io::hashing::blake2_256; use sp_runtime::sp_std::vec::Vec; +use sp_std::borrow::ToOwned; use crate::types::*; diff --git a/pallets/rbac/src/lib.rs b/pallets/rbac/src/lib.rs index 94916a24..d8dcfde6 100644 --- a/pallets/rbac/src/lib.rs +++ b/pallets/rbac/src/lib.rs @@ -24,7 +24,7 @@ pub mod pallet { use frame_system::pallet_prelude::*; use sp_runtime::sp_std::vec::Vec; - const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(0); #[pallet::config] pub trait Config: frame_system::Config { diff --git a/pallets/rbac/src/types.rs b/pallets/rbac/src/types.rs index ab5fd9a6..37d18f83 100644 --- a/pallets/rbac/src/types.rs +++ b/pallets/rbac/src/types.rs @@ -1,5 +1,6 @@ //use super::*; -use frame_support::{pallet_prelude::*, sp_io::hashing::blake2_256}; +use frame_support::pallet_prelude::*; +use sp_io::hashing::blake2_256; use sp_runtime::sp_std::vec::Vec; pub type PalletId = [u8; 32]; diff --git a/pallets/template/Cargo.toml b/pallets/template/Cargo.toml index 06adf862..a4e07e33 100644 --- a/pallets/template/Cargo.toml +++ b/pallets/template/Cargo.toml @@ -16,18 +16,18 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } log = { version = "0.4.14", default-features = false } scale-info = { version = "2.5.0", default-features = false, features = [ - "derive" + "derive", ] } -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } -frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", optional = true } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +frame-support = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } +frame-system = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } +frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1", optional = true } +sp-std = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } [dev-dependencies] -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-core = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } +sp-io = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } +sp-std = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk", tag = "v1.3.0-rc1" } [features] default = ["std"]