diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ae1101e..c01f55df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,10 @@ jobs: rustup update stable rustup toolchain install nightly rustup target add wasm32-unknown-unknown --toolchain nightly - + + - name: Check format + run: cargo fmt --all -- --check + - name: Build run: SKIP_WASM_BUILD= cargo check --all-targets --features runtime-benchmarks diff --git a/Cargo.lock b/Cargo.lock index c3438c9c..0980582a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,16 +18,16 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli", + "gimli 0.27.3", ] [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli", + "gimli 0.28.0", ] [[package]] @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8f9420f797f2d9e935edf629310eb938a0d839f984e25327f3c7eed22300c" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" dependencies = [ "memchr", ] @@ -205,24 +205,23 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] name = "anstyle-parse" @@ -244,9 +243,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -254,9 +253,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -310,7 +309,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.25", + "time 0.3.27", ] [[package]] @@ -326,7 +325,7 @@ dependencies = [ "num-traits", "rusticata-macros", "thiserror", - "time 0.3.25", + "time 0.3.27", ] [[package]] @@ -412,7 +411,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -423,7 +422,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -436,7 +435,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] @@ -464,16 +463,16 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line 0.20.0", + "addr2line 0.21.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.31.1", + "object 0.32.0", "rustc-demangle", ] @@ -513,6 +512,15 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "basic-toml" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" +dependencies = [ + "serde", +] + [[package]] name = "beef" version = "0.5.2" @@ -549,7 +557,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -802,9 +810,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -945,9 +953,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.23" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03aef18ddf7d879c15ce20f04826ef8418101c7e528014c3eeea13321047dca3" +checksum = "7c8d502cbaec4595d2e7d5f61e318f05417bd2b66fdc3809498f0d3fdf0bea27" dependencies = [ "clap_builder", "clap_derive", @@ -956,9 +964,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.23" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ce6fffb678c9b80a70b6b6de0aad31df727623a70fd9a842c30cd573e2fa98" +checksum = "5891c7bc0edb3e1c2204fc5e94009affabeb1821c9e5fdc3959536c5c0bb984d" dependencies = [ "anstream", "anstyle", @@ -968,21 +976,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "codespan-reporting" @@ -1137,7 +1145,7 @@ dependencies = [ "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli", + "gimli 0.27.3", "hashbrown 0.13.2", "log", "regalloc2", @@ -1388,23 +1396,37 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", "fiat-crypto", - "packed_simd_2", "platforms", + "rustc_version 0.4.0", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "cxx" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666a3ec767f4bbaf0dcfcc3b4ea048b90520b254fdf88813e763f4c762636c14" +checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" dependencies = [ "cc", "cxxbridge-flags", @@ -1414,9 +1436,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162bec16c4cc28b19e26db0197b60ba5480fdb9a4cbf0f4c6c104a937741b78e" +checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" dependencies = [ "cc", "codespan-reporting", @@ -1424,24 +1446,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] name = "cxxbridge-flags" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6e8c238aadc4b9f2c00269d04c87abb23f96dd240803872536eed1a304bb40e" +checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" [[package]] name = "cxxbridge-macro" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d9ffb4193dd22180b8d5747b1e095c3d9c9c665ce39b0483a488948f437e06" +checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -1556,9 +1578,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "derive-syn-parse" @@ -1613,6 +1635,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "difflib" version = "0.4.0" @@ -1698,9 +1726,15 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] +[[package]] +name = "dissimilar" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" + [[package]] name = "downcast" version = "0.11.0" @@ -1736,9 +1770,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "ecdsa" @@ -1775,6 +1809,16 @@ dependencies = [ "signature 1.6.4", ] +[[package]] +name = "ed25519" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.1.0", +] + [[package]] name = "ed25519-dalek" version = "1.0.1" @@ -1782,13 +1826,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ "curve25519-dalek 3.2.0", - "ed25519", - "rand 0.7.3", - "serde", + "ed25519 1.5.3", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek 4.0.0", + "ed25519 2.2.2", + "rand_core 0.6.4", + "serde", + "sha2 0.10.7", + "zeroize", +] + [[package]] name = "ed25519-zebra" version = "3.1.0" @@ -1939,7 +1995,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2062,9 +2118,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "libz-sys", @@ -2281,7 +2337,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2293,7 +2349,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2303,7 +2359,46 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0 dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", +] + +[[package]] +name = "frame-support-test" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +dependencies = [ + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-support-test-pallet", + "frame-system", + "parity-scale-codec", + "pretty_assertions", + "rustversion", + "scale-info", + "serde", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-version", + "static_assertions", + "trybuild", +] + +[[package]] +name = "frame-support-test-pallet" +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", + "scale-info", + "serde", + "sp-runtime", ] [[package]] @@ -2443,7 +2538,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "waker-fn", ] @@ -2455,7 +2550,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2500,7 +2595,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "pin-utils", "slab", ] @@ -2597,6 +2692,12 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "glob" version = "0.3.1" @@ -2640,9 +2741,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -2828,7 +2929,7 @@ checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] @@ -2871,7 +2972,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "socket2 0.4.9", "tokio", "tower-service", @@ -2879,22 +2980,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" -dependencies = [ - "http", - "hyper", - "log", - "rustls 0.20.8", - "rustls-native-certs", - "tokio", - "tokio-rustls 0.23.4", - "webpki-roots", -] - [[package]] name = "hyper-rustls" version = "0.24.1" @@ -2908,7 +2993,8 @@ dependencies = [ "rustls 0.21.6", "rustls-native-certs", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", + "webpki-roots 0.23.1", ] [[package]] @@ -3180,9 +3266,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ "jsonrpsee-core", "jsonrpsee-http-client", @@ -3195,9 +3281,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" +checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" dependencies = [ "futures-util", "http", @@ -3208,17 +3294,17 @@ dependencies = [ "soketto", "thiserror", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls", "tokio-util", "tracing", - "webpki-roots", + "webpki-roots 0.25.2", ] [[package]] name = "jsonrpsee-core" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", @@ -3244,13 +3330,13 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc345b0a43c6bc49b947ebeb936e886a419ee3d894421790c969cc56040542ad" +checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" dependencies = [ "async-trait", "hyper", - "hyper-rustls 0.23.2", + "hyper-rustls", "jsonrpsee-core", "jsonrpsee-types", "rustc-hash", @@ -3263,9 +3349,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c" +checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" dependencies = [ "heck", "proc-macro-crate", @@ -3276,9 +3362,9 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc" +checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" dependencies = [ "futures-channel", "futures-util", @@ -3298,9 +3384,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" +checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" dependencies = [ "anyhow", "beef", @@ -3312,9 +3398,9 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9" +checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" dependencies = [ "http", "jsonrpsee-client-transport", @@ -3324,7 +3410,7 @@ dependencies = [ [[package]] name = "jur-node" -version = "2.0.2" +version = "2.1.0" dependencies = [ "clap", "frame-benchmarking", @@ -3370,7 +3456,7 @@ dependencies = [ [[package]] name = "jur-node-runtime" -version = "2.0.2" +version = "2.1.0" dependencies = [ "frame-benchmarking", "frame-executive", @@ -3517,12 +3603,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - [[package]] name = "libp2p" version = "0.51.3" @@ -3647,12 +3727,12 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2d584751cecb2aabaa56106be6be91338a60a0f4e420cf2af639204f596fc1" +checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ "bs58 0.4.0", - "ed25519-dalek", + "ed25519-dalek 2.0.0", "log", "multiaddr", "multihash", @@ -3932,7 +4012,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -4145,7 +4225,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -4159,7 +4239,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -4170,7 +4250,7 @@ checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -4181,7 +4261,7 @@ checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -4574,9 +4654,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -4662,9 +4742,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" dependencies = [ "memchr", ] @@ -4733,16 +4813,6 @@ dependencies = [ "sha2 0.10.7", ] -[[package]] -name = "packed_simd_2" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" -dependencies = [ - "cfg-if", - "libm", -] - [[package]] name = "pallet-assets" version = "4.0.0-dev" @@ -4805,13 +4875,13 @@ dependencies = [ [[package]] name = "pallet-community" -version = "0.1.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", + "frame-support-test", "frame-system", "jur-primitives", - "pallet-insecure-randomness-collective-flip", "pallet-whitelist", "parity-scale-codec", "scale-info", @@ -4877,7 +4947,7 @@ dependencies = [ [[package]] name = "pallet-passport" -version = "0.1.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -4897,7 +4967,7 @@ dependencies = [ [[package]] name = "pallet-proposal" -version = "0.1.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -4971,7 +5041,7 @@ dependencies = [ [[package]] name = "pallet-token-swap" -version = "0.1.0" +version = "1.0.0" dependencies = [ "bs58 0.5.0", "frame-benchmarking", @@ -5056,7 +5126,7 @@ dependencies = [ [[package]] name = "pallet-user" -version = "0.1.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -5074,7 +5144,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" -version = "0.1.0" +version = "1.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -5200,7 +5270,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -5293,7 +5363,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -5309,12 +5379,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 1.9.3", + "indexmap 2.0.0", ] [[package]] @@ -5334,7 +5404,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -5345,9 +5415,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -5399,7 +5469,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "windows-sys 0.48.0", ] @@ -5440,9 +5510,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" +checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" [[package]] name = "ppv-lite86" @@ -5480,6 +5550,16 @@ dependencies = [ "termtree", ] +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + [[package]] name = "prettyplease" version = "0.1.25" @@ -5497,7 +5577,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" dependencies = [ "proc-macro2", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -5561,7 +5641,7 @@ checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -5607,7 +5687,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -5732,9 +5812,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -5861,7 +5941,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" dependencies = [ "pem", "ring", - "time 0.3.25", + "time 0.3.27", "x509-parser 0.13.2", "yasna", ] @@ -5874,7 +5954,7 @@ checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", "ring", - "time 0.3.25", + "time 0.3.27", "yasna", ] @@ -5909,22 +5989,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ef7e18e8841942ddb1cf845054f8008410030a3997875d9e49b7a363063df1" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfaf0c85b766276c797f3791f5bc6d5bd116b41d53049af2789666b0c0bc9fa" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -6229,7 +6309,7 @@ checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" dependencies = [ "log", "ring", - "rustls-webpki", + "rustls-webpki 0.101.4", "sct 0.7.0", ] @@ -6254,6 +6334,16 @@ dependencies = [ "base64 0.21.2", ] +[[package]] +name = "rustls-webpki" +version = "0.100.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustls-webpki" version = "0.101.4" @@ -6390,7 +6480,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -6863,7 +6953,7 @@ dependencies = [ "futures", "futures-timer", "hyper", - "hyper-rustls 0.24.1", + "hyper-rustls", "libp2p", "log", "num_cpus", @@ -7154,7 +7244,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -7435,22 +7525,22 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.183" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -7602,15 +7692,15 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -7635,14 +7725,14 @@ checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ "aes-gcm 0.9.4", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.1", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", "ring", "rustc_version 0.4.0", @@ -7719,7 +7809,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -7924,7 +8014,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0 dependencies = [ "quote", "sp-core-hashing", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -7943,7 +8033,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0 dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -7977,8 +8067,8 @@ version = "23.0.0" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", - "ed25519", - "ed25519-dalek", + "ed25519 1.5.3", + "ed25519-dalek 1.0.1", "libsecp256k1", "log", "parity-scale-codec", @@ -8118,7 +8208,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -8303,7 +8393,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -8373,9 +8463,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.41.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc443bad666016e012538782d9e3006213a7db43e9fb1dda91657dc06a6fa08" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" dependencies = [ "Inflector", "num-format", @@ -8581,9 +8671,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -8637,9 +8727,9 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand 2.0.0", @@ -8665,22 +8755,22 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -8731,9 +8821,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ "deranged", "itoa", @@ -8750,9 +8840,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" dependencies = [ "time-core", ] @@ -8812,9 +8902,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.31.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ "backtrace", "bytes", @@ -8822,7 +8912,7 @@ dependencies = [ "mio", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "signal-hook-registry", "socket2 0.5.3", "tokio-macros", @@ -8837,7 +8927,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -8851,17 +8941,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.8", - "tokio", - "webpki 0.22.0", -] - [[package]] name = "tokio-rustls" version = "0.24.1" @@ -8879,7 +8958,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tokio", "tokio-util", ] @@ -8894,7 +8973,7 @@ dependencies = [ "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tokio", "tracing", ] @@ -8966,7 +9045,7 @@ dependencies = [ "http", "http-body", "http-range-header", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tower-layer", "tower-service", ] @@ -8991,7 +9070,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tracing-attributes", "tracing-core", ] @@ -9004,7 +9083,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -9181,6 +9260,22 @@ dependencies = [ "zstd 0.12.4", ] +[[package]] +name = "trybuild" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6df60d81823ed9c520ee897489573da4b1d79ffbe006b8134f46de1a1aa03555" +dependencies = [ + "basic-toml", + "dissimilar", + "glob", + "once_cell", + "serde", + "serde_derive", + "serde_json", + "termcolor", +] + [[package]] name = "tt-call" version = "1.0.9" @@ -9436,7 +9531,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", "wasm-bindgen-shared", ] @@ -9470,7 +9565,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -9624,7 +9719,7 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli", + "gimli 0.27.3", "log", "object 0.30.4", "target-lexicon", @@ -9643,7 +9738,7 @@ dependencies = [ "anyhow", "cranelift-codegen", "cranelift-native", - "gimli", + "gimli 0.27.3", "object 0.30.4", "target-lexicon", "wasmtime-environ", @@ -9657,7 +9752,7 @@ checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli", + "gimli 0.27.3", "indexmap 1.9.3", "log", "object 0.30.4", @@ -9679,7 +9774,7 @@ dependencies = [ "bincode", "cfg-if", "cpp_demangle", - "gimli", + "gimli 0.27.3", "log", "object 0.30.4", "rustc-demangle", @@ -9789,6 +9884,21 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "webpki-roots" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" +dependencies = [ + "rustls-webpki 0.100.2", +] + +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "webrtc" version = "0.6.0" @@ -9815,7 +9925,7 @@ dependencies = [ "sha2 0.10.7", "stun", "thiserror", - "time 0.3.25", + "time 0.3.27", "tokio", "turn", "url", @@ -9847,9 +9957,9 @@ dependencies = [ [[package]] name = "webrtc-dtls" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" +checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" dependencies = [ "aes 0.6.0", "aes-gcm 0.10.2", @@ -9864,12 +9974,11 @@ dependencies = [ "hkdf", "hmac 0.12.1", "log", - "oid-registry 0.6.1", "p256", "p384", "rand 0.8.5", "rand_core 0.6.4", - "rcgen 0.9.3", + "rcgen 0.10.0", "ring", "rustls 0.19.1", "sec1 0.3.0", @@ -9882,7 +9991,7 @@ dependencies = [ "tokio", "webpki 0.21.4", "webrtc-util", - "x25519-dalek 2.0.0-pre.1", + "x25519-dalek 2.0.0", "x509-parser 0.13.2", ] @@ -10075,7 +10184,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -10093,7 +10202,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -10113,17 +10222,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "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", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -10134,9 +10243,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -10152,9 +10261,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -10170,9 +10279,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -10188,9 +10297,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -10206,9 +10315,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -10218,9 +10327,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -10236,15 +10345,15 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.10" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5504cc7644f4b593cbc05c4a55bf9bd4e94b867c3c0bd440934174d50482427d" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] @@ -10281,12 +10390,13 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-pre.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.0.0", "rand_core 0.6.4", + "serde", "zeroize", ] @@ -10306,7 +10416,7 @@ dependencies = [ "ring", "rusticata-macros", "thiserror", - "time 0.3.25", + "time 0.3.27", ] [[package]] @@ -10324,7 +10434,7 @@ dependencies = [ "oid-registry 0.6.1", "rusticata-macros", "thiserror", - "time 0.3.25", + "time 0.3.27", ] [[package]] @@ -10341,13 +10451,19 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + [[package]] name = "yasna" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.25", + "time 0.3.27", ] [[package]] @@ -10367,7 +10483,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0f66a144..fde2851b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "node", "pallets/token-swap", diff --git a/node/Cargo.toml b/node/Cargo.toml index f2b908b0..611f6190 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jur-node" -version = "2.0.2" +version = "2.1.0" edition = "2021" license = "Unlicense" publish = false @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] name = "jur-node" [dependencies] -clap = { version = "4.3.23", features = ["derive"] } +clap = { version = "4.4.1", 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-v1.0.0" } @@ -55,7 +55,7 @@ frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/parityte 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 = "2.0.2", path = "../runtime" } +jur-node-runtime = { version = "2.1.0", path = "../runtime" } primitives = { package = 'jur-primitives', path = '../primitives' } # CLI-specific dependencies diff --git a/node/src/benchmarking.rs b/node/src/benchmarking.rs index cc80649b..f1bf7661 100644 --- a/node/src/benchmarking.rs +++ b/node/src/benchmarking.rs @@ -23,8 +23,8 @@ use crate::service::FullClient; use jur_node_runtime as runtime; -use runtime::{AccountId, BalancesCall, SystemCall}; use primitives::Balance; +use runtime::{AccountId, BalancesCall, SystemCall}; use sc_cli::Result; use sc_client_api::BlockBackend; use sp_core::{Encode, Pair}; @@ -38,143 +38,147 @@ use std::{sync::Arc, time::Duration}; /// /// Note: Should only be used for benchmarking. pub struct RemarkBuilder { - client: Arc, + client: Arc, } impl RemarkBuilder { - /// Creates a new [`Self`] from the given client. - pub fn new(client: Arc) -> Self { - Self { client } - } + /// Creates a new [`Self`] from the given client. + pub fn new(client: Arc) -> Self { + Self { client } + } } impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder { - fn pallet(&self) -> &str { - "system" - } - - fn extrinsic(&self) -> &str { - "remark" - } - - fn build(&self, nonce: u32) -> std::result::Result { - let acc = Sr25519Keyring::Bob.pair(); - let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic( - self.client.as_ref(), - acc, - SystemCall::remark { remark: vec![] }.into(), - nonce, - ) - .into(); - - Ok(extrinsic) - } + fn pallet(&self) -> &str { + "system" + } + + fn extrinsic(&self) -> &str { + "remark" + } + + fn build(&self, nonce: u32) -> std::result::Result { + let acc = Sr25519Keyring::Bob.pair(); + let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic( + self.client.as_ref(), + acc, + SystemCall::remark { remark: vec![] }.into(), + nonce, + ) + .into(); + + Ok(extrinsic) + } } /// Generates `Balances::TransferKeepAlive` extrinsics for the benchmarks. /// /// Note: Should only be used for benchmarking. pub struct TransferKeepAliveBuilder { - client: Arc, - dest: AccountId, - value: Balance, + client: Arc, + dest: AccountId, + value: Balance, } impl TransferKeepAliveBuilder { - /// Creates a new [`Self`] from the given client. - pub fn new(client: Arc, dest: AccountId, value: Balance) -> Self { - Self { client, dest, value } - } + /// Creates a new [`Self`] from the given client. + pub fn new(client: Arc, dest: AccountId, value: Balance) -> Self { + Self { client, dest, value } + } } impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder { - fn pallet(&self) -> &str { - "balances" - } - - fn extrinsic(&self) -> &str { - "transfer_keep_alive" - } - - fn build(&self, nonce: u32) -> std::result::Result { - let acc = Sr25519Keyring::Bob.pair(); - let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic( - self.client.as_ref(), - acc, - BalancesCall::transfer_keep_alive { dest: self.dest.clone().into(), value: self.value } - .into(), - nonce, - ) - .into(); - - Ok(extrinsic) - } + fn pallet(&self) -> &str { + "balances" + } + + fn extrinsic(&self) -> &str { + "transfer_keep_alive" + } + + fn build(&self, nonce: u32) -> std::result::Result { + let acc = Sr25519Keyring::Bob.pair(); + let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic( + self.client.as_ref(), + acc, + BalancesCall::transfer_keep_alive { dest: self.dest.clone().into(), value: self.value } + .into(), + nonce, + ) + .into(); + + Ok(extrinsic) + } } /// Create a transaction using the given `call`. /// /// Note: Should only be used for benchmarking. pub fn create_benchmark_extrinsic( - client: &FullClient, - sender: sp_core::sr25519::Pair, - call: runtime::RuntimeCall, - nonce: u32, + client: &FullClient, + sender: sp_core::sr25519::Pair, + call: runtime::RuntimeCall, + nonce: u32, ) -> runtime::UncheckedExtrinsic { - let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"); - let best_hash = client.chain_info().best_hash; - let best_block = client.chain_info().best_number; - - let period = runtime::BlockHashCount::get() - .checked_next_power_of_two() - .map(|c| c / 2) - .unwrap_or(2) as u64; - let extra: runtime::SignedExtra = ( - frame_system::CheckNonZeroSender::::new(), - frame_system::CheckSpecVersion::::new(), - frame_system::CheckTxVersion::::new(), - frame_system::CheckGenesis::::new(), - frame_system::CheckEra::::from(sp_runtime::generic::Era::mortal( - period, - best_block.saturated_into(), - )), - frame_system::CheckNonce::::from(nonce), - frame_system::CheckWeight::::new(), - pallet_transaction_payment::ChargeTransactionPayment::::from(0), - ); - - let raw_payload = runtime::SignedPayload::from_raw( - call.clone(), - extra.clone(), - ( - (), - runtime::VERSION.spec_version, - runtime::VERSION.transaction_version, - genesis_hash, - best_hash, - (), - (), - (), - ), - ); - let signature = raw_payload.using_encoded(|e| sender.sign(e)); - - runtime::UncheckedExtrinsic::new_signed( - call, - sp_runtime::AccountId32::from(sender.public()).into(), - runtime::Signature::Sr25519(signature), - extra, - ) + let genesis_hash = client + .block_hash(0) + .ok() + .flatten() + .expect("Genesis block exists; qed"); + let best_hash = client.chain_info().best_hash; + let best_block = client.chain_info().best_number; + + let period = runtime::BlockHashCount::get() + .checked_next_power_of_two() + .map(|c| c / 2) + .unwrap_or(2) as u64; + let extra: runtime::SignedExtra = ( + frame_system::CheckNonZeroSender::::new(), + frame_system::CheckSpecVersion::::new(), + frame_system::CheckTxVersion::::new(), + frame_system::CheckGenesis::::new(), + frame_system::CheckEra::::from(sp_runtime::generic::Era::mortal( + period, + best_block.saturated_into(), + )), + frame_system::CheckNonce::::from(nonce), + frame_system::CheckWeight::::new(), + pallet_transaction_payment::ChargeTransactionPayment::::from(0), + ); + + let raw_payload = runtime::SignedPayload::from_raw( + call.clone(), + extra.clone(), + ( + (), + runtime::VERSION.spec_version, + runtime::VERSION.transaction_version, + genesis_hash, + best_hash, + (), + (), + (), + ), + ); + let signature = raw_payload.using_encoded(|e| sender.sign(e)); + + runtime::UncheckedExtrinsic::new_signed( + call, + sp_runtime::AccountId32::from(sender.public()).into(), + runtime::Signature::Sr25519(signature), + extra, + ) } /// Generates inherent data for the `benchmark overhead` command. /// /// Note: Should only be used for benchmarking. pub fn inherent_benchmark_data() -> Result { - let mut inherent_data = InherentData::new(); - let d = Duration::from_millis(0); - let timestamp = sp_timestamp::InherentDataProvider::new(d.into()); - - futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data)) - .map_err(|e| format!("creating inherent data: {:?}", e))?; - Ok(inherent_data) -} \ No newline at end of file + let mut inherent_data = InherentData::new(); + let d = Duration::from_millis(0); + let timestamp = sp_timestamp::InherentDataProvider::new(d.into()); + + futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data)) + .map_err(|e| format!("creating inherent data: {:?}", e))?; + Ok(inherent_data) +} diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 4028d530..47648dcb 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,18 +1,17 @@ +use hex_literal::hex; use jur_node_runtime::{ - AccountId, AuraConfig, BalancesConfig, - RuntimeGenesisConfig, GrandpaConfig, Signature, SudoConfig, SystemConfig, - WASM_BINARY, + AccountId, AuraConfig, BalancesConfig, GrandpaConfig, RuntimeGenesisConfig, Signature, + SudoConfig, SystemConfig, WASM_BINARY, }; use sc_service::ChainType; +use sc_service::Properties; use sp_consensus_aura::sr25519::AuthorityId as AuraId; -use sp_core::{sr25519, Pair, Public}; use sp_consensus_grandpa::AuthorityId as GrandpaId; +use sp_core::crypto::UncheckedInto; +use sp_core::{sr25519, Pair, Public}; use sp_runtime::traits::{IdentifyAccount, Verify}; use sp_runtime::AccountId32; use std::str::FromStr; -use hex_literal::hex; -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; @@ -40,18 +39,20 @@ pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) { } pub fn sudo_account_local() -> AccountId { - AccountId32::from_str(&"5DviAKtS4ns5TBuoHyigkkwEtNbG4sN1m8mw6XAfTBW7GG7j".to_string()).expect("Invalid Account Id") + AccountId32::from_str("5DviAKtS4ns5TBuoHyigkkwEtNbG4sN1m8mw6XAfTBW7GG7j") + .expect("Invalid Account Id") } pub fn sudo_account_testnet() -> AccountId { - AccountId32::from_str(&"5ESNiXWyksqs5DxjSJ9gW2PA6gmgHLvGEUWdiaFfWDfNu82P".to_string()).expect("Invalid Account Id") + AccountId32::from_str("5ESNiXWyksqs5DxjSJ9gW2PA6gmgHLvGEUWdiaFfWDfNu82P") + .expect("Invalid Account Id") } pub fn sudo_account_mainnet() -> AccountId { - AccountId32::from_str(&"5H13qUDnaSjaahePMYTQoqezHGHWwQGreM5kkEbuMUHu5Vjn".to_string()).expect("Invalid Account Id") + AccountId32::from_str("5H13qUDnaSjaahePMYTQoqezHGHWwQGreM5kkEbuMUHu5Vjn") + .expect("Invalid Account Id") } - pub fn development_config() -> Result { let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; @@ -118,17 +119,23 @@ pub fn local_config() -> Result { // Initial PoA authorities vec![ ( - hex!["4076403ada1e84a045cfc627efe8f7f1a734e95a50644e7030c0cb1a70dc580f"].unchecked_into(), - hex!["e52e2901ea2bb2795601f1e130e1936c7f861e6375ea70ad7ca92ee9a121a75f"].unchecked_into() + hex!["4076403ada1e84a045cfc627efe8f7f1a734e95a50644e7030c0cb1a70dc580f"] + .unchecked_into(), + hex!["e52e2901ea2bb2795601f1e130e1936c7f861e6375ea70ad7ca92ee9a121a75f"] + .unchecked_into(), ), ( - hex!["e8a6d9e3b7961f74fffcd7f7847957dc8e469e07cc49711c52beef4ecae92147"].unchecked_into(), - hex!["e9e9d202692f8446f013c0b550e4bb1507d6de60a52cdaee0a4863cc554897f9"].unchecked_into() + hex!["e8a6d9e3b7961f74fffcd7f7847957dc8e469e07cc49711c52beef4ecae92147"] + .unchecked_into(), + hex!["e9e9d202692f8446f013c0b550e4bb1507d6de60a52cdaee0a4863cc554897f9"] + .unchecked_into(), ), ( - hex!["accec13ca659e4eb665dcf13d269a2ae529dcf7eed870453417c745e15e3ad27"].unchecked_into(), - hex!["ee1773c391a8d3e404f2b6f1f0ec5e22b9719a753b2a24376ab50113283d49d0"].unchecked_into() - ) + hex!["accec13ca659e4eb665dcf13d269a2ae529dcf7eed870453417c745e15e3ad27"] + .unchecked_into(), + hex!["ee1773c391a8d3e404f2b6f1f0ec5e22b9719a753b2a24376ab50113283d49d0"] + .unchecked_into(), + ), ], // Sudo account sudo_account_local(), @@ -143,7 +150,7 @@ pub fn local_config() -> Result { hex!["dc320380454e4fd8a99b7e789138b6a39bf267a96cc2458582de086a9a3a8b69"].into(), hex!["54003a5867459f5db90540fa993ea2d72deeb44e98644197c524d0c23e0bc951"].into(), ], - true + true, ) }, // Bootnodes @@ -178,17 +185,23 @@ pub fn jur_testnet_config() -> Result { // Initial PoA authorities vec![ ( - hex!["1c10840139097128f7b28315814351ac9d3b3015615acc87c821685bd3c12f75"].unchecked_into(), - hex!["b3728b98ab621a98f17a727542de3748aa2427495c82ba94f9c4d2f726efc393"].unchecked_into() + hex!["1c10840139097128f7b28315814351ac9d3b3015615acc87c821685bd3c12f75"] + .unchecked_into(), + hex!["b3728b98ab621a98f17a727542de3748aa2427495c82ba94f9c4d2f726efc393"] + .unchecked_into(), ), ( - hex!["60ba45f02ae84bcd0c4f3dbf48af1cdc7dd3b6b555e9ff4bf49b049f46501a7d"].unchecked_into(), - hex!["403eeb3e1674713e25b61b01d6a71da99b2cad0abd21500e20c2853df9f70efd"].unchecked_into() + hex!["60ba45f02ae84bcd0c4f3dbf48af1cdc7dd3b6b555e9ff4bf49b049f46501a7d"] + .unchecked_into(), + hex!["403eeb3e1674713e25b61b01d6a71da99b2cad0abd21500e20c2853df9f70efd"] + .unchecked_into(), ), ( - hex!["34a2e82b426fcba4f45b118415296b0bcb4ffc5ac569a01a4d7f4612459a6742"].unchecked_into(), - hex!["0d2358b76bc57cc34fb972b3326dec12d68b7047b5307fe6d0b9bee0b89c9835"].unchecked_into() - ) + hex!["34a2e82b426fcba4f45b118415296b0bcb4ffc5ac569a01a4d7f4612459a6742"] + .unchecked_into(), + hex!["0d2358b76bc57cc34fb972b3326dec12d68b7047b5307fe6d0b9bee0b89c9835"] + .unchecked_into(), + ), ], // Sudo account sudo_account_testnet(), @@ -203,7 +216,7 @@ pub fn jur_testnet_config() -> Result { hex!["743b7ff50e3c859ad455f3194824e374e7ab553a0a35130053f26661d8099b55"].into(), hex!["aad0a8a8165dc2189d2a7be27647a6e6271a88dcfdda1e6b9599680ca3ac2f30"].into(), ], - true + true, ) }, // Bootnodes @@ -238,21 +251,29 @@ pub fn jur_mainnet_config() -> Result { // Initial PoA authorities vec![ ( - hex!["3a7ba9a4e315a6ce061338c3605d4f2b4de436b29e8c6a44ef7a9f6c06670523"].unchecked_into(), - hex!["2ad9eddbc9a121413f0658b798bc9fedc9ebfaa03979844871780f97e32cddea"].unchecked_into() + hex!["3a7ba9a4e315a6ce061338c3605d4f2b4de436b29e8c6a44ef7a9f6c06670523"] + .unchecked_into(), + hex!["2ad9eddbc9a121413f0658b798bc9fedc9ebfaa03979844871780f97e32cddea"] + .unchecked_into(), ), ( - hex!["28799c33bdff7174671cdf00a31de7072db82c3e0caf7b07bf308f191511db48"].unchecked_into(), - hex!["2f030305d54e650281312ed900590ad0b560fcd02b7efaedbd8ab7e3d0c05752"].unchecked_into() + hex!["28799c33bdff7174671cdf00a31de7072db82c3e0caf7b07bf308f191511db48"] + .unchecked_into(), + hex!["2f030305d54e650281312ed900590ad0b560fcd02b7efaedbd8ab7e3d0c05752"] + .unchecked_into(), ), ( - hex!["2e7bffef555f987c9c63bffdb52c0fbf32c713bfe62ffd8d300f26a1531d5c69"].unchecked_into(), - hex!["a1ad48550ce00756b725d57926988771f6a960fc3ac414a0dcd4ea87a0d46618"].unchecked_into() + hex!["2e7bffef555f987c9c63bffdb52c0fbf32c713bfe62ffd8d300f26a1531d5c69"] + .unchecked_into(), + hex!["a1ad48550ce00756b725d57926988771f6a960fc3ac414a0dcd4ea87a0d46618"] + .unchecked_into(), ), ( - hex!["a459a5db296d38e80e38ea5cb863c7f88b5ba6ea5dc2f888cae9726e8f908c36"].unchecked_into(), - hex!["f87122bdc0f31343bba1c1b8f11e1584e5ed42234ce479df89608aecde43260d"].unchecked_into() - ) + hex!["a459a5db296d38e80e38ea5cb863c7f88b5ba6ea5dc2f888cae9726e8f908c36"] + .unchecked_into(), + hex!["f87122bdc0f31343bba1c1b8f11e1584e5ed42234ce479df89608aecde43260d"] + .unchecked_into(), + ), ], // Sudo account sudo_account_mainnet(), @@ -265,7 +286,7 @@ pub fn jur_mainnet_config() -> Result { hex!["2e7bffef555f987c9c63bffdb52c0fbf32c713bfe62ffd8d300f26a1531d5c69"].into(), hex!["a459a5db296d38e80e38ea5cb863c7f88b5ba6ea5dc2f888cae9726e8f908c36"].into(), ], - true + true, ) }, // Bootnodes @@ -282,7 +303,6 @@ pub fn jur_mainnet_config() -> Result { )) } - /// Configure initial storage state for FRAME modules. fn testnet_genesis( wasm_binary: &[u8], @@ -299,13 +319,20 @@ fn testnet_genesis( }, balances: BalancesConfig { // Configure endowed accounts with initial balance of 1 << 60. - balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), + balances: endowed_accounts + .iter() + .cloned() + .map(|k| (k, 1 << 60)) + .collect(), }, aura: AuraConfig { authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), }, grandpa: GrandpaConfig { - authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), + authorities: initial_authorities + .iter() + .map(|x| (x.1.clone(), 1)) + .collect(), ..Default::default() }, sudo: SudoConfig { diff --git a/node/src/command.rs b/node/src/command.rs index 807f6d84..c32c7fe7 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -44,11 +44,11 @@ impl SubstrateCli for Cli { "local" => Box::new(chain_spec::local_config()?), "jur-testnet" => Box::new(chain_spec::jur_testnet_config()?), "jur-node" => Box::new(chain_spec::jur_mainnet_config()?), - path => - Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), + path => { + Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?) + }, }) } - } /// Parse and run command line arguments @@ -120,7 +120,7 @@ pub fn run() -> sc_cli::Result<()> { "Runtime benchmarking wasn't enabled when building the node. \ You can enable it with `--features runtime-benchmarks`." .into(), - ) + ); } cmd.run::(config) @@ -169,8 +169,9 @@ pub fn run() -> sc_cli::Result<()> { cmd.run(client, inherent_benchmark_data()?, Vec::new(), &ext_factory) }, - BenchmarkCmd::Machine(cmd) => - cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()), + BenchmarkCmd::Machine(cmd) => { + cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()) + }, } }) }, @@ -212,4 +213,4 @@ pub fn run() -> sc_cli::Result<()> { }) }, } -} \ No newline at end of file +} diff --git a/node/src/main.rs b/node/src/main.rs index 7587d9ae..426cbabb 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -4,9 +4,9 @@ mod chain_spec; #[macro_use] mod service; +mod benchmarking; mod cli; mod command; -mod benchmarking; mod rpc; fn main() -> sc_cli::Result<()> { diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 030d9325..bbc727c1 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -9,12 +9,12 @@ use std::sync::Arc; use jsonrpsee::RpcModule; use jur_node_runtime::{opaque::Block, AccountId, Nonce}; +use primitives::Balance; +pub use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; -use primitives::Balance; -pub use sc_rpc_api::DenyUnsafe; /// Full client dependencies. pub struct FullDeps { @@ -30,14 +30,14 @@ pub struct FullDeps { pub fn create_full( deps: FullDeps, ) -> Result, Box> - where - C: ProvideRuntimeApi, - C: HeaderBackend + HeaderMetadata + 'static, - C: Send + Sync + 'static, - C::Api: substrate_frame_rpc_system::AccountNonceApi, - C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, - C::Api: BlockBuilder, - P: TransactionPool + 'static, +where + C: ProvideRuntimeApi, + C: HeaderBackend + HeaderMetadata + 'static, + C: Send + Sync + 'static, + C::Api: substrate_frame_rpc_system::AccountNonceApi, + C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, + C::Api: BlockBuilder, + P: TransactionPool + 'static, { use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use substrate_frame_rpc_system::{System, SystemApiServer}; @@ -54,4 +54,4 @@ pub fn create_full( // `module.merge(YourRpcTrait::into_rpc(YourRpcStruct::new(ReferenceToClient, ...)))?;` Ok(module) -} \ No newline at end of file +} diff --git a/node/src/service.rs b/node/src/service.rs index 3a7872eb..ff4da0a4 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -4,8 +4,8 @@ use futures::FutureExt; use jur_node_runtime::{self, opaque::Block, RuntimeApi}; use sc_client_api::{Backend, BlockBackend}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; -pub use sc_executor::NativeElseWasmExecutor; use sc_consensus_grandpa::SharedVoterState; +pub use sc_executor::NativeElseWasmExecutor; use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncParams}; use sc_telemetry::{Telemetry, TelemetryWorker}; use sc_transaction_pool_api::OffchainTransactionPoolFactory; @@ -33,7 +33,7 @@ impl sc_executor::NativeExecutionDispatch for ExecutorDispatch { } pub(crate) type FullClient = -sc_service::TFullClient>; + sc_service::TFullClient>; type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; @@ -60,7 +60,6 @@ pub fn new_partial( >, ServiceError, > { - let telemetry = config .telemetry_endpoints .clone() @@ -83,7 +82,9 @@ pub fn new_partial( let client = Arc::new(client); let telemetry = telemetry.map(|(worker, telemetry)| { - task_manager.spawn_handle().spawn("telemetry", None, worker.run()); + task_manager + .spawn_handle() + .spawn("telemetry", None, worker.run()); telemetry }); @@ -156,7 +157,11 @@ pub fn new_full(config: Configuration) -> Result { 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"), + &client + .block_hash(0) + .ok() + .flatten() + .expect("Genesis block exists; qed"), &config.chain_spec, ); @@ -197,8 +202,8 @@ pub fn new_full(config: Configuration) -> Result { enable_http_requests: true, custom_extensions: |_| vec![], }) - .run(client.clone(), task_manager.spawn_handle()) - .boxed(), + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } @@ -329,4 +334,4 @@ pub fn new_full(config: Configuration) -> Result { network_starter.start_network(); Ok(task_manager) -} \ No newline at end of file +} diff --git a/pallets/community/Cargo.toml b/pallets/community/Cargo.toml index 7d1e4905..fb2f5961 100644 --- a/pallets/community/Cargo.toml +++ b/pallets/community/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-community" -version = "0.1.0" +version = "1.0.0" description = "Jur Community Pallet" authors = ["Jur Team "] homepage = "https://jur.io/" @@ -35,7 +35,7 @@ serde = { version = "1.0.132" } 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" } +frame-support-test = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } [features] default = ["std"] diff --git a/pallets/community/src/benchmarking.rs b/pallets/community/src/benchmarking.rs index 24c8d64e..52203c4f 100644 --- a/pallets/community/src/benchmarking.rs +++ b/pallets/community/src/benchmarking.rs @@ -14,7 +14,7 @@ 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: Some(CommunityType::Nation), customs: Some(vec![ diff --git a/pallets/community/src/lib.rs b/pallets/community/src/lib.rs index c26a3b07..7aa81459 100644 --- a/pallets/community/src/lib.rs +++ b/pallets/community/src/lib.rs @@ -23,7 +23,8 @@ #![cfg_attr(not(feature = "std"), no_std)] -use codec::Encode; +use crate::types::*; +use codec::{Decode, Encode}; use frame_support::{dispatch::DispatchResult, traits::Randomness, BoundedVec}; pub use pallet::*; use primitives::Incrementable; @@ -31,8 +32,6 @@ use sp_runtime::RuntimeDebug; use sp_std::vec::Vec; pub use weights::WeightInfo; -use crate::types::*; - pub mod types; #[cfg(test)] @@ -56,7 +55,7 @@ pub mod pallet { use super::*; /// The current storage version. - const STORAGE_VERSION: StorageVersion = StorageVersion::new(6); + const STORAGE_VERSION: StorageVersion = StorageVersion::new(7); #[cfg(feature = "runtime-benchmarks")] pub trait BenchmarkHelper { @@ -133,7 +132,7 @@ pub mod pallet { _, Blake2_128Concat, T::CommunityId, - Community, + Community, >; /// The communities owned by a given account @@ -144,7 +143,7 @@ pub mod pallet { Blake2_128Concat, T::AccountId, BoundedVec, - ValueQuery + ValueQuery, >; /// Stores the `CommunityId` that is going to be used for the next @@ -156,7 +155,7 @@ pub mod pallet { #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { /// Created Community [communityId, referenceId, founder] - CreatedCommunity(T::CommunityId, T::Hash, T::AccountId), + CreatedCommunity(T::CommunityId, [u8; 16], T::AccountId), /// Updated Community [community] UpdatedCommunity(T::CommunityId), /// Updated Community [community] @@ -197,7 +196,7 @@ pub mod pallet { /// Founder not whitelisted. FounderNotExist, /// Too Many Communities - TooManyCommunities + TooManyCommunities, } #[pallet::hooks] @@ -239,7 +238,10 @@ pub mod pallet { let founder = T::CreateOrigin::ensure_origin(origin, &community_id)?; - pallet_whitelist::Founders::::get().binary_search(&founder).ok().ok_or(Error::::FounderNotExist)?; + pallet_whitelist::Founders::::get() + .binary_search(&founder) + .ok() + .ok_or(Error::::FounderNotExist)?; Self::do_create_community( community_id, @@ -252,7 +254,7 @@ pub mod pallet { category, tagline, primary_color, - secondary_color + secondary_color, ) } @@ -520,12 +522,11 @@ pub mod pallet { ) -> 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_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 { @@ -584,12 +585,11 @@ impl Pallet { Default::default() }; - let bounded_tag: BoundedVec = - if let Some(tag) = maybe_tag { - tag.try_into().map_err(|_| Error::::BadTag)? - } 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 { @@ -609,7 +609,12 @@ impl Pallet { // Random value. let nonce = Self::get_and_increment_nonce(); - let (random_value, _) = T::MyRandomness::random(&nonce); + let random_seed = T::MyRandomness::random(&nonce).encode(); + + let random_number = u128::decode(&mut random_seed.as_ref()) + .expect("secure hashes should always be bigger than u32; qed"); + + let random_value: [u8; 16] = random_number.to_be_bytes(); let community = Community { founder: founder.clone(), @@ -622,7 +627,7 @@ impl Pallet { category, tag: bounded_tag, primary_color: bounded_primary_color, - secondary_color: bounded_secondary_color + secondary_color: bounded_secondary_color, }; >::try_mutate(founder.clone(), |communities| -> DispatchResult { diff --git a/pallets/community/src/migration.rs b/pallets/community/src/migration.rs index 3f339f06..87a49c46 100644 --- a/pallets/community/src/migration.rs +++ b/pallets/community/src/migration.rs @@ -2,107 +2,153 @@ 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!( +pub mod v7 { + use frame_support::{pallet_prelude::*, weights::Weight}; + + use super::*; + #[derive(Decode)] + pub struct OldCommunity< + AccountId, + Hash, + NameLimit: Get, + 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 reference_id: Hash, + pub category: Category, + pub tag: BoundedVec, + pub primary_color: BoundedVec, + pub secondary_color: BoundedVec, + } + + pub struct MigrateToV7(sp_std::marker::PhantomData); + impl OnRuntimeUpgrade for MigrateToV7 { + fn on_runtime_upgrade() -> Weight { + let current_version = Pallet::::current_storage_version(); + let onchain_version = Pallet::::on_chain_storage_version(); + + if onchain_version == 6 && current_version == 7 { + let mut translated = 0u64; + Communities::::translate::< + OldCommunity< + T::AccountId, + T::Hash, + T::NameLimit, + T::DescriptionLimit, + T::TagLimit, + T::ColorLimit, + >, + _, + >(|_key, old_value| { + translated.saturating_inc(); + + let random_seed = old_value.reference_id.encode(); + + let random_number = u128::decode(&mut random_seed.as_ref()) + .expect("secure hashes should always be bigger than u32; qed"); + + let random_value: [u8; 16] = random_number.to_be_bytes(); + Some(Community { + founder: old_value.founder, + logo: old_value.logo, + name: old_value.name, + description: old_value.description, + members: old_value.members, + metadata: old_value.metadata, + reference_id: random_value, + category: old_value.category, + tag: old_value.tag, + primary_color: old_value.primary_color, + secondary_color: old_value.secondary_color, + }) + }); + 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!( + 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) - } - } + T::DbWeight::get().reads(1) + } + } - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { - frame_support::ensure!( + #[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(()) - } - } -} + 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 + use super::*; + use crate::mock::{Test as T, *}; + use frame_support::pallet_prelude::StorageVersion; + + #[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) + ); + }); + } +} diff --git a/pallets/community/src/mock.rs b/pallets/community/src/mock.rs index 3ad85397..509207be 100644 --- a/pallets/community/src/mock.rs +++ b/pallets/community/src/mock.rs @@ -1,15 +1,15 @@ use crate as pallet_community; -use crate::{CommunityMetaData, CommunityType, Category}; -use frame_support::pallet_prelude::Hooks; +use crate::{Category, CommunityMetaData, CommunityType}; use frame_support::{ parameter_types, traits::{AsEnsureOriginWithArg, ConstU16, ConstU32, ConstU64}, }; +use frame_support_test::TestRandomness; use frame_system as system; use sp_core::H256; use sp_runtime::{ - BuildStorage, traits::{BlakeTwo256, Header as _, IdentityLookup}, + BuildStorage, }; type Block = frame_system::mocking::MockBlock; @@ -19,7 +19,6 @@ frame_support::construct_runtime!( pub enum Test { System: frame_system, - CollectiveFlip: pallet_insecure_randomness_collective_flip, Community: pallet_community, Whitelist: pallet_whitelist, } @@ -55,7 +54,6 @@ 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,7 +64,7 @@ impl pallet_community::Config for Test { #[cfg(feature = "runtime-benchmarks")] type Helper = (); type WeightInfo = (); - type MyRandomness = CollectiveFlip; + type MyRandomness = TestRandomness; type TagLimit = ConstU32<50>; type ColorLimit = ConstU32<7>; type CommunityLimit = ConstU32<3>; @@ -93,7 +91,6 @@ pub fn setup_blocks(blocks: u64) { 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(); @@ -141,7 +138,7 @@ pub fn create_community() { Category::Public, Some("tag".into()), Some("#222307".into()), - Some("#E76080".into()) + Some("#E76080".into()), ) .unwrap(); } diff --git a/pallets/community/src/tests.rs b/pallets/community/src/tests.rs index bce17601..bf1cf0a7 100644 --- a/pallets/community/src/tests.rs +++ b/pallets/community/src/tests.rs @@ -1,10 +1,10 @@ +use crate::types::Category; use crate::{ mock::*, types::{CommunityMetaData, CommunityType}, Communities, Error, }; use frame_support::{assert_noop, assert_ok}; -use crate::types::Category; #[test] fn create_community_works() { @@ -67,7 +67,7 @@ fn create_community_works_only_with_name() { Category::Public, Some("tag".into()), Some("#222307".into()), - Some("#E76080".into()) + Some("#E76080".into()), ) .unwrap(); assert!(Communities::::contains_key(1)); @@ -81,35 +81,35 @@ fn create_community_not_works_with_invalid_color() { add_founder(); assert_noop!( 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()) - ), + 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 ); assert_noop!( 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()) - ), + 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 ); }); @@ -459,25 +459,16 @@ fn update_community_tag_and_colors_works() { 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().tag, "tag".as_bytes().to_vec()); assert_eq!( Communities::::get(1).unwrap().primary_color, - "#222307" - .as_bytes() - .to_vec() + "#222307".as_bytes().to_vec() ); assert_eq!( Communities::::get(1).unwrap().secondary_color, - "#E76080" - .as_bytes() - .to_vec() + "#E76080".as_bytes().to_vec() ); let tag = "Alpha"; @@ -494,6 +485,9 @@ fn update_community_tag_and_colors_works() { 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()); + 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 ff55cc30..f989f302 100644 --- a/pallets/community/src/types.rs +++ b/pallets/community/src/types.rs @@ -4,19 +4,24 @@ use frame_support::{pallet_prelude::Get, BoundedVec}; use scale_info::TypeInfo; use sp_std::{prelude::*, vec::Vec}; -pub type CommunityMetaDataFor = - CommunityMetaData<::AccountId>; +pub type CommunityMetaDataFor = CommunityMetaData<::AccountId>; #[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, Default)] #[scale_info(skip_type_params(NameLimit, DescriptionLimit, TagLimit, ColorLimit))] -pub struct Community, DescriptionLimit: Get, TagLimit: Get, ColorLimit: Get> { +pub struct Community< + AccountId, + NameLimit: Get, + 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 reference_id: Hash, + pub reference_id: [u8; 16], pub category: Category, pub tag: BoundedVec, pub primary_color: BoundedVec, @@ -57,7 +62,7 @@ pub enum Category { /// public. Public, /// A NFT Gated community. - NFTGated + NFTGated, } impl Default for CommunityType { diff --git a/pallets/passport/Cargo.toml b/pallets/passport/Cargo.toml index d3fe13b9..1e8506ad 100644 --- a/pallets/passport/Cargo.toml +++ b/pallets/passport/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-passport" -version = "0.1.0" +version = "1.0.0" description = "Jur Passport Pallet" authors = ["Jur Team "] homepage = "https://jur.io/" diff --git a/pallets/passport/src/benchmarking.rs b/pallets/passport/src/benchmarking.rs index 26613538..f4a35678 100644 --- a/pallets/passport/src/benchmarking.rs +++ b/pallets/passport/src/benchmarking.rs @@ -6,7 +6,7 @@ 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, Category}; +use pallet_community::types::{Category, CommunityMetaData, CommunityType}; use sp_std::vec; use sp_std::vec::Vec; @@ -56,7 +56,7 @@ fn create_community(caller: T::AccountId) -> T::CommunityId { Category::Public, Some("tag".into()), Some("#222307".into()), - Some("#E76080".into()) + Some("#E76080".into()), ) .unwrap(); @@ -64,10 +64,7 @@ fn create_community(caller: T::AccountId) -> T::CommunityId { } pub fn add_founder(caller: T::AccountId) { - pallet_whitelist::Pallet::::add_founder( - RawOrigin::Root.into(), - caller - ).unwrap(); + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller).unwrap(); } benchmarks! { diff --git a/pallets/passport/src/lib.rs b/pallets/passport/src/lib.rs index 56b67d00..752edfdf 100644 --- a/pallets/passport/src/lib.rs +++ b/pallets/passport/src/lib.rs @@ -96,7 +96,8 @@ 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 = StorageMap<_, Twox64Concat, T::CommunityId, T::PassportId, OptionQuery>; + pub type NextPassportId = + StorageMap<_, Twox64Concat, T::CommunityId, T::PassportId, OptionQuery>; #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] @@ -137,28 +138,30 @@ pub mod pallet { /// #[pallet::call_index(0)] #[pallet::weight(::WeightInfo::mint())] - pub fn mint( - origin: OriginFor, - community_id: T::CommunityId, - ) -> DispatchResult { + pub fn mint(origin: OriginFor, 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 || community.members.contains(&origin), Error::::MemberDoesNotExist); + ensure!( + origin == community.founder || community.members.contains(&origin), + Error::::MemberDoesNotExist + ); let maybe_passport = Passports::::get(community_id, &origin); - ensure!(maybe_passport.is_some() == false, Error::::PassportAlreadyMinted); + ensure!(maybe_passport.is_none(), Error::::PassportAlreadyMinted); - let mut passport_id = NextPassportId::::get(community_id).unwrap_or(T::PassportId::initial_value()); + let mut passport_id = + NextPassportId::::get(community_id).unwrap_or(T::PassportId::initial_value()); // Adding this check to reserve the slots for community - if community_id == T::CommunityId::initial_value() && passport_id < T::PassportId::jur_community_reserve_slots() { + if community_id == T::CommunityId::initial_value() + && passport_id < T::PassportId::jur_community_reserve_slots() + { passport_id = T::PassportId::jur_community_reserve_slots(); } - let passport_details = - PassportDetails { id: passport_id, address: None }; + let passport_details = PassportDetails { id: passport_id, address: None }; >::insert(community_id, &origin, passport_details); @@ -190,7 +193,10 @@ pub mod pallet { let community = pallet_community::Communities::::get(community_id) .ok_or(Error::::CommunityDoesNotExist)?; - ensure!(origin == community.founder || community.members.contains(&origin), Error::::MemberDoesNotExist); + ensure!( + origin == community.founder || community.members.contains(&origin), + Error::::MemberDoesNotExist + ); >::get(community_id, &origin).ok_or(Error::::PassportNotAvailable)?; diff --git a/pallets/passport/src/mock.rs b/pallets/passport/src/mock.rs index b682f4b9..5f74aeba 100644 --- a/pallets/passport/src/mock.rs +++ b/pallets/passport/src/mock.rs @@ -6,8 +6,8 @@ use frame_support::{ use frame_system as system; use sp_core::H256; use sp_runtime::{ - BuildStorage, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; type Block = frame_system::mocking::MockBlock; @@ -87,7 +87,10 @@ impl pallet_passport::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - let mut 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 8240b01b..42694b91 100644 --- a/pallets/passport/src/tests.rs +++ b/pallets/passport/src/tests.rs @@ -2,7 +2,7 @@ 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, Category}; +use pallet_community::types::{Category, CommunityMetaData, CommunityType}; fn get_community_metadata() -> CommunityMetaData { let community_metadata = CommunityMetaData { @@ -27,10 +27,7 @@ fn get_community_metadata() -> CommunityMetaData { } pub fn add_founder() { - Whitelist::add_founder( - RuntimeOrigin::root(), - 1 - ).unwrap(); + Whitelist::add_founder(RuntimeOrigin::root(), 1).unwrap(); } fn create_community() { @@ -39,14 +36,16 @@ 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( + "Jur is the core community of the Jur ecosystem, which includes all the contributors." + .into(), + ), Some(vec![1, 2]), Some(get_community_metadata()), Category::Public, Some("tag".into()), Some("#222307".into()), - Some("#E76080".into()) + Some("#E76080".into()), ) .unwrap(); } diff --git a/pallets/proposal/Cargo.toml b/pallets/proposal/Cargo.toml index 5469aebd..a35e36f1 100644 --- a/pallets/proposal/Cargo.toml +++ b/pallets/proposal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-proposal" -version = "0.1.0" +version = "1.0.0" description = "Jur Proposal Pallet" authors = ["Jur Team "] homepage = "https://jur.io/" diff --git a/pallets/proposal/src/benchmarking.rs b/pallets/proposal/src/benchmarking.rs index 3a87c17d..c590d998 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, Category}; +use pallet_community::types::{Category, CommunityMetaData, CommunityType}; use sp_std::vec; const SEED: u32 = 0; @@ -36,10 +36,7 @@ fn get_community_metadata() -> CommunityMetaData { } pub fn add_founder(caller: T::AccountId) { - pallet_whitelist::Pallet::::add_founder( - RawOrigin::Root.into(), - caller - ).unwrap(); + pallet_whitelist::Pallet::::add_founder(RawOrigin::Root.into(), caller).unwrap(); } fn create_community(caller: T::AccountId) -> T::CommunityId { @@ -62,7 +59,7 @@ fn create_community(caller: T::AccountId) -> T::CommunityId { Category::Public, Some("tag".into()), Some("#222307".into()), - Some("#E76080".into()) + Some("#E76080".into()), ) .unwrap(); diff --git a/pallets/proposal/src/lib.rs b/pallets/proposal/src/lib.rs index 80ad02e8..98f309c0 100644 --- a/pallets/proposal/src/lib.rs +++ b/pallets/proposal/src/lib.rs @@ -14,8 +14,8 @@ //! ## Functionalities //! //! * A founder can create a new proposal for a particular community and specify: -//! - if it’s historical or not -//! - the ask/question to the other Members +//! - if it’s historical or not +//! - the ask/question to the other Members //! * A member can vote on an existing proposal //! //! ## Interface @@ -243,7 +243,7 @@ pub mod pallet { // 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 { + if yes_vote_info.vote_count > (*voters_count as u64) / 2 { ProposalResult::::insert( proposal_id, (ProposalResultStatus::Accepted, yes_vote_info), @@ -305,7 +305,10 @@ pub mod pallet { ensure!(origin == community.founder, Error::::NotAllowed); ensure!(choices.len() >= 2, Error::::InvalidChoicesGiven); - ensure!(proposal_duration >= 1 && proposal_duration <= PROPOSAL_DURATION_LIMIT, Error::::InvalidProposalDuration); + ensure!( + (1..=PROPOSAL_DURATION_LIMIT).contains(&proposal_duration), + Error::::InvalidProposalDuration + ); Self::do_create_proposal( origin, @@ -374,8 +377,7 @@ pub mod pallet { // 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 + vote.who .try_push(origin.clone()) .ok() .ok_or(Error::::AccountLimitReached)?; diff --git a/pallets/proposal/src/mock.rs b/pallets/proposal/src/mock.rs index 13dcae21..d8b0c273 100644 --- a/pallets/proposal/src/mock.rs +++ b/pallets/proposal/src/mock.rs @@ -7,8 +7,8 @@ use frame_support::{ use frame_system as system; use sp_core::H256; use sp_runtime::{ - BuildStorage, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; type Block = frame_system::mocking::MockBlock; diff --git a/pallets/proposal/src/tests.rs b/pallets/proposal/src/tests.rs index 59951cb6..ccc64219 100644 --- a/pallets/proposal/src/tests.rs +++ b/pallets/proposal/src/tests.rs @@ -4,7 +4,7 @@ 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, Category}; +use pallet_community::types::{Category, CommunityMetaData, CommunityType}; fn get_community_metadata() -> CommunityMetaData { let community_metadata = CommunityMetaData { @@ -42,16 +42,13 @@ fn create_community() { Category::Public, Some("tag".into()), Some("#222307".into()), - Some("#E76080".into()) + Some("#E76080".into()), ) .unwrap(); } pub fn add_founder() { - Whitelist::add_founder( - RuntimeOrigin::root(), - 1 - ).unwrap(); + Whitelist::add_founder(RuntimeOrigin::root(), 1).unwrap(); } fn create_proposal() { @@ -69,10 +66,7 @@ fn create_proposal() { 1, bounded_proposal_name, bounded_proposal_description, - vec![ - "Yes".as_bytes().to_vec(), - "No".as_bytes().to_vec(), - ], + vec!["Yes".as_bytes().to_vec(), "No".as_bytes().to_vec()], false, 5, ) @@ -332,10 +326,7 @@ fn cast_vote_works_with_proposal_result_accepted() { 1, bounded_proposal_name, bounded_proposal_description, - vec![ - "Yes".as_bytes().to_vec(), - "No".as_bytes().to_vec(), - ], + vec!["Yes".as_bytes().to_vec(), "No".as_bytes().to_vec(),], false, 1, )); @@ -370,10 +361,7 @@ fn cast_vote_works_with_proposal_result_rejected() { 1, bounded_proposal_name, bounded_proposal_description, - vec![ - "Yes".as_bytes().to_vec(), - "No".as_bytes().to_vec(), - ], + vec!["Yes".as_bytes().to_vec(), "No".as_bytes().to_vec(),], false, 1, )); diff --git a/pallets/token-swap/Cargo.toml b/pallets/token-swap/Cargo.toml index 551e18b2..e4c24922 100644 --- a/pallets/token-swap/Cargo.toml +++ b/pallets/token-swap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-token-swap" -version = "0.1.0" +version = "1.0.0" description = "Jur Token Swap Pallet" authors = ["Jur Team "] homepage = "https://jur.io/" diff --git a/pallets/token-swap/src/benchmarking.rs b/pallets/token-swap/src/benchmarking.rs index 2208cb1d..d0fe9b1f 100644 --- a/pallets/token-swap/src/benchmarking.rs +++ b/pallets/token-swap/src/benchmarking.rs @@ -2,30 +2,30 @@ use super::*; #[allow(unused)] use crate::Pallet as TokenSwap; -use hex_literal::hex; use frame_benchmarking::benchmarks; -use frame_system::RawOrigin; use frame_system::pallet_prelude::BlockNumberFor; +use frame_system::RawOrigin; +use hex_literal::hex; const VECHAIN_ROOT_HASH: VechainHash = - hex!("e1a1226e0df5be016d753d53ff38d22e93d935c3cdeac637d69eed653c5c482e"); + hex!("e1a1226e0df5be016d753d53ff38d22e93d935c3cdeac637d69eed653c5c482e"); fn assert_last_event(generic_event: ::RuntimeEvent) { - frame_system::Pallet::::assert_last_event(generic_event.into()); + frame_system::Pallet::::assert_last_event(generic_event.into()); } benchmarks! { update_state_root { let account_proof: Vec> = vec![ - hex!("f90211a08cb1ac44e82cb4da253057ed4575d7235dd22c0d965e28ff35220709ae6c16b5a00807476567c6070dbd58cee9d9b57f75f3db7079f28d40ef72e462a11deafa99a06aa64b0e91632994c7c1601752da803e9019a8475794d685df31656022842015a081adf37c65163e73ff0fcd30a23edb8d6d5e51f2c33959fccc6112a2d0faa741a092c3c0368c9b8a4bdc4bf6889a920500b3ac73b062f7964b1c31c37cb343838ba046e377b0b72bec352cc184da4036246ed1879f3a202ed1860cf53b8aef4ef0c5a0c2418dd77e392e52142244a8f840b3e8c57e34dedadfb4e797c412c8cbf3ff72a0b9917de6b92fa6bf175ef1230ae9364d7e63ff5b4bf1a6b0146dfd6a3c4fbd44a00b1f06aa845f8a4889139ed3e2cc597af62eb0f3b3fafcbe753763dfbef9bb2fa0ccfd87afdd05cd311bd6e497f9f04388c9d37723e8db897bfc7de500ac0ddddda034ec07b89e7d2b8b350061107a0f74e160b0771215409374be8cd7d649b6ef6ea02e621e8efe0375438cba6a367e564b61c822a0c0aba06e9aa06e9d5237889a26a0a768208d7fb53653c66d2ebcfc8fc4173a429ec7c0975ace75081400f32231bfa052c301a7f1bdabdd52c86bfe989bf50d3aeb21dbcf617ad7a215d2a21b88a8e0a0ba41ed78050871cec255c7de2ec39c98769f239193295a92bc0176cd1383024aa0e3d0532ed8229c7f3cd64f0759eade693763bf3ff36e0fa6b85f2869e5c7f0ee80").to_vec(), - hex!("f90211a072f07acbe8e921d6e511d454b2951f6b2cc697dca7d9a89bd8d2496b7f49ce17a06275931f81658af53c6bc606d90a4368bbbe8c08778d6a20bae204dc799a51a4a0fbe0430a163b4972608bffb8bbfe17ededa3011e59841ab5214826871958c7eea09f9c2d0e076e4b309328fd5c9d9c44df7ca2d7b705c9ed630bfbbb2135e410d0a0b51d50c2a073dfd3a5ee14ad5107f62b509de28d66744cacd94964c68d31759ea0104458c3d026006c9f1fef01304ed803cc3a8ae5788df8d06bfce85d564450e8a036c394647f25255d805b4dab45f072fb61a5c915bd62fd9f7fe5b3eb094b5029a015cbe3e57d6c3c9d4bfaa68c2960266dc014299d6db548af92409ad59eb99afaa0138aa6f0bb6fffa13553941cdaf9350ba9698b1373a2487efbd5c5aa98b9ae74a055e1fadf168181b99f02fde7f05e77830fb194e7c44c4dbfe1af01a51091fb12a02938300d5024d0e237736b4a3807f0e8147981e6c781e6f03505448552622d1fa02e43771db196931b686900ec6be0445b21637a119e1a5d68a23699b924dae1f9a08211c17e719cc5eedd4a5165151da32564011a00bc9cc9ee4b20d48f3cebe8a4a07ea26c77ee430f2bb0ebca58903062bc8db37855089fbaebf47c7e94a6f8238ba0ed6f5576f12b53303894910b4dba88b9b21de41fde5f7ad1c986a8ed72021a9ba0036de702298e490c9250d740bee64226e331c58eb371fea4d29b8386923ffc1880").to_vec(), - hex!("f90211a01cea4d9c9c96cbf2d8c70f7b3fa8d5752e9a19c83ede08c6e42f08061299b076a091469a894e3250fcde6e72360e988426c1de48f898ec89417e906772024b53e9a08b4280eb2f079d6e83d252189d32c2f8d3ee5711d8f01e2dfef264d1c3402360a0d62d0321153a0b991177f1a1a13ac4b12060822f2d84ca71988aed1ef7413cb6a07e3872f53621cd4e6b892c881fbcd2aee31764c676164633bf47edc75bcea47ca023ddd534d1a13e9a0dd736cec2d941854f9a5a5010d6f9eef7a956b2ba1ced25a040d8d4e90361d9ffa04a41cc204465b24c8f9a957d1c9d8b8aa07b6fffaf8595a0dfdf1cd466bf35660fb6ad5a5939fd785b138735b4c3e67bb887a007a61b43cca023a1c5dd27c6928a639a3bb8c836f977886f55159646ada842683efc42850da6a06c3c8f7d2e7ea180388e685baeadf171296d5dc4caf76de083a752047093a00ba02633f48dd9e0a57f2bfe0d7c1ab7c01c0180c769c0f858e2374babec6bb11074a0672dc2742762f4d6ca2ecc4374f8e266765f11799f11d5fd69441a063cc6504aa0e1e2786ec51e1ab41f2ac5a9edc1447ea1de548d33c1a9b10a479526c520ce4da0b05f6ce218351935899ddde34036447b5cbeeb1d5f38266bd7813404857b3eaba05937eb6e2a17857cc18345cb59e5a4c78324d127b111db5e50bca455171f0496a05f342c4abe4ead14fb9c5f9fe39a473ac8084a214094a87e3121ed6e2edde5e080").to_vec(), - hex!("f9017180a09ffc4e7326dd2b4ae8a64890382fabfce1c6e6a079a5a1c8e914c2f9ce78eb7ca0aeeb238613088ddb97393186857d41561179f2d5366f6d39f53a99ed42c0ca7ea0d9a8980df80605e37320b2add6f4cdf43c39f07fd5d973cb17c03c40238f8cdca0683d4cb6415d88998d67edfa4c6c79fae1e1eb7cb2ca1e92e6c984e53e3dfadca061418c983a4fa07c9eb6926447d597a883100ac613882c238480dc4370462334a05c88e0a5a9f07d0c8888cace7e08ac00d6625052811fe910de4a36ead8fa4278a0a9578ef10c917b8dafdeb2e067462131bcf9f00630c72bdc1262255c6f2222e1a0db4e8d78cbdc42eea499e0600bc4b348ce58b82d9564eb6a2a1658c47b241811a05a85ccf841f1a02a9dcc066ee886fb8593677fdb09a42151fe3b47c6c70a88d0a0ddb408723f87c9f71692d8c48f919c9b73cd22284b7517107b6c5b0ad94ba4d8a0ebeb97f031c5fbcf374e5520e30392e1eac79351138dda6c432fe2b085d63bf48080808080").to_vec(), - hex!("f87180a0424a7c77f954cd360ced27c63e459b69a2407ca9498590add188aa6a126e1a4d8080a0ca4edfdb951a6eb3064d5afd48ccf37dbb7544eefd3e6370f265f9b87ec891c08080a040ad28e3e0ff9a5c3440dc25a1ac0bd1ea103dae4342d9e50279b55d96eebdb0808080808080808080").to_vec(), - hex!("f87d9e3f539a7fc1a6603092ab102bef7cc8c495ef7174c4668ac9b6c884cdc701b85cf85a80808094a18b81879e99394df4b99b78cf71037836706db2a06439ad2859e615114f02251c6d09c2a36e62d6de6cd55d0ad771964009ab6cc4a0072fbb05700cf818d7d3f6de8bb4d0d18cdfed173106b2b5af87ee06fe801d39").to_vec(), - ]; - - 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]; + hex!("f90211a08cb1ac44e82cb4da253057ed4575d7235dd22c0d965e28ff35220709ae6c16b5a00807476567c6070dbd58cee9d9b57f75f3db7079f28d40ef72e462a11deafa99a06aa64b0e91632994c7c1601752da803e9019a8475794d685df31656022842015a081adf37c65163e73ff0fcd30a23edb8d6d5e51f2c33959fccc6112a2d0faa741a092c3c0368c9b8a4bdc4bf6889a920500b3ac73b062f7964b1c31c37cb343838ba046e377b0b72bec352cc184da4036246ed1879f3a202ed1860cf53b8aef4ef0c5a0c2418dd77e392e52142244a8f840b3e8c57e34dedadfb4e797c412c8cbf3ff72a0b9917de6b92fa6bf175ef1230ae9364d7e63ff5b4bf1a6b0146dfd6a3c4fbd44a00b1f06aa845f8a4889139ed3e2cc597af62eb0f3b3fafcbe753763dfbef9bb2fa0ccfd87afdd05cd311bd6e497f9f04388c9d37723e8db897bfc7de500ac0ddddda034ec07b89e7d2b8b350061107a0f74e160b0771215409374be8cd7d649b6ef6ea02e621e8efe0375438cba6a367e564b61c822a0c0aba06e9aa06e9d5237889a26a0a768208d7fb53653c66d2ebcfc8fc4173a429ec7c0975ace75081400f32231bfa052c301a7f1bdabdd52c86bfe989bf50d3aeb21dbcf617ad7a215d2a21b88a8e0a0ba41ed78050871cec255c7de2ec39c98769f239193295a92bc0176cd1383024aa0e3d0532ed8229c7f3cd64f0759eade693763bf3ff36e0fa6b85f2869e5c7f0ee80").to_vec(), + hex!("f90211a072f07acbe8e921d6e511d454b2951f6b2cc697dca7d9a89bd8d2496b7f49ce17a06275931f81658af53c6bc606d90a4368bbbe8c08778d6a20bae204dc799a51a4a0fbe0430a163b4972608bffb8bbfe17ededa3011e59841ab5214826871958c7eea09f9c2d0e076e4b309328fd5c9d9c44df7ca2d7b705c9ed630bfbbb2135e410d0a0b51d50c2a073dfd3a5ee14ad5107f62b509de28d66744cacd94964c68d31759ea0104458c3d026006c9f1fef01304ed803cc3a8ae5788df8d06bfce85d564450e8a036c394647f25255d805b4dab45f072fb61a5c915bd62fd9f7fe5b3eb094b5029a015cbe3e57d6c3c9d4bfaa68c2960266dc014299d6db548af92409ad59eb99afaa0138aa6f0bb6fffa13553941cdaf9350ba9698b1373a2487efbd5c5aa98b9ae74a055e1fadf168181b99f02fde7f05e77830fb194e7c44c4dbfe1af01a51091fb12a02938300d5024d0e237736b4a3807f0e8147981e6c781e6f03505448552622d1fa02e43771db196931b686900ec6be0445b21637a119e1a5d68a23699b924dae1f9a08211c17e719cc5eedd4a5165151da32564011a00bc9cc9ee4b20d48f3cebe8a4a07ea26c77ee430f2bb0ebca58903062bc8db37855089fbaebf47c7e94a6f8238ba0ed6f5576f12b53303894910b4dba88b9b21de41fde5f7ad1c986a8ed72021a9ba0036de702298e490c9250d740bee64226e331c58eb371fea4d29b8386923ffc1880").to_vec(), + hex!("f90211a01cea4d9c9c96cbf2d8c70f7b3fa8d5752e9a19c83ede08c6e42f08061299b076a091469a894e3250fcde6e72360e988426c1de48f898ec89417e906772024b53e9a08b4280eb2f079d6e83d252189d32c2f8d3ee5711d8f01e2dfef264d1c3402360a0d62d0321153a0b991177f1a1a13ac4b12060822f2d84ca71988aed1ef7413cb6a07e3872f53621cd4e6b892c881fbcd2aee31764c676164633bf47edc75bcea47ca023ddd534d1a13e9a0dd736cec2d941854f9a5a5010d6f9eef7a956b2ba1ced25a040d8d4e90361d9ffa04a41cc204465b24c8f9a957d1c9d8b8aa07b6fffaf8595a0dfdf1cd466bf35660fb6ad5a5939fd785b138735b4c3e67bb887a007a61b43cca023a1c5dd27c6928a639a3bb8c836f977886f55159646ada842683efc42850da6a06c3c8f7d2e7ea180388e685baeadf171296d5dc4caf76de083a752047093a00ba02633f48dd9e0a57f2bfe0d7c1ab7c01c0180c769c0f858e2374babec6bb11074a0672dc2742762f4d6ca2ecc4374f8e266765f11799f11d5fd69441a063cc6504aa0e1e2786ec51e1ab41f2ac5a9edc1447ea1de548d33c1a9b10a479526c520ce4da0b05f6ce218351935899ddde34036447b5cbeeb1d5f38266bd7813404857b3eaba05937eb6e2a17857cc18345cb59e5a4c78324d127b111db5e50bca455171f0496a05f342c4abe4ead14fb9c5f9fe39a473ac8084a214094a87e3121ed6e2edde5e080").to_vec(), + hex!("f9017180a09ffc4e7326dd2b4ae8a64890382fabfce1c6e6a079a5a1c8e914c2f9ce78eb7ca0aeeb238613088ddb97393186857d41561179f2d5366f6d39f53a99ed42c0ca7ea0d9a8980df80605e37320b2add6f4cdf43c39f07fd5d973cb17c03c40238f8cdca0683d4cb6415d88998d67edfa4c6c79fae1e1eb7cb2ca1e92e6c984e53e3dfadca061418c983a4fa07c9eb6926447d597a883100ac613882c238480dc4370462334a05c88e0a5a9f07d0c8888cace7e08ac00d6625052811fe910de4a36ead8fa4278a0a9578ef10c917b8dafdeb2e067462131bcf9f00630c72bdc1262255c6f2222e1a0db4e8d78cbdc42eea499e0600bc4b348ce58b82d9564eb6a2a1658c47b241811a05a85ccf841f1a02a9dcc066ee886fb8593677fdb09a42151fe3b47c6c70a88d0a0ddb408723f87c9f71692d8c48f919c9b73cd22284b7517107b6c5b0ad94ba4d8a0ebeb97f031c5fbcf374e5520e30392e1eac79351138dda6c432fe2b085d63bf48080808080").to_vec(), + hex!("f87180a0424a7c77f954cd360ced27c63e459b69a2407ca9498590add188aa6a126e1a4d8080a0ca4edfdb951a6eb3064d5afd48ccf37dbb7544eefd3e6370f265f9b87ec891c08080a040ad28e3e0ff9a5c3440dc25a1ac0bd1ea103dae4342d9e50279b55d96eebdb0808080808080808080").to_vec(), + hex!("f87d9e3f539a7fc1a6603092ab102bef7cc8c495ef7174c4668ac9b6c884cdc701b85cf85a80808094a18b81879e99394df4b99b78cf71037836706db2a06439ad2859e615114f02251c6d09c2a36e62d6de6cd55d0ad771964009ab6cc4a0072fbb05700cf818d7d3f6de8bb4d0d18cdfed173106b2b5af87ee06fe801d39").to_vec(), + ]; + + 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, BlockNumberFor::::from(10u32), "".as_bytes().to_vec(), account_proof) verify { assert_last_event::(Event::::UpdatedStorageRoot(storage_root).into()); @@ -33,13 +33,13 @@ benchmarks! { claim { let account_proof: Vec> = vec![ - hex!("f90211a08cb1ac44e82cb4da253057ed4575d7235dd22c0d965e28ff35220709ae6c16b5a00807476567c6070dbd58cee9d9b57f75f3db7079f28d40ef72e462a11deafa99a06aa64b0e91632994c7c1601752da803e9019a8475794d685df31656022842015a081adf37c65163e73ff0fcd30a23edb8d6d5e51f2c33959fccc6112a2d0faa741a092c3c0368c9b8a4bdc4bf6889a920500b3ac73b062f7964b1c31c37cb343838ba046e377b0b72bec352cc184da4036246ed1879f3a202ed1860cf53b8aef4ef0c5a0c2418dd77e392e52142244a8f840b3e8c57e34dedadfb4e797c412c8cbf3ff72a0b9917de6b92fa6bf175ef1230ae9364d7e63ff5b4bf1a6b0146dfd6a3c4fbd44a00b1f06aa845f8a4889139ed3e2cc597af62eb0f3b3fafcbe753763dfbef9bb2fa0ccfd87afdd05cd311bd6e497f9f04388c9d37723e8db897bfc7de500ac0ddddda034ec07b89e7d2b8b350061107a0f74e160b0771215409374be8cd7d649b6ef6ea02e621e8efe0375438cba6a367e564b61c822a0c0aba06e9aa06e9d5237889a26a0a768208d7fb53653c66d2ebcfc8fc4173a429ec7c0975ace75081400f32231bfa052c301a7f1bdabdd52c86bfe989bf50d3aeb21dbcf617ad7a215d2a21b88a8e0a0ba41ed78050871cec255c7de2ec39c98769f239193295a92bc0176cd1383024aa0e3d0532ed8229c7f3cd64f0759eade693763bf3ff36e0fa6b85f2869e5c7f0ee80").to_vec(), - hex!("f90211a072f07acbe8e921d6e511d454b2951f6b2cc697dca7d9a89bd8d2496b7f49ce17a06275931f81658af53c6bc606d90a4368bbbe8c08778d6a20bae204dc799a51a4a0fbe0430a163b4972608bffb8bbfe17ededa3011e59841ab5214826871958c7eea09f9c2d0e076e4b309328fd5c9d9c44df7ca2d7b705c9ed630bfbbb2135e410d0a0b51d50c2a073dfd3a5ee14ad5107f62b509de28d66744cacd94964c68d31759ea0104458c3d026006c9f1fef01304ed803cc3a8ae5788df8d06bfce85d564450e8a036c394647f25255d805b4dab45f072fb61a5c915bd62fd9f7fe5b3eb094b5029a015cbe3e57d6c3c9d4bfaa68c2960266dc014299d6db548af92409ad59eb99afaa0138aa6f0bb6fffa13553941cdaf9350ba9698b1373a2487efbd5c5aa98b9ae74a055e1fadf168181b99f02fde7f05e77830fb194e7c44c4dbfe1af01a51091fb12a02938300d5024d0e237736b4a3807f0e8147981e6c781e6f03505448552622d1fa02e43771db196931b686900ec6be0445b21637a119e1a5d68a23699b924dae1f9a08211c17e719cc5eedd4a5165151da32564011a00bc9cc9ee4b20d48f3cebe8a4a07ea26c77ee430f2bb0ebca58903062bc8db37855089fbaebf47c7e94a6f8238ba0ed6f5576f12b53303894910b4dba88b9b21de41fde5f7ad1c986a8ed72021a9ba0036de702298e490c9250d740bee64226e331c58eb371fea4d29b8386923ffc1880").to_vec(), - hex!("f90211a01cea4d9c9c96cbf2d8c70f7b3fa8d5752e9a19c83ede08c6e42f08061299b076a091469a894e3250fcde6e72360e988426c1de48f898ec89417e906772024b53e9a08b4280eb2f079d6e83d252189d32c2f8d3ee5711d8f01e2dfef264d1c3402360a0d62d0321153a0b991177f1a1a13ac4b12060822f2d84ca71988aed1ef7413cb6a07e3872f53621cd4e6b892c881fbcd2aee31764c676164633bf47edc75bcea47ca023ddd534d1a13e9a0dd736cec2d941854f9a5a5010d6f9eef7a956b2ba1ced25a040d8d4e90361d9ffa04a41cc204465b24c8f9a957d1c9d8b8aa07b6fffaf8595a0dfdf1cd466bf35660fb6ad5a5939fd785b138735b4c3e67bb887a007a61b43cca023a1c5dd27c6928a639a3bb8c836f977886f55159646ada842683efc42850da6a06c3c8f7d2e7ea180388e685baeadf171296d5dc4caf76de083a752047093a00ba02633f48dd9e0a57f2bfe0d7c1ab7c01c0180c769c0f858e2374babec6bb11074a0672dc2742762f4d6ca2ecc4374f8e266765f11799f11d5fd69441a063cc6504aa0e1e2786ec51e1ab41f2ac5a9edc1447ea1de548d33c1a9b10a479526c520ce4da0b05f6ce218351935899ddde34036447b5cbeeb1d5f38266bd7813404857b3eaba05937eb6e2a17857cc18345cb59e5a4c78324d127b111db5e50bca455171f0496a05f342c4abe4ead14fb9c5f9fe39a473ac8084a214094a87e3121ed6e2edde5e080").to_vec(), - hex!("f9017180a09ffc4e7326dd2b4ae8a64890382fabfce1c6e6a079a5a1c8e914c2f9ce78eb7ca0aeeb238613088ddb97393186857d41561179f2d5366f6d39f53a99ed42c0ca7ea0d9a8980df80605e37320b2add6f4cdf43c39f07fd5d973cb17c03c40238f8cdca0683d4cb6415d88998d67edfa4c6c79fae1e1eb7cb2ca1e92e6c984e53e3dfadca061418c983a4fa07c9eb6926447d597a883100ac613882c238480dc4370462334a05c88e0a5a9f07d0c8888cace7e08ac00d6625052811fe910de4a36ead8fa4278a0a9578ef10c917b8dafdeb2e067462131bcf9f00630c72bdc1262255c6f2222e1a0db4e8d78cbdc42eea499e0600bc4b348ce58b82d9564eb6a2a1658c47b241811a05a85ccf841f1a02a9dcc066ee886fb8593677fdb09a42151fe3b47c6c70a88d0a0ddb408723f87c9f71692d8c48f919c9b73cd22284b7517107b6c5b0ad94ba4d8a0ebeb97f031c5fbcf374e5520e30392e1eac79351138dda6c432fe2b085d63bf48080808080").to_vec(), - hex!("f87180a0424a7c77f954cd360ced27c63e459b69a2407ca9498590add188aa6a126e1a4d8080a0ca4edfdb951a6eb3064d5afd48ccf37dbb7544eefd3e6370f265f9b87ec891c08080a040ad28e3e0ff9a5c3440dc25a1ac0bd1ea103dae4342d9e50279b55d96eebdb0808080808080808080").to_vec(), - hex!("f87d9e3f539a7fc1a6603092ab102bef7cc8c495ef7174c4668ac9b6c884cdc701b85cf85a80808094a18b81879e99394df4b99b78cf71037836706db2a06439ad2859e615114f02251c6d09c2a36e62d6de6cd55d0ad771964009ab6cc4a0072fbb05700cf818d7d3f6de8bb4d0d18cdfed173106b2b5af87ee06fe801d39").to_vec(), - ]; + hex!("f90211a08cb1ac44e82cb4da253057ed4575d7235dd22c0d965e28ff35220709ae6c16b5a00807476567c6070dbd58cee9d9b57f75f3db7079f28d40ef72e462a11deafa99a06aa64b0e91632994c7c1601752da803e9019a8475794d685df31656022842015a081adf37c65163e73ff0fcd30a23edb8d6d5e51f2c33959fccc6112a2d0faa741a092c3c0368c9b8a4bdc4bf6889a920500b3ac73b062f7964b1c31c37cb343838ba046e377b0b72bec352cc184da4036246ed1879f3a202ed1860cf53b8aef4ef0c5a0c2418dd77e392e52142244a8f840b3e8c57e34dedadfb4e797c412c8cbf3ff72a0b9917de6b92fa6bf175ef1230ae9364d7e63ff5b4bf1a6b0146dfd6a3c4fbd44a00b1f06aa845f8a4889139ed3e2cc597af62eb0f3b3fafcbe753763dfbef9bb2fa0ccfd87afdd05cd311bd6e497f9f04388c9d37723e8db897bfc7de500ac0ddddda034ec07b89e7d2b8b350061107a0f74e160b0771215409374be8cd7d649b6ef6ea02e621e8efe0375438cba6a367e564b61c822a0c0aba06e9aa06e9d5237889a26a0a768208d7fb53653c66d2ebcfc8fc4173a429ec7c0975ace75081400f32231bfa052c301a7f1bdabdd52c86bfe989bf50d3aeb21dbcf617ad7a215d2a21b88a8e0a0ba41ed78050871cec255c7de2ec39c98769f239193295a92bc0176cd1383024aa0e3d0532ed8229c7f3cd64f0759eade693763bf3ff36e0fa6b85f2869e5c7f0ee80").to_vec(), + hex!("f90211a072f07acbe8e921d6e511d454b2951f6b2cc697dca7d9a89bd8d2496b7f49ce17a06275931f81658af53c6bc606d90a4368bbbe8c08778d6a20bae204dc799a51a4a0fbe0430a163b4972608bffb8bbfe17ededa3011e59841ab5214826871958c7eea09f9c2d0e076e4b309328fd5c9d9c44df7ca2d7b705c9ed630bfbbb2135e410d0a0b51d50c2a073dfd3a5ee14ad5107f62b509de28d66744cacd94964c68d31759ea0104458c3d026006c9f1fef01304ed803cc3a8ae5788df8d06bfce85d564450e8a036c394647f25255d805b4dab45f072fb61a5c915bd62fd9f7fe5b3eb094b5029a015cbe3e57d6c3c9d4bfaa68c2960266dc014299d6db548af92409ad59eb99afaa0138aa6f0bb6fffa13553941cdaf9350ba9698b1373a2487efbd5c5aa98b9ae74a055e1fadf168181b99f02fde7f05e77830fb194e7c44c4dbfe1af01a51091fb12a02938300d5024d0e237736b4a3807f0e8147981e6c781e6f03505448552622d1fa02e43771db196931b686900ec6be0445b21637a119e1a5d68a23699b924dae1f9a08211c17e719cc5eedd4a5165151da32564011a00bc9cc9ee4b20d48f3cebe8a4a07ea26c77ee430f2bb0ebca58903062bc8db37855089fbaebf47c7e94a6f8238ba0ed6f5576f12b53303894910b4dba88b9b21de41fde5f7ad1c986a8ed72021a9ba0036de702298e490c9250d740bee64226e331c58eb371fea4d29b8386923ffc1880").to_vec(), + hex!("f90211a01cea4d9c9c96cbf2d8c70f7b3fa8d5752e9a19c83ede08c6e42f08061299b076a091469a894e3250fcde6e72360e988426c1de48f898ec89417e906772024b53e9a08b4280eb2f079d6e83d252189d32c2f8d3ee5711d8f01e2dfef264d1c3402360a0d62d0321153a0b991177f1a1a13ac4b12060822f2d84ca71988aed1ef7413cb6a07e3872f53621cd4e6b892c881fbcd2aee31764c676164633bf47edc75bcea47ca023ddd534d1a13e9a0dd736cec2d941854f9a5a5010d6f9eef7a956b2ba1ced25a040d8d4e90361d9ffa04a41cc204465b24c8f9a957d1c9d8b8aa07b6fffaf8595a0dfdf1cd466bf35660fb6ad5a5939fd785b138735b4c3e67bb887a007a61b43cca023a1c5dd27c6928a639a3bb8c836f977886f55159646ada842683efc42850da6a06c3c8f7d2e7ea180388e685baeadf171296d5dc4caf76de083a752047093a00ba02633f48dd9e0a57f2bfe0d7c1ab7c01c0180c769c0f858e2374babec6bb11074a0672dc2742762f4d6ca2ecc4374f8e266765f11799f11d5fd69441a063cc6504aa0e1e2786ec51e1ab41f2ac5a9edc1447ea1de548d33c1a9b10a479526c520ce4da0b05f6ce218351935899ddde34036447b5cbeeb1d5f38266bd7813404857b3eaba05937eb6e2a17857cc18345cb59e5a4c78324d127b111db5e50bca455171f0496a05f342c4abe4ead14fb9c5f9fe39a473ac8084a214094a87e3121ed6e2edde5e080").to_vec(), + hex!("f9017180a09ffc4e7326dd2b4ae8a64890382fabfce1c6e6a079a5a1c8e914c2f9ce78eb7ca0aeeb238613088ddb97393186857d41561179f2d5366f6d39f53a99ed42c0ca7ea0d9a8980df80605e37320b2add6f4cdf43c39f07fd5d973cb17c03c40238f8cdca0683d4cb6415d88998d67edfa4c6c79fae1e1eb7cb2ca1e92e6c984e53e3dfadca061418c983a4fa07c9eb6926447d597a883100ac613882c238480dc4370462334a05c88e0a5a9f07d0c8888cace7e08ac00d6625052811fe910de4a36ead8fa4278a0a9578ef10c917b8dafdeb2e067462131bcf9f00630c72bdc1262255c6f2222e1a0db4e8d78cbdc42eea499e0600bc4b348ce58b82d9564eb6a2a1658c47b241811a05a85ccf841f1a02a9dcc066ee886fb8593677fdb09a42151fe3b47c6c70a88d0a0ddb408723f87c9f71692d8c48f919c9b73cd22284b7517107b6c5b0ad94ba4d8a0ebeb97f031c5fbcf374e5520e30392e1eac79351138dda6c432fe2b085d63bf48080808080").to_vec(), + hex!("f87180a0424a7c77f954cd360ced27c63e459b69a2407ca9498590add188aa6a126e1a4d8080a0ca4edfdb951a6eb3064d5afd48ccf37dbb7544eefd3e6370f265f9b87ec891c08080a040ad28e3e0ff9a5c3440dc25a1ac0bd1ea103dae4342d9e50279b55d96eebdb0808080808080808080").to_vec(), + hex!("f87d9e3f539a7fc1a6603092ab102bef7cc8c495ef7174c4668ac9b6c884cdc701b85cf85a80808094a18b81879e99394df4b99b78cf71037836706db2a06439ad2859e615114f02251c6d09c2a36e62d6de6cd55d0ad771964009ab6cc4a0072fbb05700cf818d7d3f6de8bb4d0d18cdfed173106b2b5af87ee06fe801d39").to_vec(), + ]; TokenSwap::::update_state_root(RawOrigin::Root.into(), VECHAIN_ROOT_HASH, BlockNumberFor::::from(10u32), "".as_bytes().to_vec(), account_proof)?; let signature = hex!("58acd0227ff9dc881e386cda6dfb316b5f8a0f1bd14069c1b39d6f6fe6e6c026145e9441d503f2b9e29a1757cb2a19f5807abd27f8c3017c808ac0468930ae7401"); diff --git a/pallets/token-swap/src/lib.rs b/pallets/token-swap/src/lib.rs index 0b29318c..ace8822a 100644 --- a/pallets/token-swap/src/lib.rs +++ b/pallets/token-swap/src/lib.rs @@ -1,4 +1,3 @@ - //! # Jur Token Swap Pallet //! A pallet allowing users to submit a proof of deposit along with a signed message //! containing their Substrate address but signed with the Ethereum key (a secp256k1 signature). @@ -68,7 +67,10 @@ use parity_scale_codec::{Decode, Encode}; use primitives::proof::{ compute_storage_key_for_depositor, convert, decode_rlp, extract_storage_root, verify_proof, }; -use primitives::{Balance, CurrencyId, EthereumAddress, ACCOUNT_ID_INITIAL_INDEX, ETHEREUM_SIGNATURE_SIZE, ADDRESS_LEN, MAX_ACCOUNT_ID_INDEX, FROM_INDEX, VechainHash}; +use primitives::{ + Balance, CurrencyId, EthereumAddress, VechainHash, ACCOUNT_ID_INITIAL_INDEX, ADDRESS_LEN, + ETHEREUM_SIGNATURE_SIZE, FROM_INDEX, MAX_ACCOUNT_ID_INDEX, +}; use scale_info::TypeInfo; use sp_io::{crypto::secp256k1_ecdsa_recover, hashing::blake2_256, hashing::keccak_256}; use sp_runtime::traits::Zero; @@ -91,7 +93,7 @@ pub struct EcdsaSignature(pub [u8; ETHEREUM_SIGNATURE_SIZE]); impl PartialEq for EcdsaSignature { fn eq(&self, other: &Self) -> bool { - &self.0[..] == &other.0[..] + self.0[..] == other.0[..] } } @@ -125,7 +127,7 @@ pub mod pallet { use super::*; use frame_support::traits::LockableCurrency; use frame_system::pallet_prelude::*; - use primitives::{PRIORITY, ETHEREUM_ADDRESS_SIZE, ValidityError}; + use primitives::{ValidityError, ETHEREUM_ADDRESS_SIZE, PRIORITY}; /// Configure the pallet by specifying the parameters and types on which it depends. #[pallet::config] @@ -207,14 +209,30 @@ pub mod pallet { impl From> for TransactionValidityError { fn from(error: Error) -> Self { match error { - Error::::InvalidEthereumSignature => TransactionValidityError::Invalid(InvalidTransaction::Custom(ValidityError::InvalidEthereumSignature.into())), - Error::::InvalidSubstrateAddress => TransactionValidityError::Invalid(InvalidTransaction::Custom(ValidityError::InvalidSubstrateAddress.into())), - Error::::PrefixDoesNotMatch => TransactionValidityError::Invalid(InvalidTransaction::Custom(ValidityError::PrefixDoesNotMatch.into())), - Error::::ContentNotFound => TransactionValidityError::Invalid(InvalidTransaction::Custom(ValidityError::ContentNotFound.into())), - Error::::InvalidJson => TransactionValidityError::Invalid(InvalidTransaction::Custom(ValidityError::InvalidJson.into())), - Error::::NotSufficientLockedBalance => TransactionValidityError::Invalid(InvalidTransaction::Custom(ValidityError::NotSufficientLockedBalance.into())), - Error::::InvalidProof => TransactionValidityError::Invalid(InvalidTransaction::Custom(ValidityError::InvalidProof.into())), - _ => TransactionValidityError::Invalid(InvalidTransaction::Custom(ValidityError::InvalidInput.into())), + Error::::InvalidEthereumSignature => TransactionValidityError::Invalid( + InvalidTransaction::Custom(ValidityError::InvalidEthereumSignature.into()), + ), + Error::::InvalidSubstrateAddress => TransactionValidityError::Invalid( + InvalidTransaction::Custom(ValidityError::InvalidSubstrateAddress.into()), + ), + Error::::PrefixDoesNotMatch => TransactionValidityError::Invalid( + InvalidTransaction::Custom(ValidityError::PrefixDoesNotMatch.into()), + ), + Error::::ContentNotFound => TransactionValidityError::Invalid( + InvalidTransaction::Custom(ValidityError::ContentNotFound.into()), + ), + Error::::InvalidJson => TransactionValidityError::Invalid( + InvalidTransaction::Custom(ValidityError::InvalidJson.into()), + ), + Error::::NotSufficientLockedBalance => TransactionValidityError::Invalid( + InvalidTransaction::Custom(ValidityError::NotSufficientLockedBalance.into()), + ), + Error::::InvalidProof => TransactionValidityError::Invalid( + InvalidTransaction::Custom(ValidityError::InvalidProof.into()), + ), + _ => TransactionValidityError::Invalid(InvalidTransaction::Custom( + ValidityError::InvalidInput.into(), + )), } } } @@ -271,8 +289,9 @@ pub mod pallet { let account_rlp = verify_proof(vechain_root_hash, account_proof, deposit_contract_hash) .ok() .ok_or(Error::::InvalidProof)?; - let storage_root = - extract_storage_root(account_rlp).ok().ok_or(Error::::InvalidProof)?; + let storage_root = extract_storage_root(account_rlp) + .ok() + .ok_or(Error::::InvalidProof)?; let root_information = RootInfo { storage_root: storage_root.clone(), meta_block_number, ipfs_path }; @@ -289,14 +308,13 @@ pub mod pallet { /// Verification of storageRoot. This proof is verified once at the same time as the update of the state root. fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity { - let (maybe_signer, maybe_json, storage_proof) = match call { Call::claim { ethereum_signature, signed_json, storage_proof } => { - let blake2_256_hash: VechainHash = blake2_256(&signed_json); + let blake2_256_hash: VechainHash = blake2_256(signed_json); ( - Self::eth_recover(ðereum_signature, blake2_256_hash), - serde_json::from_slice(&signed_json), - storage_proof + Self::eth_recover(ethereum_signature, blake2_256_hash), + serde_json::from_slice(signed_json), + storage_proof, ) }, _ => return Err(InvalidTransaction::Call.into()), @@ -326,13 +344,14 @@ pub mod pallet { } impl Pallet { + fn get_address(signed_json: serde_json::Value) -> Result, Error> { + // Step-2: Parse signed json as json and extract the payload >> content. + // Extract Substrate address after removing refix 'My JUR address is' and + // convert into T::AccountId and remove dest parameter - fn get_address( - signed_json: serde_json::Value, - ) -> Result, Error> { - // Step-2: Parse signed json as json and extract the payload >> content. Extract Substrate address after removing refix 'My JUR address is' and convert into T::AccountId and remove dest parameter - - let content_str = signed_json["payload"]["content"].as_str().ok_or(Error::::ContentNotFound)?; + let content_str = signed_json["payload"]["content"] + .as_str() + .ok_or(Error::::ContentNotFound)?; ensure!( content_str.as_bytes().starts_with(T::Prefix::get()), @@ -352,7 +371,6 @@ impl Pallet { signer: EthereumAddress, storage_proof: Vec>, ) -> Result<(Balance, Balance), Error> { - // Step-3: Proof Verification let storage_key = compute_storage_key_for_depositor(signer); @@ -363,11 +381,13 @@ impl Pallet { storage_proof, storage_key, ) + .ok() + .ok_or(Error::::InvalidProof)?; + + let locked_balance = decode_rlp(storage_rlp) .ok() .ok_or(Error::::InvalidProof)?; - - let locked_balance = decode_rlp(storage_rlp).ok().ok_or(Error::::InvalidProof)?; - let balance = Self::latest_claimed_balance(&signer).unwrap_or(Zero::zero()); + let balance = Self::latest_claimed_balance(signer).unwrap_or(Zero::zero()); ensure!(locked_balance > balance, Error::::NotSufficientLockedBalance); Ok((locked_balance, locked_balance - balance)) @@ -384,12 +404,14 @@ impl Pallet { let signer = Self::eth_recover(ðereum_signature, blake2_256_hash) .ok_or(Error::::InvalidEthereumSignature)?; - let vs: serde_json::Value = - serde_json::from_slice(&signed_json).ok().ok_or(Error::::InvalidJson)?; + let vs: serde_json::Value = serde_json::from_slice(&signed_json) + .ok() + .ok_or(Error::::InvalidJson)?; let address = Self::get_address(vs)?; let account_id = - T::AccountId::decode(&mut &address[ACCOUNT_ID_INITIAL_INDEX..MAX_ACCOUNT_ID_INDEX]).map_err(|_| Error::::InvalidJson)?; + T::AccountId::decode(&mut &address[ACCOUNT_ID_INITIAL_INDEX..MAX_ACCOUNT_ID_INDEX]) + .map_err(|_| Error::::InvalidJson)?; let (locked_balance, mint_amount) = Self::get_mint_amount(signer, storage_proof)?; T::Balances::mint_into(&account_id, mint_amount)?; diff --git a/pallets/token-swap/src/mock.rs b/pallets/token-swap/src/mock.rs index 367c95ab..dd7e8472 100644 --- a/pallets/token-swap/src/mock.rs +++ b/pallets/token-swap/src/mock.rs @@ -9,8 +9,8 @@ use hex_literal::hex; use primitives::{Balance, CurrencyId, JUR}; use sp_core::H256; use sp_runtime::{ - BuildStorage, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; type Block = frame_system::mocking::MockBlock; @@ -127,5 +127,8 @@ 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/user/Cargo.toml b/pallets/user/Cargo.toml index d0d509a4..da34a8cf 100644 --- a/pallets/user/Cargo.toml +++ b/pallets/user/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-user" -version = "0.1.0" +version = "1.0.0" description = "Jur User Pallet" authors = ["Jur Team "] homepage = "https://jur.io/" diff --git a/pallets/user/src/lib.rs b/pallets/user/src/lib.rs index bddae89d..8496b6e8 100644 --- a/pallets/user/src/lib.rs +++ b/pallets/user/src/lib.rs @@ -2,8 +2,8 @@ //! //! 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. +//! ## 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. //! @@ -108,19 +108,19 @@ pub mod pallet { if name.is_some() { let username: String = String::from_utf8(name.clone().unwrap().to_vec()).expect("Invalid username"); - ensure!(!username.contains(" "), Error::::UsernameInvalid); + 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); + ensure!(!profile.contains(' '), Error::::UsernameInvalid); } // Validating the duplicate username for (account, userdata) in Users::::iter() { ensure!( - userdata.name != name || userdata.name == None || - ( account == user && userdata.name == name),Error::::UsernameNotAvailable + userdata.name != name || userdata.name.is_none() || account == user, + Error::::UsernameNotAvailable ); } diff --git a/pallets/user/src/mock.rs b/pallets/user/src/mock.rs index de86695b..a6fcdd89 100644 --- a/pallets/user/src/mock.rs +++ b/pallets/user/src/mock.rs @@ -1,11 +1,11 @@ use crate as pallet_user; use frame_support::traits::{ConstU16, ConstU32, ConstU64}; +use frame_system as system; use sp_core::H256; use sp_runtime::{ - BuildStorage, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; -use frame_system as system; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. @@ -52,5 +52,8 @@ impl pallet_user::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - frame_system::GenesisConfig::::default().build_storage().unwrap().into() + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } diff --git a/pallets/user/src/tests.rs b/pallets/user/src/tests.rs index c711d414..35033577 100644 --- a/pallets/user/src/tests.rs +++ b/pallets/user/src/tests.rs @@ -1,17 +1,15 @@ +use crate::Users; 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_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)); }); @@ -20,14 +18,11 @@ fn update_user_works() { #[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_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(2), diff --git a/pallets/whitelist/Cargo.toml b/pallets/whitelist/Cargo.toml index 2d847727..6ed4ccd9 100644 --- a/pallets/whitelist/Cargo.toml +++ b/pallets/whitelist/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-whitelist" -version = "0.1.0" +version = "1.0.0" description = "Jur Whitelist Pallet" authors = ["Jur Team "] homepage = "https://jur.io/" diff --git a/pallets/whitelist/src/lib.rs b/pallets/whitelist/src/lib.rs index 47766961..86f0d631 100644 --- a/pallets/whitelist/src/lib.rs +++ b/pallets/whitelist/src/lib.rs @@ -3,10 +3,9 @@ //! 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. +//! ## 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 diff --git a/pallets/whitelist/src/tests.rs b/pallets/whitelist/src/tests.rs index 11c09a41..74563faa 100644 --- a/pallets/whitelist/src/tests.rs +++ b/pallets/whitelist/src/tests.rs @@ -1,7 +1,7 @@ use crate::mock::Whitelist; use crate::{mock::*, Error}; -use frame_support::{assert_noop, assert_ok}; use frame_support::error::BadOrigin; +use frame_support::{assert_noop, assert_ok}; #[test] fn add_founder_works() { @@ -77,10 +77,7 @@ fn add_admin_works_failed_with_admin_exist() { #[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 - ); + assert_noop!(Whitelist::add_admin(RuntimeOrigin::signed(1), 1), BadOrigin); }); } @@ -105,10 +102,7 @@ fn revoke_admin_works_failed_with_admin_not_exist() { #[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 - ); + assert_noop!(Whitelist::revoke_admin(RuntimeOrigin::signed(1), 1), BadOrigin); }); } diff --git a/primitives/src/proof.rs b/primitives/src/proof.rs index d70f2d93..d7a5246b 100644 --- a/primitives/src/proof.rs +++ b/primitives/src/proof.rs @@ -95,7 +95,7 @@ pub fn verify_proof( } if terminal { - if nibbles_iter.count() != INITIAL_INDEX as usize { + if nibbles_iter.count() != INITIAL_INDEX { return Err(ErrorMessage::ProofTooShort); } else { return Ok(value); @@ -119,7 +119,7 @@ pub fn verify_proof( }; root = convert(branch)?; - } + }, _ => return Err(ErrorMessage::ProofTooShort), }; } @@ -142,7 +142,7 @@ pub fn extract_storage_root(account_rlp: Vec) -> Result, ErrorMessag None => Err(ErrorMessage::InvalidRLP), Some(value) => Ok(value.as_val()?), } - } + }, _ => Err(ErrorMessage::InvalidAccount), } } diff --git a/primitives/src/tests.rs b/primitives/src/tests.rs index 4b9e2a68..bf4056e6 100644 --- a/primitives/src/tests.rs +++ b/primitives/src/tests.rs @@ -2,8 +2,8 @@ use crate::proof::{ compute_storage_key_for_depositor, convert, decode_rlp, extract_storage_root, verify_proof, ErrorMessage, }; -use frame_support::assert_ok; use crate::EthereumAddress; +use frame_support::assert_ok; use hex_literal::hex; fn get_account_rlp() -> Vec { @@ -39,15 +39,14 @@ fn verify_storage_proof_works() { #[test] fn verify_storage_proof_not_works_for_proof_without_prefix() { - assert_eq!( verify_proof( - [255, 209, 120, 49, 99, 103, 39, 161, 43, 151, 204, 61, 119, 88, 144, 94, 8, - 152, - 107, 30, 102, 112, 131, 208, 46, 241, 200, 16, 220, 221, 103, 92,], + [ + 255, 209, 120, 49, 99, 103, 39, 161, 43, 151, 204, 61, 119, 88, 144, 94, 8, 152, + 107, 30, 102, 112, 131, 208, 46, 241, 200, 16, 220, 221, 103, 92, + ], vec![vec![194, 128, 128]], - hex! - ("13614086fa178320f9277044fb1a8a462fdd1e42c15784123ab858a611499221").to_vec(), + hex!("13614086fa178320f9277044fb1a8a462fdd1e42c15784123ab858a611499221").to_vec(), ), Err(ErrorMessage::InvalidProofData) ); @@ -94,12 +93,11 @@ fn verify_account_proof_works() { hex!("f87e9f3b02dc6e1fe55f373af0e138b09941acd1723941e80ca5e067a8942da35d61b85cf85a80808094f077b491b355e64048ce21e3a6fc4751eeea77faa0b08505f2763206c8a2bd47c2b1318945e1b05abad77be1c54c794e3ba18cf579a033896be85e4ef6c4ad532cd0f0b75cf032244e8b0052cfe071a49394b98bea04").to_vec(), ]; - assert_ok!( - verify_proof( - hex!("c066ed531c19ba6d36322481654fc6cdf089a79954e1e5941b18188f6bc199e3"), - account_proof, - hex!("5a0b02dc6e1fe55f373af0e138b09941acd1723941e80ca5e067a8942da35d61").to_vec() - )); + assert_ok!(verify_proof( + hex!("c066ed531c19ba6d36322481654fc6cdf089a79954e1e5941b18188f6bc199e3"), + account_proof, + hex!("5a0b02dc6e1fe55f373af0e138b09941acd1723941e80ca5e067a8942da35d61").to_vec() + )); } #[test] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 6e87457b..06729065 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jur-node-runtime" -version = "2.0.2" +version = "2.1.0" edition = "2021" license = "Unlicense" publish = false @@ -51,12 +51,12 @@ frame-system-benchmarking = { version = "4.0.0-dev", default-features = false, g 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" } +pallet-token-swap = { version = "1.0.0", default-features = false, path = "../pallets/token-swap" } +pallet-community = { version = "1.0.0", default-features = false, path = "../pallets/community" } +pallet-proposal = { version = "1.0.0", default-features = false, path = "../pallets/proposal" } +pallet-user = { version = "1.0.0", default-features = false, path = "../pallets/user" } +pallet-passport = { version = "1.0.0", default-features = false, path = "../pallets/passport" } +pallet-whitelist = { version = "1.0.0", default-features = false, path = "../pallets/whitelist" } primitives = { package = 'jur-primitives', path = '../primitives', default-features = false } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 7e52e9d8..97eb7d17 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -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: 106, + spec_version: 107, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -600,7 +600,7 @@ pub type Executive = frame_executive::Executive< Migrations, >; -pub type Migrations = pallet_community::migration::v6::MigrateToV6; +pub type Migrations = pallet_community::migration::v7::MigrateToV7; #[cfg(feature = "runtime-benchmarks")] #[macro_use]