diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 591afa03..1ae1101e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: rustup default stable rustup update nightly rustup update stable + rustup toolchain install nightly rustup target add wasm32-unknown-unknown --toolchain nightly - name: Build diff --git a/.gitignore b/.gitignore index e1ae361c..fa572565 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,6 @@ terraform.tfstate # will have compiled files and executables /target/ -/.idea/ \ No newline at end of file +/.idea/ +.DS_Store +.envrc diff --git a/Cargo.lock b/Cargo.lock index 73a422fc..4c5a1816 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,20 +14,20 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.26.2", + "gimli", ] [[package]] name = "addr2line" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ - "gimli 0.27.2", + "gimli", ] [[package]] @@ -42,7 +42,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -51,18 +51,18 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "rand_core 0.6.4", ] [[package]] name = "aead" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c192eb8f11fc081b0fe4259ba5af04217d4e0faddd02417310a927911abd7c8" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ "crypto-common", - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -90,12 +90,12 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433cfd6710c9986c576a25ca913c39d66a6474107b406f34f91d4a8923395241" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", - "cipher 0.4.3", + "cipher 0.4.4", "cpufeatures", ] @@ -115,13 +115,13 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" +checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" dependencies = [ - "aead 0.5.1", - "aes 0.8.2", - "cipher 0.4.3", + "aead 0.5.2", + "aes 0.8.3", + "cipher 0.4.4", "ctr 0.9.2", "ghash 0.5.0", "subtle", @@ -153,7 +153,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.10", "once_cell", "version_check", ] @@ -165,20 +165,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", - "getrandom 0.2.8", + "getrandom 0.2.10", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c" dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -197,11 +203,60 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" -version = "1.0.69" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "approx" @@ -220,15 +275,15 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "array-bytes" -version = "4.2.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -238,9 +293,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asn1-rs" @@ -255,14 +310,14 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.20", + "time 0.3.25", ] [[package]] name = "asn1-rs" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf6690c370453db30743b373a60ba498fc0d6d83b11f4abfd87a84a075db5dd4" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ "asn1-rs-derive 0.4.0", "asn1-rs-impl", @@ -271,7 +326,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.20", + "time 0.3.25", ] [[package]] @@ -282,7 +337,7 @@ checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -294,7 +349,7 @@ checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -306,20 +361,14 @@ checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] -[[package]] -name = "asn1_der" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" - [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -328,62 +377,73 @@ dependencies = [ [[package]] name = "async-io" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock", "autocfg", + "cfg-if", "concurrent-queue", "futures-lite", - "libc", "log", "parking", "polling", + "rustix 0.37.23", "slab", - "socket2", + "socket2 0.4.9", "waker-fn", - "windows-sys 0.42.0", ] [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] +[[package]] +name = "async-recursion" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "async-trait" -version = "0.1.64" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "asynchronous-codec" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ "bytes", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", ] [[package]] name = "atomic-waker" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] name = "atty" @@ -404,16 +464,16 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" dependencies = [ - "addr2line 0.19.0", + "addr2line 0.20.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.30.3", + "object 0.31.1", "rustc-demangle", ] @@ -430,10 +490,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] -name = "base58" +name = "base16ct" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -443,9 +503,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -473,22 +533,23 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.64.0" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", "lazycell", "peeking_take_while", + "prettyplease 0.2.12", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn", + "syn 2.0.28", ] [[package]] @@ -497,6 +558,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "bitvec" version = "1.0.1" @@ -515,7 +582,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -525,8 +592,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", - "arrayvec 0.7.2", - "constant_time_eq", + "arrayvec 0.7.4", + "constant_time_eq 0.2.6", ] [[package]] @@ -536,21 +603,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ "arrayref", - "arrayvec 0.7.2", - "constant_time_eq", + "arrayvec 0.7.4", + "constant_time_eq 0.2.6", ] [[package]] name = "blake3" -version = "1.3.3" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" +checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" dependencies = [ "arrayref", - "arrayvec 0.7.2", + "arrayvec 0.7.4", "cc", "cfg-if", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -571,16 +638,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] name = "block-buffer" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -610,9 +677,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bounded-collections" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a071c348a5ef6da1d3a87166b408170b46002382b1dda83992b5c2208cefb370" +checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" dependencies = [ "log", "parity-scale-codec", @@ -626,11 +693,20 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bstr" -version = "1.3.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffdb39cb703212f3c11973452c2861b972f757b021158f3516ba10f2fa8b2c1" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", "serde", @@ -647,9 +723,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -694,31 +770,31 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.3" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6031a462f977dd38968b6f23378356512feeace69cef817e1a4475108093cec3" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" -version = "0.15.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a1ec454bc3eead8719cb56e15dbbfecdbc14e4b3a3ae4936cc6e31f5fc0d07" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.16", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -726,11 +802,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -755,9 +832,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.10.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" dependencies = [ "smallvec", ] @@ -801,13 +878,13 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.23" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "time 0.1.45", "wasm-bindgen", @@ -816,13 +893,13 @@ dependencies = [ [[package]] name = "cid" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" dependencies = [ "core2", "multibase", - "multihash 0.16.3", + "multihash", "serde", "unsigned-varint", ] @@ -833,7 +910,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -842,14 +919,14 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] name = "cipher" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", @@ -857,9 +934,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ed9a53e5d4d9c573ae844bfac6872b159cb1d1585a83b29e7a64b7eef7332a" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -868,40 +945,44 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.8" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" +checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" dependencies = [ - "bitflags", + "clap_builder", "clap_derive", - "clap_lex", - "is-terminal", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.1.8" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "clap_lex" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" -dependencies = [ - "os_str_bytes", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "codespan-reporting" @@ -913,11 +994,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "comfy-table" -version = "6.1.4" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7b787b0dc42e8111badfdbe4c3059158ccb2db8780352fa1b01e8ccf45cc4d" +checksum = "9ab77dbd8adecaf3f0db40581631b995f312a8a5ae3aa9993188bb8f23d83a5b" dependencies = [ "strum", "strum_macros", @@ -926,24 +1013,65 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c278839b831783b70278b14df4d45e1beb1aad306c07bb796637de9a0e323e8e" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.45.0", +] + [[package]] name = "const-oid" -version = "0.9.2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "const-random" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "proc-macro-hack", + "tiny-keccak", +] + +[[package]] +name = "constant_time_eq" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" [[package]] name = "constant_time_eq" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" @@ -957,9 +1085,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core2" @@ -981,37 +1109,36 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] [[package]] name = "cranelift-bforest" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc42ba2e232e5b20ff7dc299a812d53337dadce9a7e39a238e6a5cb82d2e57b" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "253531aca9b6f56103c9420369db3263e784df39aa1c90685a1f69cfbba0623e" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" dependencies = [ - "arrayvec 0.7.2", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli 0.26.2", - "hashbrown 0.12.3", + "gimli", + "hashbrown 0.13.2", "log", "regalloc2", "smallvec", @@ -1020,33 +1147,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f2154365e2bff1b1b8537a7181591fdff50d8e27fa6e40d5c69c3bad0ca7c8" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687e14e3f5775248930e0d5a84195abef8b829958e9794bf8d525104993612b4" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" [[package]] name = "cranelift-entity" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42ea692c7b450ad18b8c9889661505d51c09ec4380cf1c2d278dbb2da22cae1" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8483c2db6f45fe9ace984e5adc5d058102227e4c62e5aa2054e16b0275fd3a6e" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ "cranelift-codegen", "log", @@ -1056,15 +1183,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9793158837678902446c411741d87b43f57dadfb944f2440db4287cda8cbd59" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" [[package]] name = "cranelift-native" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72668c7755f2b880665cb422c8ad2d56db58a88b9bebfef0b73edc2277c13c49" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" dependencies = [ "cranelift-codegen", "libc", @@ -1073,9 +1200,9 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.93.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852ce4b088b44ac4e29459573943009a70d1b192c8d77ef949b4e814f656fc1" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1113,9 +1240,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -1134,22 +1261,22 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.14" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.8.0", + "memoffset 0.9.0", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -1166,7 +1293,19 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +dependencies = [ + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -1178,7 +1317,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "rand_core 0.6.4", "typenum", ] @@ -1189,7 +1328,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -1199,7 +1338,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] @@ -1218,7 +1357,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher 0.4.3", + "cipher 0.4.4", ] [[package]] @@ -1249,23 +1388,23 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.0" +version = "4.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da00a7a9a4eb92a0a0f8e75660926d48f0d0f3c537e455c457bcdaa1e16b1ac" +checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" dependencies = [ "cfg-if", "fiat-crypto", "packed_simd_2", - "platforms 3.0.2", + "platforms", "subtle", "zeroize", ] [[package]] name = "cxx" -version = "1.0.91" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" +checksum = "666a3ec767f4bbaf0dcfcc3b4ea048b90520b254fdf88813e763f4c762636c14" dependencies = [ "cc", "cxxbridge-flags", @@ -1275,9 +1414,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.91" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" +checksum = "162bec16c4cc28b19e26db0197b60ba5480fdb9a4cbf0f4c6c104a937741b78e" dependencies = [ "cc", "codespan-reporting", @@ -1285,31 +1424,31 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 2.0.28", ] [[package]] name = "cxxbridge-flags" -version = "1.0.91" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" +checksum = "d6e8c238aadc4b9f2c00269d04c87abb23f96dd240803872536eed1a304bb40e" [[package]] name = "cxxbridge-macro" -version = "1.0.91" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" +checksum = "59d9ffb4193dd22180b8d5747b1e095c3d9c9c665ce39b0483a488948f437e06" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "darling" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0808e1bd8671fb44a113a14e13497557533369847788fa2ae912b6ebfce9fa8" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" dependencies = [ "darling_core", "darling_macro", @@ -1317,40 +1456,40 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001d80444f28e193f30c2f293455da62dcf9a6b29918a4253152ae2b1de592cb" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.109", ] [[package]] name = "darling_macro" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "data-encoding-macro" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" +checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1358,12 +1497,12 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" +checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" dependencies = [ "data-encoding", - "syn", + "syn 1.0.109", ] [[package]] @@ -1377,6 +1516,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "der-parser" version = "7.0.0" @@ -1393,11 +1542,11 @@ dependencies = [ [[package]] name = "der-parser" -version = "8.1.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d4bc9b0db0a0df9ae64634ac5bdefb7afcb534e182275ca0beadbe486701c1" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.1", + "asn1-rs 0.5.2", "displaydoc", "nom", "num-bigint", @@ -1405,6 +1554,12 @@ dependencies = [ "rusticata-macros", ] +[[package]] +name = "deranged" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" + [[package]] name = "derive-syn-parse" version = "0.1.5" @@ -1413,7 +1568,7 @@ checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1434,7 +1589,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1444,7 +1599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn", + "syn 1.0.109", ] [[package]] @@ -1455,7 +1610,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1479,16 +1634,17 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.3", + "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] @@ -1536,13 +1692,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -1551,17 +1707,11 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - [[package]] name = "dtoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00704156a7de8df8da0911424e30c2049957b0a714542a44e05fe693dd85313" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dyn-clonable" @@ -1581,14 +1731,14 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" [[package]] name = "ecdsa" @@ -1596,10 +1746,24 @@ version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "der", - "elliptic-curve", - "rfc6979", - "signature", + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + +[[package]] +name = "ecdsa" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +dependencies = [ + "der 0.7.8", + "digest 0.10.7", + "elliptic-curve 0.13.5", + "rfc6979 0.4.0", + "signature 2.1.0", + "spki 0.7.2", ] [[package]] @@ -1608,7 +1772,7 @@ version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ - "signature", + "signature 1.6.4", ] [[package]] @@ -1641,9 +1805,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" @@ -1651,22 +1815,47 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "base16ct", - "crypto-bigint", - "der", - "digest 0.10.6", - "ff", - "generic-array 0.14.6", - "group", + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array 0.14.7", + "group 0.12.1", "hkdf", "pem-rfc7468", - "pkcs8", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.2", + "digest 0.10.7", + "ff 0.13.0", + "generic-array 0.14.7", + "group 0.13.0", + "pkcs8 0.10.2", "rand_core 0.6.4", - "sec1", + "sec1 0.7.3", "subtle", "zeroize", ] +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "enum-as-inner" version = "0.5.1" @@ -1676,7 +1865,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1698,15 +1887,21 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" -version = "0.2.8" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1736,15 +1931,15 @@ dependencies = [ [[package]] name = "expander" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" dependencies = [ "blake2", "fs-err", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -1768,6 +1963,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "fdlimit" version = "0.2.1" @@ -1787,11 +1988,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fiat-crypto" -version = "0.1.17" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a214f5bb88731d436478f3ae1f8a277b62124089ba9fb67f4f93fb100ef73c90" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" [[package]] name = "file-per-thread-logger" @@ -1805,21 +2016,21 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.45.0", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", ] [[package]] name = "finality-grandpa" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24e6c429951433ccb7c87fd528c60084834dcd14763182c1f83291bcde24c34" +checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" dependencies = [ "either", "futures", @@ -1851,9 +2062,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "libz-sys", @@ -1878,16 +2089,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", ] [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -1901,7 +2112,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-support-procedural", @@ -1926,7 +2137,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "array-bytes", @@ -1960,12 +2171,13 @@ dependencies = [ "sp-database", "sp-externalities", "sp-inherents", + "sp-io", "sp-keystore", "sp-runtime", "sp-state-machine", - "sp-std", "sp-storage", "sp-trie", + "sp-wasm-interface", "thiserror", "thousands", ] @@ -1973,7 +2185,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -1989,9 +2201,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ "cfg-if", "parity-scale-codec", @@ -2002,32 +2214,37 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "async-recursion", "futures", + "indicatif", + "jsonrpsee", "log", "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", + "spinners", "substrate-rpc-client", "tokio", + "tokio-retry", ] [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "environmental", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", "log", - "once_cell", + "macro_magic", "parity-scale-codec", "paste", "scale-info", @@ -2037,6 +2254,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", + "sp-debug-derive", "sp-inherents", "sp-io", "sp-runtime", @@ -2051,45 +2269,49 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "cfg-expr", "derive-syn-parse", + "expander", "frame-support-procedural-tools", "itertools", + "macro_magic", + "proc-macro-warning", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "cfg-if", "frame-support", "log", "parity-scale-codec", @@ -2106,7 +2328,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -2121,7 +2343,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sp-api", @@ -2130,7 +2352,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "parity-scale-codec", @@ -2156,27 +2378,16 @@ dependencies = [ ] [[package]] -name = "fs4" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea55201cc351fdb478217c0fb641b59813da9b4efe4c414a9d8f989a657d149" -dependencies = [ - "libc", - "rustix 0.35.13", - "winapi", -] - -[[package]] -name = "funty" -version = "2.0.0" +name = "funty" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -2189,9 +2400,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -2199,15 +2410,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -2217,34 +2428,34 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", "parking", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -2260,15 +2471,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-timer" @@ -2278,9 +2489,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -2289,7 +2500,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "pin-utils", "slab", ] @@ -2314,12 +2525,13 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -2345,9 +2557,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -2371,26 +2583,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug 0.3.0", - "polyval 0.6.0", + "polyval 0.6.1", ] [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" - [[package]] name = "glob" version = "0.3.1" @@ -2399,9 +2605,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" dependencies = [ "aho-corasick", "bstr", @@ -2416,16 +2622,27 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ - "ff", + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", "rand_core 0.6.4", "subtle", ] [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -2433,7 +2650,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -2442,9 +2659,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.6" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "035ef95d03713f2c347a72547b7cd38cbc9af7cd51e6099fb62d586d4a6dee3a" +checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" dependencies = [ "log", "pest", @@ -2487,6 +2704,12 @@ dependencies = [ "ahash 0.8.3", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "heck" version = "0.4.1" @@ -2504,18 +2727,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -2529,6 +2743,12 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + [[package]] name = "hkdf" version = "0.12.3" @@ -2564,7 +2784,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2574,7 +2794,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.6", + "generic-array 0.14.7", "hmac 0.8.1", ] @@ -2608,14 +2828,14 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", ] [[package]] name = "http-range-header" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -2625,9 +2845,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -2637,9 +2857,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.24" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -2651,8 +2871,8 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.9", - "socket2", + "pin-project-lite 0.2.12", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -2671,31 +2891,47 @@ dependencies = [ "rustls 0.20.8", "rustls-native-certs", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", + "webpki-roots", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "log", + "rustls 0.21.6", + "rustls-native-certs", + "tokio", + "tokio-rustls 0.24.1", ] [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows 0.48.0", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -2717,9 +2953,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2737,9 +2973,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba7abdbb86e485125dad06c2691e1e393bf3b08c7b743b43aa162a00fd39062e" +checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" dependencies = [ "async-io", "core-foundation", @@ -2751,7 +2987,7 @@ dependencies = [ "rtnetlink", "system-configuration", "tokio", - "windows", + "windows 0.34.0", ] [[package]] @@ -2780,27 +3016,50 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", "serde", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "indicatif" +version = "0.17.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + [[package]] name = "inout" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", ] [[package]] @@ -2842,18 +3101,13 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" - -[[package]] -name = "io-lifetimes" -version = "1.0.5" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ + "hermit-abi 0.3.2", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2864,32 +3118,31 @@ checksum = "aa2f047c0a98b2f299aa5d6d7088443570faae494e9ae1305e48be000c9e0eb1" [[package]] name = "ipconfig" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.3", "widestring", - "winapi", + "windows-sys 0.48.0", "winreg", ] [[package]] name = "ipnet" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.4" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes 1.0.5", - "rustix 0.36.8", - "windows-sys 0.45.0", + "hermit-abi 0.3.2", + "rustix 0.38.8", + "windows-sys 0.48.0", ] [[package]] @@ -2903,9 +3156,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" @@ -2918,9 +3171,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -2932,6 +3185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" dependencies = [ "jsonrpsee-core", + "jsonrpsee-http-client", "jsonrpsee-proc-macros", "jsonrpsee-server", "jsonrpsee-types", @@ -2954,7 +3208,7 @@ dependencies = [ "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tokio-util", "tracing", "webpki-roots", @@ -2967,7 +3221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" dependencies = [ "anyhow", - "arrayvec 0.7.2", + "arrayvec 0.7.4", "async-lock", "async-trait", "beef", @@ -2988,6 +3242,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-http-client" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls 0.23.2", + "jsonrpsee-core", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "jsonrpsee-proc-macros" version = "0.16.2" @@ -2998,7 +3271,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3051,14 +3324,14 @@ dependencies = [ [[package]] name = "jur-node" -version = "4.0.0-dev" +version = "2.0.0" dependencies = [ "clap", "frame-benchmarking", "frame-benchmarking-cli", "frame-system", "futures", - "hex-literal", + "hex-literal 0.4.1", "jsonrpsee", "jur-node-runtime", "jur-primitives", @@ -3071,21 +3344,22 @@ dependencies = [ "sc-consensus-aura", "sc-consensus-grandpa", "sc-executor", - "sc-keystore", - "sc-rpc", + "sc-network", + "sc-offchain", "sc-rpc-api", "sc-service", + "sc-statement-store", "sc-telemetry", "sc-transaction-pool", "sc-transaction-pool-api", "sp-api", "sp-block-builder", "sp-blockchain", - "sp-consensus", "sp-consensus-aura", "sp-consensus-grandpa", "sp-core", "sp-inherents", + "sp-io", "sp-keyring", "sp-runtime", "sp-timestamp", @@ -3096,7 +3370,7 @@ dependencies = [ [[package]] name = "jur-node-runtime" -version = "4.0.0-dev" +version = "2.0.0" dependencies = [ "frame-benchmarking", "frame-executive", @@ -3105,20 +3379,26 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal", + "hex-literal 0.4.1", "jur-primitives", "pallet-assets", "pallet-aura", "pallet-authorship", "pallet-balances", + "pallet-community", "pallet-grandpa", + "pallet-insecure-randomness-collective-flip", "pallet-multisig", + "pallet-passport", + "pallet-proposal", "pallet-sudo", "pallet-timestamp", "pallet-token-swap", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", + "pallet-user", + "pallet-whitelist", "parity-scale-codec", "scale-info", "sp-api", @@ -3142,7 +3422,7 @@ name = "jur-primitives" version = "1.0.0" dependencies = [ "frame-support", - "hex-literal", + "hex-literal 0.3.4", "parity-scale-codec", "rlp", "rustc-hex", @@ -3156,21 +3436,22 @@ dependencies = [ [[package]] name = "k256" -version = "0.11.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.6", + "ecdsa 0.16.8", + "elliptic-curve 0.13.5", + "once_cell", + "sha2 0.10.7", ] [[package]] name = "keccak" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] @@ -3196,9 +3477,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2182b8219fee6bd83aacaab7344e840179ae079d5216aa4e249b4d704646a844" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", @@ -3222,9 +3503,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -3242,31 +3523,27 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" - [[package]] name = "libp2p" -version = "0.50.0" +version = "0.51.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0a0d2f693675f49ded13c5d510c48b78069e23cbd9108d7ccd59f6dc568819" +checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" dependencies = [ "bytes", "futures", "futures-timer", - "getrandom 0.2.8", + "getrandom 0.2.10", "instant", - "libp2p-core 0.38.0", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", "libp2p-dns", "libp2p-identify", + "libp2p-identity", "libp2p-kad", "libp2p-mdns", "libp2p-metrics", - "libp2p-mplex", - "libp2p-noise 0.41.0", + "libp2p-noise", "libp2p-ping", "libp2p-quic", "libp2p-request-response", @@ -3276,88 +3553,70 @@ dependencies = [ "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", - "multiaddr 0.16.0", - "parking_lot 0.12.1", + "multiaddr", "pin-project", - "smallvec", ] [[package]] -name = "libp2p-core" -version = "0.38.0" +name = "libp2p-allow-block-list" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a8fcd392ff67af6cc3f03b1426c41f7f26b6b9aff2dc632c1c56dd649e571f" +checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "log", - "multiaddr 0.16.0", - "multihash 0.16.3", - "multistream-select", - "once_cell", - "parking_lot 0.12.1", - "pin-project", - "prost", - "prost-build", - "rand 0.8.5", - "rw-stream-sink", - "sec1", - "sha2 0.10.6", - "smallvec", - "thiserror", - "unsigned-varint", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", "void", - "zeroize", ] [[package]] name = "libp2p-core" -version = "0.39.0" +version = "0.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881d9a54e97d97cdaa4125d48269d97ca8c40e5fefec6b85b30440dc60cc551f" +checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", "either", "fnv", "futures", "futures-timer", "instant", + "libp2p-identity", "log", - "multiaddr 0.17.0", - "multihash 0.17.0", + "multiaddr", + "multihash", "multistream-select", "once_cell", "parking_lot 0.12.1", "pin-project", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", "rw-stream-sink", - "sec1", - "sha2 0.10.6", "smallvec", "thiserror", "unsigned-varint", "void", - "zeroize", ] [[package]] name = "libp2p-dns" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e42a271c1b49f789b92f7fc87749fa79ce5c7bdc88cbdfacb818a4bca47fec5" +checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" dependencies = [ "futures", - "libp2p-core 0.38.0", + "libp2p-core", "log", "parking_lot 0.12.1", "smallvec", @@ -3366,32 +3625,51 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" +checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" dependencies = [ "asynchronous-codec", + "either", "futures", "futures-timer", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", "lru", - "prost", - "prost-build", - "prost-codec", + "quick-protobuf", + "quick-protobuf-codec", "smallvec", "thiserror", "void", ] +[[package]] +name = "libp2p-identity" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2d584751cecb2aabaa56106be6be91338a60a0f4e420cf2af639204f596fc1" +dependencies = [ + "bs58 0.4.0", + "ed25519-dalek", + "log", + "multiaddr", + "multihash", + "quick-protobuf", + "rand 0.8.5", + "sha2 0.10.7", + "thiserror", + "zeroize", +] + [[package]] name = "libp2p-kad" -version = "0.42.1" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" +checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "asynchronous-codec", "bytes", "either", @@ -3399,13 +3677,13 @@ dependencies = [ "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "smallvec", "thiserror", "uint", @@ -3415,19 +3693,20 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f378264aade9872d6ccd315c0accc18be3a35d15fc1b9c36e5b6f983b62b5b" +checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" dependencies = [ "data-encoding", "futures", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", "rand 0.8.5", "smallvec", - "socket2", + "socket2 0.4.9", "tokio", "trust-dns-proto", "void", @@ -3435,11 +3714,11 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad8a64f29da86005c86a4d2728b8a0719e9b192f4092b609fd8790acb9dec55" +checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" dependencies = [ - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-identify", "libp2p-kad", "libp2p-ping", @@ -3447,63 +3726,22 @@ dependencies = [ "prometheus-client", ] -[[package]] -name = "libp2p-mplex" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03805b44107aa013e7cbbfa5627b31c36cbedfdfb00603c0311998882bc4bace" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures", - "libp2p-core 0.38.0", - "log", - "nohash-hasher", - "parking_lot 0.12.1", - "rand 0.8.5", - "smallvec", - "unsigned-varint", -] - -[[package]] -name = "libp2p-noise" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978cb57efe82e892ec6f348a536bfbd9fee677adbe5689d7a93ad3a9bffbf2e" -dependencies = [ - "bytes", - "curve25519-dalek 3.2.0", - "futures", - "libp2p-core 0.38.0", - "log", - "once_cell", - "prost", - "prost-build", - "rand 0.8.5", - "sha2 0.10.6", - "snow", - "static_assertions", - "thiserror", - "x25519-dalek 1.1.1", - "zeroize", -] - [[package]] name = "libp2p-noise" -version = "0.42.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1216f9ec823ac7a2289b954674c54cbce81c9e45920b4fcf173018ede4295246" +checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ "bytes", "curve25519-dalek 3.2.0", "futures", - "libp2p-core 0.39.0", + "libp2p-core", + "libp2p-identity", "log", "once_cell", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", - "sha2 0.10.6", + "sha2 0.10.7", "snow", "static_assertions", "thiserror", @@ -3513,14 +3751,15 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "929fcace45a112536e22b3dcfd4db538723ef9c3cb79f672b98be2cc8e25f37f" +checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" dependencies = [ + "either", "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-swarm", "log", "rand 0.8.5", @@ -3529,15 +3768,16 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.7.0-alpha.2" +version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971f629ff7519f4d4889a7c981f0dc09c6ad493423cd8a13ee442de241bc8c8" +checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ "bytes", "futures", "futures-timer", "if-watch", - "libp2p-core 0.39.0", + "libp2p-core", + "libp2p-identity", "libp2p-tls", "log", "parking_lot 0.12.1", @@ -3550,80 +3790,78 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3236168796727bfcf4927f766393415361e2c644b08bedb6a6b13d957c9a4884" +checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" dependencies = [ "async-trait", - "bytes", "futures", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "smallvec", - "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a35472fe3276b3855c00f1c032ea8413615e030256429ad5349cdf67c6e1a0" +checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" dependencies = [ "either", "fnv", "futures", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm-derive", "log", - "pin-project", "rand 0.8.5", "smallvec", - "thiserror", "tokio", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" +checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" dependencies = [ "heck", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "libp2p-tcp" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b257baf6df8f2df39678b86c578961d48cc8b68642a12f0f763f56c8e5858d" +checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" dependencies = [ "futures", "futures-timer", "if-watch", "libc", - "libp2p-core 0.38.0", + "libp2p-core", "log", - "socket2", + "socket2 0.4.9", "tokio", ] [[package]] name = "libp2p-tls" -version = "0.1.0-alpha.2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9baf6f6292149e124ee737d9a79dbee783f29473fc368c7faad9d157841078a" +checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" dependencies = [ "futures", "futures-rustls", - "libp2p-core 0.39.0", + "libp2p-core", + "libp2p-identity", "rcgen 0.10.0", "ring", "rustls 0.20.8", @@ -3635,13 +3873,13 @@ dependencies = [ [[package]] name = "libp2p-wasm-ext" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb1a35299860e0d4b3c02a3e74e3b293ad35ae0cee8a056363b0c862d082069" +checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" dependencies = [ "futures", "js-sys", - "libp2p-core 0.38.0", + "libp2p-core", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", @@ -3649,9 +3887,9 @@ dependencies = [ [[package]] name = "libp2p-webrtc" -version = "0.4.0-alpha.2" +version = "0.4.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4401ec550d36f413310ba5d4bf564bb21f89fb1601cadb32b2300f8bc1eb5b" +checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" dependencies = [ "async-trait", "asynchronous-codec", @@ -3660,13 +3898,13 @@ dependencies = [ "futures-timer", "hex", "if-watch", - "libp2p-core 0.39.0", - "libp2p-noise 0.42.0", + "libp2p-core", + "libp2p-identity", + "libp2p-noise", "log", - "multihash 0.17.0", - "prost", - "prost-build", - "prost-codec", + "multihash", + "quick-protobuf", + "quick-protobuf-codec", "rand 0.8.5", "rcgen 0.9.3", "serde", @@ -3680,14 +3918,14 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d705506030d5c0aaf2882437c70dab437605f21c5f9811978f694e6917a3b54" +checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core 0.38.0", + "libp2p-core", "log", "parking_lot 0.12.1", "quicksink", @@ -3699,23 +3937,22 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f63594a0aa818642d9d4915c791945053877253f08a3626f13416b5cd928a29" +checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" dependencies = [ "futures", - "libp2p-core 0.38.0", + "libp2p-core", "log", - "parking_lot 0.12.1", "thiserror", "yamux", ] [[package]] name = "librocksdb-sys" -version = "0.8.3+7.4.4" +version = "0.11.0+8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557b255ff04123fcc176162f56ed0c9cd42d8f357cf55b3fabeb60f7413741b3" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" dependencies = [ "bindgen", "bzip2-sys", @@ -3776,9 +4013,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.8" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", "pkg-config", @@ -3787,9 +4024,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" dependencies = [ "cc", ] @@ -3811,30 +4048,36 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475015a7f8f017edb28d2e69813be23500ad4b32cfe3421c4148efc97324ee52" +checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" dependencies = [ "nalgebra", ] [[package]] name = "linux-raw-sys" -version = "0.0.46" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -3842,20 +4085,17 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] @@ -3896,6 +4136,60 @@ dependencies = [ "libc", ] +[[package]] +name = "macro_magic" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "macro_magic_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "macro_magic_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + [[package]] name = "match_cfg" version = "0.1.0" @@ -3908,7 +4202,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -3919,10 +4213,11 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.2" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" +checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" dependencies = [ + "autocfg", "rawpointer", ] @@ -3932,7 +4227,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -3943,11 +4238,11 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memfd" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b20a59d985586e4a5aef64564ac77299f8586d8be6cf9106a5a40207e8908efb" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "rustix 0.36.8", + "rustix 0.37.23", ] [[package]] @@ -3977,6 +4272,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "memory-db" version = "0.32.0" @@ -3986,12 +4290,6 @@ dependencies = [ "hash-db", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "merlin" version = "2.0.1" @@ -4012,30 +4310,29 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "mockall" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e4a1c770583dac7ab5e2f6c139153b783a53a1bbee9729613f193e59828326" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" dependencies = [ "cfg-if", "downcast", @@ -4048,45 +4345,28 @@ dependencies = [ [[package]] name = "mockall_derive" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "832663583d5fa284ca8810bf7015e46c9fff9622d3cf34bd1eea5003fec06dd0" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "multiaddr" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aebdb21e90f81d13ed01dc84123320838e53963c2ca94b60b305d3fa64f31e" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "multibase", - "multihash 0.16.3", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint", - "url", + "syn 1.0.109", ] [[package]] name = "multiaddr" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b53e0cc5907a5c216ba6584bf74be8ab47d6d6289f72793b2dddbf15dc3bf8c" +checksum = "2b36f567c7099511fa8612bbbb52dda2419ce0bdbacf31714e3a5ffdb766d3bd" dependencies = [ "arrayref", "byteorder", "data-encoding", + "log", "multibase", - "multihash 0.17.0", + "multihash", "percent-encoding", "serde", "static_assertions", @@ -4098,28 +4378,11 @@ dependencies = [ name = "multibase" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "blake3", - "core2", - "digest 0.10.6", - "multihash-derive", - "sha2 0.10.6", - "sha3", - "unsigned-varint", +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", ] [[package]] @@ -4128,10 +4391,14 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", "core2", - "digest 0.10.6", + "digest 0.10.7", "multihash-derive", - "sha2 0.10.6", + "sha2 0.10.7", + "sha3", "unsigned-varint", ] @@ -4145,7 +4412,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -4171,9 +4438,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6515c882ebfddccaa73ead7320ca28036c4bc84c9bcca3cc0cbba8efe89223a" +checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" dependencies = [ "approx", "matrixmultiply", @@ -4187,13 +4454,13 @@ dependencies = [ [[package]] name = "nalgebra-macros" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232c68884c0c99810a5a4d333ef7e47689cfd0edc85efc9e54e1e6bf5212766" +checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4224,7 +4491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" dependencies = [ "anyhow", - "bitflags", + "bitflags 1.3.2", "byteorder", "libc", "netlink-packet-core", @@ -4260,9 +4527,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "260e21fbb6f3d253a14df90eb0000a6066780a15dd901a7519ce02d77a94985b" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ "bytes", "futures", @@ -4277,7 +4544,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.6.5", @@ -4318,9 +4585,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] @@ -4331,7 +4598,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "itoa", ] @@ -4352,47 +4619,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", - "num-bigint", "num-integer", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.2", "libc", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "object" -version = "0.29.0" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", - "hashbrown 0.12.3", - "indexmap", + "hashbrown 0.13.2", + "indexmap 1.9.3", "memchr", ] [[package]] name = "object" -version = "0.30.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ "memchr", ] @@ -4412,14 +4684,14 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.1", + "asn1-rs 0.5.2", ] [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -4439,21 +4711,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - [[package]] name = "p256" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2 0.10.6", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.7", ] [[package]] @@ -4462,9 +4728,9 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2 0.10.6", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.7", ] [[package]] @@ -4474,13 +4740,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" dependencies = [ "cfg-if", - "libm 0.1.4", + "libm", ] [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4495,7 +4761,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -4511,7 +4777,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -4525,7 +4791,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4537,10 +4803,29 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-community" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "jur-primitives", + "pallet-insecure-randomness-collective-flip", + "pallet-whitelist", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4560,10 +4845,24 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-insecure-randomness-collective-flip" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "safe-mix", + "scale-info", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4576,10 +4875,50 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-passport" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "jur-primitives", + "pallet-community", + "pallet-insecure-randomness-collective-flip", + "pallet-whitelist", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-proposal" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "jur-primitives", + "pallet-community", + "pallet-insecure-randomness-collective-flip", + "pallet-whitelist", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -4600,8 +4939,9 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", @@ -4614,7 +4954,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4633,11 +4973,11 @@ dependencies = [ name = "pallet-token-swap" version = "0.1.0" dependencies = [ - "bs58", + "bs58 0.5.0", "frame-benchmarking", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.4.1", "jur-primitives", "libsecp256k1", "pallet-assets", @@ -4656,7 +4996,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -4672,7 +5012,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -4688,7 +5028,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -4700,7 +5040,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4714,11 +5054,47 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-user" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "jur-primitives", + "pallet-insecure-randomness-collective-flip", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-whitelist" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "jur-primitives", + "pallet-insecure-randomness-collective-flip", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "parity-db" -version = "0.4.6" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bfb81cf5c90a222db2fb7b3a7cbf8cc7f38dfb6647aca4d98edf8281f56ed5" +checksum = "78f19d20a0d2cc52327a88d131fa1c4ea81ea4a04714aedcfeca2dd410049cf8" dependencies = [ "blake2", "crc32fast", @@ -4736,11 +5112,11 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.4.0" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ - "arrayvec 0.7.2", + "arrayvec 0.7.4", "bitvec", "byte-slice-cast", "bytes", @@ -4751,14 +5127,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4775,9 +5151,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "parking_lot" @@ -4797,7 +5173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.7", + "parking_lot_core 0.9.8", ] [[package]] @@ -4809,29 +5185,35 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.45.0", + "windows-targets 0.48.1", ] +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + [[package]] name = "paste" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" @@ -4848,7 +5230,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -4877,15 +5259,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.5.5" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ "thiserror", "ucd-trie", @@ -4893,9 +5275,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.5.5" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac3922aac69a40733080f53c1ce7f91dcf57e1a5f6c52f421fadec7fbdc4b69" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" dependencies = [ "pest", "pest_generator", @@ -4903,26 +5285,26 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.5.5" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06646e185566b5961b4058dd107e0a7f56e77c3f484549fb119867773c0f202" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "pest_meta" -version = "2.5.5" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f60b2ba541577e2a0c307c8f39d1439108120eb7903adeb6497fa880c59616" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", - "sha2 0.10.6", + "sha2 0.10.7", ] [[package]] @@ -4932,27 +5314,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -4963,9 +5345,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -4979,21 +5361,25 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "der", - "spki", + "der 0.6.1", + "spki 0.6.0", ] [[package]] -name = "pkg-config" -version = "0.3.26" +name = "pkcs8" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.8", + "spki 0.7.2", +] [[package]] -name = "platforms" -version = "2.0.0" +name = "pkg-config" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" @@ -5003,16 +5389,18 @@ checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polling" -version = "2.5.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", + "bitflags 1.3.2", "cfg-if", + "concurrent-queue", "libc", "log", - "wepoll-ffi", - "windows-sys 0.42.0", + "pin-project-lite 0.2.12", + "windows-sys 0.48.0", ] [[package]] @@ -5040,16 +5428,22 @@ dependencies = [ [[package]] name = "polyval" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.5.0", + "universal-hash 0.5.1", ] +[[package]] +name = "portable-atomic" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -5072,15 +5466,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" [[package]] name = "predicates-tree" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" dependencies = [ "predicates-core", "termtree", @@ -5088,12 +5482,22 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.23" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "prettyplease" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" dependencies = [ "proc-macro2", - "syn", + "syn 2.0.28", ] [[package]] @@ -5116,7 +5520,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ "thiserror", - "toml", + "toml 0.5.11", ] [[package]] @@ -5128,7 +5532,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -5143,11 +5547,28 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro-warning" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -5168,32 +5589,32 @@ dependencies = [ [[package]] name = "prometheus-client" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", "parking_lot 0.12.1", - "prometheus-client-derive-text-encode", + "prometheus-client-derive-encode", ] [[package]] -name = "prometheus-client-derive-text-encode" -version = "0.3.0" +name = "prometheus-client-derive-encode" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "prost" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -5201,9 +5622,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", @@ -5212,46 +5633,33 @@ dependencies = [ "log", "multimap", "petgraph", - "prettyplease", + "prettyplease 0.1.25", "prost", "prost-types", "regex", - "syn", + "syn 1.0.109", "tempfile", "which", ] -[[package]] -name = "prost-codec" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" -dependencies = [ - "asynchronous-codec", - "bytes", - "prost", - "thiserror", - "unsigned-varint", -] - [[package]] name = "prost-derive" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "prost-types" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ "prost", ] @@ -5271,6 +5679,28 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] + [[package]] name = "quicksink" version = "0.1.2" @@ -5284,9 +5714,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4ced82a24bb281af338b9e8f94429b6eca01b4e66d899f40031f074e74c9" +checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" dependencies = [ "bytes", "rand 0.8.5", @@ -5302,9 +5732,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -5374,7 +5804,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.10", ] [[package]] @@ -5403,9 +5833,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -5413,9 +5843,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -5431,7 +5861,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", "ring", - "time 0.3.20", + "time 0.3.25", "x509-parser 0.13.2", "yasna", ] @@ -5444,7 +5874,7 @@ checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring", - "time 0.3.20", + "time 0.3.25", "yasna", ] @@ -5454,7 +5884,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", ] [[package]] @@ -5463,36 +5902,36 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.8", - "redox_syscall", + "getrandom 0.2.10", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.14" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c78fb8c9293bcd48ef6fce7b4ca950ceaf21210de6e105a883ee280c0f7b9ed" +checksum = "61ef7e18e8841942ddb1cf845054f8008410030a3997875d9e49b7a363063df1" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.14" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" +checksum = "2dfaf0c85b766276c797f3791f5bc6d5bd116b41d53049af2789666b0c0bc9fa" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "regalloc2" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d4fbfb40c1c66a78ba3ddd41c1110247cf52f97b87d0f2fc9209bd49b030c" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" dependencies = [ "fxhash", "log", @@ -5502,13 +5941,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.3.6", + "regex-syntax 0.7.4", ] [[package]] @@ -5517,26 +5957,31 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] -name = "region" -version = "3.0.0" +name = "regex-syntax" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags", - "libc", - "mach", - "winapi", -] +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "resolv-conf" @@ -5554,11 +5999,21 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "crypto-bigint", + "crypto-bigint 0.4.9", "hmac 0.12.1", "zeroize", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + [[package]] name = "ring" version = "0.16.20" @@ -5586,9 +6041,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" dependencies = [ "libc", "librocksdb-sys", @@ -5657,9 +6112,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -5673,13 +6128,22 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver 1.0.18", ] [[package]] @@ -5693,30 +6157,43 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.13" +version = "0.36.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" +checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", - "io-lifetimes 0.7.5", + "io-lifetimes", "libc", - "linux-raw-sys 0.0.46", - "windows-sys 0.42.0", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", ] [[package]] name = "rustix" -version = "0.36.8" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", - "io-lifetimes 1.0.5", + "io-lifetimes", "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.5", + "windows-sys 0.48.0", ] [[package]] @@ -5744,11 +6221,23 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "rustls" +version = "0.21.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct 0.7.0", +] + [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -5758,18 +6247,28 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.2", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" dependencies = [ - "base64 0.21.0", + "ring", + "untrusted", ] [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rw-stream-sink" @@ -5784,15 +6283,24 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "safe-mix" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" +dependencies = [ + "rustc_version 0.2.3", +] [[package]] name = "safe_arch" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794821e4ccb0d9f979512f9c1973480123f9bd62a90d74ab0f9426fcf8f4a529" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" dependencies = [ "bytemuck", ] @@ -5809,7 +6317,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "sp-core", @@ -5820,7 +6328,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "futures-timer", @@ -5843,7 +6351,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -5858,7 +6366,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -5877,25 +6385,25 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "chrono", "clap", "fdlimit", "futures", - "libp2p", + "libp2p-identity", "log", "names", "parity-scale-codec", @@ -5906,7 +6414,6 @@ dependencies = [ "sc-client-db", "sc-keystore", "sc-network", - "sc-network-common", "sc-service", "sc-telemetry", "sc-tracing", @@ -5928,7 +6435,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "fnv", "futures", @@ -5944,9 +6451,9 @@ dependencies = [ "sp-core", "sp-database", "sp-externalities", - "sp-keystore", "sp-runtime", "sp-state-machine", + "sp-statement-store", "sp-storage", "substrate-prometheus-endpoint", ] @@ -5954,7 +6461,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "kvdb", @@ -5980,12 +6487,12 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", "futures-timer", - "libp2p", + "libp2p-identity", "log", "mockall", "parking_lot 0.12.1", @@ -6005,7 +6512,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -6034,7 +6541,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ahash 0.8.3", "array-bytes", @@ -6056,6 +6563,7 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-telemetry", + "sc-transaction-pool-api", "sc-utils", "serde_json", "sp-api", @@ -6074,7 +6582,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -6097,14 +6605,13 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "lru", "parity-scale-codec", "parking_lot 0.12.1", "sc-executor-common", - "sc-executor-wasmi", "sc-executor-wasmtime", + "schnellru", "sp-api", "sp-core", "sp-externalities", @@ -6115,46 +6622,30 @@ dependencies = [ "sp-version", "sp-wasm-interface", "tracing", - "wasmi", ] [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", "thiserror", "wasm-instrument", - "wasmi", -] - -[[package]] -name = "sc-executor-wasmi" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" -dependencies = [ - "log", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmi", ] [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "anyhow", "cfg-if", "libc", "log", - "once_cell", - "rustix 0.36.8", + "rustix 0.36.15", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -6165,7 +6656,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ansi_term", "futures", @@ -6181,10 +6672,9 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", - "async-trait", "parking_lot 0.12.1", "serde_json", "sp-application-crypto", @@ -6196,7 +6686,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "async-channel", @@ -6211,46 +6701,43 @@ dependencies = [ "libp2p", "linked_hash_set", "log", - "lru", "mockall", "parity-scale-codec", "parking_lot 0.12.1", + "partial_sort", "pin-project", "rand 0.8.5", - "sc-block-builder", "sc-client-api", - "sc-consensus", "sc-network-common", - "sc-peerset", "sc-utils", "serde", "serde_json", "smallvec", "sp-arithmetic", "sp-blockchain", - "sp-consensus", "sp-core", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", + "wasm-timer", "zeroize", ] [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "async-channel", "cid", "futures", - "libp2p", + "libp2p-identity", "log", "prost", "prost-build", "sc-client-api", "sc-network", - "sc-network-common", "sp-blockchain", "sp-runtime", "thiserror", @@ -6260,45 +6747,33 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "array-bytes", "async-trait", - "bitflags", - "bytes", + "bitflags 1.3.2", "futures", - "futures-timer", - "libp2p", + "libp2p-identity", "parity-scale-codec", "prost-build", "sc-consensus", - "sc-peerset", - "sc-utils", - "serde", - "smallvec", - "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", - "zeroize", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ahash 0.8.3", "futures", "futures-timer", "libp2p", "log", - "lru", "sc-network", "sc-network-common", - "sc-peerset", + "schnellru", "sp-runtime", "substrate-prometheus-endpoint", "tracing", @@ -6307,19 +6782,18 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", + "async-channel", "futures", - "libp2p", + "libp2p-identity", "log", "parity-scale-codec", "prost", "prost-build", "sc-client-api", "sc-network", - "sc-network-common", - "sc-peerset", "sp-blockchain", "sp-core", "sp-runtime", @@ -6329,16 +6803,16 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", + "async-channel", "async-trait", "fork-tree", "futures", "futures-timer", "libp2p", "log", - "lru", "mockall", "parity-scale-codec", "prost", @@ -6347,8 +6821,8 @@ dependencies = [ "sc-consensus", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", + "schnellru", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -6363,17 +6837,15 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "futures", "libp2p", "log", "parity-scale-codec", - "pin-project", "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", "sp-consensus", "sp-runtime", @@ -6383,7 +6855,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "bytes", @@ -6391,8 +6863,9 @@ dependencies = [ "futures", "futures-timer", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.1", "libp2p", + "log", "num_cpus", "once_cell", "parity-scale-codec", @@ -6401,33 +6874,22 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", - "sc-peerset", + "sc-transaction-pool-api", "sc-utils", "sp-api", "sp-core", + "sp-externalities", + "sp-keystore", "sp-offchain", "sp-runtime", "threadpool", "tracing", ] -[[package]] -name = "sc-peerset" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" -dependencies = [ - "futures", - "libp2p", - "log", - "sc-utils", - "serde_json", - "wasm-timer", -] - [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -6436,7 +6898,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "jsonrpsee", @@ -6459,6 +6921,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-session", + "sp-statement-store", "sp-version", "tokio", ] @@ -6466,7 +6929,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -6485,7 +6948,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "http", "jsonrpsee", @@ -6500,7 +6963,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "futures", @@ -6526,7 +6989,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "directories", @@ -6553,11 +7016,9 @@ dependencies = [ "sc-network-light", "sc-network-sync", "sc-network-transactions", - "sc-offchain", "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", - "sc-storage-monitor", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -6592,7 +7053,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "parity-scale-codec", @@ -6601,25 +7062,27 @@ dependencies = [ ] [[package]] -name = "sc-storage-monitor" -version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +name = "sc-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "clap", - "fs4", - "futures", "log", - "sc-client-db", - "sc-utils", + "parity-db", + "parking_lot 0.12.1", + "sc-client-api", + "sp-api", + "sp-blockchain", "sp-core", - "thiserror", + "sp-runtime", + "sp-statement-store", + "substrate-prometheus-endpoint", "tokio", ] [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "libc", @@ -6638,7 +7101,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "chrono", "futures", @@ -6657,7 +7120,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ansi_term", "atty", @@ -6665,12 +7128,10 @@ dependencies = [ "lazy_static", "libc", "log", - "once_cell", "parking_lot 0.12.1", "regex", "rustc-hash", "sc-client-api", - "sc-rpc-server", "sc-tracing-proc-macro", "serde", "sp-api", @@ -6688,25 +7149,24 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", "futures-timer", "linked-hash-map", "log", - "num-traits", "parity-scale-codec", "parking_lot 0.12.1", "sc-client-api", @@ -6726,13 +7186,15 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", "log", + "parity-scale-codec", "serde", "sp-blockchain", + "sp-core", "sp-runtime", "thiserror", ] @@ -6740,7 +7202,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-channel", "futures", @@ -6754,9 +7216,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.3.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001cf62ece89779fd16105b5f515ad0e5cedcd5440d3dd806bb067978e7c3608" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" dependencies = [ "bitvec", "cfg-if", @@ -6768,23 +7230,23 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.3.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "303959cf613a6f6efd19ed4b4ad5bf79966a13352716299ad532cfb115f4205c" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -6818,15 +7280,15 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scratch" -version = "1.0.3" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "sct" @@ -6866,10 +7328,24 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "base16ct", - "der", - "generic-array 0.14.6", - "pkcs8", + "base16ct 0.1.1", + "der 0.6.1", + "generic-array 0.14.7", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.8", + "generic-array 0.14.7", + "pkcs8 0.10.2", "subtle", "zeroize", ] @@ -6903,11 +7379,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -6916,9 +7392,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -6935,9 +7411,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] @@ -6950,35 +7435,44 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.152" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "serde_json" -version = "1.0.93" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + [[package]] name = "sha-1" version = "0.9.8" @@ -7000,7 +7494,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -7030,22 +7524,22 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] name = "sha3" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", "keccak", ] @@ -7079,15 +7573,25 @@ version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", + "rand_core 0.6.4", +] + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.7", "rand_core 0.6.4", ] [[package]] name = "simba" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50582927ed6f77e4ac020c057f37a268fc6aebc29225050365aacbb9deeeddc4" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" dependencies = [ "approx", "num-complex", @@ -7113,15 +7617,15 @@ dependencies = [ [[package]] name = "slice-group-by" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "snap" @@ -7131,31 +7635,41 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ba5f4d4ff12bdb6a169ed51b7c48c0e0ac4b0b4b31012b2571e97d78d3201d" +checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" dependencies = [ "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.0", + "curve25519-dalek 4.0.0-rc.1", "rand_core 0.6.4", "ring", - "rustc_version", - "sha2 0.10.6", + "rustc_version 0.4.0", + "sha2 0.10.7", "subtle", ] [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "soketto" version = "0.7.1" @@ -7176,13 +7690,16 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", "parity-scale-codec", + "scale-info", "sp-api-proc-macro", "sp-core", + "sp-externalities", + "sp-metadata-ir", "sp-runtime", "sp-state-machine", "sp-std", @@ -7194,7 +7711,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "blake2", @@ -7202,13 +7719,13 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "sp-application-crypto" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "23.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -7220,8 +7737,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "16.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "integer-sqrt", "num-traits", @@ -7235,9 +7752,8 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", @@ -7247,13 +7763,13 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "log", - "lru", "parity-scale-codec", "parking_lot 0.12.1", + "schnellru", "sp-api", "sp-consensus", "sp-database", @@ -7265,7 +7781,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -7280,14 +7796,13 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", - "sp-consensus", "sp-consensus-slots", "sp-inherents", "sp-runtime", @@ -7298,21 +7813,17 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", - "merlin", "parity-scale-codec", "scale-info", "serde", "sp-api", "sp-application-crypto", - "sp-consensus", "sp-consensus-slots", - "sp-consensus-vrf", "sp-core", "sp-inherents", - "sp-keystore", "sp-runtime", "sp-std", "sp-timestamp", @@ -7321,7 +7832,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "finality-grandpa", "log", @@ -7339,7 +7850,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -7348,29 +7859,16 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "sp-consensus-vrf" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" -dependencies = [ - "parity-scale-codec", - "scale-info", - "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-core" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "21.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", - "base58", - "bitflags", + "bitflags 1.3.2", "blake2", "bounded-collections", + "bs58 0.4.0", "dyn-clonable", "ed25519-zebra", "futures", @@ -7383,6 +7881,7 @@ dependencies = [ "merlin", "parity-scale-codec", "parking_lot 0.12.1", + "paste", "primitive-types", "rand 0.8.5", "regex", @@ -7401,38 +7900,37 @@ dependencies = [ "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", "zeroize", ] [[package]] name = "sp-core-hashing" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "9.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "blake2b_simd", "byteorder", - "digest 0.10.6", - "sha2 0.10.6", + "digest 0.10.7", + "sha2 0.10.7", "sha3", - "sp-std", "twox-hash", ] [[package]] name = "sp-core-hashing-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "9.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "proc-macro2", "quote", "sp-core-hashing", - "syn", + "syn 2.0.28", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -7440,18 +7938,18 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "sp-externalities" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "0.19.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "environmental", "parity-scale-codec", @@ -7462,13 +7960,12 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-core", "sp-runtime", "sp-std", "thiserror", @@ -7476,16 +7973,16 @@ dependencies = [ [[package]] name = "sp-io" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "23.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", "ed25519", "ed25519-dalek", - "futures", "libsecp256k1", "log", "parity-scale-codec", + "rustversion", "secp256k1", "sp-core", "sp-externalities", @@ -7501,8 +7998,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "24.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "lazy_static", "sp-core", @@ -7512,16 +8009,11 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "0.27.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "async-trait", - "futures", - "merlin", "parity-scale-codec", "parking_lot 0.12.1", - "schnorrkel", - "serde", "sp-core", "sp-externalities", "thiserror", @@ -7530,16 +8022,27 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "thiserror", - "zstd", + "zstd 0.12.4", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std", ] [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "sp-api", "sp-core", @@ -7548,8 +8051,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "backtrace", "lazy_static", @@ -7559,7 +8062,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "rustc-hash", "serde", @@ -7568,8 +8071,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "24.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "either", "hash256-std-hasher", @@ -7590,8 +8093,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "17.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -7608,25 +8111,26 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "11.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-core", + "sp-keystore", "sp-runtime", "sp-staking", "sp-std", @@ -7635,10 +8139,12 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", + "serde", "sp-core", "sp-runtime", "sp-std", @@ -7646,8 +8152,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "0.28.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", @@ -7661,18 +8167,36 @@ dependencies = [ "sp-std", "sp-trie", "thiserror", - "tracing", + "tracing", + "trie-db", +] + +[[package]] +name = "sp-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-runtime-interface", + "sp-std", + "thiserror", ] [[package]] name = "sp-std" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" [[package]] name = "sp-storage" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "13.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -7685,11 +8209,9 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", - "futures-timer", - "log", "parity-scale-codec", "sp-inherents", "sp-runtime", @@ -7699,8 +8221,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "10.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sp-std", @@ -7712,7 +8234,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "sp-api", "sp-runtime", @@ -7721,10 +8243,9 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", - "log", "parity-scale-codec", "scale-info", "sp-core", @@ -7736,12 +8257,12 @@ dependencies = [ [[package]] name = "sp-trie" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "22.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ahash 0.8.3", "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", @@ -7759,8 +8280,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "22.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -7776,33 +8297,32 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "sp-wasm-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "14.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", "sp-std", - "wasmi", "wasmtime", ] [[package]] name = "sp-weights" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +version = "20.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -7820,6 +8340,17 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spinners" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" +dependencies = [ + "lazy_static", + "maplit", + "strum", +] + [[package]] name = "spki" version = "0.6.0" @@ -7827,14 +8358,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ "base64ct", - "der", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.8", ] [[package]] name = "ss58-registry" -version = "1.39.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecf0bd63593ef78eca595a7fc25e9a443ca46fe69fd472f8f09f5245cdcd769d" +checksum = "bfc443bad666016e012538782d9e3006213a7db43e9fb1dda91657dc06a6fa08" dependencies = [ "Inflector", "num-format", @@ -7863,7 +8404,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg_aliases", "libc", "parking_lot 0.11.2", @@ -7882,7 +8423,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7910,7 +8451,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] @@ -7948,15 +8489,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" -dependencies = [ - "platforms 2.0.0", -] +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -7975,7 +8513,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hyper", "log", @@ -7987,7 +8525,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "jsonrpsee", @@ -8000,16 +8538,17 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ansi_term", "build-helper", "cargo_metadata", "filetime", + "parity-wasm", "sp-maybe-compressed-blob", "strum", "tempfile", - "toml", + "toml 0.7.6", "walkdir", "wasm-opt", ] @@ -8040,6 +8579,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -8048,17 +8598,17 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "unicode-xid", ] [[package]] name = "system-configuration" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] @@ -8081,21 +8631,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.6" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.4.0" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" dependencies = [ "cfg-if", - "fastrand", - "redox_syscall", - "rustix 0.36.8", - "windows-sys 0.42.0", + "fastrand 2.0.0", + "redox_syscall 0.3.5", + "rustix 0.38.8", + "windows-sys 0.48.0", ] [[package]] @@ -8109,28 +8659,28 @@ dependencies = [ [[package]] name = "termtree" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -8160,9 +8710,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.5.3+5.3.0-patched" +version = "0.5.4+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a678df20055b43e57ef8cddde41cdfda9a3c1a060b67f4c5836dfb1d78543ba8" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" dependencies = [ "cc", "libc", @@ -8181,10 +8731,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.20" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" dependencies = [ + "deranged", "itoa", "serde", "time-core", @@ -8193,15 +8744,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" dependencies = [ "time-core", ] @@ -8218,13 +8769,22 @@ dependencies = [ "pbkdf2 0.11.0", "rand 0.8.5", "rustc-hash", - "sha2 0.10.6", + "sha2 0.10.7", "thiserror", "unicode-normalization", "wasm-bindgen", "zeroize", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -8252,33 +8812,43 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "signal-hook-registry", - "socket2", + "socket2 0.5.3", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", +] + +[[package]] +name = "tokio-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand 0.8.5", + "tokio", ] [[package]] @@ -8292,29 +8862,39 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.6", + "tokio", +] + [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tokio", "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tokio", "tracing", ] @@ -8328,6 +8908,40 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower" version = "0.4.13" @@ -8341,18 +8955,18 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.3.5" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" dependencies = [ - "bitflags", + "bitflags 2.4.0", "bytes", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", ] @@ -8377,27 +8991,27 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", - "pin-project-lite 0.2.9", + "pin-project-lite 0.2.12", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -8497,7 +9111,7 @@ dependencies = [ "lazy_static", "rand 0.8.5", "smallvec", - "socket2", + "socket2 0.4.9", "thiserror", "tinyvec", "tokio", @@ -8534,17 +9148,17 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.41#3bd809d59c31c7205a0f36c6ddcba603e43051fc" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "clap", "frame-remote-externalities", + "frame-try-runtime", "hex", "log", "parity-scale-codec", "sc-cli", "sc-executor", - "sc-service", "serde", "serde_json", "sp-api", @@ -8564,7 +9178,7 @@ dependencies = [ "sp-version", "sp-weights", "substrate-rpc-client", - "zstd", + "zstd 0.12.4", ] [[package]] @@ -8599,8 +9213,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "digest 0.10.6", - "rand 0.7.3", + "digest 0.10.7", + "rand 0.8.5", "static_assertions", ] @@ -8612,9 +9226,9 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uint" @@ -8630,15 +9244,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -8667,15 +9281,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.6", + "generic-array 0.14.7", "subtle", ] [[package]] name = "universal-hash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", "subtle", @@ -8701,22 +9315,28 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.4.0", "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ - "getrandom 0.2.8", + "getrandom 0.2.10", ] [[package]] @@ -8760,22 +9380,20 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -8799,9 +9417,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -8809,24 +9427,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.28", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -8836,9 +9454,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8846,22 +9464,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-instrument" @@ -8874,9 +9492,9 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.111.0" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a303793cbc01fb96551badfc7367db6007396bba6bac97936b3c8b6f7fdb41" +checksum = "87fef6d0d508f08334e0ab0e6877feb4c0ecb3956bcf2cb950699b22fedf3e9c" dependencies = [ "anyhow", "libc", @@ -8890,9 +9508,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.111.0" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c9deb56f8a9f2ec177b3bd642a8205621835944ed5da55f2388ef216aca5a4" +checksum = "bc816bbc1596c8f2e8127e137a760c798023ef3d378f2ae51f0f1840e2dfa445" dependencies = [ "anyhow", "cxx", @@ -8902,15 +9520,14 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.111.0" +version = "0.112.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4432e28b542738a9776cedf92e8a99d8991c7b4667ee2c7ccddfb479dd2856a7" +checksum = "40199e4f68ef1071b3c6d0bd8026a12b481865d4b9e49c156932ea9a6234dd14" dependencies = [ "anyhow", "cc", "cxx", "cxx-build", - "regex", ] [[package]] @@ -8928,63 +9545,29 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wasmi" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" -dependencies = [ - "parity-wasm", - "wasmi-validation", - "wasmi_core", -] - -[[package]] -name = "wasmi-validation" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] - -[[package]] -name = "wasmi_core" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" -dependencies = [ - "downcast-rs", - "libm 0.2.6", - "memory_units", - "num-rational", - "num-traits", - "region", -] - [[package]] name = "wasmparser" -version = "0.100.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ - "indexmap", + "indexmap 1.9.3", "url", ] [[package]] name = "wasmtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a222f5fa1e14b2cefc286f1b68494d7a965f4bf57ec04c59bb62673d639af6" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", - "object 0.29.0", + "object 0.30.4", "once_cell", "paste", "psm", @@ -8997,43 +9580,43 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-asm-macros" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4407a7246e7d2f3d8fb1cf0c72fda8dbafdb6dd34d555ae8bea0e5ae031089cc" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ceb3adf61d654be0be67fffdce42447b0880481348785be5fe40b5dd7663a4c" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.21.2", "bincode", "directories-next", "file-per-thread-logger", "log", - "rustix 0.36.8", + "rustix 0.36.15", "serde", - "sha2 0.10.6", - "toml", - "windows-sys 0.42.0", - "zstd", + "sha2 0.10.7", + "toml 0.5.11", + "windows-sys 0.45.0", + "zstd 0.11.2+zstd.1.5.2", ] [[package]] name = "wasmtime-cranelift" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c366bb8647e01fd08cb5589976284b00abfded5529b33d7e7f3f086c68304a4" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" dependencies = [ "anyhow", "cranelift-codegen", @@ -9041,27 +9624,43 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.26.2", + "gimli", "log", - "object 0.29.0", + "object 0.30.4", "target-lexicon", "thiserror", "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli", + "object 0.30.4", + "target-lexicon", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b8b50962eae38ee319f7b24900b7cf371f03eebdc17400c1dc8575fc10c9a7" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.26.2", - "indexmap", + "gimli", + "indexmap 1.9.3", "log", - "object 0.29.0", + "object 0.30.4", "serde", "target-lexicon", "thiserror", @@ -9071,18 +9670,18 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffaed4f9a234ba5225d8e64eac7b4a5d13b994aeb37353cde2cbeb3febda9eaa" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.26.2", + "gimli", "log", - "object 0.29.0", + "object 0.30.4", "rustc-demangle", "serde", "target-lexicon", @@ -9090,60 +9689,60 @@ dependencies = [ "wasmtime-jit-debug", "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-jit-debug" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed41cbcbf74ce3ff6f1d07d1b707888166dc408d1a880f651268f4f7c9194b2" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ - "object 0.29.0", + "object 0.30.4", "once_cell", - "rustix 0.36.8", + "rustix 0.36.15", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a28ae1e648461bfdbb79db3efdaee1bca5b940872e4175390f465593a2e54c" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ "cfg-if", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-runtime" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e704b126e4252788ccfc3526d4d4511d4b23c521bf123e447ac726c14545217b" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "mach", "memfd", - "memoffset 0.6.5", + "memoffset 0.8.0", "paste", "rand 0.8.5", - "rustix 0.36.8", + "rustix 0.36.15", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-types" -version = "6.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e5572c5727c1ee7e8f28717aaa8400e4d22dcbd714ea5457d85b5005206568" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", @@ -9153,9 +9752,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -9213,10 +9812,10 @@ dependencies = [ "sdp", "serde", "serde_json", - "sha2 0.10.6", + "sha2 0.10.7", "stun", "thiserror", - "time 0.3.20", + "time 0.3.25", "tokio", "turn", "url", @@ -9253,15 +9852,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" dependencies = [ "aes 0.6.0", - "aes-gcm 0.10.1", + "aes-gcm 0.10.2", "async-trait", "bincode", "block-modes", "byteorder", "ccm", "curve25519-dalek 3.2.0", - "der-parser 8.1.0", - "elliptic-curve", + "der-parser 8.2.0", + "elliptic-curve 0.12.3", "hkdf", "hmac 0.12.1", "log", @@ -9273,11 +9872,11 @@ dependencies = [ "rcgen 0.9.3", "ring", "rustls 0.19.1", - "sec1", + "sec1 0.3.0", "serde", "sha1", - "sha2 0.10.6", - "signature", + "sha2 0.10.7", + "signature 1.6.4", "subtle", "thiserror", "tokio", @@ -9318,7 +9917,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" dependencies = [ "log", - "socket2", + "socket2 0.4.9", "thiserror", "tokio", "webrtc-util", @@ -9326,18 +9925,15 @@ dependencies = [ [[package]] name = "webrtc-media" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a3c157a040324e5049bcbd644ffc9079e6738fa2cfab2bcff64e5cc4c00d7" +checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" dependencies = [ "byteorder", "bytes", - "derive_builder", - "displaydoc", "rand 0.8.5", "rtp", "thiserror", - "webrtc-util", ] [[package]] @@ -9388,7 +9984,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" dependencies = [ "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "cc", "ipnet", @@ -9402,15 +9998,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "wepoll-ffi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" -dependencies = [ - "cc", -] - [[package]] name = "which" version = "4.4.0" @@ -9424,9 +10011,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.8" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b689b6c49d6549434bf944e6b0f39238cf63693cb7a147e9d887507fffa3b223" +checksum = "aa469ffa65ef7e0ba0f164183697b89b854253fd31aeb92358b7b6155177d62f" dependencies = [ "bytemuck", "safe_arch", @@ -9434,9 +10021,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -9483,18 +10070,12 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows-targets 0.48.1", ] [[package]] @@ -9503,29 +10084,59 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", ] [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.1", + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_msvc" @@ -9535,9 +10146,15 @@ checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" @@ -9547,9 +10164,15 @@ checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_msvc" @@ -9559,9 +10182,15 @@ checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" @@ -9571,15 +10200,27 @@ checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" @@ -9589,17 +10230,33 @@ checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "5504cc7644f4b593cbc05c4a55bf9bd4e94b867c3c0bd440934174d50482427d" +dependencies = [ + "memchr", +] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -9649,7 +10306,7 @@ dependencies = [ "ring", "rusticata-macros", "thiserror", - "time 0.3.20", + "time 0.3.25", ] [[package]] @@ -9658,16 +10315,16 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.1", + "asn1-rs 0.5.2", "base64 0.13.1", "data-encoding", - "der-parser 8.1.0", + "der-parser 8.2.0", "lazy_static", "nom", "oid-registry 0.6.1", "rusticata-macros", "thiserror", - "time 0.3.20", + "time 0.3.25", ] [[package]] @@ -9686,32 +10343,31 @@ dependencies = [ [[package]] name = "yasna" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.20", + "time 0.3.25", ] [[package]] name = "zeroize" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.3.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn", - "synstructure", + "syn 2.0.28", ] [[package]] @@ -9720,7 +10376,16 @@ version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ - "zstd-safe", + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", ] [[package]] @@ -9733,11 +10398,21 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + [[package]] name = "zstd-sys" -version = "2.0.7+zstd.1.5.4" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", "libc", diff --git a/docs/RELEASE.md b/docs/RELEASE.md new file mode 100644 index 00000000..d78d08e1 --- /dev/null +++ b/docs/RELEASE.md @@ -0,0 +1,18 @@ +# Release management + +## Versioning + +We use [semantic versioning](https://semver.org). + +## How to make a new release from the staging branch + +1. Create a new branch for the future version from `staging`: `release/vMAJ.MIN.PATCH` +2. Create a PR and include the following changes: + * Bump up the `spec-version` [field](https://github.com/jurteam/jur-node/blob/main/runtime/src/lib.rs#L123) right away. + * Update the `version` fields in the `runtime/Cargo.toml` and `node/Cargo.toml` files accordingly. +4. All new changes to the new release will be merged into the new branch. +5. Open a PR against staging ASAP. +6. When the branch is ready for release create an annotated tag" `git tag -a vMAJ.MIN.PATCH -m "Release vMAJ.MIN.PATCH"` +7. Merge the tag into main: `git checkout main && git merge vMAJ.MIN.PATCH`. Push main and the tag. +8. Done + diff --git a/node/Cargo.toml b/node/Cargo.toml index 62ae60b1..65bda7eb 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jur-node" -version = "4.0.0-dev" +version = "2.0.0" edition = "2021" license = "Unlicense" publish = false @@ -13,55 +13,56 @@ targets = ["x86_64-unknown-linux-gnu"] name = "jur-node" [dependencies] -clap = { version = "4.0.9", features = ["derive"] } -hex-literal = '0.3.4' +clap = { version = "4.2.5", features = ["derive"] } +hex-literal = '0.4.1' futures = { version = "0.3.21", features = ["thread-pool"]} -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-core = { version = "21.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-statement-store = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-runtime = { version = "24.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-keyring = { version = "24.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-io = { version = "23.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } # These dependencies are used for the node template's RPCs jsonrpsee = { version = "0.16.2", features = ["server"] } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } # These dependencies are used for runtime benchmarking -frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } # Local Dependencies -jur-node-runtime = { version = "4.0.0-dev", path = "../runtime" } +jur-node-runtime = { version = "2.0.0", path = "../runtime" } primitives = { package = 'jur-primitives', path = '../primitives' } # CLI-specific dependencies -try-runtime-cli = { version = "0.10.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +try-runtime-cli = { version = "0.10.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [build-dependencies] -substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [features] default = [] @@ -73,4 +74,4 @@ runtime-benchmarks = [ ] # Enable features that allow the runtime to be tried and debugged. Name might be subject to change # in the near future. -try-runtime = ["jur-node-runtime/try-runtime", "try-runtime-cli"] \ No newline at end of file +try-runtime = ["jur-node-runtime/try-runtime", "try-runtime-cli/try-runtime"] diff --git a/node/src/benchmarking.rs b/node/src/benchmarking.rs index 10d33e75..cc80649b 100644 --- a/node/src/benchmarking.rs +++ b/node/src/benchmarking.rs @@ -101,10 +101,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder { let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic( self.client.as_ref(), acc, - BalancesCall::transfer_keep_alive { - dest: self.dest.clone().into(), - value: self.value.into(), - } + BalancesCall::transfer_keep_alive { dest: self.dest.clone().into(), value: self.value } .into(), nonce, ) @@ -162,10 +159,10 @@ pub fn create_benchmark_extrinsic( let signature = raw_payload.using_encoded(|e| sender.sign(e)); runtime::UncheckedExtrinsic::new_signed( - call.clone(), + call, sp_runtime::AccountId32::from(sender.public()).into(), - runtime::Signature::Sr25519(signature.clone()), - extra.clone(), + runtime::Signature::Sr25519(signature), + extra, ) } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index c872e4ed..4028d530 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,6 +1,6 @@ use jur_node_runtime::{ AccountId, AuraConfig, BalancesConfig, - GenesisConfig, GrandpaConfig, Signature, SudoConfig, SystemConfig, + RuntimeGenesisConfig, GrandpaConfig, Signature, SudoConfig, SystemConfig, WASM_BINARY, }; use sc_service::ChainType; @@ -15,7 +15,7 @@ use sp_core::crypto::UncheckedInto; use sc_service::Properties; /// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; /// Generate a crypto pair from seed. pub fn get_from_seed(seed: &str) -> ::Public { @@ -290,11 +290,12 @@ fn testnet_genesis( root_key: AccountId, endowed_accounts: Vec, _enable_println: bool, -) -> GenesisConfig { - GenesisConfig { +) -> RuntimeGenesisConfig { + RuntimeGenesisConfig { system: SystemConfig { // Add Wasm runtime to storage. code: wasm_binary.to_vec(), + ..Default::default() }, balances: BalancesConfig { // Configure endowed accounts with initial balance of 1 << 60. @@ -305,6 +306,7 @@ fn testnet_genesis( }, grandpa: GrandpaConfig { authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), + ..Default::default() }, sudo: SudoConfig { // Assign network admin rights. diff --git a/node/src/cli.rs b/node/src/cli.rs index dd610477..15ceaa06 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -10,6 +10,7 @@ pub struct Cli { } #[derive(Debug, clap::Subcommand)] +#[allow(clippy::large_enum_variant)] pub enum Subcommand { /// Key management cli utilities #[command(subcommand)] diff --git a/node/src/command.rs b/node/src/command.rs index 328b67e3..807f6d84 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -6,10 +6,13 @@ use crate::{ }; use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE}; use jur_node_runtime::{Block, EXISTENTIAL_DEPOSIT}; -use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; +use sc_cli::SubstrateCli; use sc_service::PartialComponents; use sp_keyring::Sr25519Keyring; +#[cfg(feature = "try-runtime")] +use try_runtime_cli::block_building_info::timestamp_with_aura_info; + impl SubstrateCli for Cli { fn impl_name() -> String { "Substrate Node".into() @@ -46,9 +49,6 @@ impl SubstrateCli for Cli { }) } - fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { - &jur_node_runtime::VERSION - } } /// Parse and run command line arguments @@ -123,7 +123,7 @@ pub fn run() -> sc_cli::Result<()> { ) } - cmd.run::(config) + cmd.run::(config) }, BenchmarkCmd::Block(cmd) => { let PartialComponents { client, .. } = service::new_partial(&config)?; @@ -176,6 +176,8 @@ pub fn run() -> sc_cli::Result<()> { }, #[cfg(feature = "try-runtime")] Some(Subcommand::TryRuntime(cmd)) => { + use crate::service::ExecutorDispatch; + use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; let runner = cli.create_runner(cmd)?; runner.async_run(|config| { // we don't need any of the components of new_partial, just a runtime, or a task @@ -184,11 +186,13 @@ pub fn run() -> sc_cli::Result<()> { let task_manager = sc_service::TaskManager::new(config.tokio_handle.clone(), registry) .map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?; + let info_provider = timestamp_with_aura_info(6000); + Ok(( cmd.run::::ExtendHostFunctions, - >>(), + >, _>(Some(info_provider)), task_manager, )) }) diff --git a/node/src/rpc.rs b/node/src/rpc.rs index cb9d980f..030d9325 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use jsonrpsee::RpcModule; -use jur_node_runtime::{opaque::Block, AccountId, Index}; +use jur_node_runtime::{opaque::Block, AccountId, Nonce}; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; @@ -34,7 +34,7 @@ pub fn create_full( C: ProvideRuntimeApi, C: HeaderBackend + HeaderMetadata + 'static, C: Send + Sync + 'static, - C::Api: substrate_frame_rpc_system::AccountNonceApi, + C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BlockBuilder, P: TransactionPool + 'static, @@ -45,7 +45,7 @@ pub fn create_full( let mut module = RpcModule::new(()); let FullDeps { client, pool, deny_unsafe } = deps; - module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; + module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?; module.merge(TransactionPayment::new(client).into_rpc())?; // Extend this RPC with a custom API by using the following syntax. diff --git a/node/src/service.rs b/node/src/service.rs index 9c4bb032..3a7872eb 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,13 +1,14 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. +use futures::FutureExt; use jur_node_runtime::{self, opaque::Block, RuntimeApi}; -use sc_client_api::BlockBackend; +use sc_client_api::{Backend, BlockBackend}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; pub use sc_executor::NativeElseWasmExecutor; use sc_consensus_grandpa::SharedVoterState; -use sc_keystore::LocalKeystore; use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncParams}; use sc_telemetry::{Telemetry, TelemetryWorker}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use std::{sync::Arc, time::Duration}; @@ -36,6 +37,7 @@ sc_service::TFullClient; type FullSelectChain = sc_consensus::LongestChain; +#[allow(clippy::type_complexity)] pub fn new_partial( config: &Configuration, ) -> Result< @@ -58,9 +60,6 @@ pub fn new_partial( >, ServiceError, > { - if config.keystore_remote.is_some() { - return Err(ServiceError::Other("Remote Keystores are not supported.".into())) - } let telemetry = config .telemetry_endpoints @@ -73,12 +72,7 @@ pub fn new_partial( }) .transpose()?; - let executor = NativeElseWasmExecutor::::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, - ); + let executor = sc_service::new_native_or_wasm_executor(config); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( @@ -105,7 +99,7 @@ pub fn new_partial( let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( client.clone(), - &(client.clone() as Arc<_>), + &client, select_chain.clone(), telemetry.as_ref().map(|x| x.handle()), )?; @@ -147,45 +141,28 @@ pub fn new_partial( }) } -fn remote_keystore(_url: &String) -> Result, &'static str> { - // FIXME: here would the concrete keystore be built, - // must return a concrete type (NOT `LocalKeystore`) that - // implements `CryptoStore` and `SyncCryptoStore` - Err("Remote Keystore not supported.") -} - /// Builds a new service for a full client. -pub fn new_full(mut config: Configuration) -> Result { +pub fn new_full(config: Configuration) -> Result { let sc_service::PartialComponents { client, backend, mut task_manager, import_queue, - mut keystore_container, + keystore_container, select_chain, transaction_pool, other: (block_import, grandpa_link, mut telemetry), } = new_partial(&config)?; - if let Some(url) = &config.keystore_remote { - match remote_keystore(url) { - Ok(k) => keystore_container.set_remote_keystore(k), - Err(e) => - return Err(ServiceError::Other(format!( - "Error hooking up remote keystore for {}: {}", - url, e - ))), - }; - } + let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name( &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), &config.chain_spec, ); - config - .network - .extra_sets - .push(sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone())); + net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config( + grandpa_protocol_name.clone(), + )); let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), grandpa_link.shared_authority_set().clone(), @@ -195,6 +172,7 @@ pub fn new_full(mut config: Configuration) -> Result let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), @@ -204,11 +182,23 @@ pub fn new_full(mut config: Configuration) -> Result })?; if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-worker", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + is_validator: config.role.is_authority(), + keystore: Some(keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + enable_http_requests: true, + custom_extensions: |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } @@ -233,7 +223,7 @@ pub fn new_full(mut config: Configuration) -> Result let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { network: network.clone(), client: client.clone(), - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), task_manager: &mut task_manager, transaction_pool: transaction_pool.clone(), rpc_builder: rpc_extensions_builder, @@ -249,7 +239,7 @@ pub fn new_full(mut config: Configuration) -> Result let proposer_factory = sc_basic_authorship::ProposerFactory::new( task_manager.spawn_handle(), client.clone(), - transaction_pool, + transaction_pool.clone(), prometheus_registry.as_ref(), telemetry.as_ref().map(|x| x.handle()), ); @@ -276,7 +266,7 @@ pub fn new_full(mut config: Configuration) -> Result }, force_authoring, backoff_authoring_blocks, - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), sync_oracle: sync_service.clone(), justification_sync_link: sync_service.clone(), block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), @@ -296,8 +286,7 @@ pub fn new_full(mut config: Configuration) -> Result if enable_grandpa { // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. - let keystore = - if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None }; + let keystore = if role.is_authority() { Some(keystore_container.keystore()) } else { None }; let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec @@ -326,6 +315,7 @@ pub fn new_full(mut config: Configuration) -> Result prometheus_registry, shared_voter_state: SharedVoterState::empty(), telemetry: telemetry.as_ref().map(|x| x.handle()), + offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool), }; // the GRANDPA voter task is considered infallible, i.e. diff --git a/pallets/community/Cargo.toml b/pallets/community/Cargo.toml index bfbd3b32..7d1e4905 100644 --- a/pallets/community/Cargo.toml +++ b/pallets/community/Cargo.toml @@ -14,25 +14,28 @@ repository = "https://github.com/jurteam/jur-node/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.1.2", features = ["derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"], default-features = false } primitives = { package = 'jur-primitives', path = '../../primitives', default-features = false } -scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } # Substrate -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.41" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v1.0.0" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } -sp-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +sp-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } + +pallet-whitelist = { package = 'pallet-whitelist', path = '../whitelist', default-features = false } [dev-dependencies] serde = { version = "1.0.132" } # Substrate -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [features] default = ["std"] @@ -46,5 +49,6 @@ std = [ "primitives/std", "sp-std/std", "sp-runtime/std", + "pallet-whitelist/std", ] try-runtime = [ "frame-support/try-runtime" ] diff --git a/pallets/community/src/benchmarking.rs b/pallets/community/src/benchmarking.rs index 17676b49..1b794162 100644 --- a/pallets/community/src/benchmarking.rs +++ b/pallets/community/src/benchmarking.rs @@ -14,29 +14,30 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } -fn get_metadata() -> CommunityMetaData { +fn get_metadata() -> CommunityMetaData { CommunityMetaData { - community_type: CommunityType::Nation, - customs: vec![ + community_type: Some(CommunityType::Nation), + customs: Some(vec![ "in public transport young people should leave the seat to elderly or pregnant women" .into(), "name newborns with a name that starts with the letter A".into(), - ], - languages: vec!["English".into(), "German".into()], - norms: vec![], - religions: vec!["Christianity".into(), "Buddhism".into()], - territories: vec!["Mars".into()], - traditions: vec![ + ]), + languages: Some(vec!["English".into(), "German".into()]), + norms: Some(vec![]), + religions: Some(vec!["Christianity".into(), "Buddhism".into()]), + territories: Some(vec!["Mars".into()]), + traditions: Some(vec![ "Exchange gifts for Christmas".into(), "Organize one charity event every 100 blocks".into(), - ], - values: vec!["Peace".into(), "No gender discrimination".into()], + ]), + values: Some(vec!["Peace".into(), "No gender discrimination".into()]), } } benchmarks! { create_community { let caller: T::AccountId = whitelisted_caller(); let members = vec![account("sub", 1, SEED), account("sub", 2, SEED)]; + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller.clone()).unwrap(); }: _( RawOrigin::Signed(caller.clone()), @@ -45,16 +46,22 @@ benchmarks! { "Jur".into(), Some("Jur is the core community of the Jur ecosystem, which includes all the contributors.".into()), Some(members), - Some(get_metadata::()) + Some(get_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ) verify { - assert_last_event::(Event::::CreatedCommunity(T::Helper::community(0), caller).into()); + assert!(Communities::::get(T::Helper::community(1)).is_some()); } - delete_community { + update_community { let caller: T::AccountId = whitelisted_caller(); let members = vec![account("sub", 1, SEED)]; + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller.clone()).unwrap(); + Community::::create_community( RawOrigin::Signed(caller.clone()).into(), // hash of IPFS path of dummy logo @@ -62,20 +69,29 @@ benchmarks! { "Jur".into(), Some("Jur is the core community of the Jur ecosystem, which includes all the contributors.".into()), Some(members), - Some(get_metadata::()) + Some(get_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ).unwrap(); + let logo = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq"; + let description = "Jur is the core community of the Jur ecosystem"; + }: _( - RawOrigin::Signed(caller), T::Helper::community(0) + RawOrigin::Signed(caller), T::Helper::community(1), Some(logo.into()), Some(description.into()) ) verify { - assert_last_event::(Event::::DeletedCommunity(T::Helper::community(0)).into()); + assert_last_event::(Event::::UpdatedCommunity(T::Helper::community(1)).into()); } - update_community { + update_metadata { let caller: T::AccountId = whitelisted_caller(); let members = vec![account("sub", 1, SEED)]; + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller.clone()).unwrap(); + Community::::create_community( RawOrigin::Signed(caller.clone()).into(), // hash of IPFS path of dummy logo @@ -83,41 +99,44 @@ benchmarks! { "Jur".into(), Some("Jur is the core community of the Jur ecosystem, which includes all the contributors.".into()), Some(members), - Some(get_metadata::()) + Some(get_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ).unwrap(); - let metadata: CommunityMetaData = CommunityMetaData { - community_type: CommunityType::Nation, - customs: vec![ + let community_metadata = CommunityMetaData { + community_type: Some(CommunityType::Nation), + customs: Some(vec![ "in public transport young people should leave the seat to elderly or pregnant women" .into(), "name newborns with a name that starts with the letter A".into(), - ], - languages: vec!["English".into()], - norms: vec![], - religions: vec!["Christianity".into()], - territories: vec!["Mars".into()], - traditions: vec![ + ]), + languages: Some(vec!["Spanish".into(), "Swish".into()]), + norms: None, + religions: Some(vec!["Christianity".into(), "Buddhism".into()]), + territories: None, + traditions: Some(vec![ "Exchange gifts for Christmas".into(), "Organize one charity event every 100 blocks".into(), - ], - values: vec!["Peace".into(), "No gender discrimination".into()], + ]), + values: Some(vec!["Peace".into(), "No gender discrimination".into()]), }; - let logo = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq"; - let description = "Jur is the core community of the Jur ecosystem"; - }: _( - RawOrigin::Signed(caller), Some(logo.into()), Some(description.into()), T::Helper::community(0), Some(metadata) + RawOrigin::Signed(caller), T::Helper::community(1), community_metadata ) verify { - assert_last_event::(Event::::UpdatedCommunity(T::Helper::community(0)).into()); + assert_last_event::(Event::::UpdatedMetadata(T::Helper::community(1)).into()); } - add_members { + accept_members { let caller: T::AccountId = whitelisted_caller(); let members = vec![account("sub", 1, SEED)]; + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller.clone()).unwrap(); + Community::::create_community( RawOrigin::Signed(caller.clone()).into(), // hash of IPFS path of dummy logo @@ -125,16 +144,135 @@ benchmarks! { "Jur".into(), Some("Jur is the core community of the Jur ecosystem, which includes all the contributors.".into()), Some(members), - Some(get_metadata::()) + Some(get_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ).unwrap(); let members = vec![account("sub", 2, SEED), account("sub", 3, SEED)]; }: _( - RawOrigin::Signed(caller), T::Helper::community(0), members + RawOrigin::Signed(caller), T::Helper::community(1), members + ) + verify { + assert_last_event::(Event::::AddedMembers(T::Helper::community(1)).into()); + } + + join_community { + let caller: T::AccountId = whitelisted_caller(); + let members = vec![account("sub", 1, SEED)]; + + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller.clone()).unwrap(); + + Community::::create_community( + RawOrigin::Signed(caller.clone()).into(), + // hash of IPFS path of dummy logo + Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), + "Jur".into(), + Some("Jur is the core community of the Jur ecosystem, which includes all the contributors.".into()), + Some(members), + Some(get_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) + ).unwrap(); + + let member: T::AccountId = whitelisted_caller(); + + }: _( + RawOrigin::Signed(member), T::Helper::community(1) + ) + verify { + assert_last_event::(Event::::JoinedCommunity(T::Helper::community(1)).into()); + } + + leave_community { + let caller: T::AccountId = whitelisted_caller(); + let member: T::AccountId = whitelisted_caller(); + + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller.clone()).unwrap(); + + Community::::create_community( + RawOrigin::Signed(caller.clone()).into(), + // hash of IPFS path of dummy logo + Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), + "Jur".into(), + Some("Jur is the core community of the Jur ecosystem, which includes all the contributors.".into()), + Some(vec![member.clone()]), + Some(get_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) + ).unwrap(); + + }: _( + RawOrigin::Signed(member), T::Helper::community(1) + ) + verify { + assert_last_event::(Event::::LeavedCommunity(T::Helper::community(1)).into()); + } + + remove_member { + let caller: T::AccountId = whitelisted_caller(); + let member: T::AccountId = whitelisted_caller(); + + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller.clone()).unwrap(); + + Community::::create_community( + RawOrigin::Signed(caller.clone()).into(), + // hash of IPFS path of dummy logo + Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), + "Jur".into(), + Some("Jur is the core community of the Jur ecosystem, which includes all the contributors.".into()), + Some(vec![member.clone()]), + Some(get_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) + + ).unwrap(); + + }: _( + RawOrigin::Signed(caller), member.clone(), T::Helper::community(1) + ) + verify { + assert_last_event::(Event::::RemovedMember(member).into()); + } + + update_passport_metadata { + let caller: T::AccountId = whitelisted_caller(); + let members = vec![account("sub", 1, SEED)]; + + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller.clone()).unwrap(); + + Community::::create_community( + RawOrigin::Signed(caller.clone()).into(), + // hash of IPFS path of dummy logo + Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), + "Jur".into(), + Some("Jur is the core community of the Jur ecosystem, which includes all the contributors.".into()), + Some(members), + Some(get_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) + ).unwrap(); + + let tag = "Alpha"; + let p_color = "#E76081"; + let s_color = "#222308"; + + }: _( + RawOrigin::Signed(caller), T::Helper::community(1), Some(tag.into()), Some(p_color.into()), Some(s_color.into()) ) verify { - assert_last_event::(Event::::AddedMembers(T::Helper::community(0)).into()); + assert_last_event::(Event::::UpdatedTagAndColors(T::Helper::community(1)).into()); } impl_benchmark_test_suite!(Community, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/pallets/community/src/lib.rs b/pallets/community/src/lib.rs index c308bb4c..6c415b0f 100644 --- a/pallets/community/src/lib.rs +++ b/pallets/community/src/lib.rs @@ -15,13 +15,16 @@ //! //! * `create_community` //! * `update_community` +//! * `update_metadata` //! * `delete_community` -//! * `add_members` +//! * `accept_members` +//! * `join_community` //! #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::{dispatch::DispatchResult, BoundedVec}; +use codec::Encode; +use frame_support::{dispatch::DispatchResult, traits::Randomness, BoundedVec}; pub use pallet::*; use primitives::Incrementable; use sp_runtime::RuntimeDebug; @@ -40,8 +43,11 @@ mod tests; #[cfg(feature = "runtime-benchmarks")] mod benchmarking; +pub mod migration; pub mod weights; +const LOG_TARGET: &str = "runtime::community"; + #[frame_support::pallet] pub mod pallet { use frame_support::{pallet_prelude::*, traits::EnsureOriginWithArg}; @@ -49,6 +55,9 @@ pub mod pallet { use super::*; + /// The current storage version. + const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); + #[cfg(feature = "runtime-benchmarks")] pub trait BenchmarkHelper { fn community(i: u32) -> CommunityId; @@ -63,7 +72,7 @@ pub mod pallet { /// Configure the pallet by specifying the parameters and types on which it /// depends. #[pallet::config] - pub trait Config: frame_system::Config { + pub trait Config: frame_system::Config + pallet_whitelist::Config { /// Because this pallet emits events, it depends on the runtime's /// definition of an event. type RuntimeEvent: From> + IsType<::RuntimeEvent>; @@ -92,12 +101,31 @@ pub mod pallet { /// Weight information type WeightInfo: WeightInfo; + + type MyRandomness: Randomness>; + + /// The maximum length of tag. + #[pallet::constant] + type TagLimit: Get; + + /// The maximum length of color. + #[pallet::constant] + type ColorLimit: Get; + + /// The number of community, allowed to create by a founder. + #[pallet::constant] + type CommunityLimit: Get; } #[pallet::pallet] #[pallet::without_storage_info] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); + /// To be used in generating refernce number + #[pallet::storage] + pub(crate) type Nonce = StorageValue<_, u64, ValueQuery>; + /// Store the community with community id #[pallet::storage] #[pallet::getter(fn communities)] @@ -105,7 +133,18 @@ pub mod pallet { _, Blake2_128Concat, T::CommunityId, - Community, + Community, + >; + + /// The communities owned by a given account + #[pallet::storage] + #[pallet::getter(fn community_account)] + pub type CommunityAccount = StorageMap< + _, + Blake2_128Concat, + T::AccountId, + BoundedVec, + ValueQuery >; /// Stores the `CommunityId` that is going to be used for the next @@ -116,14 +155,22 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// Created Community [community, founder] - CreatedCommunity(T::CommunityId, T::AccountId), - /// Deleted Community [community] - DeletedCommunity(T::CommunityId), + /// Created Community [communityId, referenceId, founder] + CreatedCommunity(T::CommunityId, T::Hash, T::AccountId), /// Updated Community [community] UpdatedCommunity(T::CommunityId), /// Updated Community [community] AddedMembers(T::CommunityId), + /// Updated Community Metadata [community] + UpdatedMetadata(T::CommunityId), + /// Joined Community [community] + JoinedCommunity(T::CommunityId), + /// Leaved Community [community] + LeavedCommunity(T::CommunityId), + /// Removed member from community [member] + RemovedMember(T::AccountId), + /// Updated Tag And Colors [community] + UpdatedTagAndColors(T::CommunityId), } // Errors inform users that something went wrong. @@ -137,6 +184,20 @@ pub mod pallet { BadName, /// Invalid description given. BadDescription, + /// Already a member of the community. + AlreadyMember, + /// Not member of given community. + NotMember, + /// Not Allowed For Public Community + NotAllowedForPublicCommunity, + /// Invalid tag given. + BadTag, + /// Invalid description given. + BadColor, + /// Founder not whitelisted. + FounderNotExist, + /// Too Many Communities + TooManyCommunities } #[pallet::hooks] @@ -160,7 +221,7 @@ pub mod pallet { /// Emits `CreatedCommunity` event when successful. /// #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::create_community())] + #[pallet::weight(::WeightInfo::create_community())] pub fn create_community( origin: OriginFor, logo: Option>, @@ -168,12 +229,18 @@ pub mod pallet { description: Option>, members: Option>, metadata: Option>, + category: Category, + tagline: Option>, + primary_color: Option>, + secondary_color: Option>, ) -> DispatchResult { let community_id = NextCommunityId::::get().unwrap_or(T::CommunityId::initial_value()); let founder = T::CreateOrigin::ensure_origin(origin, &community_id)?; + pallet_whitelist::Founders::::get().binary_search(&founder).ok().ok_or(Error::::FounderNotExist)?; + Self::do_create_community( community_id, founder, @@ -182,79 +249,86 @@ pub mod pallet { description, members, metadata, + category, + tagline, + primary_color, + secondary_color ) } - /// Delete a particular community from a privileged origin. + /// Update a particular community from a privileged origin. /// /// The origin must conform to `CreateOrigin`. /// /// Parameters: - /// - `community_id`: Id of the community to be deleted + /// - `community_id`: Id of the community to be updated. + /// - `logo`: This is an image file (also a GIF is valid) that is uploaded on IPFS. + /// - `description`: Information about community. + /// + /// Emits `UpdatedCommunity` event when successful. /// - /// Emits `DeletedCommunity` event when successful. #[pallet::call_index(1)] - #[pallet::weight(T::WeightInfo::delete_community())] - pub fn delete_community( + #[pallet::weight(::WeightInfo::update_community())] + pub fn update_community( origin: OriginFor, community_id: T::CommunityId, + logo: Option>, + description: Option>, ) -> DispatchResult { let founder = T::CreateOrigin::ensure_origin(origin, &community_id)?; - let community = - Communities::::get(community_id).ok_or(Error::::CommunityNotExist)?; + let bounded_description: BoundedVec = + if let Some(desc) = description { + desc.try_into().map_err(|_| Error::::BadDescription)? + } else { + Default::default() + }; - ensure!(founder == community.founder, Error::::NoPermission); + Communities::::try_mutate(community_id, |maybe_community| { + let community = maybe_community + .as_mut() + .ok_or(Error::::CommunityNotExist)?; - // TODO Also need to delete associated proposal - >::remove(community_id); + ensure!(founder == community.founder, Error::::NoPermission); - Self::deposit_event(Event::DeletedCommunity(community_id)); + community.logo = logo; + community.description = bounded_description; - Ok(()) + Self::deposit_event(Event::UpdatedCommunity(community_id)); + + Ok(()) + }) } - /// Update a particular community from a privileged origin. + /// Update a particular community metadata from a privileged origin. /// /// The origin must conform to `CreateOrigin`. /// /// Parameters: - /// - `logo`: This is an image file (also a GIF is valid) that is uploaded on IPFS. - /// - `description`: Information about community - /// - `community_id`: Id of the community to be updated + /// - `community_id`: Id of the community to be updated. /// - `metadata`: Other customizable fields like community_type, custom, language, norms etc. /// - /// Emits `UpdatedCommunity` event when successful. + /// Emits `UpdatedMetadata` event when successful. /// #[pallet::call_index(2)] - #[pallet::weight(T::WeightInfo::update_community())] - pub fn update_community( + #[pallet::weight(::WeightInfo::update_metadata())] + pub fn update_metadata( origin: OriginFor, - logo: Option>, - description: Option>, community_id: T::CommunityId, - metadata: Option>, + metadata: CommunityMetaDataFor, ) -> DispatchResult { let founder = T::CreateOrigin::ensure_origin(origin, &community_id)?; - let bounded_description: BoundedVec = - if let Some(desc) = description { - desc - .try_into() - .map_err(|_| Error::::BadDescription)? - } else { - Default::default() - }; - Communities::::try_mutate(community_id, |maybe_community| { let community = maybe_community .as_mut() .ok_or(Error::::CommunityNotExist)?; + ensure!(founder == community.founder, Error::::NoPermission); - community.logo = logo; - community.description = bounded_description; - community.metadata = metadata; - Self::deposit_event(Event::UpdatedCommunity(community_id)); + + community.metadata = Option::from(metadata); + + Self::deposit_event(Event::UpdatedMetadata(community_id)); Ok(()) }) @@ -270,8 +344,8 @@ pub mod pallet { /// /// Emits `UpdatedCommunity` event when successful. #[pallet::call_index(3)] - #[pallet::weight(10_000)] - pub fn add_members( + #[pallet::weight(::WeightInfo::accept_members())] + pub fn accept_members( origin: OriginFor, community_id: T::CommunityId, members: Vec, @@ -299,6 +373,187 @@ pub mod pallet { Ok(()) }) } + + /// Join any particular public community. + /// + /// The origin must conform to `CreateOrigin`. + /// + /// Parameters: + /// - `community_id`: Id of the community to be updated + /// + /// Emits `JoinedCommunity` event when successful. + #[pallet::call_index(4)] + #[pallet::weight(::WeightInfo::join_community())] + pub fn join_community( + origin: OriginFor, + community_id: T::CommunityId, + ) -> DispatchResult { + let member = T::CreateOrigin::ensure_origin(origin, &community_id)?; + + Communities::::try_mutate(community_id, |maybe_community| { + let community = maybe_community + .as_mut() + .ok_or(Error::::CommunityNotExist)?; + + let mut community_members = community.members.clone(); + + ensure!(!community_members.contains(&member), Error::::AlreadyMember); + community_members.push(member.clone()); + + community.members = community_members; + + Self::deposit_event(Event::JoinedCommunity(community_id)); + + Ok(()) + }) + } + + /// Leave any particular private/public community. + /// + /// The origin must conform to `CreateOrigin`. + /// + /// Parameters: + /// - `community_id`: Id of the community to be updated + /// + /// Emits `LeavedCommunity` event when successful. + #[pallet::call_index(5)] + #[pallet::weight(::WeightInfo::leave_community())] + pub fn leave_community( + origin: OriginFor, + community_id: T::CommunityId, + ) -> DispatchResult { + let member = T::CreateOrigin::ensure_origin(origin, &community_id)?; + + Communities::::try_mutate(community_id, |maybe_community| { + let community = maybe_community + .as_mut() + .ok_or(Error::::CommunityNotExist)?; + + let mut community_members = community.members.clone(); + + ensure!(community_members.contains(&member), Error::::NotMember); + + let index = community_members + .iter() + .position(|value| *value == member.clone()) + .expect("Member not found."); + + community_members.remove(index); + + community.members = community_members; + + Self::deposit_event(Event::LeavedCommunity(community_id)); + + Ok(()) + }) + } + + /// Remove member from private community. + /// + /// The origin must conform to `CreateOrigin`. + /// + /// Parameters: + /// - `member`: member Account which founder want to remove from community + /// - `community_id`: Id of the community to be updated + /// + /// Emits `RemovedMember` event when successful. + #[pallet::call_index(6)] + #[pallet::weight(::WeightInfo::remove_member())] + pub fn remove_member( + origin: OriginFor, + member: T::AccountId, + community_id: T::CommunityId, + ) -> DispatchResult { + let founder = T::CreateOrigin::ensure_origin(origin, &community_id)?; + + Communities::::try_mutate(community_id, |maybe_community| { + let community = maybe_community + .as_mut() + .ok_or(Error::::CommunityNotExist)?; + + // TODO update below check to restrict this extrinsic for private communities + // ensure!(community.type == "Private", Error::::NoPermission); + + ensure!(founder == community.founder, Error::::NoPermission); + + let mut community_members = community.members.clone(); + + ensure!(community_members.contains(&member), Error::::NotMember); + + let index = community_members + .iter() + .position(|value| *value == member.clone()) + .expect("Member not found."); + + community_members.remove(index); + + community.members = community_members; + + Self::deposit_event(Event::RemovedMember(member)); + + Ok(()) + }) + } + + /// Update tag and colors of a particular community from a privileged origin. + /// + /// The origin must conform to `CreateOrigin`. + /// + /// Parameters: + /// - `community_id`: Id of the community to be updated. + /// - `tag`: This is tagline. + /// - `primary_color`: Primary color, which will be used by the passport generator. + /// - `secondary_color`: Secondary color, which will be used by the passport generator.. + /// Emits `UpdatedTagAndColors` event when successful. + /// + #[pallet::call_index(7)] + #[pallet::weight(::WeightInfo::update_passport_metadata())] + pub fn update_passport_metadata( + origin: OriginFor, + community_id: T::CommunityId, + tagline: Option>, + primary_color: Option>, + secondary_color: Option>, + ) -> DispatchResult { + let founder = T::CreateOrigin::ensure_origin(origin, &community_id)?; + + let bounded_tag: BoundedVec = + if let Some(t) = tagline { + t.try_into().map_err(|_| Error::::BadTag)? + } else { + Default::default() + }; + + let bounded_primary_color: BoundedVec = + if let Some(color) = primary_color { + color.try_into().map_err(|_| Error::::BadColor)? + } else { + Default::default() + }; + + let bounded_secondary_color: BoundedVec = + if let Some(color) = secondary_color { + color.try_into().map_err(|_| Error::::BadColor)? + } else { + Default::default() + }; + + Communities::::try_mutate(community_id, |maybe_community| { + let community = maybe_community + .as_mut() + .ok_or(Error::::CommunityNotExist)?; + + ensure!(founder == community.founder, Error::::NoPermission); + + community.tag = bounded_tag; + community.primary_color = bounded_primary_color; + community.secondary_color = bounded_secondary_color; + + Self::deposit_event(Event::UpdatedTagAndColors(community_id)); + + Ok(()) + }) + } } } @@ -311,24 +566,47 @@ impl Pallet { maybe_description: Option>, maybe_members: Option>, metadata: Option>, + category: Category, + maybe_tag: Option>, + maybe_primary_color: Option>, + maybe_secondary_color: Option>, ) -> DispatchResult { let bounded_name: BoundedVec = name.clone().try_into().map_err(|_| Error::::BadName)?; let bounded_description: BoundedVec = if let Some(desc) = maybe_description { - desc - .try_into() - .map_err(|_| Error::::BadDescription)? - } else { - Default::default() - }; - - let members= if let Some(members) = maybe_members { - members - } else { - Vec::new() - }; + desc.try_into().map_err(|_| Error::::BadDescription)? + } else { + Default::default() + }; + + let bounded_tag: BoundedVec = + if let Some(tag) = maybe_tag { + tag.try_into().map_err(|_| Error::::BadTag)? + } else { + Default::default() + }; + + let bounded_primary_color: BoundedVec = + if let Some(color) = maybe_primary_color { + color.try_into().map_err(|_| Error::::BadColor)? + } else { + Default::default() + }; + + let bounded_secondary_color: BoundedVec = + if let Some(color) = maybe_secondary_color { + color.try_into().map_err(|_| Error::::BadColor)? + } else { + Default::default() + }; + + let members = if let Some(members) = maybe_members { members } else { Vec::new() }; + + // Random value. + let nonce = Self::get_and_increment_nonce(); + let (random_value, _) = T::MyRandomness::random(&nonce); let community = Community { founder: founder.clone(), @@ -337,15 +615,32 @@ impl Pallet { description: bounded_description, members, metadata, + reference_id: random_value, + category, + tag: bounded_tag, + primary_color: bounded_primary_color, + secondary_color: bounded_secondary_color }; + >::try_mutate(founder.clone(), |communities| -> DispatchResult { + communities + .try_push(community_id) + .map_err(|_| Error::::TooManyCommunities)?; + Ok(()) + })?; >::insert(community_id, community); let next_id = community_id.increment(); NextCommunityId::::set(Some(next_id)); - Self::deposit_event(Event::CreatedCommunity(community_id, founder)); + Self::deposit_event(Event::CreatedCommunity(community_id, random_value, founder)); Ok(()) } + + fn get_and_increment_nonce() -> Vec { + let nonce = Nonce::::get(); + Nonce::::put(nonce.wrapping_add(1)); + nonce.encode() + } } diff --git a/pallets/community/src/migration.rs b/pallets/community/src/migration.rs new file mode 100644 index 00000000..3f339f06 --- /dev/null +++ b/pallets/community/src/migration.rs @@ -0,0 +1,108 @@ +use super::*; +use frame_support::{log, traits::OnRuntimeUpgrade}; +use sp_runtime::Saturating; + +pub mod v6 { + use frame_support::{pallet_prelude::*, weights::Weight}; + + use super::*; + + pub struct MigrateToV6(sp_std::marker::PhantomData); + impl OnRuntimeUpgrade for MigrateToV6 { + + fn on_runtime_upgrade() -> Weight { + let current_version = Pallet::::current_storage_version(); + let onchain_version = Pallet::::on_chain_storage_version(); + + if onchain_version == 5 && current_version == 6 { + let mut translated = 0u64; + for (id, community) in Communities::::iter() { + translated.saturating_inc(); + >::try_mutate(community.founder, |communities| -> DispatchResult { + communities + .try_push(id) + .map_err(|_| Error::::TooManyCommunities)?; + Ok(()) + }).unwrap(); + } + 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, &'static str> { + frame_support::ensure!( + Pallet::::on_chain_storage_version() == 1, + "must upgrade linearly" + ); + let prev_count = Communities::::iter().count(); + Ok((prev_count as u32).encode()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(prev_count: Vec) -> Result<(), &'static str> { + 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 = Communities::::iter().count() as u32; + assert_eq!( + prev_count, post_count, + "the community 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 == 2, "must_upgrade"); + assert_eq!( + current_version, onchain_version, + "after migration, the current_version and onchain_version should be the same" + ); + + Ok(()) + } + } +} + + +#[cfg(test)] +#[cfg(feature = "try-runtime")] +mod test { + use frame_support::pallet_prelude::StorageVersion; + use super::*; + use crate::mock::{Test as T, *}; + + #[test] + fn migration_works() { + new_test_ext().execute_with(|| { + assert_eq!(StorageVersion::get::>(), 0); + + create_community(); + setup_blocks(5); + create_community(); + + assert_eq!(Communities::::iter_values().count() as u32, 2); + + let state = v3::MigrateToV3::::pre_upgrade().unwrap(); + let _w = v3::MigrateToV3::::on_runtime_upgrade(); + v3::MigrateToV3::::post_upgrade(state).unwrap(); + + assert_eq!(Communities::::iter_values().count() as u32, 2); + assert_eq!(StorageVersion::get::>(), 2); + assert_ne!(Some(Communities::::get(1).unwrap().reference_id), Some(Communities::::get(0).unwrap().reference_id)); + }); + } +} \ No newline at end of file diff --git a/pallets/community/src/mock.rs b/pallets/community/src/mock.rs index 486976d5..3ad85397 100644 --- a/pallets/community/src/mock.rs +++ b/pallets/community/src/mock.rs @@ -1,4 +1,6 @@ use crate as pallet_community; +use crate::{CommunityMetaData, CommunityType, Category}; +use frame_support::pallet_prelude::Hooks; use frame_support::{ parameter_types, traits::{AsEnsureOriginWithArg, ConstU16, ConstU32, ConstU64}, @@ -6,22 +8,20 @@ use frame_support::{ use frame_system as system; use sp_core::H256; use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, + traits::{BlakeTwo256, Header as _, IdentityLookup}, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Community: pallet_community::{Pallet, Call, Storage, Event}, + System: frame_system, + CollectiveFlip: pallet_insecure_randomness_collective_flip, + Community: pallet_community, + Whitelist: pallet_whitelist, } ); @@ -37,13 +37,12 @@ impl system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -56,6 +55,7 @@ impl system::Config for Test { type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; } +impl pallet_insecure_randomness_collective_flip::Config for Test {} impl pallet_community::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -66,12 +66,82 @@ impl pallet_community::Config for Test { #[cfg(feature = "runtime-benchmarks")] type Helper = (); type WeightInfo = (); + type MyRandomness = CollectiveFlip; + type TagLimit = ConstU32<50>; + type ColorLimit = ConstU32<7>; + type CommunityLimit = ConstU32<3>; +} + +impl pallet_whitelist::Config for Test { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); } // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - system::GenesisConfig::default() - .build_storage::() + let mut ext: sp_io::TestExternalities = system::GenesisConfig::::default() + .build_storage() .unwrap() - .into() + .into(); + ext.execute_with(|| System::set_block_number(1)); + ext +} + +pub fn setup_blocks(blocks: u64) { + let mut parent_hash = System::parent_hash(); + + for i in 1..(blocks + 1) { + System::reset_events(); + System::initialize(&i, &parent_hash, &Default::default()); + CollectiveFlip::on_initialize(i); + + let header = System::finalize(); + parent_hash = header.hash(); + System::set_block_number(*header.number()); + } +} + +pub fn get_metadata() -> CommunityMetaData { + let community_metadata = CommunityMetaData { + community_type: Some(CommunityType::Nation), + customs: Some(vec![ + "in public transport young people should leave the seat to elderly or pregnant women" + .into(), + "name newborns with a name that starts with the letter A".into(), + ]), + languages: Some(vec!["English".into(), "German".into()]), + norms: Some(vec![]), + religions: Some(vec!["Christianity".into(), "Buddhism".into()]), + territories: Some(vec!["Mars".into()]), + traditions: Some(vec![ + "Exchange gifts for Christmas".into(), + "Organize one charity event every 100 blocks".into(), + ]), + values: Some(vec!["Peace".into(), "No gender discrimination".into()]), + }; + + community_metadata +} + +pub fn add_founder() { + Whitelist::add_founder(RuntimeOrigin::root(), 1).unwrap(); +} +pub fn create_community() { + Community::create_community( + RuntimeOrigin::signed(1), + // hash of IPFS path of dummy logo + Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), + "Jur".into(), + Some( + "Jur is the core community of the Jur ecosystem, which includes all the contributors." + .into(), + ), + Some(vec![1, 2]), + Some(get_metadata()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) + ) + .unwrap(); } diff --git a/pallets/community/src/tests.rs b/pallets/community/src/tests.rs index 5514c5bb..bce17601 100644 --- a/pallets/community/src/tests.rs +++ b/pallets/community/src/tests.rs @@ -4,48 +4,50 @@ use crate::{ Communities, Error, }; use frame_support::{assert_noop, assert_ok}; -use sp_core::H256; +use crate::types::Category; -fn get_metadata() -> CommunityMetaData { - let community_metadata = CommunityMetaData { - community_type: CommunityType::Nation, - customs: vec![ - "in public transport young people should leave the seat to elderly or pregnant women" - .into(), - "name newborns with a name that starts with the letter A".into(), - ], - languages: vec!["English".into(), "German".into()], - norms: vec![], - religions: vec!["Christianity".into(), "Buddhism".into()], - territories: vec!["Mars".into()], - traditions: vec![ - "Exchange gifts for Christmas".into(), - "Organize one charity event every 100 blocks".into(), - ], - values: vec!["Peace".into(), "No gender discrimination".into()], - }; - - community_metadata -} -fn create_community() { - Community::create_community( - RuntimeOrigin::signed(1), - // hash of IPFS path of dummy logo - Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), - "Jur".into(), - Some("Jur is the core community of the Jur ecosystem, which includes all the contributors." - .into()), - Some(vec![1, 2]), - Some(get_metadata()), - ) - .unwrap(); -} #[test] fn create_community_works() { new_test_ext().execute_with(|| { - assert!(!Communities::::contains_key(0)); + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + assert!(Communities::::contains_key(1)); + setup_blocks(5); create_community(); - assert!(Communities::::contains_key(0)); + assert_ne!( + Some(Communities::::get(2).unwrap().reference_id), + Some(Communities::::get(1).unwrap().reference_id) + ); + }); +} + +#[test] +fn founder_with_more_communities_not_allowed() { + new_test_ext().execute_with(|| { + add_founder(); + create_community(); + create_community(); + create_community(); + assert_noop!( + Community::create_community( + RuntimeOrigin::signed(1), + // hash of IPFS path of dummy logo + Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), + "Jur".into(), + Some( + "Jur is the core community of the Jur ecosystem, which includes all the contributors." + .into(), + ), + Some(vec![1, 2]), + Some(get_metadata()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) + ), + Error::::TooManyCommunities + ); }); } @@ -53,6 +55,7 @@ fn create_community_works() { fn create_community_works_only_with_name() { new_test_ext().execute_with(|| { assert!(!Communities::::contains_key(0)); + add_founder(); Community::create_community( RuntimeOrigin::signed(1), // hash of IPFS path of dummy logo @@ -61,38 +64,53 @@ fn create_community_works_only_with_name() { None, None, None, + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ) - .unwrap(); - assert!(Communities::::contains_key(0)); - assert_eq!(Communities::::get(0).unwrap().name.to_vec(), "Jur".as_bytes().to_vec()); + .unwrap(); + assert!(Communities::::contains_key(1)); + assert_eq!(Communities::::get(1).unwrap().name.to_vec(), "Jur".as_bytes().to_vec()); }); } #[test] -fn delete_community_works() { - new_test_ext().execute_with(|| { - create_community(); - assert!(Communities::::contains_key(0)); - - assert_ok!(Community::delete_community(RuntimeOrigin::signed(1), 0)); - assert!(!Communities::::contains_key(0)); - }); -} - -#[test] -fn delete_community_not_works_for_invalid_input() { +fn create_community_not_works_with_invalid_color() { new_test_ext().execute_with(|| { + add_founder(); assert_noop!( - Community::delete_community(RuntimeOrigin::signed(1), 0), - Error::::CommunityNotExist + Community::create_community( + RuntimeOrigin::signed(1), + // hash of IPFS path of dummy logo + None, + "Jur".into(), + None, + None, + None, + Category::Public, + Some("tag".into()), + Some("#invalid color".into()), + Some("#E76080".into()) + ), + Error::::BadColor ); - create_community(); - assert!(Communities::::contains_key(0)); - assert_noop!( - Community::delete_community(RuntimeOrigin::signed(2), 0), - Error::::NoPermission + Community::create_community( + RuntimeOrigin::signed(1), + // hash of IPFS path of dummy logo + None, + "Jur".into(), + None, + None, + None, + Category::Public, + Some("tag".into()), + Some("#E76080".into()), + Some("#invalid color".into()) + ), + Error::::BadColor ); }); } @@ -106,24 +124,22 @@ fn update_community_not_works_for_invalid_input() { assert_noop!( Community::update_community( RuntimeOrigin::signed(1), - Some(logo.into()), - Some(description.into()), 0, - Some(get_metadata()) + Some(logo.into()), + Some(description.into()) ), Error::::CommunityNotExist ); - + add_founder(); create_community(); - assert!(Communities::::contains_key(0)); + assert!(Communities::::contains_key(1)); assert_noop!( Community::update_community( RuntimeOrigin::signed(2), + 1, Some(logo.into()), - Some(description.into()), - 0, - Some(get_metadata()) + Some(description.into()) ), Error::::NoPermission ); @@ -133,74 +149,351 @@ fn update_community_not_works_for_invalid_input() { #[test] fn update_community_works() { new_test_ext().execute_with(|| { - create_community(); - assert!(Communities::::contains_key(0)); - - assert_eq!(Communities::::get(0).unwrap().metadata.unwrap().languages, vec!["English".as_bytes().to_vec(), "German".as_bytes().to_vec()]); - - let metadata = CommunityMetaData { - community_type: CommunityType::Nation, - customs: vec![ - "in public transport young people should leave the seat to elderly or pregnant women" - .into(), - "name newborns with a name that starts with the letter A".into(), - ], - languages: vec!["English".into()], - norms: vec![], - religions: vec!["Christianity".into()], - territories: vec!["Mars".into()], - traditions: vec![ - "Exchange gifts for Christmas".into(), - "Organize one charity event every 100 blocks".into(), - ], - values: vec!["Peace".into(), "No gender discrimination".into()], - }; + add_founder(); + create_community(); + assert!(Communities::::contains_key(1)); - let logo = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq"; - let description = "Jur is the core community of the Jur ecosystem"; + assert_eq!( + Communities::::get(1).unwrap().logo.unwrap(), + "bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq" + .as_bytes() + .to_vec() + ); - assert_ok!(Community::update_community(RuntimeOrigin::signed(1), Some(logo.into()), Some(description.into()), 0, Some(metadata))); + let logo = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq"; + let description = "Jur is the core community of the Jur ecosystem"; - assert_eq!(Communities::::get(0).unwrap().logo.unwrap(), logo.as_bytes().to_vec()); - assert_eq!(Communities::::get(0).unwrap().metadata.unwrap().languages, vec!["English".as_bytes().to_vec()]); - assert_eq!(Communities::::get(0).unwrap().metadata.unwrap().religions, vec!["Christianity".as_bytes().to_vec()]); + assert_ok!(Community::update_community( + RuntimeOrigin::signed(1), + 1, + Some(logo.into()), + Some(description.into()) + )); - }); + assert_eq!(Communities::::get(1).unwrap().logo.unwrap(), logo.as_bytes().to_vec()); + }); } #[test] -fn add_members_works() { +fn accept_members_works() { new_test_ext().execute_with(|| { assert!(!Communities::::contains_key(0)); + add_founder(); create_community(); let new_members = vec![3, 4]; - assert_eq!(Communities::::get(0).unwrap().members, vec![1, 2]); + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); - assert_ok!(Community::add_members(RuntimeOrigin::signed(1), 0, new_members)); - assert_eq!(Communities::::get(0).unwrap().members, vec![1, 2, 3, 4]); + assert_ok!(Community::accept_members(RuntimeOrigin::signed(1), 1, new_members)); + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2, 3, 4]); }); } #[test] -fn add_members_not_works_for_invalid_input() { +fn accept_members_not_works_for_invalid_input() { new_test_ext().execute_with(|| { assert!(!Communities::::contains_key(0)); let new_members = vec![3, 4]; assert_noop!( - Community::add_members(RuntimeOrigin::signed(1), 1, new_members.clone()), + Community::accept_members(RuntimeOrigin::signed(1), 1, new_members.clone()), Error::::CommunityNotExist ); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + assert_noop!( + Community::accept_members(RuntimeOrigin::signed(2), 1, new_members), + Error::::NoPermission + ); + }); +} + +#[test] +fn update_metadata_works() { + new_test_ext().execute_with(|| { + add_founder(); create_community(); + assert!(Communities::::contains_key(1)); + + assert_eq!( + Communities::::get(1) + .unwrap() + .metadata + .unwrap() + .languages, + Some(vec!["English".as_bytes().to_vec(), "German".as_bytes().to_vec()]) + ); - assert_eq!(Communities::::get(0).unwrap().members, vec![1, 2]); + let community_metadata = CommunityMetaData { + community_type: Some(CommunityType::Nation), + customs: Some(vec![ + "in public transport young people should leave the seat to elderly or pregnant women" + .into(), + "name newborns with a name that starts with the letter A".into(), + ]), + languages: Some(vec!["Spanish".into(), "Swish".into()]), + norms: None, + religions: Some(vec!["Christianity".into(), "Buddhism".into()]), + territories: None, + traditions: Some(vec![ + "Exchange gifts for Christmas".into(), + "Organize one charity event every 100 blocks".into(), + ]), + values: Some(vec!["Peace".into(), "No gender discrimination".into()]), + }; + + assert_ok!(Community::update_metadata(RuntimeOrigin::signed(1), 1, community_metadata)); + + assert_eq!( + Communities::::get(1) + .unwrap() + .metadata + .unwrap() + .languages, + Some(vec!["Spanish".as_bytes().to_vec(), "Swish".as_bytes().to_vec()]) + ); + + assert_eq!( + Communities::::get(1) + .unwrap() + .metadata + .unwrap() + .territories, + None + ); + + assert_eq!(Communities::::get(1).unwrap().metadata.unwrap().norms, None); + }); +} + +#[test] +fn update_metadata_not_works_for_invalid_community_id() { + new_test_ext().execute_with(|| { + add_founder(); + create_community(); + assert!(Communities::::contains_key(1)); + + assert_eq!( + Communities::::get(1) + .unwrap() + .metadata + .unwrap() + .languages, + Some(vec!["English".as_bytes().to_vec(), "German".as_bytes().to_vec()]) + ); + + assert_noop!( + Community::update_metadata(RuntimeOrigin::signed(1), 2, get_metadata()), + Error::::CommunityNotExist + ); + }); +} + +#[test] +fn update_metadata_not_works_for_invalid_caller() { + new_test_ext().execute_with(|| { + add_founder(); + create_community(); + assert!(Communities::::contains_key(1)); + + assert_eq!( + Communities::::get(1) + .unwrap() + .metadata + .unwrap() + .languages, + Some(vec!["English".as_bytes().to_vec(), "German".as_bytes().to_vec()]) + ); assert_noop!( - Community::add_members(RuntimeOrigin::signed(2), 0, new_members), + Community::update_metadata(RuntimeOrigin::signed(2), 1, get_metadata()), Error::::NoPermission ); }); } + +#[test] +fn join_community_works() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(0)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + + assert_ok!(Community::join_community(RuntimeOrigin::signed(3), 1)); + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2, 3]); + }); +} + +#[test] +fn join_community_not_works_for_already_joined() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + assert_noop!( + Community::join_community(RuntimeOrigin::signed(2), 1), + Error::::AlreadyMember + ); + }); +} + +#[test] +fn join_community_not_works_for_invalid_community() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + assert_noop!( + Community::join_community(RuntimeOrigin::signed(2), 2), + Error::::CommunityNotExist + ); + }); +} + +#[test] +fn leave_community_works() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + + assert_ok!(Community::leave_community(RuntimeOrigin::signed(2), 1)); + assert_eq!(Communities::::get(1).unwrap().members, vec![1]); + }); +} + +#[test] +fn leave_community_not_work_for_member_not_part_of_community() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + + assert_noop!( + Community::leave_community(RuntimeOrigin::signed(3), 1), + Error::::NotMember + ); + }); +} + +#[test] +fn leave_community_not_work_for_invalid_community() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + + assert_noop!( + Community::leave_community(RuntimeOrigin::signed(2), 2), + Error::::CommunityNotExist + ); + }); +} + +#[test] +fn remove_member_works() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + + assert_ok!(Community::remove_member(RuntimeOrigin::signed(1), 2, 1)); + assert_eq!(Communities::::get(1).unwrap().members, vec![1]); + }); +} + +#[test] +fn remove_member_not_work_for_member_not_part_of_community() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + + assert_noop!( + Community::remove_member(RuntimeOrigin::signed(1), 3, 1), + Error::::NotMember + ); + }); +} + +#[test] +fn remove_member_not_work_for_invalid_community() { + new_test_ext().execute_with(|| { + assert!(!Communities::::contains_key(1)); + add_founder(); + create_community(); + + assert_eq!(Communities::::get(1).unwrap().members, vec![1, 2]); + + assert_noop!( + Community::remove_member(RuntimeOrigin::signed(1), 2, 2), + Error::::CommunityNotExist + ); + }); +} + +#[test] +fn update_community_tag_and_colors_works() { + new_test_ext().execute_with(|| { + add_founder(); + create_community(); + assert!(Communities::::contains_key(1)); + + assert_eq!( + Communities::::get(1).unwrap().tag, + "tag" + .as_bytes() + .to_vec() + ); + + assert_eq!( + Communities::::get(1).unwrap().primary_color, + "#222307" + .as_bytes() + .to_vec() + ); + + assert_eq!( + Communities::::get(1).unwrap().secondary_color, + "#E76080" + .as_bytes() + .to_vec() + ); + + let tag = "Alpha"; + let p_color = "#E76081"; + let s_color = "#222308"; + + assert_ok!(Community::update_passport_metadata( + RuntimeOrigin::signed(1), + 1, + Some(tag.into()), + Some(p_color.into()), + Some(s_color.into()) + )); + + assert_eq!(Communities::::get(1).unwrap().tag, tag.as_bytes().to_vec()); + assert_eq!(Communities::::get(1).unwrap().primary_color, p_color.as_bytes().to_vec()); + assert_eq!(Communities::::get(1).unwrap().secondary_color, s_color.as_bytes().to_vec()); + }); +} diff --git a/pallets/community/src/types.rs b/pallets/community/src/types.rs index 0bd96fba..ff55cc30 100644 --- a/pallets/community/src/types.rs +++ b/pallets/community/src/types.rs @@ -5,50 +5,69 @@ use scale_info::TypeInfo; use sp_std::{prelude::*, vec::Vec}; pub type CommunityMetaDataFor = - CommunityMetaData<::AccountId, ::Hash>; + CommunityMetaData<::AccountId>; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, Default)] -#[scale_info(skip_type_params(NameLimit, DescriptionLimit))] -pub struct Community, DescriptionLimit: Get> { +#[scale_info(skip_type_params(NameLimit, DescriptionLimit, TagLimit, ColorLimit))] +pub struct Community, DescriptionLimit: Get, TagLimit: Get, ColorLimit: Get> { pub founder: AccountId, pub logo: Option>, pub name: BoundedVec, pub description: BoundedVec, pub members: Vec, - pub metadata: Option>, + pub metadata: Option>, + pub reference_id: Hash, + pub category: Category, + pub tag: BoundedVec, + pub primary_color: BoundedVec, + pub secondary_color: BoundedVec, } #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, Default)] -pub struct CommunityMetaData { - pub community_type: CommunityType, - pub customs: Vec>, - pub languages: Vec>, - pub norms: Vec, - pub religions: Vec>, - pub territories: Vec>, - pub traditions: Vec>, - pub values: Vec>, +pub struct CommunityMetaData { + pub community_type: Option>, + pub customs: Option>>, + pub languages: Option>>, + pub norms: Option>>, + pub religions: Option>>, + pub territories: Option>>, + pub traditions: Option>>, + pub values: Option>>, } #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, Default)] -pub struct State { - pub constitution: Vec, +pub struct State { + pub constitution: Vec>, pub government: Vec, pub citizens: Vec, } -/// Different types of Communitie. +/// Different types of Communities. #[derive(Eq, PartialEq, Clone, RuntimeDebug, TypeInfo, Encode, Decode)] -pub enum CommunityType { +pub enum CommunityType { /// Community Type. Community, /// A community of entities and people united by a commonality. Nation, /// A State is the next step of a Nation. - State(State), + State(State), } -impl Default for CommunityType { +#[derive(Eq, PartialEq, Clone, RuntimeDebug, TypeInfo, Encode, Decode)] +pub enum Category { + /// public. + Public, + /// A NFT Gated community. + NFTGated +} + +impl Default for CommunityType { fn default() -> Self { Self::Community } } + +impl Default for Category { + fn default() -> Self { + Self::Public + } +} diff --git a/pallets/community/src/weights.rs b/pallets/community/src/weights.rs index 9abdf541..7ed2645b 100644 --- a/pallets/community/src/weights.rs +++ b/pallets/community/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_community //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Ayushs-MacBook-Pro.local`, CPU: `` +//! HOSTNAME: `PAR02052`, CPU: `` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -12,7 +12,6 @@ // benchmark // pallet // --chain=dev -// --execution=wasm // --wasm-execution=compiled // --pallet=pallet-community // --extrinsic=* @@ -31,9 +30,13 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_community. pub trait WeightInfo { fn create_community() -> Weight; - fn delete_community() -> Weight; fn update_community() -> Weight; - fn add_members() -> Weight; + fn update_metadata() -> Weight; + fn accept_members() -> Weight; + fn join_community() -> Weight; + fn leave_community() -> Weight; + fn remove_member() -> Weight; + fn update_passport_metadata() -> Weight; } /// Weights for pallet_community using the Substrate node and recommended hardware. @@ -41,47 +44,95 @@ pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { /// Storage: Community NextCommunityId (r:1 w:1) /// Proof Skipped: Community NextCommunityId (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Community Nonce (r:1 w:1) + /// Proof Skipped: Community Nonce (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) + /// Proof: RandomnessCollectiveFlip RandomMaterial (max_values: Some(1), max_size: Some(2594), added: 3089, mode: MaxEncodedLen) /// Storage: Community Communities (r:0 w:1) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) fn create_community() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `1569` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 1569) + // Measured: `118` + // Estimated: `7403` + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 7403) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Community Communities (r:1 w:1) + /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) + fn update_community() -> Weight { + // Proof Size summary in bytes: + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4213) .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Community Communities (r:1 w:1) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - fn delete_community() -> Weight { + fn update_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `625` - // Estimated: `4090` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_000_000, 4090) + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 4213) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Community Communities (r:1 w:1) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - fn update_community() -> Weight { + fn accept_members() -> Weight { + // Proof Size summary in bytes: + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4213) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Community Communities (r:1 w:1) + /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) + fn join_community() -> Weight { + // Proof Size summary in bytes: + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 4213) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Community Communities (r:1 w:1) + /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) + fn leave_community() -> Weight { + // Proof Size summary in bytes: + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 4213) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Community Communities (r:1 w:1) + /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) + fn remove_member() -> Weight { // Proof Size summary in bytes: - // Measured: `625` - // Estimated: `4090` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 4090) + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4213) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Community Communities (r:1 w:1) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - fn add_members() -> Weight { + fn update_passport_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `625` - // Estimated: `4090` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 4090) + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4213) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -91,47 +142,95 @@ impl WeightInfo for SubstrateWeight { impl WeightInfo for () { /// Storage: Community NextCommunityId (r:1 w:1) /// Proof Skipped: Community NextCommunityId (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Community Nonce (r:1 w:1) + /// Proof Skipped: Community Nonce (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) + /// Proof: RandomnessCollectiveFlip RandomMaterial (max_values: Some(1), max_size: Some(2594), added: 3089, mode: MaxEncodedLen) /// Storage: Community Communities (r:0 w:1) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) fn create_community() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `1569` - // Minimum execution time: 13_000_000 picoseconds. - Weight::from_parts(14_000_000, 1569) + // Measured: `118` + // Estimated: `7403` + // Minimum execution time: 18_000_000 picoseconds. + Weight::from_parts(19_000_000, 7403) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: Community Communities (r:1 w:1) + /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) + fn update_community() -> Weight { + // Proof Size summary in bytes: + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4213) .saturating_add(RocksDbWeight::get().reads(1_u64)) - .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Community Communities (r:1 w:1) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - fn delete_community() -> Weight { + fn update_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `625` - // Estimated: `4090` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(14_000_000, 4090) + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 17_000_000 picoseconds. + Weight::from_parts(17_000_000, 4213) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Community Communities (r:1 w:1) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - fn update_community() -> Weight { + fn accept_members() -> Weight { + // Proof Size summary in bytes: + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4213) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Community Communities (r:1 w:1) + /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) + fn join_community() -> Weight { + // Proof Size summary in bytes: + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 4213) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Community Communities (r:1 w:1) + /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) + fn leave_community() -> Weight { + // Proof Size summary in bytes: + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(15_000_000, 4213) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: Community Communities (r:1 w:1) + /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) + fn remove_member() -> Weight { // Proof Size summary in bytes: - // Measured: `625` - // Estimated: `4090` - // Minimum execution time: 16_000_000 picoseconds. - Weight::from_parts(17_000_000, 4090) + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4213) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: Community Communities (r:1 w:1) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - fn add_members() -> Weight { + fn update_passport_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `625` - // Estimated: `4090` - // Minimum execution time: 14_000_000 picoseconds. - Weight::from_parts(15_000_000, 4090) + // Measured: `748` + // Estimated: `4213` + // Minimum execution time: 15_000_000 picoseconds. + Weight::from_parts(16_000_000, 4213) .saturating_add(RocksDbWeight::get().reads(1_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/passport/Cargo.toml b/pallets/passport/Cargo.toml index 39474b74..d3fe13b9 100644 --- a/pallets/passport/Cargo.toml +++ b/pallets/passport/Cargo.toml @@ -13,27 +13,29 @@ repository = "https://github.com/jurteam/jur-chain/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.1.2", features = ["derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"], default-features = false } primitives = { package = 'jur-primitives', path = '../../primitives', default-features = false } -scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } # Substrate -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.41" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v1.0.0" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } # Jur custom pallets pallet-community = { package = 'pallet-community', path = '../community', default-features = false } +pallet-whitelist = { package = 'pallet-whitelist', path = '../whitelist', default-features = false } [dev-dependencies] serde = { version = "1.0.132" } # Substrate -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [features] default = ["std"] diff --git a/pallets/passport/src/benchmarking.rs b/pallets/passport/src/benchmarking.rs index 2092af08..50b8a433 100644 --- a/pallets/passport/src/benchmarking.rs +++ b/pallets/passport/src/benchmarking.rs @@ -2,12 +2,11 @@ use super::*; -#[allow(unused)] use crate::Pallet as Passport; use frame_benchmarking::{account, benchmarks, whitelisted_caller}; use frame_support::BoundedVec; use frame_system::RawOrigin; -use pallet_community::types::{CommunityMetaData, CommunityType}; +use pallet_community::types::{CommunityMetaData, CommunityType, Category}; use sp_std::vec; use sp_std::vec::Vec; @@ -17,23 +16,23 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } -fn get_community_metadata() -> CommunityMetaData { +fn get_community_metadata() -> CommunityMetaData { CommunityMetaData { - community_type: CommunityType::Nation, - customs: vec![ + community_type: Some(CommunityType::Nation), + customs: Some(vec![ "in public transport young people should leave the seat to elderly or pregnant women" .into(), "name newborns with a name that starts with the letter A".into(), - ], - languages: vec!["English".into(), "German".into()], - norms: vec![], - religions: vec!["Christianity".into(), "Buddhism".into()], - territories: vec!["Mars".into()], - traditions: vec![ + ]), + languages: Some(vec!["English".into(), "German".into()]), + norms: Some(vec![]), + religions: Some(vec!["Christianity".into(), "Buddhism".into()]), + territories: Some(vec!["Mars".into()]), + traditions: Some(vec![ "Exchange gifts for Christmas".into(), "Organize one charity event every 100 blocks".into(), - ], - values: vec!["Peace".into(), "No gender discrimination".into()], + ]), + values: Some(vec!["Peace".into(), "No gender discrimination".into()]), } } @@ -48,41 +47,52 @@ fn create_community(caller: T::AccountId) -> T::CommunityId { // hash of IPFS path of dummy logo Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), "Jur".as_bytes().to_vec(), - Some("Jur is the core community of the Jur ecosystem, which includes all the contributors." - .into()), + Some( + "Jur is the core community of the Jur ecosystem, which includes all the contributors." + .into(), + ), Some(members), Some(get_community_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ) .unwrap(); community_id } +pub fn add_founder(caller: T::AccountId) { + pallet_whitelist::Pallet::::add_founder( + RawOrigin::Root.into(), + caller + ).unwrap(); +} + benchmarks! { mint { let caller: T::AccountId = whitelisted_caller(); - let member: T::AccountId = account("sub", 1, SEED); + add_founder::(caller.clone()); let community_id = create_community::(caller.clone()); }: _( RawOrigin::Signed(caller.clone()), - member, community_id ) verify { assert_last_event::(Event::::MintedPassport( - ::Helper::passport(0), - caller + ::Helper::passport(1) ).into()); } update_passport { let caller: T::AccountId = whitelisted_caller(); let member: T::AccountId = account("sub", 1, SEED); + add_founder::(caller.clone()); let community_id = create_community::(caller.clone()); Passport::::mint( - RawOrigin::Signed(caller.clone()).into(), - member.clone(), + RawOrigin::Signed(member.clone()).into(), community_id.clone() ).unwrap(); @@ -91,56 +101,10 @@ benchmarks! { let bounded_passport_address: BoundedVec::AddressLimit> = passport_address.try_into().unwrap(); - }: _(RawOrigin::Signed(caller), community_id, member, bounded_passport_address) + }: _(RawOrigin::Signed(member), community_id, bounded_passport_address) verify { assert_last_event::(Event::::UpdatedPassport( - ::Helper::passport(0) - ).into()); - } - - add_stamps { - let caller: T::AccountId = whitelisted_caller(); - let member: T::AccountId = account("sub", 1, SEED); - let community_id = create_community::(caller.clone()); - - Passport::::mint( - RawOrigin::Signed(caller.clone()).into(), - member.clone(), - community_id.clone() - ).unwrap(); - - let stamp_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_stamp_address: BoundedVec::AddressLimit> = - stamp_address.try_into().unwrap(); - - }: _(RawOrigin::Signed(caller), community_id, member, bounded_stamp_address) - verify { - assert_last_event::(Event::::AddedStamp( - ::Helper::passport(0) - ).into()); - } - - update_avatar { - let caller: T::AccountId = whitelisted_caller(); - let member: T::AccountId = account("sub", 1, SEED); - let community_id = create_community::(caller.clone()); - - Passport::::mint( - RawOrigin::Signed(caller.clone()).into(), - member.clone(), - community_id.clone() - ).unwrap(); - - let avatar_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_avatar_address: BoundedVec::AddressLimit> = - avatar_address.try_into().unwrap(); - - }: _(RawOrigin::Signed(member), community_id, bounded_avatar_address) - verify { - assert_last_event::(Event::::UpdatedAvatar( - ::Helper::passport(0) + ::Helper::passport(1) ).into()); } diff --git a/pallets/passport/src/lib.rs b/pallets/passport/src/lib.rs index 0b6ca803..27596db9 100644 --- a/pallets/passport/src/lib.rs +++ b/pallets/passport/src/lib.rs @@ -17,8 +17,6 @@ //! //! * `mint` //! * `update_passport` -//! * `add_stamps` -//! * `update_avatar` //! #![cfg_attr(not(feature = "std"), no_std)] @@ -98,19 +96,15 @@ pub mod pallet { /// Stores the `PassportId` that is going to be used for the next passport. /// This gets incremented whenever a new passport is created. #[pallet::storage] - pub type NextPassportId = StorageValue<_, T::PassportId, OptionQuery>; + pub type NextPassportId = StorageMap<_, Twox64Concat, T::CommunityId, T::PassportId, OptionQuery>; #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// Minted Passport [passport, account] - MintedPassport(T::PassportId, T::AccountId), + /// Minted Passport [passport] + MintedPassport(T::PassportId), /// Updated Passport [passport] UpdatedPassport(T::PassportId), - /// Added Stamp to passport [passport] - AddedStamp(T::PassportId), - /// Updated Avatar to passport [passport] - UpdatedAvatar(T::PassportId), } #[pallet::error] @@ -134,11 +128,10 @@ pub mod pallet { impl Pallet { /// Mint a new passport /// - /// The origin must be Signed and the founder of the community. + /// The origin must be Signed and the founder/member of the community. /// /// Parameters: /// - `community_id`: Id of the community. - /// - `member`: Member of the community. /// /// Emits `MintedPassport` event when successful. /// @@ -146,42 +139,38 @@ pub mod pallet { #[pallet::weight(::WeightInfo::mint())] pub fn mint( origin: OriginFor, - member: T::AccountId, community_id: T::CommunityId, ) -> DispatchResult { let origin = ensure_signed(origin)?; let community = pallet_community::Communities::::get(community_id) .ok_or(Error::::CommunityDoesNotExist)?; - ensure!(origin == community.founder, Error::::NotAllowed); + ensure!(origin == community.founder || community.members.contains(&origin), Error::::MemberDoesNotExist); - ensure!(community.members.contains(&member), Error::::MemberDoesNotExist); - - let maybe_passport = Passports::::get(community_id, &member); + let maybe_passport = Passports::::get(community_id, &origin); ensure!(maybe_passport.is_some() == false, Error::::PassportAlreadyMinted); - let passport_id = NextPassportId::::get().unwrap_or(T::PassportId::initial_value()); + let passport_id = NextPassportId::::get(community_id).unwrap_or(T::PassportId::initial_value()); let passport_details = - PassportDetails { id: passport_id, address: None, stamps: None, avatar: None }; + PassportDetails { id: passport_id, address: None }; - >::insert(community_id, &member, passport_details); + >::insert(community_id, &origin, passport_details); let next_id = passport_id.increment(); - NextPassportId::::set(Some(next_id)); + NextPassportId::::insert(community_id, next_id); - Self::deposit_event(Event::MintedPassport(passport_id, origin)); + Self::deposit_event(Event::MintedPassport(passport_id)); Ok(()) } /// Update the passport. /// - /// The origin must be Signed and the founder of the community. + /// The origin must be Signed and the community member of the community. /// /// Parameters: /// - `community_id`: Id of the community. - /// - `member`: Member of the community. - /// - `passport_address`: Address of the passport + /// - `passport_address`: IPFS Address of the passport /// /// Emits `UpdatedPassport` event when successful. /// @@ -190,18 +179,17 @@ pub mod pallet { pub fn update_passport( origin: OriginFor, community_id: T::CommunityId, - member: T::AccountId, passport_address: BoundedVec, ) -> DispatchResult { let origin = ensure_signed(origin)?; let community = pallet_community::Communities::::get(community_id) .ok_or(Error::::CommunityDoesNotExist)?; - ensure!(origin == community.founder, Error::::NotAllowed); + ensure!(origin == community.founder || community.members.contains(&origin), Error::::MemberDoesNotExist); - >::get(community_id, &member).ok_or(Error::::PassportNotAvailable)?; + >::get(community_id, &origin).ok_or(Error::::PassportNotAvailable)?; - Passports::::try_mutate(community_id, member, |passport_details| { + Passports::::try_mutate(community_id, origin, |passport_details| { let passport = passport_details .as_mut() .ok_or(Error::::PassportNotAvailable)?; @@ -212,89 +200,5 @@ pub mod pallet { Ok(()) }) } - - /// Add the stamp to the passport. - /// - /// The origin must be Signed and the founder of the community. - /// - /// Parameters: - /// - `community_id`: Id of the community. - /// - `member`: Member of the community. - /// - `stamp`: stamp of the passport - /// - /// Emits `AddedStamp` event when successful. - /// - #[pallet::call_index(2)] - #[pallet::weight(::WeightInfo::add_stamps())] - pub fn add_stamps( - origin: OriginFor, - community_id: T::CommunityId, - member: T::AccountId, - stamp: BoundedVec, - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - let community = pallet_community::Communities::::get(community_id) - .ok_or(Error::::CommunityDoesNotExist)?; - - ensure!(origin == community.founder, Error::::NotAllowed); - - >::get(community_id, &member).ok_or(Error::::PassportNotAvailable)?; - - Passports::::try_mutate(community_id, member, |passport_details| { - let passport = passport_details - .as_mut() - .ok_or(Error::::PassportNotAvailable)?; - - let mut stamps = vec![]; - - if passport.stamps.is_some() { - stamps = passport.stamps.clone().unwrap(); - } - - stamps.push(stamp); - - passport.stamps = Some(stamps); - - Self::deposit_event(Event::AddedStamp(passport.id)); - Ok(()) - }) - } - - /// Add/update the avatar to the passport. - /// - /// The origin must be Signed and the founder of the community. - /// - /// Parameters: - /// - `community_id`: Id of the community. - /// - `avatar`: avatar of the passport - /// - /// Emits `UpdatedAvatar` event when successful. - /// - #[pallet::call_index(3)] - #[pallet::weight(::WeightInfo::update_avatar())] - pub fn update_avatar( - origin: OriginFor, - community_id: T::CommunityId, - avatar: BoundedVec, - ) -> DispatchResult { - let origin = ensure_signed(origin)?; - let community = pallet_community::Communities::::get(community_id) - .ok_or(Error::::CommunityDoesNotExist)?; - - ensure!(community.members.contains(&origin), Error::::NotAllowed); - - >::get(community_id, &origin).ok_or(Error::::PassportNotAvailable)?; - - Passports::::try_mutate(community_id, &origin, |passport_details| { - let passport = passport_details - .as_mut() - .ok_or(Error::::PassportNotAvailable)?; - - passport.avatar = Some(avatar); - - Self::deposit_event(Event::UpdatedAvatar(passport.id)); - Ok(()) - }) - } } } diff --git a/pallets/passport/src/mock.rs b/pallets/passport/src/mock.rs index 6792f526..b682f4b9 100644 --- a/pallets/passport/src/mock.rs +++ b/pallets/passport/src/mock.rs @@ -6,23 +6,21 @@ use frame_support::{ use frame_system as system; use sp_core::H256; use sp_runtime::{ - testing::Header, + BuildStorage, traits::{BlakeTwo256, IdentityLookup}, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Community: pallet_community::{Pallet, Call, Storage, Event}, + System: frame_system, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip, + Community: pallet_community, Passport: pallet_passport, + Whitelist: pallet_whitelist, } ); @@ -38,13 +36,12 @@ impl system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -57,6 +54,7 @@ impl system::Config for Test { type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; } +impl pallet_insecure_randomness_collective_flip::Config for Test {} impl pallet_community::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -67,6 +65,15 @@ impl pallet_community::Config for Test { #[cfg(feature = "runtime-benchmarks")] type Helper = (); type WeightInfo = (); + type MyRandomness = RandomnessCollectiveFlip; + type TagLimit = ConstU32<50>; + type ColorLimit = ConstU32<7>; + type CommunityLimit = ConstU32<3>; +} + +impl pallet_whitelist::Config for Test { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); } impl pallet_passport::Config for Test { @@ -80,8 +87,7 @@ impl pallet_passport::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into() + let mut ext: sp_io::TestExternalities = system::GenesisConfig::::default().build_storage().unwrap().into(); + ext.execute_with(|| System::set_block_number(1)); + ext } diff --git a/pallets/passport/src/tests.rs b/pallets/passport/src/tests.rs index 1abadb16..3b736c54 100644 --- a/pallets/passport/src/tests.rs +++ b/pallets/passport/src/tests.rs @@ -2,31 +2,37 @@ use crate::{mock::*, Error, Passports}; use frame_support::pallet_prelude::ConstU32; use frame_support::BoundedVec; use frame_support::{assert_noop, assert_ok}; -use pallet_community::types::{CommunityMetaData, CommunityType}; -use sp_core::H256; +use pallet_community::types::{CommunityMetaData, CommunityType, Category}; -fn get_community_metadata() -> CommunityMetaData { +fn get_community_metadata() -> CommunityMetaData { let community_metadata = CommunityMetaData { - community_type: CommunityType::Nation, - customs: vec![ + community_type: Some(CommunityType::Nation), + customs: Some(vec![ "in public transport young people should leave the seat to elderly or pregnant women" .into(), "name newborns with a name that starts with the letter A".into(), - ], - languages: vec!["English".into(), "German".into()], - norms: vec![], - religions: vec!["Christianity".into(), "Buddhism".into()], - territories: vec!["Mars".into()], - traditions: vec![ + ]), + languages: Some(vec!["English".into(), "German".into()]), + norms: Some(vec![]), + religions: Some(vec!["Christianity".into(), "Buddhism".into()]), + territories: Some(vec!["Mars".into()]), + traditions: Some(vec![ "Exchange gifts for Christmas".into(), "Organize one charity event every 100 blocks".into(), - ], - values: vec!["Peace".into(), "No gender discrimination".into()], + ]), + values: Some(vec!["Peace".into(), "No gender discrimination".into()]), }; community_metadata } +pub fn add_founder() { + Whitelist::add_founder( + RuntimeOrigin::root(), + 1 + ).unwrap(); +} + fn create_community() { Community::create_community( RuntimeOrigin::signed(1), @@ -37,39 +43,51 @@ fn create_community() { .into()), Some(vec![1, 2]), Some(get_community_metadata()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ) .unwrap(); } fn mint_passport() { + add_founder(); create_community(); - Passport::mint(RuntimeOrigin::signed(1), 2, 0).unwrap(); + Passport::mint(RuntimeOrigin::signed(2), 1).unwrap(); } #[test] -fn mint_passport_works() { +fn mint_passport_works_for_founder() { new_test_ext().execute_with(|| { + add_founder(); create_community(); - assert_ok!(Passport::mint(RuntimeOrigin::signed(1), 2, 0)); - - assert!(Passports::::get(0, 2).is_some()); + assert_ok!(Passport::mint(RuntimeOrigin::signed(1), 1)); + assert_eq!(Passports::::get(1, 1).unwrap().id, 1); + create_community(); + assert_ok!(Passport::mint(RuntimeOrigin::signed(1), 2)); + assert_eq!(Passports::::get(2, 1).unwrap().id, 1); }); } #[test] -fn mint_passport_not_works_if_user_is_not_founder() { +fn mint_passport_works_for_member() { new_test_ext().execute_with(|| { + add_founder(); create_community(); - assert_noop!(Passport::mint(RuntimeOrigin::signed(2), 12, 0), Error::::NotAllowed); + assert_ok!(Passport::mint(RuntimeOrigin::signed(2), 1)); + + assert!(Passports::::get(1, 2).is_some()); }); } #[test] fn mint_passport_not_works_for_invalid_community() { new_test_ext().execute_with(|| { + add_founder(); create_community(); assert_noop!( - Passport::mint(RuntimeOrigin::signed(1), 2, 1), + Passport::mint(RuntimeOrigin::signed(2), 2), Error::::CommunityDoesNotExist ); }); @@ -78,9 +96,10 @@ fn mint_passport_not_works_for_invalid_community() { #[test] fn mint_passport_not_works_when_member_not_part_of_community() { new_test_ext().execute_with(|| { + add_founder(); create_community(); assert_noop!( - Passport::mint(RuntimeOrigin::signed(1), 12, 0), + Passport::mint(RuntimeOrigin::signed(12), 1), Error::::MemberDoesNotExist ); }); @@ -89,10 +108,9 @@ fn mint_passport_not_works_when_member_not_part_of_community() { #[test] fn mint_passport_not_works_when_passport_already_minted() { new_test_ext().execute_with(|| { - create_community(); mint_passport(); assert_noop!( - Passport::mint(RuntimeOrigin::signed(1), 2, 0), + Passport::mint(RuntimeOrigin::signed(2), 1), Error::::PassportAlreadyMinted ); }); @@ -101,7 +119,6 @@ fn mint_passport_not_works_when_passport_already_minted() { #[test] fn update_passport_works() { new_test_ext().execute_with(|| { - create_community(); mint_passport(); let passport_address: Vec = @@ -110,14 +127,13 @@ fn update_passport_works() { passport_address.try_into().unwrap(); assert_ok!(Passport::update_passport( - RuntimeOrigin::signed(1), - 0, - 2, + RuntimeOrigin::signed(2), + 1, bounded_passport_address.clone() )); assert_eq!( - Passports::::get(0, 2).unwrap().address.unwrap(), + Passports::::get(1, 2).unwrap().address.unwrap(), bounded_passport_address ); }); @@ -126,7 +142,6 @@ fn update_passport_works() { #[test] fn update_passport_not_works_for_invalid_community() { new_test_ext().execute_with(|| { - create_community(); mint_passport(); let passport_address: Vec = @@ -135,16 +150,15 @@ fn update_passport_not_works_for_invalid_community() { passport_address.try_into().unwrap(); assert_noop!( - Passport::update_passport(RuntimeOrigin::signed(1), 5, 2, bounded_passport_address), + Passport::update_passport(RuntimeOrigin::signed(1), 5, bounded_passport_address), Error::::CommunityDoesNotExist ); }); } #[test] -fn update_passport_not_works_for_unminted_passport() { +fn update_passport_not_works_for_invalid_member() { new_test_ext().execute_with(|| { - create_community(); mint_passport(); let passport_address: Vec = @@ -153,105 +167,24 @@ fn update_passport_not_works_for_unminted_passport() { passport_address.try_into().unwrap(); assert_noop!( - Passport::update_passport(RuntimeOrigin::signed(1), 1, 3, bounded_passport_address), - Error::::PassportNotAvailable - ); - }); -} - -#[test] -fn update_stamps_works() { - new_test_ext().execute_with(|| { - create_community(); - mint_passport(); - - let stamp: Vec = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_stamp: BoundedVec> = stamp.try_into().unwrap(); - - assert_ok!(Passport::add_stamps(RuntimeOrigin::signed(1), 0, 2, bounded_stamp.clone())); - - assert!(Passports::::get(0, 2) - .unwrap() - .stamps - .unwrap() - .contains(&bounded_stamp)); - }); -} - -#[test] -fn update_stamps_not_works_for_invalid_community() { - new_test_ext().execute_with(|| { - create_community(); - mint_passport(); - - let stamp: Vec = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_stamp: BoundedVec> = stamp.try_into().unwrap(); - - assert_noop!( - Passport::add_stamps(RuntimeOrigin::signed(1), 5, 2, bounded_stamp), - Error::::CommunityDoesNotExist - ); - }); -} - -#[test] -fn update_stamps_not_works_for_unminted_passport() { - new_test_ext().execute_with(|| { - create_community(); - mint_passport(); - - let stamp: Vec = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_stamp: BoundedVec> = stamp.try_into().unwrap(); - - assert_noop!( - Passport::add_stamps(RuntimeOrigin::signed(1), 1, 3, bounded_stamp), - Error::::PassportNotAvailable - ); - }); -} - -#[test] -fn update_avatar_works() { - new_test_ext().execute_with(|| { - create_community(); - mint_passport(); - - let avatar: Vec = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_avatar: BoundedVec> = avatar.try_into().unwrap(); - - assert_ok!(Passport::update_avatar(RuntimeOrigin::signed(2), 0, bounded_avatar.clone())); - - assert_eq!(Passports::::get(0, 2).unwrap().avatar.unwrap(), bounded_avatar); - }); -} - -#[test] -fn update_avatar_not_works_for_invalid_community() { - new_test_ext().execute_with(|| { - create_community(); - mint_passport(); - - let avatar: Vec = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_avatar: BoundedVec> = avatar.try_into().unwrap(); - - assert_noop!( - Passport::update_avatar(RuntimeOrigin::signed(2), 5, bounded_avatar), + Passport::update_passport(RuntimeOrigin::signed(3), 5, bounded_passport_address), Error::::CommunityDoesNotExist ); }); } #[test] -fn update_avatar_not_works_for_unminted_passport() { +fn update_passport_not_works_for_unminted_passport() { new_test_ext().execute_with(|| { - create_community(); mint_passport(); - let avatar: Vec = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_avatar: BoundedVec> = avatar.try_into().unwrap(); + let passport_address: Vec = + "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); + let bounded_passport_address: BoundedVec> = + passport_address.try_into().unwrap(); assert_noop!( - Passport::update_avatar(RuntimeOrigin::signed(2), 1, bounded_avatar), + Passport::update_passport(RuntimeOrigin::signed(1), 1, bounded_passport_address), Error::::PassportNotAvailable ); }); diff --git a/pallets/passport/src/types.rs b/pallets/passport/src/types.rs index b8130f99..7d01575c 100644 --- a/pallets/passport/src/types.rs +++ b/pallets/passport/src/types.rs @@ -2,13 +2,10 @@ use codec::{Decode, Encode}; use frame_support::RuntimeDebug; use frame_support::{pallet_prelude::Get, BoundedVec}; use scale_info::TypeInfo; -use sp_std::vec::Vec; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, Default)] #[scale_info(skip_type_params(AddressLimit))] pub struct PassportDetails> { pub id: PassportId, pub address: Option>, - pub stamps: Option>>, - pub avatar: Option>, } diff --git a/pallets/passport/src/weights.rs b/pallets/passport/src/weights.rs index 6689c1db..1ed964a0 100644 --- a/pallets/passport/src/weights.rs +++ b/pallets/passport/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_passport //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-08-02, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Ayushs-MacBook-Pro.local`, CPU: `` +//! HOSTNAME: `MacBook-Pro.local`, CPU: `` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -32,8 +32,6 @@ use sp_std::marker::PhantomData; pub trait WeightInfo { fn mint() -> Weight; fn update_passport() -> Weight; - fn add_stamps() -> Weight; - fn update_avatar() -> Weight; } /// Weights for pallet_passport using the Substrate node and recommended hardware. @@ -44,13 +42,13 @@ impl WeightInfo for SubstrateWeight { /// Storage: Passport Passports (r:1 w:1) /// Proof Skipped: Passport Passports (max_values: None, max_size: None, mode: Measured) /// Storage: Passport NextPassportId (r:1 w:1) - /// Proof Skipped: Passport NextPassportId (max_values: Some(1), max_size: None, mode: Measured) + /// Proof Skipped: Passport NextPassportId (max_values: None, max_size: None, mode: Measured) fn mint() -> Weight { // Proof Size summary in bytes: - // Measured: `667` - // Estimated: `10416` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_000_000, 10416) + // Measured: `770` + // Estimated: `12705` + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(24_000_000, 12705) .saturating_add(T::DbWeight::get().reads(3_u64)) .saturating_add(T::DbWeight::get().writes(2_u64)) } @@ -60,36 +58,10 @@ impl WeightInfo for SubstrateWeight { /// Proof Skipped: Passport Passports (max_values: None, max_size: None, mode: Measured) fn update_passport() -> Weight { // Proof Size summary in bytes: - // Measured: `791` - // Estimated: `8512` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 8512) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Community Communities (r:1 w:0) - /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - /// Storage: Passport Passports (r:1 w:1) - /// Proof Skipped: Passport Passports (max_values: None, max_size: None, mode: Measured) - fn add_stamps() -> Weight { - // Proof Size summary in bytes: - // Measured: `791` - // Estimated: `8512` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 8512) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: Community Communities (r:1 w:0) - /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - /// Storage: Passport Passports (r:1 w:1) - /// Proof Skipped: Passport Passports (max_values: None, max_size: None, mode: Measured) - fn update_avatar() -> Weight { - // Proof Size summary in bytes: - // Measured: `791` - // Estimated: `8512` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(21_000_000, 8512) + // Measured: `903` + // Estimated: `8736` + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 8736) .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -102,13 +74,13 @@ impl WeightInfo for () { /// Storage: Passport Passports (r:1 w:1) /// Proof Skipped: Passport Passports (max_values: None, max_size: None, mode: Measured) /// Storage: Passport NextPassportId (r:1 w:1) - /// Proof Skipped: Passport NextPassportId (max_values: Some(1), max_size: None, mode: Measured) + /// Proof Skipped: Passport NextPassportId (max_values: None, max_size: None, mode: Measured) fn mint() -> Weight { // Proof Size summary in bytes: - // Measured: `667` - // Estimated: `10416` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(20_000_000, 10416) + // Measured: `770` + // Estimated: `12705` + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(24_000_000, 12705) .saturating_add(RocksDbWeight::get().reads(3_u64)) .saturating_add(RocksDbWeight::get().writes(2_u64)) } @@ -118,36 +90,10 @@ impl WeightInfo for () { /// Proof Skipped: Passport Passports (max_values: None, max_size: None, mode: Measured) fn update_passport() -> Weight { // Proof Size summary in bytes: - // Measured: `791` - // Estimated: `8512` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 8512) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Community Communities (r:1 w:0) - /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - /// Storage: Passport Passports (r:1 w:1) - /// Proof Skipped: Passport Passports (max_values: None, max_size: None, mode: Measured) - fn add_stamps() -> Weight { - // Proof Size summary in bytes: - // Measured: `791` - // Estimated: `8512` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 8512) - .saturating_add(RocksDbWeight::get().reads(2_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) - } - /// Storage: Community Communities (r:1 w:0) - /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - /// Storage: Passport Passports (r:1 w:1) - /// Proof Skipped: Passport Passports (max_values: None, max_size: None, mode: Measured) - fn update_avatar() -> Weight { - // Proof Size summary in bytes: - // Measured: `791` - // Estimated: `8512` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(21_000_000, 8512) + // Measured: `903` + // Estimated: `8736` + // Minimum execution time: 22_000_000 picoseconds. + Weight::from_parts(23_000_000, 8736) .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } diff --git a/pallets/proposal/Cargo.toml b/pallets/proposal/Cargo.toml index 30512a72..5469aebd 100644 --- a/pallets/proposal/Cargo.toml +++ b/pallets/proposal/Cargo.toml @@ -13,27 +13,30 @@ repository = "https://github.com/jurteam/jur-chain/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.1.2", features = ["derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"], default-features = false } primitives = { package = 'jur-primitives', path = '../../primitives', default-features = false } -scale-info = { version = "2.2.0", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } # Substrate -frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.41" } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v1.0.0" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } -sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } # Jur custom pallets pallet-community = { package = 'pallet-community', path = '../community', default-features = false } +pallet-whitelist = { package = 'pallet-whitelist', path = '../whitelist', default-features = false } [dev-dependencies] serde = { version = "1.0.132" } # Substrate -sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } -sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.41" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } + [features] default = ["std"] diff --git a/pallets/proposal/src/benchmarking.rs b/pallets/proposal/src/benchmarking.rs index 3218909f..3a87c17d 100644 --- a/pallets/proposal/src/benchmarking.rs +++ b/pallets/proposal/src/benchmarking.rs @@ -6,7 +6,7 @@ use super::*; use crate::Pallet as Proposal; use frame_benchmarking::{account, benchmarks, whitelisted_caller}; use frame_system::RawOrigin; -use pallet_community::types::{CommunityMetaData, CommunityType}; +use pallet_community::types::{CommunityMetaData, CommunityType, Category}; use sp_std::vec; const SEED: u32 = 0; @@ -15,26 +15,33 @@ fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } -fn get_community_metadata() -> CommunityMetaData { +fn get_community_metadata() -> CommunityMetaData { CommunityMetaData { - community_type: CommunityType::Nation, - customs: vec![ + community_type: Some(CommunityType::Nation), + customs: Some(vec![ "in public transport young people should leave the seat to elderly or pregnant women" .into(), "name newborns with a name that starts with the letter A".into(), - ], - languages: vec!["English".into(), "German".into()], - norms: vec![], - religions: vec!["Christianity".into(), "Buddhism".into()], - territories: vec!["Mars".into()], - traditions: vec![ + ]), + languages: Some(vec!["English".into(), "German".into()]), + norms: Some(vec![]), + religions: Some(vec!["Christianity".into(), "Buddhism".into()]), + territories: Some(vec!["Mars".into()]), + traditions: Some(vec![ "Exchange gifts for Christmas".into(), "Organize one charity event every 100 blocks".into(), - ], - values: vec!["Peace".into(), "No gender discrimination".into()], + ]), + values: Some(vec!["Peace".into(), "No gender discrimination".into()]), } } +pub fn add_founder(caller: T::AccountId) { + pallet_whitelist::Pallet::::add_founder( + RawOrigin::Root.into(), + caller + ).unwrap(); +} + fn create_community(caller: T::AccountId) -> T::CommunityId { let community_id = pallet_community::NextCommunityId::::get().unwrap_or(T::CommunityId::initial_value()); @@ -46,10 +53,16 @@ fn create_community(caller: T::AccountId) -> T::CommunityId { // hash of IPFS path of dummy logo Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), "Jur".as_bytes().to_vec(), - Some("Jur is the core community of the Jur ecosystem, which includes all the contributors." - .into()), + Some( + "Jur is the core community of the Jur ecosystem, which includes all the contributors." + .into(), + ), members, Some(get_community_metadata::()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ) .unwrap(); @@ -59,17 +72,22 @@ fn create_community(caller: T::AccountId) -> T::CommunityId { fn add_proposal(caller: T::AccountId) -> (T::CommunityId, T::ProposalId, T::ChoiceId) { let proposal_id = NextProposalId::::get().unwrap_or(T::ProposalId::initial_value()); + add_founder::(caller.clone()); let community_id = create_community::(caller.clone()); - let proposal_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_proposal_address: BoundedVec::AddressLimit> = - proposal_address.try_into().unwrap(); + + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec::NameLimit> = + proposal_name.try_into().unwrap(); + + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec::DescriptionLimit> = + proposal_description.try_into().unwrap(); Proposal::::create_proposal( RawOrigin::Signed(caller).into(), community_id, - bounded_proposal_address, - "Which is your native country".into(), + bounded_proposal_name, + bounded_proposal_description, vec![ "India".as_bytes().to_vec(), "Germany".as_bytes().to_vec(), @@ -88,31 +106,47 @@ fn add_proposal(caller: T::AccountId) -> (T::CommunityId, T::Proposal benchmarks! { create_proposal { let caller: T::AccountId = whitelisted_caller(); + add_founder::(caller.clone()); let community_id = create_community::(caller.clone()); - let proposal_address: Vec = "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_proposal_address: BoundedVec::AddressLimit> = proposal_address.try_into().unwrap(); - let proposal: Vec = "Which language should we speak within the Community?".into(); + + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec::NameLimit> = + proposal_name.try_into().unwrap(); + + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec::DescriptionLimit> = + proposal_description.try_into().unwrap(); + }: _( RawOrigin::Signed(caller), community_id, - bounded_proposal_address, - proposal.clone(), - vec!["English".as_bytes().to_vec(), "Ghukliak".as_bytes().to_vec(), "官话".as_bytes().to_vec(), "Rust".as_bytes().to_vec()], + bounded_proposal_name, + bounded_proposal_description, + vec![ + "English".as_bytes().to_vec(), + "Ghukliak".as_bytes().to_vec(), + "官话".as_bytes().to_vec(), + "Rust".as_bytes().to_vec() + ], false, 5 ) verify { - assert_last_event::(Event::::CreatedProposal(proposal).into()); + assert_last_event::(Event::::CreatedProposal(::Helper::proposal(1)).into()); } - submit_choice { + cast_vote { let caller: T::AccountId = whitelisted_caller(); let member = account("sub", 1, SEED); let (community_id, proposal_id, choice_id) = add_proposal::(caller.clone()); - }: _(RawOrigin::Signed(member), community_id, proposal_id, choice_id) + let choice: Vec = "India".into(); + let bounded_choice: BoundedVec::LabelLimit> = + choice.try_into().unwrap(); + + }: _(RawOrigin::Signed(member), community_id, proposal_id, bounded_choice) verify { - assert_last_event::(Event::::SubmittedChoice.into()); + assert_last_event::(Event::::VoteCasted(proposal_id).into()); } impl_benchmark_test_suite!(Proposal, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/pallets/proposal/src/lib.rs b/pallets/proposal/src/lib.rs index 51bd6f15..0674ba7a 100644 --- a/pallets/proposal/src/lib.rs +++ b/pallets/proposal/src/lib.rs @@ -21,14 +21,14 @@ //! ## Interface //! //! * `create_proposal` -//! * `submit_choice` +//! * `cast_vote` //! #![cfg_attr(not(feature = "std"), no_std)] pub use pallet::*; mod types; -use crate::types::{Choice, Proposal, Vote}; +use crate::types::{Choice, Proposal, ProposalResultStatus, Vote}; use frame_support::{dispatch::DispatchResultWithPostInfo, BoundedVec}; use primitives::{Incrementable, BLOCKS_PER_DAY}; use sp_std::vec::Vec; @@ -79,17 +79,17 @@ pub mod pallet { /// Identifier for the Choice. type ChoiceId: Member + Parameter + MaxEncodedLen + Copy + Incrementable; - /// The maximum length of any description. + /// The maximum length of proposal name/title. #[pallet::constant] - type DescriptionLimit: Get; + type NameLimit: Get; - /// The maximum length of any label. + /// The maximum length of proposal description. #[pallet::constant] - type LabelLimit: Get; + type DescriptionLimit: Get; - /// The maximum length of address. + /// The maximum length of choice label. #[pallet::constant] - type AddressLimit: Get; + type LabelLimit: Get; /// The maximum length of address. #[pallet::constant] @@ -116,24 +116,19 @@ pub mod pallet { T::CommunityId, Blake2_128Concat, T::ProposalId, - Proposal<::DescriptionLimit, T::AddressLimit, T::AccountId, T::AccountLimit>, + Proposal< + ::DescriptionLimit, + ::NameLimit, + T::AccountId, + T::AccountLimit, + >, OptionQuery, >; - #[pallet::storage] - #[pallet::getter(fn proposal_details)] - pub type ProposalDetails = StorageMap< - _, - Blake2_128Concat, - T::AccountId, - Vec::DescriptionLimit, T::AddressLimit, T::AccountId, T::AccountLimit>>, - ValueQuery, - >; - #[pallet::storage] #[pallet::getter(fn proposal_expire)] pub type ProposalExpireTime = - StorageMap<_, Identity, T::BlockNumber, (T::ProposalId, T::CommunityId), OptionQuery>; + StorageMap<_, Identity, BlockNumberFor, (T::ProposalId, T::CommunityId), OptionQuery>; /// Store Choices for a particular proposal #[pallet::storage] @@ -153,7 +148,7 @@ pub mod pallet { _, Blake2_128Concat, T::ChoiceId, - Vote, + Vote, T::AccountId, T::AccountLimit>, OptionQuery, >; @@ -167,15 +162,25 @@ pub mod pallet { #[pallet::storage] pub(super) type NextChoiceId = StorageValue<_, T::ChoiceId, OptionQuery>; + /// Store the `Proposal Result` + #[pallet::storage] + pub(super) type ProposalResult = StorageMap< + _, + Blake2_128Concat, + T::ProposalId, + (ProposalResultStatus, Vote, T::AccountId, T::AccountLimit>), + OptionQuery, + >; + #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// Created Proposals [description] - CreatedProposal(Vec), - /// Submitted Proposal - SubmittedChoice, - /// Proposal state changed - ProposalStateChanged, + /// Created Proposals [Proposal Id] + CreatedProposal(T::ProposalId), + /// Submitted Proposal [Proposal Id] + VoteCasted(T::ProposalId), + /// Proposal state changed [Proposal Id] + ProposalStateChanged(T::ProposalId), } #[pallet::error] @@ -200,34 +205,59 @@ pub mod pallet { VotesNotFound, /// New account can't be added due to account limit. AccountLimitReached, + /// Invalid Proposal duration. + InvalidProposalDuration, + /// Invalid Choices given during creating proposal. + InvalidChoicesGiven, } #[pallet::hooks] impl Hooks> for Pallet { - fn on_initialize(n: BlockNumberFor) -> Weight { - let option_proposal_expire = ProposalExpireTime::::get(n); + fn on_initialize(block_number: BlockNumberFor) -> Weight { + let option_proposal_expire = ProposalExpireTime::::get(block_number); if let Some((proposal_id, community_id)) = option_proposal_expire { Proposals::::try_mutate( community_id, proposal_id, |proposal_detail| -> DispatchResult { - let all_proposal = proposal_detail + let proposal_data = proposal_detail .as_mut() .ok_or(Error::::ProposalDoesNotExist)?; - all_proposal.status = false; - let proposer_account = &all_proposal.proposer; - - ProposalDetails::::mutate(proposer_account, |proposals| { - for proposal in proposals { - match &proposal { - _all_proposal => proposal.status = false, - } - } - }); - - Self::deposit_event(Event::::ProposalStateChanged); + // Add the proposalResult storage to add the result after the deadline of proposal voting. + let voters_count = &proposal_data.voter_accounts.len(); + + // find all the choice id's for the current proposal. + // iterate for all the choice id's and get the total no of votes for it. + let choice_ids = + Choices::::get(proposal_id).ok_or(Error::::ChoiceDoesNotExist)?; + + // fetching the vote information for both choices. + let yes_vote_info = + Votes::::get(choice_ids[0].id).ok_or(Error::::VotesNotFound)?; + let no_vote_info = + Votes::::get(choice_ids[1].id).ok_or(Error::::VotesNotFound)?; + + // Inserting the proposal result according to the voting. + // If 51% or more then from all voters voted in favour of proposal + // then proposal is Accepted. + // Otherwise the proposal is rejected. + if yes_vote_info.vote_count > (1 * (*voters_count as u64)) / 2 { + ProposalResult::::insert( + proposal_id, + (ProposalResultStatus::Accepted, yes_vote_info), + ); + } else { + ProposalResult::::insert( + proposal_id, + (ProposalResultStatus::Rejected, no_vote_info), + ); + } + + proposal_data.status = false; + + Self::deposit_event(Event::::ProposalStateChanged(proposal_id)); Ok(()) }, @@ -248,11 +278,11 @@ pub mod pallet { /// /// Parameters: /// - `community_id`: Id of the community. - /// - 'address': IPFS address of the proposal. - /// - `proposal`: A proposal like `Which language should we speak within the Community?`. + /// - `name`: name/title of the proposal. + /// - `description`: description of the proposal. /// - `choices`: Choices for a given proposal. /// - `is_historical`: A Proposal can be marked as historical. - /// - 'proposal_duration': Voting duration of the proposal. + /// - `proposal_duration`: Voting duration of the proposal. /// In case it is flagged as such, the proposal becomes part of the History. /// /// Emits `CreatedProposal` event when successful. @@ -262,46 +292,50 @@ pub mod pallet { pub fn create_proposal( origin: OriginFor, community_id: T::CommunityId, - address: BoundedVec, - proposal: Vec, + name: BoundedVec::NameLimit>, + description: BoundedVec::DescriptionLimit>, choices: Vec>, is_historical: bool, proposal_duration: u32, ) -> DispatchResultWithPostInfo { let community = pallet_community::Communities::::get(community_id) .ok_or(Error::::CommunityDoesNotExist)?; + let origin = ensure_signed(origin)?; ensure!(origin == community.founder, Error::::NotAllowed); + ensure!(choices.len() >= 2, Error::::InvalidChoicesGiven); + ensure!(proposal_duration >= 1, Error::::InvalidProposalDuration); + Self::do_create_proposal( origin, community_id, - address, - proposal, + name, + description, choices, is_historical, proposal_duration, ) } - /// Submit a choice for a proposal. + /// cast a vote for a proposal. /// /// The origin must be Signed and the member of the community. /// /// Parameters: /// - `community_id`: Id of the community. /// - `proposal_id`: Id of the proposal. - /// - `choice_id`: Id of the coice. + /// - `choice_id`: Id of the choice. /// - /// Emits `SubmittedChoice` event when successful. + /// Emits `cast_vote` event when successful. /// #[pallet::call_index(1)] - #[pallet::weight(::WeightInfo::submit_choice())] - pub fn submit_choice( + #[pallet::weight(::WeightInfo::cast_vote())] + pub fn cast_vote( origin: OriginFor, community_id: T::CommunityId, proposal_id: T::ProposalId, - choice_id: T::ChoiceId, + choice: BoundedVec, ) -> DispatchResultWithPostInfo { let community = pallet_community::Communities::::get(community_id) .ok_or(Error::::CommunityDoesNotExist)?; @@ -314,23 +348,37 @@ pub mod pallet { ensure!(Choices::::contains_key(proposal_id), Error::::NoChoiceAvailable); + ensure!(proposal.status, Error::::ProposalNotActive); + + ensure!(!(proposal.voter_accounts).contains(&origin), Error::::DuplicateVote); + // Get all the choices id from the current proposal and // check if current choice_id is already present or not? - let all_choices = + let proposal_choices = Choices::::get(proposal_id).ok_or(Error::::NoChoiceAvailable)?; - all_choices + proposal_choices .into_iter() - .find(|choice| choice.id == choice_id) + .find(|choices| choices.label == choice) .ok_or(Error::::ChoiceDoesNotExist)?; - ensure!(proposal.status, Error::::ProposalNotActive); + let proposal_choices = + Choices::::get(proposal_id).ok_or(Error::::NoChoiceAvailable)?; - ensure!(!(proposal.voter_accounts).contains(&origin), Error::::DuplicateVote); + let mut choice_id = proposal_choices[0].id; + + if proposal_choices[1].label == choice { + choice_id = proposal_choices[1].id; + } // Adding the vote to the storage. Votes::::mutate(choice_id, |optional_vote| -> DispatchResult { let vote = optional_vote.as_mut().ok_or(Error::::VotesNotFound)?; + let _voters = vote + .who + .try_push(origin.clone()) + .ok() + .ok_or(Error::::AccountLimitReached)?; *optional_vote = Some(Vote { who: vote.who.clone(), vote_count: vote.vote_count + 1, @@ -344,15 +392,21 @@ pub mod pallet { community_id, proposal_id, |proposal_details| -> DispatchResult { - let all_proposal = proposal_details + let proposal_info = proposal_details .as_mut() .ok_or(Error::::ProposalDoesNotExist)?; - all_proposal.voter_accounts.try_push(origin).ok().ok_or(Error::::AccountLimitReached)?; + + proposal_info + .voter_accounts + .try_push(origin.clone()) + .ok() + .ok_or(Error::::AccountLimitReached)?; + Ok(()) }, )?; - Self::deposit_event(Event::SubmittedChoice); + Self::deposit_event(Event::VoteCasted(proposal_id)); Ok(().into()) } } @@ -362,17 +416,12 @@ impl Pallet { pub fn do_create_proposal( proposer_account: T::AccountId, community_id: T::CommunityId, - address: BoundedVec, - proposal: Vec, + name: BoundedVec::NameLimit>, + description: BoundedVec::DescriptionLimit>, choices: Vec>, is_historical: bool, proposal_duration: u32, ) -> DispatchResultWithPostInfo { - let bounded_proposal: BoundedVec::DescriptionLimit> = proposal - .clone() - .try_into() - .map_err(|_| Error::::BadDescription)?; - let bounded_account: BoundedVec::AccountLimit> = Vec::new() .clone() .try_into() @@ -380,8 +429,8 @@ impl Pallet { let new_proposal = Proposal { proposer: proposer_account.clone(), - address, - description: bounded_proposal, + name, + description, historical: is_historical, status: true, voter_accounts: bounded_account.clone(), @@ -394,7 +443,7 @@ impl Pallet { .into_iter() .map(|choice| { let bounded_choice: BoundedVec::LabelLimit> = - choice.try_into().expect("Invalid choice given."); + choice.try_into().expect("Choice Label Limit Exceeded."); let choice_id: T::ChoiceId = NextChoiceId::::get().unwrap_or(T::ChoiceId::initial_value()); @@ -414,19 +463,12 @@ impl Pallet { // Storing the proposal >::insert(community_id, proposal_id, &new_proposal); - // set up the expire time of a particular proposal with community id. - let total_block = BLOCKS_PER_DAY * proposal_duration; + // Set up the expire time of a particular proposal with community id. + let total_block: u32 = BLOCKS_PER_DAY * proposal_duration; let expire_block = frame_system::Pallet::::block_number() + total_block.into(); ProposalExpireTime::::insert(expire_block, (proposal_id, community_id)); - // fetch all the proposal of current account. - let mut all_proposal = ProposalDetails::::get(proposer_account.clone()); - all_proposal.push(new_proposal); - - // Store the proposal of one account - ProposalDetails::::insert(proposer_account, all_proposal); - let next_proposal_id = proposal_id.increment(); NextProposalId::::set(Some(next_proposal_id)); @@ -434,7 +476,7 @@ impl Pallet { if !choices.is_empty() { >::insert(proposal_id, new_choices); } - Self::deposit_event(Event::CreatedProposal(proposal)); + Self::deposit_event(Event::CreatedProposal(proposal_id)); Ok(().into()) } diff --git a/pallets/proposal/src/mock.rs b/pallets/proposal/src/mock.rs index 30ee96a0..13dcae21 100644 --- a/pallets/proposal/src/mock.rs +++ b/pallets/proposal/src/mock.rs @@ -1,29 +1,27 @@ use crate as pallet_proposal; +use frame_support::pallet_prelude::Hooks; use frame_support::{ parameter_types, traits::{AsEnsureOriginWithArg, ConstU16, ConstU32, ConstU64}, }; -use frame_support::pallet_prelude::Hooks; use frame_system as system; use sp_core::H256; use sp_runtime::{ - testing::Header, + BuildStorage, traits::{BlakeTwo256, IdentityLookup}, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Community: pallet_community::{Pallet, Call, Storage, Event}, - Proposal: pallet_proposal::{Pallet, Call, Storage, Event}, + System: frame_system, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip, + Community: pallet_community, + Proposal: pallet_proposal, + Whitelist: pallet_whitelist, } ); @@ -39,13 +37,12 @@ impl system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -59,6 +56,8 @@ impl system::Config for Test { type MaxConsumers = frame_support::traits::ConstU32<16>; } +impl pallet_insecure_randomness_collective_flip::Config for Test {} + impl pallet_community::Config for Test { type RuntimeEvent = RuntimeEvent; type CommunityId = u32; @@ -68,33 +67,44 @@ impl pallet_community::Config for Test { #[cfg(feature = "runtime-benchmarks")] type Helper = (); type WeightInfo = (); + type MyRandomness = RandomnessCollectiveFlip; + type TagLimit = ConstU32<50>; + type ColorLimit = ConstU32<7>; + type CommunityLimit = ConstU32<3>; +} + +impl pallet_whitelist::Config for Test { + type RuntimeEvent = RuntimeEvent; + #[cfg(feature = "runtime-benchmarks")] + type WeightInfo = (); } impl pallet_proposal::Config for Test { type RuntimeEvent = RuntimeEvent; type ProposalId = u32; type ChoiceId = u32; + type NameLimit = ConstU32<60>; type DescriptionLimit = ConstU32<250>; - type LabelLimit = ConstU32<250>; + type LabelLimit = ConstU32<10>; + type AccountLimit = ConstU32<3>; #[cfg(feature = "runtime-benchmarks")] type Helper = (); - type AddressLimit = ConstU32<60>; - type AccountLimit = ConstU32<1>; type WeightInfo = (); } // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - system::GenesisConfig::default() - .build_storage::() + let mut ext: sp_io::TestExternalities = system::GenesisConfig::::default() + .build_storage() .unwrap() - .into() + .into(); + ext.execute_with(|| System::set_block_number(1)); + ext } fn init_block() { System::on_initialize(System::block_number()); Proposal::on_initialize(System::block_number()); - } pub fn run_to_block(n: u64) { @@ -109,4 +119,4 @@ pub fn run_to_block(n: u64) { System::set_block_number(b + 1); init_block(); } -} \ No newline at end of file +} diff --git a/pallets/proposal/src/tests.rs b/pallets/proposal/src/tests.rs index df084ffb..59951cb6 100644 --- a/pallets/proposal/src/tests.rs +++ b/pallets/proposal/src/tests.rs @@ -1,27 +1,28 @@ +use crate::pallet::ProposalResult; +use crate::types::ProposalResultStatus; use crate::{mock::*, Choices, Error, Votes}; use frame_support::pallet_prelude::ConstU32; use frame_support::BoundedVec; use frame_support::{assert_noop, assert_ok}; -use pallet_community::types::{CommunityMetaData, CommunityType}; -use sp_core::H256; +use pallet_community::types::{CommunityMetaData, CommunityType, Category}; -fn get_community_metadata() -> CommunityMetaData { +fn get_community_metadata() -> CommunityMetaData { let community_metadata = CommunityMetaData { - community_type: CommunityType::Nation, - customs: vec![ + community_type: Some(CommunityType::Nation), + customs: Some(vec![ "in public transport young people should leave the seat to elderly or pregnant women" .into(), "name newborns with a name that starts with the letter A".into(), - ], - languages: vec!["English".into(), "German".into()], - norms: vec![], - religions: vec!["Christianity".into(), "Buddhism".into()], - territories: vec!["Mars".into()], - traditions: vec![ + ]), + languages: Some(vec!["English".into(), "German".into()]), + norms: Some(vec![]), + religions: Some(vec!["Christianity".into(), "Buddhism".into()]), + territories: Some(vec!["Mars".into()]), + traditions: Some(vec![ "Exchange gifts for Christmas".into(), "Organize one charity event every 100 blocks".into(), - ], - values: vec!["Peace".into(), "No gender discrimination".into()], + ]), + values: Some(vec!["Peace".into(), "No gender discrimination".into()]), }; community_metadata @@ -32,30 +33,45 @@ fn create_community() { // hash of IPFS path of dummy logo Some("bafkreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into()), "Jur".into(), - Some("Jur is the core community of the Jur ecosystem, which includes all the contributors." - .into()), - Some(vec![1, 2]), + Some( + "Jur is the core community of the Jur ecosystem, which includes all the contributors." + .into(), + ), + Some(vec![1, 2, 7, 8]), Some(get_community_metadata()), + Category::Public, + Some("tag".into()), + Some("#222307".into()), + Some("#E76080".into()) ) .unwrap(); } +pub fn add_founder() { + Whitelist::add_founder( + RuntimeOrigin::root(), + 1 + ).unwrap(); +} + fn create_proposal() { - let proposal_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_proposal_address: BoundedVec> = - proposal_address.try_into().unwrap(); + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec> = proposal_name.try_into().unwrap(); + + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec> = + proposal_description.try_into().unwrap(); + + add_founder(); create_community(); Proposal::create_proposal( RuntimeOrigin::signed(1), - 0, - bounded_proposal_address, - "Which language should we speak within the Community?".into(), + 1, + bounded_proposal_name, + bounded_proposal_description, vec![ - "English".as_bytes().to_vec(), - "Ghukliak".as_bytes().to_vec(), - "官话".as_bytes().to_vec(), - "Rust".as_bytes().to_vec(), + "Yes".as_bytes().to_vec(), + "No".as_bytes().to_vec(), ], false, 5, @@ -66,17 +82,20 @@ fn create_proposal() { #[test] fn create_proposal_works() { new_test_ext().execute_with(|| { - let proposal_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_proposal_address: BoundedVec> = - proposal_address.try_into().unwrap(); + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec> = proposal_name.try_into().unwrap(); + + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec> = + proposal_description.try_into().unwrap(); + add_founder(); create_community(); assert_ok!(Proposal::create_proposal( RuntimeOrigin::signed(1), - 0, - bounded_proposal_address, - "Which is your native country".into(), + 1, + bounded_proposal_name, + bounded_proposal_description, vec![ "India".as_bytes().to_vec(), "Germany".as_bytes().to_vec(), @@ -86,24 +105,26 @@ fn create_proposal_works() { 5 )); - assert!(Choices::::contains_key(0)); + assert!(Choices::::contains_key(1)); }); } #[test] fn create_proposal_does_not_work_when_no_community_id() { new_test_ext().execute_with(|| { - let proposal_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_proposal_address: BoundedVec> = - proposal_address.try_into().unwrap(); + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec> = proposal_name.try_into().unwrap(); + + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec> = + proposal_description.try_into().unwrap(); assert_noop!( Proposal::create_proposal( RuntimeOrigin::signed(1), - 0, - bounded_proposal_address, - "Which is your native country".into(), + 1, + bounded_proposal_name, + bounded_proposal_description, vec![ "India".as_bytes().to_vec(), "Germany".as_bytes().to_vec(), @@ -118,151 +139,258 @@ fn create_proposal_does_not_work_when_no_community_id() { } #[test] -fn submit_choice_works() { +fn cast_vote_works() { new_test_ext().execute_with(|| { create_proposal(); - assert_ok!(Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 0, 1,)); + let choice: Vec = "Yes".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 1, bounded_choice)); assert_eq!(Votes::::get(1).unwrap().vote_count, 1); }); } #[test] -fn submit_proposal_not_work_for_invalid_input() { +fn cast_vote_not_work_for_invalid_input() { new_test_ext().execute_with(|| { create_proposal(); + let choice: Vec = "No".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); assert_noop!( - Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 11, 2,), + Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 11, bounded_choice), Error::::ProposalDoesNotExist ); }); } #[test] -fn submit_choices_not_work_for_invalid_input() { +fn cast_votes_not_work_for_invalid_input() { new_test_ext().execute_with(|| { - let proposal_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_proposal_address: BoundedVec> = - proposal_address.try_into().unwrap(); + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec> = proposal_name.try_into().unwrap(); + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec> = + proposal_description.try_into().unwrap(); + + add_founder(); create_community(); assert_ok!(Proposal::create_proposal( RuntimeOrigin::signed(1), - 0, - bounded_proposal_address.clone(), - "Which is your native language".into(), - vec![], + 1, + bounded_proposal_name.clone(), + bounded_proposal_description.clone(), + vec!["Yes".into(), "No".into()], false, 5 )); + let choice: Vec = "no".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); + assert_noop!( - Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 0, 1,), - Error::::NoChoiceAvailable + Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 1, bounded_choice), + Error::::ChoiceDoesNotExist ); assert_ok!(Proposal::create_proposal( RuntimeOrigin::signed(1), - 0, - bounded_proposal_address, - "Which Language".into(), - vec!["English".as_bytes().to_vec()], + 1, + bounded_proposal_name, + bounded_proposal_description, + vec!["English".into(), "German".into()], false, 5 )); + let choice: Vec = "No".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); + assert_noop!( - Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 1, 3,), + Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 2, bounded_choice), Error::::ChoiceDoesNotExist ); }); } #[test] -fn submit_proposal_not_work_for_after_proposal_deadline() { +fn cast_vote_not_work_for_after_proposal_deadline() { new_test_ext().execute_with(|| { - let proposal_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_proposal_address: BoundedVec> = - proposal_address.try_into().unwrap(); + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec> = proposal_name.try_into().unwrap(); + + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec> = + proposal_description.try_into().unwrap(); + add_founder(); create_community(); assert_ok!(Proposal::create_proposal( RuntimeOrigin::signed(1), - 0, - bounded_proposal_address.clone(), - "Which is your native language".into(), + 1, + bounded_proposal_name, + bounded_proposal_description, vec![ - "English".as_bytes().to_vec(), - "Ghukliak".as_bytes().to_vec(), - "官话".as_bytes().to_vec(), - "Rust".as_bytes().to_vec(), + "English".as_bytes().to_vec(), + "Ghukliak".as_bytes().to_vec(), + "官话".as_bytes().to_vec(), + "Rust".as_bytes().to_vec(), ], false, 1, )); run_to_block(15_000); + let choice: Vec = "English".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); + assert_noop!( - Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 0, 0), + Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 1, bounded_choice), Error::::ProposalNotActive ); }); } #[test] -fn submit_choice_not_works_for_duplicate_vote() { +fn cast_vote_not_works_for_duplicate_vote() { new_test_ext().execute_with(|| { create_proposal(); - assert_ok!(Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 0, 1)); + let choice: Vec = "Yes".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); + + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 1, bounded_choice.clone())); assert_eq!(Votes::::get(1).unwrap().vote_count, 1); assert_noop!( - Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 0, 1), + Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 1, bounded_choice), Error::::DuplicateVote ); }); } #[test] -fn submit_choice_not_works_for_unavailable_choice() { +fn cast_vote_not_works_for_account_limit_exceeds() { + new_test_ext().execute_with(|| { + create_proposal(); + let choice: Vec = "Yes".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 1, bounded_choice.clone())); + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(2), 1, 1, bounded_choice.clone())); + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(7), 1, 1, bounded_choice.clone())); + + assert_eq!(Votes::::get(1).unwrap().vote_count, 3); + + assert_noop!( + Proposal::cast_vote(RuntimeOrigin::signed(8), 1, 1, bounded_choice), + Error::::AccountLimitReached + ); + }); +} + +#[test] +fn create_proposal_not_working_invalid_choice() { + new_test_ext().execute_with(|| { + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec> = proposal_name.try_into().unwrap(); + + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec> = + proposal_description.try_into().unwrap(); + + add_founder(); + create_community(); + assert_noop!( + Proposal::create_proposal( + RuntimeOrigin::signed(1), + 1, + bounded_proposal_name, + bounded_proposal_description, + vec![], + false, + 5 + ), + Error::::InvalidChoicesGiven + ); + }); +} + +#[test] +fn cast_vote_works_with_proposal_result_accepted() { new_test_ext().execute_with(|| { - let proposal_address: Vec = - "abcdreifec54rzopwm6mvqm3fknmdlsw2yefpdr7xrgtsron62on2nynegq".into(); - let bounded_proposal_address: BoundedVec> = - proposal_address.try_into().unwrap(); + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec> = proposal_name.try_into().unwrap(); + + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec> = + proposal_description.try_into().unwrap(); + add_founder(); create_community(); assert_ok!(Proposal::create_proposal( RuntimeOrigin::signed(1), - 0, - bounded_proposal_address, - "Which is your native country".into(), - vec![], + 1, + bounded_proposal_name, + bounded_proposal_description, + vec![ + "Yes".as_bytes().to_vec(), + "No".as_bytes().to_vec(), + ], false, - 5 + 1, )); - assert_noop!( - Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 0, 1), - Error::::NoChoiceAvailable - ); + let choice: Vec = "Yes".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); + + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 1, bounded_choice.clone())); + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(2), 1, 1, bounded_choice.clone())); + + run_to_block(15_000); + + assert_eq!(Votes::::get(1).unwrap().vote_count, 2); + assert_eq!(ProposalResult::::get(1).unwrap().0, ProposalResultStatus::Accepted); }); } #[test] -fn submit_choice_not_works_for_account_limit_exceeds() { +fn cast_vote_works_with_proposal_result_rejected() { new_test_ext().execute_with(|| { - create_proposal(); - assert_ok!(Proposal::submit_choice(RuntimeOrigin::signed(1), 0, 0, 1)); + let proposal_name: Vec = "Jur community Language proposal".into(); + let bounded_proposal_name: BoundedVec> = proposal_name.try_into().unwrap(); - assert_eq!(Votes::::get(1).unwrap().vote_count, 1); + let proposal_description: Vec = "Description of Jur community Language proposal".into(); + let bounded_proposal_description: BoundedVec> = + proposal_description.try_into().unwrap(); - assert_noop!( - Proposal::submit_choice(RuntimeOrigin::signed(2), 0, 0, 1), - Error::::AccountLimitReached - ); + add_founder(); + create_community(); + assert_ok!(Proposal::create_proposal( + RuntimeOrigin::signed(1), + 1, + bounded_proposal_name, + bounded_proposal_description, + vec![ + "Yes".as_bytes().to_vec(), + "No".as_bytes().to_vec(), + ], + false, + 1, + )); + + let choice: Vec = "Yes".into(); + let bounded_choice: BoundedVec> = choice.try_into().unwrap(); + + let choice: Vec = "No".into(); + let bounded_choice2: BoundedVec> = choice.try_into().unwrap(); + + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(1), 1, 1, bounded_choice)); + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(2), 1, 1, bounded_choice2.clone())); + assert_ok!(Proposal::cast_vote(RuntimeOrigin::signed(7), 1, 1, bounded_choice2)); + + run_to_block(15_000); + + assert_eq!(Votes::::get(2).unwrap().vote_count, 2); + assert_eq!(ProposalResult::::get(1).unwrap().0, ProposalResultStatus::Rejected); }); } diff --git a/pallets/proposal/src/types.rs b/pallets/proposal/src/types.rs index 40584901..8ed94705 100644 --- a/pallets/proposal/src/types.rs +++ b/pallets/proposal/src/types.rs @@ -3,10 +3,15 @@ use frame_support::{pallet_prelude::Get, BoundedVec, RuntimeDebug}; use scale_info::TypeInfo; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, Default)] -#[scale_info(skip_type_params(DescriptionLimit, AddressLimit, AccountLimit))] -pub struct Proposal, AddressLimit: Get, AccountId, AccountLimit: Get> { +#[scale_info(skip_type_params(DescriptionLimit, NameLimit, AccountLimit))] +pub struct Proposal< + DescriptionLimit: Get, + NameLimit: Get, + AccountId, + AccountLimit: Get, +> { pub proposer: AccountId, - pub address: BoundedVec, + pub name: BoundedVec, pub description: BoundedVec, pub historical: bool, pub status: bool, @@ -27,3 +32,12 @@ pub struct Vote> { pub vote_count: u64, pub last_voted: BlockNumber, } + +/// Result of proposal. +#[derive(Eq, PartialEq, Clone, RuntimeDebug, TypeInfo, Encode, Decode)] +pub enum ProposalResultStatus { + /// Proposal is passed. + Accepted, + /// Proposal is rejected. + Rejected, +} diff --git a/pallets/proposal/src/weights.rs b/pallets/proposal/src/weights.rs index 1daa3d23..424d4184 100644 --- a/pallets/proposal/src/weights.rs +++ b/pallets/proposal/src/weights.rs @@ -2,9 +2,9 @@ //! Autogenerated weights for pallet_proposal //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-05-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-07-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `Ayushs-MacBook-Pro.local`, CPU: `` +//! HOSTNAME: `MacBook-Pro.local`, CPU: `Apple M1 pro` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 // Executed Command: @@ -12,7 +12,6 @@ // benchmark // pallet // --chain=dev -// --execution=wasm // --wasm-execution=compiled // --pallet=pallet-proposal // --extrinsic=* @@ -31,7 +30,7 @@ use sp_std::marker::PhantomData; /// Weight functions needed for pallet_proposal. pub trait WeightInfo { fn create_proposal() -> Weight; - fn submit_choice() -> Weight; + fn cast_vote() -> Weight; } /// Weights for pallet_proposal using the Substrate node and recommended hardware. @@ -43,6 +42,10 @@ impl WeightInfo for SubstrateWeight { /// Proof Skipped: Proposal NextProposalId (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Proposal NextChoiceId (r:1 w:1) /// Proof Skipped: Proposal NextChoiceId (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Proposal ProposalDetails (r:1 w:1) + /// Proof Skipped: Proposal ProposalDetails (max_values: None, max_size: None, mode: Measured) + /// Storage: Proposal ProposalExpireTime (r:0 w:1) + /// Proof Skipped: Proposal ProposalExpireTime (max_values: None, max_size: None, mode: Measured) /// Storage: Proposal Proposals (r:0 w:1) /// Proof Skipped: Proposal Proposals (max_values: None, max_size: None, mode: Measured) /// Storage: Proposal Choices (r:0 w:1) @@ -51,29 +54,31 @@ impl WeightInfo for SubstrateWeight { /// Proof Skipped: Proposal Votes (max_values: None, max_size: None, mode: Measured) fn create_proposal() -> Weight { // Proof Size summary in bytes: - // Measured: `631` - // Estimated: `10221` - // Minimum execution time: 33_000_000 picoseconds. - Weight::from_parts(34_000_000, 10221) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) + // Measured: `736` + // Estimated: `15788` + // Minimum execution time: 43_000_000 picoseconds. + Weight::from_parts(44_000_000, 15788) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)) } /// Storage: Community Communities (r:1 w:0) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - /// Storage: Proposal Proposals (r:1 w:0) + /// Storage: Proposal Proposals (r:1 w:1) /// Proof Skipped: Proposal Proposals (max_values: None, max_size: None, mode: Measured) /// Storage: Proposal Choices (r:1 w:0) /// Proof Skipped: Proposal Choices (max_values: None, max_size: None, mode: Measured) /// Storage: Proposal Votes (r:1 w:1) /// Proof Skipped: Proposal Votes (max_values: None, max_size: None, mode: Measured) - fn submit_choice() -> Weight { + /// Storage: Proposal ProposalDetails (r:1 w:1) + /// Proof Skipped: Proposal ProposalDetails (max_values: None, max_size: None, mode: Measured) + fn cast_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `970` - // Estimated: `17740` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 17740) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `1387` + // Estimated: `24260` + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(39_000_000, 24260) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } } @@ -85,6 +90,10 @@ impl WeightInfo for () { /// Proof Skipped: Proposal NextProposalId (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Proposal NextChoiceId (r:1 w:1) /// Proof Skipped: Proposal NextChoiceId (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: Proposal ProposalDetails (r:1 w:1) + /// Proof Skipped: Proposal ProposalDetails (max_values: None, max_size: None, mode: Measured) + /// Storage: Proposal ProposalExpireTime (r:0 w:1) + /// Proof Skipped: Proposal ProposalExpireTime (max_values: None, max_size: None, mode: Measured) /// Storage: Proposal Proposals (r:0 w:1) /// Proof Skipped: Proposal Proposals (max_values: None, max_size: None, mode: Measured) /// Storage: Proposal Choices (r:0 w:1) @@ -93,28 +102,30 @@ impl WeightInfo for () { /// Proof Skipped: Proposal Votes (max_values: None, max_size: None, mode: Measured) fn create_proposal() -> Weight { // Proof Size summary in bytes: - // Measured: `631` - // Estimated: `10221` - // Minimum execution time: 33_000_000 picoseconds. - Weight::from_parts(34_000_000, 10221) - .saturating_add(RocksDbWeight::get().reads(3_u64)) - .saturating_add(RocksDbWeight::get().writes(8_u64)) + // Measured: `736` + // Estimated: `15788` + // Minimum execution time: 43_000_000 picoseconds. + Weight::from_parts(44_000_000, 15788) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(10_u64)) } /// Storage: Community Communities (r:1 w:0) /// Proof Skipped: Community Communities (max_values: None, max_size: None, mode: Measured) - /// Storage: Proposal Proposals (r:1 w:0) + /// Storage: Proposal Proposals (r:1 w:1) /// Proof Skipped: Proposal Proposals (max_values: None, max_size: None, mode: Measured) /// Storage: Proposal Choices (r:1 w:0) /// Proof Skipped: Proposal Choices (max_values: None, max_size: None, mode: Measured) /// Storage: Proposal Votes (r:1 w:1) /// Proof Skipped: Proposal Votes (max_values: None, max_size: None, mode: Measured) - fn submit_choice() -> Weight { + /// Storage: Proposal ProposalDetails (r:1 w:1) + /// Proof Skipped: Proposal ProposalDetails (max_values: None, max_size: None, mode: Measured) + fn cast_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `970` - // Estimated: `17740` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(25_000_000, 17740) - .saturating_add(RocksDbWeight::get().reads(4_u64)) - .saturating_add(RocksDbWeight::get().writes(1_u64)) + // Measured: `1387` + // Estimated: `24260` + // Minimum execution time: 38_000_000 picoseconds. + Weight::from_parts(39_000_000, 24260) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) } } \ No newline at end of file diff --git a/pallets/token-swap/Cargo.toml b/pallets/token-swap/Cargo.toml index bf010da3..551e18b2 100644 --- a/pallets/token-swap/Cargo.toml +++ b/pallets/token-swap/Cargo.toml @@ -13,25 +13,25 @@ repository = "https://github.com/jurteam/jur-node/" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { version = "3.1.2", default-features = false, features = ["derive"] } +parity-scale-codec = { version = "3.6.4", default-features = false, features = ["derive"] } primitives = { package = 'jur-primitives', path = '../../primitives', default-features = false } -scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } -frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41"} -frame-system = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -frame-benchmarking = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41", optional = true } -sp-std = { default-features = false, version = "5.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0"} +frame-system = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-benchmarking = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } +sp-std = { default-features = false, version = "8.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-runtime = { default-features = false, version = "24.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } serde_derive = { version = "1.0.117", optional = true } rustc-hex = { version = "2.1.0", default-features = false } -sp-io = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-core = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -bs58 = { default-features = false, version = '0.4.0',features=['alloc']} -hex-literal = "0.3.4" +sp-io = { default-features = false, version = "23.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-core = { default-features = false, version = "21.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +bs58 = { default-features = false, version = '0.5.0',features=['alloc']} +hex-literal = "0.4.1" [dev-dependencies] -pallet-assets = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +pallet-assets = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } libsecp256k1 = { version = "0.7.0", default-features = false } [features] diff --git a/pallets/token-swap/src/benchmarking.rs b/pallets/token-swap/src/benchmarking.rs index b7f439b8..2208cb1d 100644 --- a/pallets/token-swap/src/benchmarking.rs +++ b/pallets/token-swap/src/benchmarking.rs @@ -5,6 +5,7 @@ use crate::Pallet as TokenSwap; use hex_literal::hex; use frame_benchmarking::benchmarks; use frame_system::RawOrigin; +use frame_system::pallet_prelude::BlockNumberFor; const VECHAIN_ROOT_HASH: VechainHash = hex!("e1a1226e0df5be016d753d53ff38d22e93d935c3cdeac637d69eed653c5c482e"); @@ -25,7 +26,7 @@ benchmarks! { ]; let storage_root: Vec = vec![7, 47, 187, 5, 112, 12, 248, 24, 215, 211, 246, 222, 139, 180, 208, 209, 140, 223, 237, 23, 49, 6, 178, 181, 175, 135, 238, 6, 254, 128, 29, 57]; - }: _(RawOrigin::Root, VECHAIN_ROOT_HASH, T::BlockNumber::from(10u32), "".as_bytes().to_vec(), account_proof) + }: _(RawOrigin::Root, VECHAIN_ROOT_HASH, BlockNumberFor::::from(10u32), "".as_bytes().to_vec(), account_proof) verify { assert_last_event::(Event::::UpdatedStorageRoot(storage_root).into()); } @@ -40,7 +41,7 @@ benchmarks! { hex!("f87d9e3f539a7fc1a6603092ab102bef7cc8c495ef7174c4668ac9b6c884cdc701b85cf85a80808094a18b81879e99394df4b99b78cf71037836706db2a06439ad2859e615114f02251c6d09c2a36e62d6de6cd55d0ad771964009ab6cc4a0072fbb05700cf818d7d3f6de8bb4d0d18cdfed173106b2b5af87ee06fe801d39").to_vec(), ]; - TokenSwap::::update_state_root(RawOrigin::Root.into(), VECHAIN_ROOT_HASH, T::BlockNumber::from(10u32), "".as_bytes().to_vec(), account_proof)?; + TokenSwap::::update_state_root(RawOrigin::Root.into(), VECHAIN_ROOT_HASH, BlockNumberFor::::from(10u32), "".as_bytes().to_vec(), account_proof)?; let signature = hex!("58acd0227ff9dc881e386cda6dfb316b5f8a0f1bd14069c1b39d6f6fe6e6c026145e9441d503f2b9e29a1757cb2a19f5807abd27f8c3017c808ac0468930ae7401"); let signed_json = r#"{"domain":"localhost:3000","payload":{"content":"My JUR address is 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY","type":"text"},"purpose":"agreement","signer":"0xa18b81879e99394df4b99b78cf71037836706db2","timestamp":1654848070}"#.as_bytes().to_vec(); diff --git a/pallets/token-swap/src/lib.rs b/pallets/token-swap/src/lib.rs index 778f2b09..0b29318c 100644 --- a/pallets/token-swap/src/lib.rs +++ b/pallets/token-swap/src/lib.rs @@ -58,10 +58,8 @@ use frame_support::{ dispatch::DispatchResult, pallet_prelude::*, traits::{ - tokens::{ - fungible::{Inspect, Mutate, Transfer}, - fungibles::{Inspect as Inspects, Mutate as Mutates, Transfer as Transfers}, - }, + fungible::{Inspect, Mutate}, + fungibles::{Inspect as Inspects, Mutate as Mutates}, Get, }, }; @@ -144,15 +142,13 @@ pub mod pallet { type Prefix: Get<&'static [u8]>; /// Assets for deposit/withdraw assets to/from token-swap module - type Assets: Transfers - + Inspects + type Assets: Inspects + Mutates; /// Balances for deposit/withdraw balance to/from account type Balances: Inspect + Mutate - + Transfer - + LockableCurrency; + + LockableCurrency>; /// The asset id for native currency. #[pallet::constant] @@ -177,7 +173,7 @@ pub mod pallet { /// Store VeChain state root #[pallet::storage] #[pallet::getter(fn root_information)] - pub type RootInformation = StorageValue<_, RootInfo, ValueQuery>; + pub type RootInformation = StorageValue<_, RootInfo>, ValueQuery>; #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] @@ -264,7 +260,7 @@ pub mod pallet { pub fn update_state_root( origin: OriginFor, vechain_root_hash: VechainHash, - meta_block_number: T::BlockNumber, + meta_block_number: BlockNumberFor, ipfs_path: Vec, account_proof: Vec>, ) -> DispatchResult { diff --git a/pallets/token-swap/src/mock.rs b/pallets/token-swap/src/mock.rs index 6bf3ec31..367c95ab 100644 --- a/pallets/token-swap/src/mock.rs +++ b/pallets/token-swap/src/mock.rs @@ -9,10 +9,9 @@ use hex_literal::hex; use primitives::{Balance, CurrencyId, JUR}; use sp_core::H256; use sp_runtime::{ - testing::Header, + BuildStorage, traits::{BlakeTwo256, IdentityLookup}, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; pub const NATIVE_CURRENCY_ID: CurrencyId = JUR; @@ -21,15 +20,12 @@ pub const VECHAIN_ROOT_HASH: VechainHash = // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Event}, - Assets: pallet_assets::{Pallet, Call, Storage, Event}, - TokenSwap: pallet_token_swap::{Pallet, Call, Storage, Event}, + System: frame_system, + Balances: pallet_balances, + Assets: pallet_assets, + TokenSwap: pallet_token_swap, } ); @@ -40,13 +36,12 @@ impl system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -75,6 +70,10 @@ impl pallet_balances::Config for Test { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); + type FreezeIdentifier = (); + type MaxFreezes = (); + type RuntimeHoldReason = (); + type MaxHolds = (); } parameter_types! { @@ -128,5 +127,5 @@ impl pallet_token_swap::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - system::GenesisConfig::default().build_storage::().unwrap().into() + system::GenesisConfig::::default().build_storage().unwrap().into() } diff --git a/pallets/token-swap/src/weights.rs b/pallets/token-swap/src/weights.rs index 851977f3..f96c6779 100644 --- a/pallets/token-swap/src/weights.rs +++ b/pallets/token-swap/src/weights.rs @@ -12,7 +12,6 @@ // benchmark // pallet // --chain=dev -// --execution=wasm // --wasm-execution=compiled // --pallet=pallet-token-swap // --extrinsic=* diff --git a/pallets/user/Cargo.toml b/pallets/user/Cargo.toml new file mode 100644 index 00000000..d0d509a4 --- /dev/null +++ b/pallets/user/Cargo.toml @@ -0,0 +1,51 @@ +[package] +name = "pallet-user" +version = "0.1.0" +description = "Jur User Pallet" +authors = ["Jur Team "] +homepage = "https://jur.io/" +edition = "2021" +license = "Apache-2.0" +publish = false +repository = "https://github.com/jurteam/jur-node/" + + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"], default-features = false } +primitives = { package = 'jur-primitives', path = '../../primitives', default-features = false } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } + +# Substrate +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v1.0.0" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } + +sp-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } + +[dev-dependencies] +serde = { version = "1.0.132" } + +# Substrate +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } + +[features] +default = ["std"] +runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"] +std = [ + "codec/std", + "scale-info/std", + "frame-benchmarking/std", + "frame-support/std", + "frame-system/std", + "primitives/std", + "sp-std/std", + "sp-runtime/std", +] +try-runtime = [ "frame-support/try-runtime" ] diff --git a/pallets/user/src/benchmarking.rs b/pallets/user/src/benchmarking.rs new file mode 100644 index 00000000..8bd9c853 --- /dev/null +++ b/pallets/user/src/benchmarking.rs @@ -0,0 +1,28 @@ +//! Benchmarking setup for pallet-user +//! +#![cfg(feature = "runtime-benchmarks")] +use super::*; + +#[allow(unused)] +use crate::Pallet as User; +use frame_benchmarking::v1::{benchmarks, whitelisted_caller}; +use frame_system::RawOrigin; + +fn assert_last_event(generic_event: ::RuntimeEvent) { + frame_system::Pallet::::assert_last_event(generic_event.into()); +} + +benchmarks! { + update_user { + let caller: T::AccountId = whitelisted_caller(); + }: _( + RawOrigin::Signed(caller.clone()), + Some("Alice".as_bytes().to_vec().try_into().unwrap()), + Some("Avatar".as_bytes().to_vec().try_into().unwrap()) + ) + verify { + assert_last_event::(Event::::UserDetailsUpdated(caller).into()); + } + + impl_benchmark_test_suite!(User, crate::mock::new_test_ext(), crate::mock::Test); +} diff --git a/pallets/user/src/lib.rs b/pallets/user/src/lib.rs new file mode 100644 index 00000000..e450541f --- /dev/null +++ b/pallets/user/src/lib.rs @@ -0,0 +1,137 @@ +//! # Jur User Pallet +//! +//! A pallet allows any $JUR token holder to add username and profile image on the Jur. +//! +//! ## Overview +//! User pallet will be the core pallet to store the basic details of JUR users. +//! Currently this pallet will store the username and profile image of the JUR user. +//! A user can add/update there username and profile image by using this pallet. +//! +//! ## Interface +//! +//! * `update_user` +//! + +#![cfg_attr(not(feature = "std"), no_std)] +pub use pallet::*; +use sp_runtime::RuntimeDebug; +pub use weights::WeightInfo; + +#[cfg(test)] +mod mock; +pub mod types; + +#[cfg(test)] +mod tests; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; +pub mod weights; + +#[frame_support::pallet] +pub mod pallet { + use crate::types::User; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + use scale_info::prelude::string::String; + + use super::*; + + /// Configure the pallet by specifying the parameters and types on which it depends. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Because this pallet emits events, it depends on the runtime's + /// definition of an event. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// The maximum length of username. + #[pallet::constant] + type NameLimit: Get; + + /// The maximum length of address(IPFS). + #[pallet::constant] + type AddressLimit: Get; + + /// Weight information + type WeightInfo: WeightInfo; + } + + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(_); + + /// Store the users with Account id. + #[pallet::storage] + #[pallet::getter(fn users)] + pub type Users = + StorageMap<_, Blake2_128Concat, T::AccountId, User>; + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// Updated user-details by user [user] + UserDetailsUpdated(T::AccountId), + } + + // Errors inform users that something went wrong. + #[pallet::error] + pub enum Error { + /// Username not available. + UsernameNotAvailable, + /// Username is not valid. + UsernameInvalid, + } + + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::call] + impl Pallet { + /// Add/Update the user details by any JUR user. + /// + /// Parameters: + /// - `name`: Username of the Account. + /// - `avatar`: This is an image file address(also a GIF is valid) that is uploaded on IPFS. + /// + /// Emits `UserDetailsUpdated` event when successful. + /// + #[pallet::call_index(0)] + #[pallet::weight(T::WeightInfo::update_user())] + pub fn update_user( + origin: OriginFor, + name: Option>, + avatar: Option>, + ) -> DispatchResult { + let user = ensure_signed(origin.clone())?; + + // Validating the username/avatar. They should not have the blank spaces + if name.is_some() { + let username: String = + String::from_utf8(name.clone().unwrap().to_vec()).expect("Invalid username"); + ensure!(!username.contains(" "), Error::::UsernameInvalid); + } + if avatar.is_some() { + let profile: String = + String::from_utf8(avatar.clone().unwrap().to_vec()).expect("Invalid username"); + ensure!(!profile.contains(" "), Error::::UsernameInvalid); + } + + // Validating the duplicate username + for (_, userdata) in Users::::iter() { + ensure!( + userdata.name != name || userdata.name == None, + Error::::UsernameNotAvailable + ); + } + + // creating the user data structure as per given inputs + let new_user = User { name, avatar }; + + // Inserting the data into the storage. + Users::::insert(user.clone(), new_user); + + Self::deposit_event(Event::UserDetailsUpdated(user)); + Ok(()) + } + } +} diff --git a/pallets/user/src/mock.rs b/pallets/user/src/mock.rs new file mode 100644 index 00000000..de86695b --- /dev/null +++ b/pallets/user/src/mock.rs @@ -0,0 +1,56 @@ +use crate as pallet_user; +use frame_support::traits::{ConstU16, ConstU32, ConstU64}; +use sp_core::H256; +use sp_runtime::{ + BuildStorage, + traits::{BlakeTwo256, IdentityLookup}, +}; +use frame_system as system; +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system, + User: pallet_user, + } +); + +impl system::Config for Test { + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type Nonce = u64; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Block = Block; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = ConstU64<250>; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = ConstU16<42>; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +impl pallet_user::Config for Test { + type RuntimeEvent = RuntimeEvent; + type NameLimit = ConstU32<24>; + type AddressLimit = ConstU32<60>; + type WeightInfo = (); +} + +// Build genesis storage according to the mock runtime. +pub fn new_test_ext() -> sp_io::TestExternalities { + frame_system::GenesisConfig::::default().build_storage().unwrap().into() +} diff --git a/pallets/user/src/tests.rs b/pallets/user/src/tests.rs new file mode 100644 index 00000000..e4c878fa --- /dev/null +++ b/pallets/user/src/tests.rs @@ -0,0 +1,40 @@ +use crate::{mock::*, Error}; +use frame_support::{assert_noop, assert_ok}; +use crate::Users; + +#[test] +fn update_user_works() { + new_test_ext().execute_with(|| { + assert_ok!( + User::update_user( + RuntimeOrigin::signed(1), + Some("Alice".as_bytes().to_vec().try_into().unwrap()), + Some("avatar".as_bytes().to_vec().try_into().unwrap()) + ) + ); + + assert!(Users::::contains_key(1)); + }); +} + +#[test] +fn update_user_not_works_with_existing_name() { + new_test_ext().execute_with(|| { + + assert_ok!( + User::update_user( + RuntimeOrigin::signed(1), + Some("Alice".as_bytes().to_vec().try_into().unwrap()), + Some("avatar".as_bytes().to_vec().try_into().unwrap()) + ) + ); + assert_noop!( + User::update_user( + RuntimeOrigin::signed(1), + Some("Alice".as_bytes().to_vec().try_into().unwrap()), + Some("avatar".as_bytes().to_vec().try_into().unwrap()) + ), + Error::::UsernameNotAvailable + ); + }); +} diff --git a/pallets/user/src/types.rs b/pallets/user/src/types.rs new file mode 100644 index 00000000..17ddce01 --- /dev/null +++ b/pallets/user/src/types.rs @@ -0,0 +1,12 @@ +use super::*; +use codec::{Decode, Encode}; +use frame_support::{pallet_prelude::Get, BoundedVec}; +use scale_info::TypeInfo; +use sp_std::prelude::*; + +#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, Default)] +#[scale_info(skip_type_params(NameLimit, AddressLimit))] +pub struct User, AddressLimit: Get> { + pub name: Option>, + pub avatar: Option>, +} diff --git a/pallets/user/src/weights.rs b/pallets/user/src/weights.rs new file mode 100644 index 00000000..0b1f6706 --- /dev/null +++ b/pallets/user/src/weights.rs @@ -0,0 +1,64 @@ + +//! Autogenerated weights for pallet_user +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-08-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `PAR02052`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/jur-node +// benchmark +// pallet +// --chain=dev +// --wasm-execution=compiled +// --pallet=pallet-user +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --template=./.maintain/frame-weight-template.hbs +// --output=./pallets/user/src/weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_user. +pub trait WeightInfo { + fn update_user() -> Weight; +} + +/// Weights for pallet_user using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + /// Storage: User Users (r:1 w:1) + /// Proof Skipped: User Users (max_values: None, max_size: None, mode: Measured) + fn update_user() -> Weight { + // Proof Size summary in bytes: + // Measured: `82` + // Estimated: `3547` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 3547) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + /// Storage: User Users (r:1 w:1) + /// Proof Skipped: User Users (max_values: None, max_size: None, mode: Measured) + fn update_user() -> Weight { + // Proof Size summary in bytes: + // Measured: `82` + // Estimated: `3547` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_000_000, 3547) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } +} \ No newline at end of file diff --git a/pallets/whitelist/Cargo.toml b/pallets/whitelist/Cargo.toml new file mode 100644 index 00000000..2d847727 --- /dev/null +++ b/pallets/whitelist/Cargo.toml @@ -0,0 +1,51 @@ +[package] +name = "pallet-whitelist" +version = "0.1.0" +description = "Jur Whitelist Pallet" +authors = ["Jur Team "] +homepage = "https://jur.io/" +edition = "2021" +license = "Apache-2.0" +publish = false +repository = "https://github.com/jurteam/jur-node/" + + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"], default-features = false } +primitives = { package = 'jur-primitives', path = '../../primitives', default-features = false } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } + +# Substrate +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v1.0.0" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } + +sp-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } + +[dev-dependencies] +serde = { version = "1.0.132" } + +# Substrate +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +pallet-insecure-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } + +[features] +default = ["std"] +runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"] +std = [ + "codec/std", + "scale-info/std", + "frame-benchmarking/std", + "frame-support/std", + "frame-system/std", + "primitives/std", + "sp-std/std", + "sp-runtime/std", +] +try-runtime = [ "frame-support/try-runtime" ] diff --git a/pallets/whitelist/src/benchmarking.rs b/pallets/whitelist/src/benchmarking.rs new file mode 100644 index 00000000..5c82333c --- /dev/null +++ b/pallets/whitelist/src/benchmarking.rs @@ -0,0 +1,67 @@ +//! Benchmarking setup for pallet-whitelist +//! +#![cfg(feature = "runtime-benchmarks")] +use super::*; + +#[allow(unused)] +use crate::Pallet as Whitelist; +use frame_benchmarking::v1::{benchmarks, whitelisted_caller}; +use frame_system::RawOrigin; + +fn assert_last_event(generic_event: ::RuntimeEvent) { + frame_system::Pallet::::assert_last_event(generic_event.into()); +} + +benchmarks! { + add_founder { + let caller: T::AccountId = whitelisted_caller(); + }: _( + RawOrigin::Root, + caller.clone() + ) + verify { + assert_last_event::(Event::::AddedFounder(caller).into()); + } + + revoke_founder { + let caller: T::AccountId = whitelisted_caller(); + Whitelist::::add_founder( + RawOrigin::Root.into(), + caller.clone() + ).unwrap(); + + }: _( + RawOrigin::Root, + caller.clone() + ) + verify { + assert_last_event::(Event::::RevokedFounder(caller).into()); + } + + add_admin { + let caller: T::AccountId = whitelisted_caller(); + }: _( + RawOrigin::Root, + caller.clone() + ) + verify { + assert_last_event::(Event::::AddedAdmin(caller).into()); + } + + revoke_admin { + let caller: T::AccountId = whitelisted_caller(); + Whitelist::::add_admin( + RawOrigin::Root.into(), + caller.clone() + ).unwrap(); + + }: _( + RawOrigin::Root, + caller.clone() + ) + verify { + assert_last_event::(Event::::RevokedAdmin(caller).into()); + } + + impl_benchmark_test_suite!(Whitelist, crate::mock::new_test_ext(), crate::mock::Test); +} diff --git a/pallets/whitelist/src/lib.rs b/pallets/whitelist/src/lib.rs new file mode 100644 index 00000000..47766961 --- /dev/null +++ b/pallets/whitelist/src/lib.rs @@ -0,0 +1,220 @@ +//! # Jur Whitelist pallet +//! +//! A pallet allows any Sudo User to add users who can create the community on the chain. +//! Also add the admin to manage that users. +//! +//! ## Overview +//! This pallet will be the main pallet to add the users as founder +//! and add admins to manage that founders. +//! Currently the sudo user can add/revoke the admin to manage the founders. +//! Sudo and admins can add the users into the founders list. +//! +//! ## Interface +//! +//! * `add_founder` +//! * `revoke_founder` +//! * `add_admin` +//! * `revoke_admin` +//! + +#![cfg_attr(not(feature = "std"), no_std)] +pub use pallet::*; +pub use weights::WeightInfo; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod tests; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; +pub mod weights; + +#[frame_support::pallet] +pub mod pallet { + use frame_support::dispatch::Vec; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + use super::*; + + /// Configure the pallet by specifying the parameters and types on which it depends. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Because this pallet emits events, it depends on the runtime's + /// definition of an event. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// Weight information + type WeightInfo: WeightInfo; + } + + #[pallet::pallet] + #[pallet::without_storage_info] + pub struct Pallet(_); + + /// Store the users with Account id. + #[pallet::storage] + #[pallet::getter(fn founders)] + pub type Founders = StorageValue<_, Vec, ValueQuery>; + + /// Admins who manage the founders access. + #[pallet::storage] + #[pallet::getter(fn admins)] + pub type Admins = StorageValue<_, Vec, ValueQuery>; + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// Added user as founder to create community [user] + AddedFounder(T::AccountId), + /// Revoke founder [user] + RevokedFounder(T::AccountId), + /// Added admin to manage founders [user] + AddedAdmin(T::AccountId), + /// Revoke admin [user] + RevokedAdmin(T::AccountId), + } + + // Errors inform users that something went wrong. + #[pallet::error] + pub enum Error { + /// Already in the founder. + AlreadyFounder, + /// Not a founder user. + FounderNotExist, + /// Already admin. + AlreadyAdmin, + /// Not a admin. + AdminNotExist, + /// No Permission. + NoPermission, + } + + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::call] + impl Pallet { + /// Add the user in founders list. + /// + /// Parameters: + /// - `account`: Account Id of user. + /// + /// Emits `AddedFounder` event when successful. + /// + #[pallet::call_index(0)] + #[pallet::weight(T::WeightInfo::add_founder())] + pub fn add_founder(origin: OriginFor, account: T::AccountId) -> DispatchResult { + ensure!( + ensure_root(origin.clone()).is_ok() + || Admins::::get() + .binary_search(&ensure_signed(origin.clone())?) + .is_ok(), + Error::::NoPermission + ); + + let mut founders = Founders::::get(); + let location = founders + .binary_search(&account) + .err() + .ok_or(Error::::AlreadyFounder)?; + + // Inserting the data into the storage. + founders.insert(location, account.clone()); + + Founders::::put(&founders); + + Self::deposit_event(Event::AddedFounder(account)); + Ok(()) + } + + /// Remove the user from founders list. + /// + /// Parameters: + /// - `account`: Account Id of user. + /// + /// Emits `RevokedFounder` event when successful. + /// + #[pallet::call_index(1)] + #[pallet::weight(T::WeightInfo::revoke_founder())] + pub fn revoke_founder(origin: OriginFor, account: T::AccountId) -> DispatchResult { + ensure!( + ensure_root(origin.clone()).is_ok() + || Admins::::get() + .binary_search(&ensure_signed(origin.clone())?) + .is_ok(), + Error::::NoPermission + ); + + let mut founders = Founders::::get(); + let location = founders + .binary_search(&account) + .ok() + .ok_or(Error::::FounderNotExist)?; + + // Removing the data into the storage. + founders.remove(location); + + Founders::::put(&founders); + + Self::deposit_event(Event::RevokedFounder(account)); + Ok(()) + } + + /// Add the admin to admin list. + /// + /// Parameters: + /// - `account`: Account Id of user. + /// + /// Emits `AddedAdmin` event when successful. + /// + #[pallet::call_index(2)] + #[pallet::weight(T::WeightInfo::add_admin())] + pub fn add_admin(origin: OriginFor, account: T::AccountId) -> DispatchResult { + ensure_root(origin.clone())?; + + let mut admins = Admins::::get(); + let location = admins + .binary_search(&account) + .err() + .ok_or(Error::::AlreadyAdmin)?; + + // Inserting the data into the storage. + admins.insert(location, account.clone()); + + Admins::::put(&admins); + + Self::deposit_event(Event::AddedAdmin(account)); + Ok(()) + } + + /// Remove the admin from admin list. + /// + /// Parameters: + /// - `account`: Account Id of user. + /// + /// Emits `RevokedAdmin` event when successful. + /// + #[pallet::call_index(3)] + #[pallet::weight(T::WeightInfo::revoke_admin())] + pub fn revoke_admin(origin: OriginFor, account: T::AccountId) -> DispatchResult { + ensure_root(origin.clone())?; + + let mut admins = Admins::::get(); + let location = admins + .binary_search(&account) + .ok() + .ok_or(Error::::AdminNotExist)?; + + // Removing the data into the storage. + admins.remove(location); + + Admins::::put(&admins); + + Self::deposit_event(Event::RevokedAdmin(account)); + Ok(()) + } + } +} diff --git a/pallets/whitelist/src/mock.rs b/pallets/whitelist/src/mock.rs new file mode 100644 index 00000000..f5974945 --- /dev/null +++ b/pallets/whitelist/src/mock.rs @@ -0,0 +1,57 @@ +use crate as pallet_whitelist; +use frame_support::traits::{ConstU16, ConstU64}; +use frame_system as system; +use sp_core::H256; +use sp_runtime::{ + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, +}; +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system, + Whitelist: pallet_whitelist, + } +); + +impl system::Config for Test { + type RuntimeEvent = RuntimeEvent; + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = (); + type BlockLength = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type Nonce = u64; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Block = Block; + type BlockHashCount = ConstU64<250>; + type DbWeight = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = ConstU16<42>; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +impl pallet_whitelist::Config for Test { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); +} + +// Build genesis storage according to the mock runtime. +pub fn new_test_ext() -> sp_io::TestExternalities { + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() +} diff --git a/pallets/whitelist/src/tests.rs b/pallets/whitelist/src/tests.rs new file mode 100644 index 00000000..11c09a41 --- /dev/null +++ b/pallets/whitelist/src/tests.rs @@ -0,0 +1,130 @@ +use crate::mock::Whitelist; +use crate::{mock::*, Error}; +use frame_support::{assert_noop, assert_ok}; +use frame_support::error::BadOrigin; + +#[test] +fn add_founder_works() { + new_test_ext().execute_with(|| { + assert_ok!(Whitelist::add_founder(RuntimeOrigin::root(), 1)); + }); +} + +#[test] +fn add_founder_works_failed_with_founder_exist() { + new_test_ext().execute_with(|| { + assert_ok!(Whitelist::add_founder(RuntimeOrigin::root(), 1)); + assert_noop!( + Whitelist::add_founder(RuntimeOrigin::root(), 1), + Error::::AlreadyFounder + ); + }); +} + +#[test] +fn add_founder_works_failed_with_non_sudo_user() { + new_test_ext().execute_with(|| { + assert_noop!( + Whitelist::add_founder(RuntimeOrigin::signed(1), 1), + Error::::NoPermission + ); + }); +} + +#[test] +fn revoke_founder_works() { + new_test_ext().execute_with(|| { + assert_ok!(Whitelist::add_founder(RuntimeOrigin::root(), 1)); + assert_ok!(Whitelist::revoke_founder(RuntimeOrigin::root(), 1)); + }); +} + +#[test] +fn revoke_founder_works_failed_with_founder_not_exist() { + new_test_ext().execute_with(|| { + assert_noop!( + Whitelist::revoke_founder(RuntimeOrigin::root(), 1), + Error::::FounderNotExist + ); + }); +} + +#[test] +fn revoke_founder_works_failed_with_non_sudo_user() { + new_test_ext().execute_with(|| { + assert_noop!( + Whitelist::revoke_founder(RuntimeOrigin::signed(1), 1), + Error::::NoPermission + ); + }); +} + +#[test] +fn add_admin_works() { + new_test_ext().execute_with(|| { + assert_ok!(Whitelist::add_admin(RuntimeOrigin::root(), 1)); + }); +} + +#[test] +fn add_admin_works_failed_with_admin_exist() { + new_test_ext().execute_with(|| { + assert_ok!(Whitelist::add_admin(RuntimeOrigin::root(), 1)); + assert_noop!(Whitelist::add_admin(RuntimeOrigin::root(), 1), Error::::AlreadyAdmin); + }); +} + +#[test] +fn add_admin_works_failed_with_non_sudo_user() { + new_test_ext().execute_with(|| { + assert_noop!( + Whitelist::add_admin(RuntimeOrigin::signed(1), 1), + BadOrigin + ); + }); +} + +#[test] +fn revoke_admin_works() { + new_test_ext().execute_with(|| { + assert_ok!(Whitelist::add_admin(RuntimeOrigin::root(), 1)); + assert_ok!(Whitelist::revoke_admin(RuntimeOrigin::root(), 1)); + }); +} + +#[test] +fn revoke_admin_works_failed_with_admin_not_exist() { + new_test_ext().execute_with(|| { + assert_noop!( + Whitelist::revoke_admin(RuntimeOrigin::root(), 1), + Error::::AdminNotExist + ); + }); +} + +#[test] +fn revoke_admin_works_failed_with_non_sudo_user() { + new_test_ext().execute_with(|| { + assert_noop!( + Whitelist::revoke_admin(RuntimeOrigin::signed(1), 1), + BadOrigin + ); + }); +} + +#[test] +fn add_founder_with_admin_works() { + new_test_ext().execute_with(|| { + assert_ok!(Whitelist::add_admin(RuntimeOrigin::root(), 1)); + assert_ok!(Whitelist::add_founder(RuntimeOrigin::signed(1), 2)); + }); +} + +#[test] +fn revoke_founder_works_with_admin() { + new_test_ext().execute_with(|| { + assert_ok!(Whitelist::add_admin(RuntimeOrigin::root(), 1)); + assert_ok!(Whitelist::add_founder(RuntimeOrigin::root(), 1)); + assert_ok!(Whitelist::revoke_founder(RuntimeOrigin::root(), 1)); + }); +} diff --git a/pallets/whitelist/src/weights.rs b/pallets/whitelist/src/weights.rs new file mode 100644 index 00000000..172811b6 --- /dev/null +++ b/pallets/whitelist/src/weights.rs @@ -0,0 +1,133 @@ + +//! Autogenerated weights for pallet_whitelist +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-08-13, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Pankajs-MacBook-Pro.local`, CPU: `` +//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// ./target/release/jur-node +// benchmark +// pallet +// --chain=dev +// --wasm-execution=compiled +// --pallet=pallet-whitelist +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --template=./.maintain/frame-weight-template.hbs +// --output=./pallets/whitelist/src/weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_whitelist. +pub trait WeightInfo { + fn add_founder() -> Weight; + fn revoke_founder() -> Weight; + fn add_admin() -> Weight; + fn revoke_admin() -> Weight; +} + +/// Weights for pallet_whitelist using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + /// Storage: `Whitelist::Founders` (r:1 w:1) + /// Proof: `Whitelist::Founders` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn add_founder() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `1491` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 1491) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Whitelist::Founders` (r:1 w:1) + /// Proof: `Whitelist::Founders` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn revoke_founder() -> Weight { + // Proof Size summary in bytes: + // Measured: `64` + // Estimated: `1549` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 1549) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Whitelist::Admins` (r:1 w:1) + /// Proof: `Whitelist::Admins` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn add_admin() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `1491` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 1491) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Whitelist::Admins` (r:1 w:1) + /// Proof: `Whitelist::Admins` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn revoke_admin() -> Weight { + // Proof Size summary in bytes: + // Measured: `64` + // Estimated: `1549` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 1549) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + /// Storage: `Whitelist::Founders` (r:1 w:1) + /// Proof: `Whitelist::Founders` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn add_founder() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `1491` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 1491) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `Whitelist::Founders` (r:1 w:1) + /// Proof: `Whitelist::Founders` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn revoke_founder() -> Weight { + // Proof Size summary in bytes: + // Measured: `64` + // Estimated: `1549` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(10_000_000, 1549) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `Whitelist::Admins` (r:1 w:1) + /// Proof: `Whitelist::Admins` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn add_admin() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `1491` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 1491) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `Whitelist::Admins` (r:1 w:1) + /// Proof: `Whitelist::Admins` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + fn revoke_admin() -> Weight { + // Proof Size summary in bytes: + // Measured: `64` + // Estimated: `1549` + // Minimum execution time: 9_000_000 picoseconds. + Weight::from_parts(9_000_000, 1549) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } +} \ No newline at end of file diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 3625cd0a..bbe0e2df 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -5,16 +5,16 @@ name = 'jur-primitives' version = '1.0.0' [dependencies] -parity-scale-codec = { version = "3.1.2", default-features = false, features = ["derive"] } -scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } +parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } serde = { version = "1.0.137", default-features = false } -sp-std = { default-features = false, version = "5.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-runtime = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +sp-std = { default-features = false, version = "8.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-runtime = { default-features = false, version = "24.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } rustc-hex = { version = "2.1.0", default-features = false } serde_derive = { version = "1.0.117", optional = true } -sp-io = { default-features = false, version = "7.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +sp-io = { default-features = false, version = "23.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } rlp = {default-features = false, version ="0.5.1"} -frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [dev-dependencies] hex-literal = "0.3.4" diff --git a/primitives/src/macros.rs b/primitives/src/macros.rs index 8aa79c37..2f3c2bea 100644 --- a/primitives/src/macros.rs +++ b/primitives/src/macros.rs @@ -10,7 +10,7 @@ macro_rules! impl_incrementable { } fn initial_value() -> Self { - 0 + 1 } } )+ diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index c7f79cb6..514f06f2 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jur-node-runtime" -version = "4.0.0-dev" +version = "2.0.0" edition = "2021" license = "Unlicense" publish = false @@ -9,53 +9,60 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.0.1", default-features = false, features = ["derive"] } -pallet-aura = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-assets = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-balances = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-grandpa = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-sudo = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -frame-try-runtime = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41", optional = true } -pallet-timestamp = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-treasury = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-authorship = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +pallet-aura = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-assets = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-balances = { version = "4.0.0-dev", 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/substrate.git", branch = "polkadot-v1.0.0" } +pallet-grandpa = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-sudo = { 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-try-runtime = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } +pallet-timestamp = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-treasury = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-authorship = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-insecure-randomness-collective-flip = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-executive = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-block-builder = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41"} -sp-consensus-aura = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-core = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-inherents = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41"} -sp-offchain = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-runtime = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-session = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-std = { version = "5.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-transaction-pool = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-version = { version = "5.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-multisig = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.41" } -sp-staking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -sp-consensus-grandpa = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +frame-executive = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-block-builder = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0"} +sp-consensus-aura = { version = "0.10.0-dev", 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/substrate.git", branch = "polkadot-v1.0.0" } +sp-inherents = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0"} +sp-offchain = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-runtime = { version = "24.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-session = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-std = { version = "8.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-transaction-pool = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-version = { version = "22.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-multisig = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-staking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-consensus-grandpa = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } # Used for the node token-swap's RPCs -frame-system-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +frame-system-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } # Used for runtime benchmarking -frame-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41", optional = true } -frame-system-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41", optional = true } -hex-literal = "0.3.4" +frame-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } +frame-system-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true } +hex-literal = "0.4.1" # Local Dependencies pallet-token-swap = { version = "0.1.0", default-features = false, path = "../pallets/token-swap" } +pallet-community = { version = "0.1.0", default-features = false, path = "../pallets/community" } +pallet-proposal = { version = "0.1.0", default-features = false, path = "../pallets/proposal" } +pallet-user = { version = "0.1.0", default-features = false, path = "../pallets/user" } +pallet-passport = { version = "0.1.0", default-features = false, path = "../pallets/passport" } +pallet-whitelist = { version = "0.1.0", default-features = false, path = "../pallets/whitelist" } + primitives = { package = 'jur-primitives', path = '../primitives', default-features = false } [build-dependencies] -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.41" } +substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [features] default = ["std"] @@ -76,6 +83,8 @@ std = [ "pallet-grandpa/std", "pallet-sudo/std", "pallet-token-swap/std", + "pallet-user/std", + "pallet-whitelist/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", @@ -96,6 +105,7 @@ std = [ "sp-consensus-grandpa/std", "pallet-treasury/std", "pallet-authorship/std", + "pallet-insecure-randomness-collective-flip/std" ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", @@ -105,17 +115,33 @@ runtime-benchmarks = [ "pallet-balances/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "sp-runtime/runtime-benchmarks", - "pallet-token-swap/runtime-benchmarks" + "pallet-token-swap/runtime-benchmarks", + "pallet-community/runtime-benchmarks", + "pallet-proposal/runtime-benchmarks", + "pallet-passport/runtime-benchmarks", + "pallet-user/runtime-benchmarks", + "pallet-whitelist/runtime-benchmarks" ] try-runtime = [ + "frame-try-runtime/try-runtime", "frame-executive/try-runtime", - "frame-try-runtime", "frame-system/try-runtime", + "frame-support/try-runtime", + "pallet-aura/try-runtime", + "pallet-assets/try-runtime", "pallet-balances/try-runtime", "pallet-grandpa/try-runtime", "pallet-sudo/try-runtime", "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", + "pallet-treasury/try-runtime", + "pallet-authorship/try-runtime", "pallet-multisig/try-runtime", - "pallet-token-swap/try-runtime" + "pallet-token-swap/try-runtime", + "pallet-community/try-runtime", + "pallet-proposal/try-runtime", + "pallet-passport/try-runtime", + "pallet-insecure-randomness-collective-flip/try-runtime", + "pallet-user/try-runtime", + "pallet-whitelist/try-runtime", ] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 22ea062e..dbd7a0ec 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -33,7 +33,7 @@ use sp_version::RuntimeVersion; pub use frame_support::{ construct_runtime, parameter_types, traits::{ - ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, EqualPrivilegeOnly, + ConstBool, ConstU128, ConstU32, ConstU64, ConstU8, EitherOfDiverse, EqualPrivilegeOnly, KeyOwnerProofSystem, Randomness, StorageInfo, }, weights::{ @@ -57,7 +57,7 @@ use frame_support::traits::{Currency, Imbalance, OnUnbalanced}; /// Import the token-swap pallet. pub use pallet_token_swap; use primitives::{ - Balance, CurrencyId, EthereumAddress, JUR, + Balance, ChoiceId, CommunityId, CurrencyId, EthereumAddress, PassportId, ProposalId, JUR, }; /// An index to a block. @@ -71,7 +71,7 @@ pub type Signature = MultiSignature; pub type AccountId = <::Signer as IdentifyAccount>::AccountId; /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; @@ -120,7 +120,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 103, + spec_version: 104, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -155,7 +155,8 @@ pub fn native_version() -> NativeVersion { const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 2 seconds of compute with a 6 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX); +const MAXIMUM_BLOCK_WEIGHT: Weight = + Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_SECOND, u64::MAX); pub const NATIVE_CURRENCY_ID: CurrencyId = JUR; @@ -190,6 +191,8 @@ parameter_types! { impl frame_system::Config for Runtime { /// The basic call filter to use in dispatchable. type BaseCallFilter = frame_support::traits::Everything; + /// The block type for the runtime. + type Block = Block; /// Block & extrinsics weights: base values and limits. type BlockWeights = RuntimeBlockWeights; /// The maximum length of a block (in bytes). @@ -200,16 +203,12 @@ impl frame_system::Config for Runtime { type RuntimeCall = RuntimeCall; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; - /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + /// The type for storing how many extrinsics an account has signed. + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -249,6 +248,7 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<32>; + type AllowMultipleBlocksPerSlot = ConstBool; } impl pallet_grandpa::Config for Runtime { @@ -285,6 +285,10 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ConstU128; type AccountStore = System; type WeightInfo = pallet_balances::weights::SubstrateWeight; + type FreezeIdentifier = (); + type MaxFreezes = (); + type RuntimeHoldReason = (); + type MaxHolds = (); } parameter_types! { @@ -328,6 +332,7 @@ impl pallet_transaction_payment::Config for Runtime { impl pallet_sudo::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; + type WeightInfo = pallet_sudo::weights::SubstrateWeight; } parameter_types! { @@ -395,6 +400,55 @@ parameter_types! { pub const MaxVotesPerVoter: u32 = 16; } +impl pallet_community::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CommunityId = CommunityId; + type CreateOrigin = AsEnsureOriginWithArg>; + type NameLimit = ConstU32<50>; + type DescriptionLimit = ConstU32<250>; + #[cfg(feature = "runtime-benchmarks")] + type Helper = (); + type WeightInfo = pallet_community::weights::SubstrateWeight; + type MyRandomness = RandomnessCollectiveFlip; + type TagLimit = ConstU32<40>; + type ColorLimit = ConstU32<7>; + type CommunityLimit = ConstU32<3>; +} + +impl pallet_proposal::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type ProposalId = ProposalId; + type ChoiceId = ChoiceId; + type NameLimit = ConstU32<512>; + type DescriptionLimit = ConstU32<8192>; + type LabelLimit = ConstU32<10>; + type AccountLimit = ConstU32<500>; + #[cfg(feature = "runtime-benchmarks")] + type Helper = (); + type WeightInfo = pallet_proposal::weights::SubstrateWeight; +} + +impl pallet_passport::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type PassportId = PassportId; + type AddressLimit = ConstU32<60>; + #[cfg(feature = "runtime-benchmarks")] + type Helper = (); + type WeightInfo = pallet_passport::weights::SubstrateWeight; +} + +impl pallet_user::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type NameLimit = ConstU32<24>; + type AddressLimit = ConstU32<60>; + type WeightInfo = pallet_user::weights::SubstrateWeight; +} + +impl pallet_whitelist::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_whitelist::weights::SubstrateWeight; +} + type NegativeImbalance = >::NegativeImbalance; pub struct Author; @@ -448,11 +502,11 @@ impl OnUnbalanced for DealWithFees { pub struct AuraAccountAdapter; impl frame_support::traits::FindAuthor for AuraAccountAdapter { fn find_author<'a, I>(digests: I) -> Option - where I: 'a + IntoIterator + where + I: 'a + IntoIterator, { - pallet_aura::AuraAuthorId::::find_author(digests).and_then(|k| { - AccountId::try_from(k.as_ref()).ok() - }) + pallet_aura::AuraAuthorId::::find_author(digests) + .and_then(|k| AccountId::try_from(k.as_ref()).ok()) } } @@ -485,14 +539,12 @@ impl pallet_treasury::Config for Runtime { type MaxApprovals = ConstU32<100>; type SpendOrigin = frame_support::traits::NeverEnsureOrigin; } + +impl pallet_insecure_randomness_collective_flip::Config for Runtime {} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub struct Runtime - where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { + pub struct Runtime { System: frame_system, Timestamp: pallet_timestamp, Aura: pallet_aura, @@ -503,10 +555,16 @@ construct_runtime!( Sudo: pallet_sudo, // Local Pallet TokenSwap: pallet_token_swap, + Community: pallet_community, + Proposal: pallet_proposal, + Passport: pallet_passport, + User: pallet_user, + Whitelist: pallet_whitelist, Authorship: pallet_authorship, Treasury: pallet_treasury, Multisig: pallet_multisig::{Pallet, Call, Storage, Event}, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip, } ); @@ -528,7 +586,8 @@ pub type SignedExtra = ( pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; /// Executive: handles dispatch to the various modules. @@ -538,8 +597,11 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, + Migrations, >; +pub type Migrations = pallet_community::migration::v6::MigrateToV6; + #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; @@ -552,6 +614,11 @@ mod benches { [pallet_balances, Balances] [pallet_timestamp, Timestamp] [pallet_token_swap, TokenSwap] + [pallet_community, Community] + [pallet_proposal, Proposal] + [pallet_passport, Passport] + [pallet_user, User] + [pallet_whitelist, Whitelist] ); } @@ -574,6 +641,14 @@ impl_runtime_apis! { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> sp_std::vec::Vec { + Runtime::metadata_versions() + } } impl sp_block_builder::BlockBuilder for Runtime { @@ -665,8 +740,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } @@ -768,7 +843,7 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: bool) -> (Weight, Weight) { + fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to // have a backtrace here. If any of the pre/post migration checks fail, we shall stop // right here and right now. @@ -776,8 +851,15 @@ impl_runtime_apis! { (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block( + block: Block, + state_root_check: bool, + signature_check: bool, + select: frame_try_runtime::TryStateSelect + ) -> Weight { + // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to + // have a backtrace here. + Executive::try_execute_block(block, state_root_check, signature_check, select).expect("try_execute_block failed") } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index eea0b8e4..4afce60a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,14 @@ [toolchain] -channel = "nightly-2023-01-01" -components = [ "rustfmt" ] +channel = "nightly-2023-08-08" +components = [ + "cargo", + "clippy", + "rust-analyzer", + "rust-src", + "rust-std", + "rustc-dev", + "rustc", + "rustfmt", +] targets = [ "wasm32-unknown-unknown" ] -profile = "minimal" +profile = "minimal" \ No newline at end of file