diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 60fda4839..d5deb1b11 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2020-09-27 + toolchain: nightly-2021-02-12 target: wasm32-unknown-unknown override: true default: true diff --git a/Cargo.lock b/Cargo.lock index 7d4cfef8a..54ff77c7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,18 +14,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ - "gimli 0.23.0", + "gimli", ] [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" @@ -81,12 +81,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "ahash" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" - [[package]] name = "ahash" version = "0.4.7" @@ -122,9 +116,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.35" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0df63cb2955042487fad3aefd2c6e3ae7389ac5dc1beb28921de0b69f779d4" +checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" [[package]] name = "approx" @@ -135,12 +129,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "arc-swap" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dabe5a181f83789739c194cbe5a897dde195078fac08568d09221fd6137a7ba8" - [[package]] name = "arrayref" version = "0.3.6" @@ -183,9 +171,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59740d83946db6a5af71ae25ddf9562c2b176b2ca42cf99a455f09f4a220d6b9" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" dependencies = [ "concurrent-queue", "event-listener", @@ -208,12 +196,15 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "1.4.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73079b49cd26b8fd5a15f68fc7707fc78698dc2a3d61430f2a7a9430230dfa04" +checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" dependencies = [ + "async-channel", "async-executor", "async-io", + "async-mutex", + "blocking", "futures-lite", "num_cpus", "once_cell", @@ -239,6 +230,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "async-lock" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1996609732bde4a9988bc42125f55f2af5f3c36370e27c778d5191a4a1b63bfb" +dependencies = [ + "event-listener", +] + [[package]] name = "async-mutex" version = "1.4.0" @@ -250,13 +250,13 @@ dependencies = [ [[package]] name = "async-process" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8cea09c1fb10a317d1b5af8024eeba256d6554763e85ecd90ff8df31c7bbda" +checksum = "ef37b86e2fa961bae5a4d212708ea0154f904ce31d1a4a7f47e1bbc33a0c040b" dependencies = [ "async-io", "blocking", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "event-listener", "futures-lite", "once_cell", @@ -266,17 +266,16 @@ dependencies = [ [[package]] name = "async-std" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9f84f1280a2b436a2c77c2582602732b6c2f4321d5494d6e799e6c367859a8" +checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" dependencies = [ "async-channel", "async-global-executor", "async-io", - "async-mutex", + "async-lock", "async-process", - "blocking", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.3", "futures-channel", "futures-core", "futures-io", @@ -287,7 +286,7 @@ dependencies = [ "memchr", "num_cpus", "once_cell", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.6", "pin-utils", "slab", "wasm-bindgen-futures", @@ -300,27 +299,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" [[package]] -name = "async-tls" -version = "0.11.0" +name = "async-trait" +version = "0.1.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" +checksum = "36ea56748e10732c49404c153638a15ec3d6211ec5ff35d9bb20e13b93576adf" dependencies = [ - "futures-core", - "futures-io", - "rustls 0.19.0", - "webpki", - "webpki-roots", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "async-trait" -version = "0.1.42" +name = "asynchronous-codec" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d" +checksum = "fb4401f0a3622dad2e0763fa79e0eb328bc70fb7dccfdd645341f00d671247d6" dependencies = [ - "proc-macro2", - "quote", - "syn", + "bytes 1.0.1", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.6", +] + +[[package]] +name = "asynchronous-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" +dependencies = [ + "bytes 1.0.1", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite 0.2.6", ] [[package]] @@ -357,18 +369,24 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.55" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5140344c85b01f9bbb4d4b7288a8aa4b3287ccef913a14bcc78a1063623598" +checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" dependencies = [ "addr2line", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.22.0", + "object 0.23.0", "rustc-demangle", ] +[[package]] +name = "base-x" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" + [[package]] name = "base58" version = "0.1.0" @@ -389,9 +407,9 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bincode" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" +checksum = "d175dfa69e619905c4c3cdb7c3c203fa3bdd5d51184e3afdb2742c0280493772" dependencies = [ "byteorder", "serde", @@ -418,7 +436,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "which", + "which 3.1.1", ] [[package]] @@ -434,7 +452,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" dependencies = [ "either", - "radium", + "radium 0.3.0", +] + +[[package]] +name = "bitvec" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f682656975d3a682daff957be4ddeb65d6ad656737cd821f2d00685ae466af1" +dependencies = [ + "funty", + "radium 0.6.2", + "tap", + "wyz", ] [[package]] @@ -469,6 +499,32 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "blake2s_simd" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "constant_time_eq", +] + +[[package]] +name = "blake3" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "cc", + "cfg-if 0.1.10", + "constant_time_eq", + "crypto-mac 0.8.0", + "digest 0.9.0", +] + [[package]] name = "block-buffer" version = "0.7.3" @@ -478,7 +534,7 @@ dependencies = [ "block-padding 0.1.5", "byte-tools", "byteorder", - "generic-array 0.12.3", + "generic-array 0.12.4", ] [[package]] @@ -537,18 +593,18 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" +checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" dependencies = [ "memchr", ] [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" [[package]] name = "byte-slice-cast" @@ -556,6 +612,12 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" +[[package]] +name = "byte-slice-cast" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c1bf4a04a88c54f589125563643d773f3254b5c38571395e2b591c693bbc81" + [[package]] name = "byte-tools" version = "0.3.1" @@ -585,6 +647,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" + [[package]] name = "cache-padded" version = "1.1.1" @@ -593,9 +661,9 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" [[package]] name = "cc" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" dependencies = [ "jobserver", ] @@ -657,15 +725,35 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "cid" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff0e3bc0b6446b3f9663c1a6aba6ef06c5aeaa1bc92bd18077be337198ab9768" +dependencies = [ + "multibase", + "multihash", + "unsigned-varint 0.5.1", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.4", +] + [[package]] name = "clang-sys" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0659001ab56b791be01d4b729c44376edc6718cf389a502e579b77b758f3296c" +checksum = "f54d78e30b388d4815220c8dd03fea5656b6c6d32adb59e89061552a102f8da1" dependencies = [ "glob", "libc", - "libloading 0.6.6", + "libloading 0.7.0", ] [[package]] @@ -701,12 +789,6 @@ dependencies = [ "cache-padded", ] -[[package]] -name = "const_fn" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd51eab21ab4fd6a3bf889e2d0958c0a6e3a61ad04260325e919e652a2a62826" - [[package]] name = "constant_time_eq" version = "0.1.5" @@ -729,6 +811,16 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +[[package]] +name = "cpp_demangle" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390" +dependencies = [ + "cfg-if 1.0.0", + "glob", +] + [[package]] name = "cpuid-bool" version = "0.1.2" @@ -743,38 +835,38 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-bforest" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dcc286b052ee24a1e5a222e7c1125e6010ad35b0f248709b9b3737a8fedcfdf" +checksum = "4066fd63b502d73eb8c5fa6bcab9c7962b05cd580f6b149ee83a8e730d8ce7fb" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9badfe36176cb653506091693bc2bb1970c9bddfcd6ec7fac404f7eaec6f38" +checksum = "1a54e4beb833a3c873a18a8fe735d73d732044004c7539a072c8faa35ccb0c60" dependencies = [ "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.21.0", + "gimli", "log", "regalloc", "serde", - "smallvec 1.5.1", + "smallvec 1.6.1", "target-lexicon", "thiserror", ] [[package]] name = "cranelift-codegen-meta" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3f460031861e4f4ad510be62b2ae50bba6cc886b598a36f9c0a970feab9598" +checksum = "c54cac7cacb443658d8f0ff36a3545822613fa202c946c0891897843bc933810" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -782,36 +874,36 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad12409e922e7697cd0bdc7dc26992f64a77c31880dfe5e3c7722f4710206d" +checksum = "a109760aff76788b2cdaeefad6875a73c2b450be13906524f6c2a81e05b8d83c" [[package]] name = "cranelift-entity" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97cdc58972ea065d107872cfb9079f4c92ade78a8af85aaff519a65b5d13f71" +checksum = "3b044234aa32531f89a08b487630ddc6744696ec04c8123a1ad388de837f5de3" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef419efb4f94ecc02e5d9fbcc910d2bb7f0040e2de570e63a454f883bc891d6" +checksum = "5452b3e4e97538ee5ef2cc071301c69a86c7adf2770916b9d04e9727096abd93" dependencies = [ "cranelift-codegen", "log", - "smallvec 1.5.1", + "smallvec 1.6.1", "target-lexicon", ] [[package]] name = "cranelift-native" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e69d44d59826eef6794066ac2c0f4ad3975f02d97030c60dbc04e3886adf36e" +checksum = "f68035c10b2e80f26cc29c32fa824380877f38483504c2a47b54e7da311caaf3" dependencies = [ "cranelift-codegen", "raw-cpuid", @@ -820,17 +912,19 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "979df666b1304624abe99738e9e0e7c7479ee5523ba4b8b237df9ff49996acbb" +checksum = "a530eb9d1c95b3309deb24c3d179d8b0ba5837ed98914a429787c395f614949d" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", + "itertools", "log", "serde", + "smallvec 1.6.1", "thiserror", - "wasmparser 0.59.0", + "wasmparser", ] [[package]] @@ -849,7 +943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.3", ] [[package]] @@ -870,8 +964,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.1", - "crossbeam-utils 0.8.1", + "crossbeam-epoch 0.9.3", + "crossbeam-utils 0.8.3", ] [[package]] @@ -891,13 +985,12 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" +checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" dependencies = [ "cfg-if 1.0.0", - "const_fn", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.3", "lazy_static", "memoffset 0.6.1", "scopeguard", @@ -927,9 +1020,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" +checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" dependencies = [ "autocfg", "cfg-if 1.0.0", @@ -948,7 +1041,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" dependencies = [ - "generic-array 0.12.3", + "generic-array 0.12.4", "subtle 1.0.0", ] @@ -971,6 +1064,16 @@ dependencies = [ "sct", ] +[[package]] +name = "ctor" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8f45d9ad417bcef4817d614a501ab55cdd96a6fdb24f49aab89a54acfd66b19" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "cuckoofilter" version = "0.5.0" @@ -984,9 +1087,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "2.1.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d85653f070353a16313d0046f173f70d1aadd5b42600a14de626f0dfb3473a5" +checksum = "434e1720189a637d44fe464f4df1e6eb900b4835255b14354497c78af37d9bb8" dependencies = [ "byteorder", "digest 0.8.1", @@ -997,9 +1100,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8492de420e9e60bc9a1d66e2dbb91825390b738a388606600663fc529b4b307" +checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" dependencies = [ "byteorder", "digest 0.9.0", @@ -1010,9 +1113,29 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993a608597367c6377b258c25d7120740f00ed23a2252b729b1932dd7866f908" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "data-encoding-macro" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a94feec3d2ba66c0b6621bca8bc6f68415b1e5c69af3586fdd0af9fd9f29b17" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f83e699727abca3c56e187945f303389590305ab2f0185ea445aa66e8d5f2a" +dependencies = [ + "data-encoding", + "syn", +] [[package]] name = "derive_more" @@ -1031,7 +1154,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array 0.12.3", + "generic-array 0.12.4", ] [[package]] @@ -1045,21 +1168,21 @@ dependencies = [ [[package]] name = "directories" -version = "2.0.2" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" dependencies = [ - "cfg-if 0.1.10", "dirs-sys", ] [[package]] -name = "directories" -version = "3.0.1" +name = "directories-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "dirs-sys", + "cfg-if 1.0.0", + "dirs-sys-next", ] [[package]] @@ -1069,7 +1192,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ "libc", - "redox_users", + "redox_users 0.3.5", + "winapi 0.3.9", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users 0.4.0", "winapi 0.3.9", ] @@ -1106,9 +1240,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d55796afa1b20c2945ca8eabfc421839f2b766619209f1ede813cf2484f31804" +checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "ed25519" @@ -1125,11 +1259,11 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 3.0.0", + "curve25519-dalek 3.0.2", "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.2", + "sha2 0.9.3", "zeroize", ] @@ -1160,9 +1294,9 @@ checksum = "6576a1755ddffd988788025e75bce9e74b018f7cc226198fe931d077911c6d7e" [[package]] name = "erased-serde" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca8b296792113e1500fd935ae487be6e00ce318952a6880555554824d6ebf38" +checksum = "0465971a8cc1fa2455c8465aaa377131e1f1cf4983280f474a13e68793aa770c" dependencies = [ "serde", ] @@ -1200,7 +1334,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", ] [[package]] @@ -1267,17 +1401,32 @@ dependencies = [ [[package]] name = "finality-grandpa" -version = "0.12.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8feb87a63249689640ac9c011742c33139204e3c134293d3054022276869133b" +checksum = "2cd795898c348a8ec9edc66ec9e014031c764d4c88cc26d09b492cd93eb41339" dependencies = [ "either", - "futures 0.3.8", - "futures-timer 2.0.2", + "futures 0.3.13", + "futures-timer 3.0.2", "log", "num-traits", - "parity-scale-codec", - "parking_lot 0.9.0", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", +] + +[[package]] +name = "finality-grandpa" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6447e2f8178843749e8c8003206def83ec124a7859475395777a28b5338647c" +dependencies = [ + "either", + "futures 0.3.13", + "futures-timer 3.0.2", + "log", + "num-traits", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", ] [[package]] @@ -1286,9 +1435,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11498d382790b7a8f2fd211780bec78619bba81cdad3a283997c0c41f836759c" dependencies = [ - "byteorder", - "rand 0.7.3", - "rustc-hex", "static_assertions", ] @@ -1299,7 +1445,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", - "rand 0.8.2", + "rand 0.8.3", "rustc-hex", "static_assertions", ] @@ -1312,9 +1458,9 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "flate2" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7411863d55df97a419aa64cb4d2f167103ea9d767e2c54a1868b7ac3f6b47129" +checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" dependencies = [ "cfg-if 1.0.0", "crc32fast", @@ -1331,17 +1477,17 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", ] [[package]] name = "form_urlencoded" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", "percent-encoding 2.1.0", @@ -1349,14 +1495,14 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.1.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", "linregress", - "parity-scale-codec", - "paste", + "parity-scale-codec 2.0.1", + "paste 1.0.4", "sp-api", "sp-io", "sp-runtime", @@ -1367,14 +1513,14 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "Inflector", "chrono", "frame-benchmarking", "handlebars", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sc-cli", "sc-client-db", "sc-executor", @@ -1390,12 +1536,12 @@ dependencies = [ [[package]] name = "frame-executive" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-io", @@ -1406,10 +1552,10 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "12.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "13.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-std", @@ -1417,24 +1563,25 @@ dependencies = [ [[package]] name = "frame-support" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "bitflags", "frame-metadata", "frame-support-procedural", - "impl-trait-for-tuples", + "impl-trait-for-tuples 0.2.1", "log", "once_cell", - "parity-scale-codec", - "paste", + "parity-scale-codec 2.0.1", + "paste 1.0.4", "serde", - "smallvec 1.5.1", + "smallvec 1.6.1", "sp-arithmetic", "sp-core", "sp-inherents", "sp-io", "sp-runtime", + "sp-staking", "sp-state-machine", "sp-std", "sp-tracing", @@ -1442,9 +1589,10 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ + "Inflector", "frame-support-procedural-tools", "proc-macro2", "quote", @@ -1453,8 +1601,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1465,8 +1613,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "proc-macro2", "quote", @@ -1475,12 +1623,12 @@ dependencies = [ [[package]] name = "frame-system" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", - "impl-trait-for-tuples", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-io", @@ -1491,13 +1639,13 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-core", "sp-runtime", "sp-std", @@ -1505,10 +1653,10 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-api", ] @@ -1524,6 +1672,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "fuchsia-cprng" version = "0.1.1" @@ -1546,17 +1704,23 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + [[package]] name = "futures" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" +checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0" +checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" dependencies = [ "futures-channel", "futures-core", @@ -1569,9 +1733,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" dependencies = [ "futures-core", "futures-sink", @@ -1579,9 +1743,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" +checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" [[package]] name = "futures-cpupool" @@ -1589,7 +1753,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "num_cpus", ] @@ -1599,8 +1763,8 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ - "futures 0.1.30", - "futures 0.3.8", + "futures 0.1.31", + "futures 0.3.13", "lazy_static", "log", "parking_lot 0.9.0", @@ -1611,9 +1775,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65" +checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1" dependencies = [ "futures-core", "futures-task", @@ -1623,30 +1787,30 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" +checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" [[package]] name = "futures-lite" -version = "1.11.2" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6c079abfac3ab269e2927ec048dabc89d009ebfdda6b8ee86624f30c689658" +checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" dependencies = [ "fastrand", "futures-core", "futures-io", "memchr", "parking", - "pin-project-lite 0.1.11", + "pin-project-lite 0.2.6", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -1654,20 +1818,28 @@ dependencies = [ "syn", ] +[[package]] +name = "futures-rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a1387e07917c711fb4ee4f48ea0adb04a3c9739e53ef85bf43ae1edc2937a8b" +dependencies = [ + "futures-io", + "rustls 0.19.0", + "webpki", +] + [[package]] name = "futures-sink" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" +checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" [[package]] name = "futures-task" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" -dependencies = [ - "once_cell", -] +checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" [[package]] name = "futures-timer" @@ -1683,11 +1855,11 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "futures-channel", "futures-core", "futures-io", @@ -1695,58 +1867,33 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project 1.0.2", + "pin-project-lite 0.2.6", "pin-utils", "proc-macro-hack", "proc-macro-nested", "slab", ] -[[package]] -name = "futures_codec" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b" -dependencies = [ - "bytes 0.5.6", - "futures 0.3.8", - "memchr", - "pin-project 0.4.27", -] - [[package]] name = "gcc" version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" -[[package]] -name = "generator" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdc09201b2e8ca1b19290cf7e65de2246b8e91fb6874279722189c4de7b94dc" -dependencies = [ - "cc", - "libc", - "log", - "rustc_version", - "winapi 0.3.9", -] - [[package]] name = "generic-array" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ "typenum", ] [[package]] name = "generic-array" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed1e761351b56f54eb9dcd0cfaca9fd0daecf93918e1cfc01c8a3d26ee7adcd" +checksum = "f797e67af32588215eaaab8327027ee8e71b9dd0b2b26996aedf20c030fce309" dependencies = [ "typenum", ] @@ -1763,20 +1910,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4060f4657be78b8e766215b02b18a2e862d83745545de804638e2b545e81aee6" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1785,30 +1932,25 @@ dependencies = [ [[package]] name = "ghash" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6e27f0689a6e15944bdce7e45425efb87eaa8ab0c6e87f11d0987a9133e2531" +checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" dependencies = [ + "opaque-debug 0.3.0", "polyval", ] [[package]] name = "gimli" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" dependencies = [ "fallible-iterator", "indexmap", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" - [[package]] name = "glob" version = "0.3.0" @@ -1850,7 +1992,7 @@ dependencies = [ "byteorder", "bytes 0.4.12", "fnv", - "futures 0.1.30", + "futures 0.1.31", "http 0.1.21", "indexmap", "log", @@ -1870,10 +2012,10 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.2", + "http 0.2.3", "indexmap", "slab", - "tokio 0.2.24", + "tokio 0.2.25", "tokio-util", "tracing", "tracing-futures", @@ -1881,9 +2023,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "3.5.1" +version = "3.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2764f9796c0ddca4b82c07f25dd2cb3db30b9a8f47940e78e1c883d9e95c3db9" +checksum = "cdb0867bbc5a3da37a753e78021d5fcf8a4db00e18dd2dd90fd36e24190e162d" dependencies = [ "log", "pest", @@ -1908,48 +2050,38 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hashbrown" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" -dependencies = [ - "ahash 0.3.8", - "autocfg", -] - [[package]] name = "hashbrown" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" dependencies = [ - "ahash 0.4.7", + "ahash", ] [[package]] name = "heck" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] [[package]] name = "hex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" @@ -1990,7 +2122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b" dependencies = [ "digest 0.8.1", - "generic-array 0.12.3", + "generic-array 0.12.4", "hmac 0.7.1", ] @@ -2007,11 +2139,11 @@ dependencies = [ [[package]] name = "http" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84129d298a6d57d246960ff8eb831ca4af3f96d29e2e28848dae275408658e26" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "fnv", "itoa", ] @@ -2023,7 +2155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "http 0.1.21", "tokio-buf", ] @@ -2035,14 +2167,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.2", + "http 0.2.3", ] [[package]] name = "httparse" -version = "1.3.4" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] name = "httpdate" @@ -2061,11 +2193,11 @@ dependencies = [ [[package]] name = "hydra-dx" -version = "2.0.0" +version = "3.0.0" dependencies = [ "frame-benchmarking", "frame-benchmarking-cli", - "futures 0.3.8", + "futures 0.3.13", "hex-literal", "hydra-dx-runtime", "jsonrpc-core", @@ -2121,7 +2253,7 @@ dependencies = [ [[package]] name = "hydra-dx-runtime" -version = "2.0.0" +version = "3.0.0" dependencies = [ "frame-benchmarking", "frame-executive", @@ -2142,6 +2274,7 @@ dependencies = [ "pallet-balances", "pallet-claims", "pallet-collective", + "pallet-election-provider-multi-phase", "pallet-elections-phragmen", "pallet-exchange", "pallet-exchange-benchmarking", @@ -2161,7 +2294,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitives", "serde", "sp-api", @@ -2183,12 +2316,12 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.35" +version = "0.12.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "futures-cpupool", "h2 0.1.26", "http 0.1.21", @@ -2213,23 +2346,23 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.9" +version = "0.13.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" dependencies = [ "bytes 0.5.6", "futures-channel", "futures-core", "futures-util", "h2 0.2.7", - "http 0.2.2", + "http 0.2.3", "http-body 0.3.1", "httparse", "httpdate", "itoa", - "pin-project 1.0.2", + "pin-project 1.0.5", "socket2", - "tokio 0.2.24", + "tokio 0.2.25", "tower-service", "tracing", "want 0.3.0", @@ -2244,11 +2377,11 @@ dependencies = [ "bytes 0.5.6", "ct-logs", "futures-util", - "hyper 0.13.9", + "hyper 0.13.10", "log", "rustls 0.18.1", "rustls-native-certs", - "tokio 0.2.24", + "tokio 0.2.25", "tokio-rustls", "webpki", ] @@ -2266,9 +2399,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" dependencies = [ "matches", "unicode-bidi", @@ -2298,12 +2431,12 @@ dependencies = [ [[package]] name = "if-watch" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d7c5e361e6b05c882b4847dd98992534cebc6fcde7f4bc98225bcf10fd6d0d" +checksum = "97b8538953a3f0d0d3868f0a706eb4273535e10d72acb5c82c1c23ae48835c85" dependencies = [ "async-io", - "futures 0.3.8", + "futures 0.3.13", "futures-lite", "if-addrs", "ipnet", @@ -2318,7 +2451,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 1.3.7", +] + +[[package]] +name = "impl-codec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" +dependencies = [ + "parity-scale-codec 2.0.1", ] [[package]] @@ -2341,14 +2483,25 @@ dependencies = [ "syn", ] +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "indexmap" -version = "1.6.1" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" +checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" dependencies = [ "autocfg", - "hashbrown 0.9.1", + "hashbrown", "serde", ] @@ -2376,7 +2529,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "futures-timer 2.0.2", ] @@ -2401,15 +2554,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.9.0" @@ -2421,9 +2565,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jobserver" @@ -2436,9 +2580,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.46" +version = "0.3.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" +checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78" dependencies = [ "wasm-bindgen", ] @@ -2450,7 +2594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7" dependencies = [ "failure", - "futures 0.1.30", + "futures 0.1.31", "jsonrpc-core", "jsonrpc-pubsub", "log", @@ -2465,7 +2609,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0745a6379e3edc893c84ec203589790774e4247420033e71a76d3ab4687991fa" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "log", "serde", "serde_derive", @@ -2499,7 +2643,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7" dependencies = [ - "hyper 0.12.35", + "hyper 0.12.36", "jsonrpc-core", "jsonrpc-server-utils", "log", @@ -2592,30 +2736,30 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0315ef2f688e33844400b31f11c263f2b3dc21d8b9355c6891c5f185fae43f9a" +checksum = "8891bd853eff90e33024195d79d578dc984c82f9e0715fcd2b525a0c19d52811" dependencies = [ "parity-util-mem", - "smallvec 1.5.1", + "smallvec 1.6.1", ] [[package]] name = "kvdb-memorydb" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73de822b260a3bdfb889dbbb65bb2d473eee2253973d6fa4a5d149a2a4a7c66e" +checksum = "30a0da8e08caf08d384a620ec19bb6c9b85c84137248e202617fb91881f25912" dependencies = [ "kvdb", "parity-util-mem", - "parking_lot 0.10.2", + "parking_lot 0.11.1", ] [[package]] name = "kvdb-rocksdb" -version = "0.9.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44947dd392f09475af614d740fe0320b66d01cb5b977f664bbbb5e45a70ea4c1" +checksum = "34446c373ccc494c2124439281c198c7636ccdc2752c06722bbffd56d459c1e4" dependencies = [ "fs-swap", "kvdb", @@ -2623,10 +2767,10 @@ dependencies = [ "num_cpus", "owning_ref", "parity-util-mem", - "parking_lot 0.10.2", + "parking_lot 0.11.1", "regex", "rocksdb", - "smallvec 1.5.1", + "smallvec 1.6.1", ] [[package]] @@ -2668,9 +2812,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.6.6" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9367bdfa836b7e3cf895867f7a570283444da90562980ec2263d6e1569b16bc" +checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" dependencies = [ "cfg-if 1.0.0", "winapi 0.3.9", @@ -2684,16 +2828,15 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.32.2" +version = "0.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022cdac4ab124be12de581e591796d4dfb7d1f1eef94669d2c1eaa0e98dd2f0e" +checksum = "adc225a49973cf9ab10d0cdd6a4b8f0cda299df9b760824bbb623f15f8f0c95a" dependencies = [ "atomic", - "bytes 0.5.6", - "futures 0.3.8", + "bytes 1.0.1", + "futures 0.3.13", "lazy_static", "libp2p-core", - "libp2p-core-derive", "libp2p-deflate", "libp2p-dns", "libp2p-floodsub", @@ -2708,6 +2851,7 @@ dependencies = [ "libp2p-pnet", "libp2p-request-response", "libp2p-swarm", + "libp2p-swarm-derive", "libp2p-tcp", "libp2p-uds", "libp2p-wasm-ext", @@ -2715,24 +2859,23 @@ dependencies = [ "libp2p-yamux", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.2", - "smallvec 1.5.1", + "pin-project 1.0.5", + "smallvec 1.6.1", "wasm-timer", ] [[package]] name = "libp2p-core" -version = "0.25.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c96d3a606a696a3a6c0ad3c3352c57bda2082ec9090930f1bd9daf787039f" +checksum = "8a2d56aadc2c2bf22cd7797f86e56a65b5b3994a0136b65be3106938acae7a26" dependencies = [ "asn1_der", "bs58", - "bytes 0.5.6", "ed25519-dalek", "either", "fnv", - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", @@ -2741,193 +2884,183 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.2", + "pin-project 1.0.5", "prost", "prost-build", "rand 0.7.3", "ring", "rw-stream-sink", - "sha2 0.9.2", - "smallvec 1.5.1", - "thiserror", - "unsigned-varint", - "void", - "zeroize", -] - -[[package]] -name = "libp2p-core-derive" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" -dependencies = [ - "quote", - "syn", + "sha2 0.9.3", + "smallvec 1.6.1", + "thiserror", + "unsigned-varint 0.7.0", + "void", + "zeroize", ] [[package]] name = "libp2p-deflate" -version = "0.25.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a579d7dd506d0620ba88ccc1754436b7de35ed6c884234f9a226bbfce382640" +checksum = "6d42eed63305f0420736fa487f9acef720c4528bd7852a6a760f5ccde4813345" dependencies = [ "flate2", - "futures 0.3.8", + "futures 0.3.13", "libp2p-core", ] [[package]] name = "libp2p-dns" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15dea5933f570844d7b5222b12b58f7bd52e9ca38cd65a1bd4f35341f053f012" +checksum = "5153b6db68fd4baa3b304e377db744dd8fea8ff4e4504509ee636abcde88d3e3" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "libp2p-core", "log", ] [[package]] name = "libp2p-floodsub" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23070a0838bd9a8adb27e6eba477eeb650c498f9d139383dd0135d20a8170253" +checksum = "b3c63dfa06581b24b1d12bf9815b43689a784424be217d6545c800c7c75a207f" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.8", + "futures 0.3.13", "libp2p-core", "libp2p-swarm", "log", "prost", "prost-build", "rand 0.7.3", - "smallvec 1.5.1", + "smallvec 1.6.1", ] [[package]] name = "libp2p-gossipsub" -version = "0.25.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e8f3aa0906fbad435dac23c177eef3cdfaaf62609791bd7f54f8553edcfdf9" +checksum = "502dc5fcbfec4aa1c63ef3f7307ffe20e90c1a1387bf23ed0bec087f2dde58a1" dependencies = [ + "asynchronous-codec 0.6.0", "base64 0.13.0", "byteorder", - "bytes 0.5.6", + "bytes 1.0.1", "fnv", - "futures 0.3.8", - "futures_codec", + "futures 0.3.13", "hex_fmt", "libp2p-core", "libp2p-swarm", "log", - "lru_time_cache", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.2", - "smallvec 1.5.1", - "unsigned-varint", + "regex", + "sha2 0.9.3", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", "wasm-timer", ] [[package]] name = "libp2p-identify" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802fb973a7e0dde3fb9a2113a62bad90338ebe01983b706e1d576d0c2af93cda" +checksum = "b40fb36a059b7a8cce1514bd8b546fa612e006c9937caa7f5950cb20021fe91e" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "libp2p-core", "libp2p-swarm", "log", "prost", "prost-build", - "smallvec 1.5.1", + "smallvec 1.6.1", "wasm-timer", ] [[package]] name = "libp2p-kad" -version = "0.26.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6506b7b7982f7626fc96a91bc61be4b1fe7ae9ac23824f0ecefcce21cb39238c" +checksum = "cf3da6c9acbcc05f93235d201d7d45ef4e8b88a45d8836f98becd8b4d443f066" dependencies = [ "arrayvec 0.5.2", - "bytes 0.5.6", + "asynchronous-codec 0.6.0", + "bytes 1.0.1", "either", "fnv", - "futures 0.3.8", - "futures_codec", + "futures 0.3.13", "libp2p-core", "libp2p-swarm", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.2", - "smallvec 1.5.1", - "uint 0.8.5", - "unsigned-varint", + "sha2 0.9.3", + "smallvec 1.6.1", + "uint 0.9.0", + "unsigned-varint 0.7.0", "void", "wasm-timer", ] [[package]] name = "libp2p-mdns" -version = "0.26.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b934ee03a361f317df7d75defa4177b285534c58f49d5e6e240278e13ef3f65" +checksum = "0e9e6374814d1b118d97ccabdfc975c8910bd16dc38a8bc058eeb08bf2080fe1" dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.8", + "futures 0.3.13", "if-watch", "lazy_static", "libp2p-core", "libp2p-swarm", "log", "rand 0.7.3", - "smallvec 1.5.1", + "smallvec 1.6.1", "socket2", "void", ] [[package]] name = "libp2p-mplex" -version = "0.25.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae2132b14045009b0f8e577a06e1459592ef0a89dedc58f3d4baf4eac956837b" +checksum = "350ce8b3923594aedabd5d6e3f875d058435052a29c3f32df378bc70d10be464" dependencies = [ - "bytes 0.5.6", - "futures 0.3.8", - "futures_codec", + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.13", "libp2p-core", "log", "nohash-hasher", "parking_lot 0.11.1", "rand 0.7.3", - "smallvec 1.5.1", - "unsigned-varint", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", ] [[package]] name = "libp2p-noise" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9610a524bef4db383cd96b4ec3ec4722eafa72c7242fa89990b74166760583d" +checksum = "4aca322b52a0c5136142a7c3971446fb1e9964923a526c9cc6ef3b7c94e57778" dependencies = [ - "bytes 0.5.6", - "curve25519-dalek 3.0.0", - "futures 0.3.8", + "bytes 1.0.1", + "curve25519-dalek 3.0.2", + "futures 0.3.13", "lazy_static", "libp2p-core", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.2", + "sha2 0.9.3", "snow", "static_assertions", "x25519-dalek", @@ -2936,11 +3069,11 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "659adf89356e04f65398bb74ee791b269e63da9e41b37f8dc19eaacd12487bfe" +checksum = "6f3813276d0708c8db0f500d8beda1bda9ad955723b9cb272c41f4727256f73c" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "libp2p-core", "libp2p-swarm", "log", @@ -2951,30 +3084,30 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.25.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96dfe26270c91d4ff095030d1fcadd602f3fd84968ebd592829916d0715798a6" +checksum = "9d58defcadb646ae4b033e130b48d87410bf76394dc3335496cae99dac803e61" dependencies = [ - "bytes 0.5.6", - "futures 0.3.8", - "futures_codec", + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.13", "libp2p-core", "log", "prost", "prost-build", - "unsigned-varint", + "unsigned-varint 0.7.0", "void", ] [[package]] name = "libp2p-pnet" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b3c2d5d26a9500e959a0e19743897239a6c4be78dadf99b70414301a70c006" +checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "log", - "pin-project 0.4.27", + "pin-project 1.0.5", "rand 0.7.3", "salsa20", "sha3", @@ -2982,51 +3115,62 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.7.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd96c3580fe59a9379ac7906c2f61c7f5ad3b7515362af0e72153a7cc9a45550" +checksum = "10e5552827c33d8326502682da73a0ba4bfa40c1b55b216af3c303f32169dd89" dependencies = [ "async-trait", - "bytes 0.5.6", - "futures 0.3.8", + "bytes 1.0.1", + "futures 0.3.13", "libp2p-core", "libp2p-swarm", "log", "lru", "minicbor", "rand 0.7.3", - "smallvec 1.5.1", - "unsigned-varint", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", "wasm-timer", ] [[package]] name = "libp2p-swarm" -version = "0.25.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6ecee54e85513a7301eb4681b3a6aac5b6d11f60d43097cf7624fd4450d7dfe" +checksum = "7955b973e1fd2bd61ffd43ce261c1223f61f4aacd5bae362a924993f9a25fd98" dependencies = [ "either", - "futures 0.3.8", + "futures 0.3.13", "libp2p-core", "log", "rand 0.7.3", - "smallvec 1.5.1", + "smallvec 1.6.1", "void", "wasm-timer", ] +[[package]] +name = "libp2p-swarm-derive" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c564ebaa36a64839f51eaddb0243aaaa29ce64affb56129193cc3248b72af273" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "libp2p-tcp" -version = "0.25.1" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc28c9ad6dc43f4c3950411cf808639d90307a076330e7996e5e94e70279bde0" +checksum = "88a5aef80e519a6cb8e2663605142f97baaaea1a252eecbf8756184765f7471b" dependencies = [ - "async-std", - "futures 0.3.8", + "async-io", + "futures 0.3.13", "futures-timer 3.0.2", - "if-addrs", + "if-watch", "ipnet", + "libc", "libp2p-core", "log", "socket2", @@ -3034,23 +3178,23 @@ dependencies = [ [[package]] name = "libp2p-uds" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d821208d4b9af4b293a56dde470edd9f9fac8bb94a51f4f5327cc29a471b3f3" +checksum = "80ac51ce419f60be966e02103c17f67ff5dc4422ba83ba54d251d6c62a4ed487" dependencies = [ "async-std", - "futures 0.3.8", + "futures 0.3.13", "libp2p-core", "log", ] [[package]] name = "libp2p-wasm-ext" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6ef400b231ba78e866b860445480ca21ee447e03034138c6d57cf2969d6bf4" +checksum = "6149c46cb76935c80bc8be6ec6e3ebd5f5e1679765a255fb34331d54610f15dd" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3060,31 +3204,29 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.26.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522a877ce42ededf1f5dd011dbc40ea116f1776818f09dacb3d7a206f3ad6305" +checksum = "d3b1c6a3431045da8b925ed83384e4c5163e14b990572307fca9c507435d4d22" dependencies = [ - "async-tls", "either", - "futures 0.3.8", + "futures 0.3.13", + "futures-rustls", "libp2p-core", "log", "quicksink", - "rustls 0.19.0", "rw-stream-sink", "soketto", - "url 2.2.0", - "webpki", + "url 2.2.1", "webpki-roots", ] [[package]] name = "libp2p-yamux" -version = "0.28.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be7ac000fa3e42ac09a6e658e48de34ac8ef9fff64a4e6e6b08dcc8f4b0e5f6" +checksum = "4819358c542a86ff95f6ae691efb4b94ddaf477079b01a686f5705b79bfc232a" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "libp2p-core", "parking_lot 0.11.1", "thiserror", @@ -3131,9 +3273,9 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "linked_hash_set" @@ -3174,41 +3316,23 @@ dependencies = [ [[package]] name = "log" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "loom" -version = "0.3.6" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e8460f2f2121162705187214720353c517b97bdfb3494c0b1e33d83ebe4bed" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", - "generator", - "scoped-tls", - "serde", - "serde_json", + "cfg-if 1.0.0", + "value-bag", ] [[package]] name = "lru" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3abe07af102235a56ac9a6dd904aab1e05483e2e8afdfffec3598be55b1b7606" +checksum = "1f374d42cdfc1d7dbf3d3dec28afab2eb97ffbf43a3234d795b5986dbf4b90ba" dependencies = [ - "hashbrown 0.9.1", + "hashbrown", ] -[[package]] -name = "lru_time_cache" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc2beb26938dfd9988fc368548b70bcdfaf955f55aa788e1682198de794a451" - [[package]] name = "mach" version = "0.3.2" @@ -3261,13 +3385,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] -name = "memmap" -version = "0.7.0" +name = "memmap2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" dependencies = [ "libc", - "winapi 0.3.9", ] [[package]] @@ -3290,12 +3413,12 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.24.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f36ddb0b2cdc25d38babba472108798e3477f02be5165f038c5e393e50c57a" +checksum = "814bbecfc0451fc314eeea34f05bbcd5b98a7ad7af37faee088b86a1e633f1d4" dependencies = [ "hash-db", - "hashbrown 0.8.2", + "hashbrown", "parity-util-mem", ] @@ -3307,9 +3430,9 @@ checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" [[package]] name = "merlin" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6feca46f4fa3443a01769d768727f10c10a20fdb65e52dc16a81f0c8269bb78" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" dependencies = [ "byteorder", "keccak", @@ -3319,18 +3442,18 @@ dependencies = [ [[package]] name = "minicbor" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0164190d1771b1458c3742075b057ed55d25cd9dfb930aade99315a1eb1fe12d" +checksum = "1c2b2c73f9640fccab53947e2b3474d5071fcbc8f82cac51ddf6c8041a30a9ea" dependencies = [ "minicbor-derive", ] [[package]] name = "minicbor-derive" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e071b3159835ee91df62dbdbfdd7ec366b7ea77c838f43aff4acda6b61bcfb9" +checksum = "19ce18b5423c573a13e80cb3046ea0af6379ef725dc3af4886bdb8f4e5093068" dependencies = [ "proc-macro2", "quote", @@ -3339,9 +3462,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", "autocfg", @@ -3425,13 +3548,13 @@ dependencies = [ [[package]] name = "module-amm-rpc" -version = "2.0.0" +version = "3.0.0" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "module-amm-rpc-runtime-api", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-api", "sp-blockchain", @@ -3442,9 +3565,9 @@ dependencies = [ [[package]] name = "module-amm-rpc-runtime-api" -version = "2.0.0" +version = "3.0.0" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-api", "sp-runtime", @@ -3458,17 +3581,32 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" +[[package]] +name = "multibase" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b78c60039650ff12e140ae867ef5299a58e19dded4d334c849dc7177083667e2" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + [[package]] name = "multihash" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dac63698b887d2d929306ea48b63760431ff8a24fac40ddb22f9c7f49fb7cab" dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", "digest 0.9.0", "generic-array 0.14.4", "multihash-derive", - "sha2 0.9.2", - "unsigned-varint", + "sha2 0.9.3", + "sha3", + "unsigned-varint 0.5.1", ] [[package]] @@ -3493,16 +3631,16 @@ checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" [[package]] name = "multistream-select" -version = "0.9.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda822043bba2d6da31c4e14041f9794f8fb130a5959289038d0b809d8888614" +checksum = "7d91ec0a2440aaff5f78ec35631a7027d50386c6163aa975f7caa0d5da4b6ff8" dependencies = [ - "bytes 0.5.6", - "futures 0.3.8", + "bytes 1.0.1", + "futures 0.3.13", "log", - "pin-project 1.0.2", - "smallvec 1.5.1", - "unsigned-varint", + "pin-project 1.0.5", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", ] [[package]] @@ -3512,7 +3650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b6147c3d50b4f3cdabfe2ecc94a0191fd3d6ad58aefd9664cf396285883486" dependencies = [ "approx", - "generic-array 0.13.2", + "generic-array 0.13.3", "matrixmultiply", "num-complex", "num-rational", @@ -3534,12 +3672,12 @@ dependencies = [ [[package]] name = "nb-connect" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8123a81538e457d44b933a02faf885d3fe8408806b23fa700e8f01c6c3a98998" +checksum = "670361df1bc2399ee1ff50406a0d422587dd3bb0da596e1978fe8e05dabddf4f" dependencies = [ "libc", - "winapi 0.3.9", + "socket2", ] [[package]] @@ -3640,32 +3778,25 @@ dependencies = [ [[package]] name = "object" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" - -[[package]] -name = "object" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" dependencies = [ "crc32fast", "indexmap", - "wasmparser 0.57.0", ] [[package]] name = "object" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" [[package]] name = "once_cell" -version = "1.5.2" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" dependencies = [ "parking_lot 0.11.1", ] @@ -3690,14 +3821,15 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "orml-currencies" -version = "0.3.3-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#59129c24d12624bae78229fd9863c45b21466221" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#42675bcf2f6bee3b9c0a52f831f23e7c43c4df8c" dependencies = [ "frame-support", "frame-system", + "funty", "orml-traits", "orml-utilities", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-io", "sp-runtime", @@ -3706,29 +3838,30 @@ dependencies = [ [[package]] name = "orml-tokens" -version = "0.3.3-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#59129c24d12624bae78229fd9863c45b21466221" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#42675bcf2f6bee3b9c0a52f831f23e7c43c4df8c" dependencies = [ "frame-support", "frame-system", + "funty", "orml-traits", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", - "sp-io", "sp-runtime", "sp-std", ] [[package]] name = "orml-traits" -version = "0.3.3-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#59129c24d12624bae78229fd9863c45b21466221" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#42675bcf2f6bee3b9c0a52f831f23e7c43c4df8c" dependencies = [ "frame-support", - "impl-trait-for-tuples", + "funty", + "impl-trait-for-tuples 0.1.3", "num-traits", "orml-utilities", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-io", "sp-runtime", @@ -3737,11 +3870,12 @@ dependencies = [ [[package]] name = "orml-utilities" -version = "0.3.3-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#59129c24d12624bae78229fd9863c45b21466221" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#42675bcf2f6bee3b9c0a52f831f23e7c43c4df8c" dependencies = [ "frame-support", - "parity-scale-codec", + "funty", + "parity-scale-codec 2.0.1", "serde", "sp-io", "sp-runtime", @@ -3759,7 +3893,7 @@ dependencies = [ [[package]] name = "pallet-amm" -version = "2.1.0" +version = "3.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -3770,7 +3904,7 @@ dependencies = [ "orml-traits", "orml-utilities", "pallet-asset-registry", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitive-types 0.8.0", "primitives", "serde", @@ -3783,11 +3917,11 @@ dependencies = [ [[package]] name = "pallet-asset-registry" -version = "2.0.0" +version = "3.0.0" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitive-types 0.8.0", "primitives", "serde", @@ -3800,13 +3934,13 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-application-crypto", "sp-authority-discovery", @@ -3816,13 +3950,13 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.0.1", "sp-authorship", "sp-inherents", "sp-runtime", @@ -3831,8 +3965,8 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-benchmarking", "frame-support", @@ -3840,12 +3974,11 @@ dependencies = [ "pallet-authorship", "pallet-session", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-application-crypto", "sp-consensus-babe", "sp-consensus-vrf", - "sp-inherents", "sp-io", "sp-runtime", "sp-session", @@ -3856,13 +3989,13 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-runtime", "sp-std", @@ -3870,7 +4003,7 @@ dependencies = [ [[package]] name = "pallet-claims" -version = "2.0.1" +version = "3.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -3882,7 +4015,7 @@ dependencies = [ "orml-traits", "orml-utilities", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitives", "rustc-hex", "serde", @@ -3894,13 +4027,13 @@ dependencies = [ [[package]] name = "pallet-collective" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-io", @@ -3908,14 +4041,31 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-election-provider-multi-phase" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec 2.0.1", + "sp-arithmetic", + "sp-election-providers", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-std", + "static_assertions", +] + [[package]] name = "pallet-elections-phragmen" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-npos-elections", "sp-runtime", @@ -3924,7 +4074,7 @@ dependencies = [ [[package]] name = "pallet-exchange" -version = "2.0.0" +version = "3.0.0" dependencies = [ "frame-support", "frame-system", @@ -3932,7 +4082,7 @@ dependencies = [ "orml-traits", "pallet-amm", "pallet-asset-registry", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitive-types 0.8.0", "primitives", "serde", @@ -3945,7 +4095,7 @@ dependencies = [ [[package]] name = "pallet-exchange-benchmarking" -version = "2.0.0" +version = "3.0.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -3956,7 +4106,7 @@ dependencies = [ "pallet-amm", "pallet-asset-registry", "pallet-exchange", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitives", "serde", "sp-core", @@ -3968,13 +4118,13 @@ dependencies = [ [[package]] name = "pallet-faucet" -version = "2.0.0" +version = "3.0.0" dependencies = [ "frame-support", "frame-system", "orml-tokens", "orml-traits", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitive-types 0.7.3", "primitives", "serde", @@ -3987,15 +4137,15 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "pallet-authorship", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-application-crypto", "sp-core", @@ -4008,14 +4158,13 @@ dependencies = [ [[package]] name = "pallet-im-online" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", "pallet-authorship", - "pallet-session", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-application-crypto", "sp-core", @@ -4042,7 +4191,7 @@ dependencies = [ "pallet-balances", "pallet-transaction-multi-payment", "pallet-transaction-payment", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitives", "serde", "sp-core", @@ -4054,13 +4203,13 @@ dependencies = [ [[package]] name = "pallet-offences" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-runtime", "sp-staking", @@ -4069,12 +4218,12 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "safe-mix", "sp-runtime", "sp-std", @@ -4082,14 +4231,14 @@ dependencies = [ [[package]] name = "pallet-session" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples", + "impl-trait-for-tuples 0.2.1", "pallet-timestamp", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-io", @@ -4102,16 +4251,17 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", "pallet-authorship", "pallet-session", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-application-crypto", + "sp-election-providers", "sp-io", "sp-npos-elections", "sp-runtime", @@ -4122,8 +4272,8 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4133,12 +4283,12 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-io", "sp-runtime", @@ -4147,14 +4297,14 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.0.1", "serde", "sp-inherents", "sp-io", @@ -4165,13 +4315,13 @@ dependencies = [ [[package]] name = "pallet-tips" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", "pallet-treasury", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-runtime", "sp-std", @@ -4191,7 +4341,7 @@ dependencies = [ "pallet-asset-registry", "pallet-balances", "pallet-transaction-payment", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitive-types 0.8.0", "primitives", "serde", @@ -4205,15 +4355,14 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", - "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", - "smallvec 1.5.1", + "smallvec 1.6.1", "sp-core", "sp-io", "sp-runtime", @@ -4222,15 +4371,14 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", - "serde", + "parity-scale-codec 2.0.1", "sp-api", "sp-blockchain", "sp-core", @@ -4240,27 +4388,25 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "frame-support", - "parity-scale-codec", - "serde", + "pallet-transaction-payment", + "parity-scale-codec 2.0.1", "sp-api", "sp-runtime", - "sp-std", ] [[package]] name = "pallet-treasury" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples", + "impl-trait-for-tuples 0.2.1", "pallet-balances", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-runtime", "sp-std", @@ -4268,23 +4414,26 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.1.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d595e372d119261593297debbe4193811a4dc811d2a1ccbb8caaa6666ad7ab" +checksum = "495197c078e54b8735181aa35c00a327f7f3a3cc00a1ee8c95926dd010f0ec6b" dependencies = [ "blake2-rfc", "crc32fast", + "fs2", + "hex", "libc", "log", - "memmap", - "parking_lot 0.10.2", + "memmap2", + "parking_lot 0.11.1", + "rand 0.8.3", ] [[package]] name = "parity-multiaddr" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f51a30667591b14f96068b2d12f1306d07a41ebd98239d194356d4d9707ac16" +checksum = "d2c6805f98667a3828afb2ec2c396a8d610497e8d546f5447188aae47c5a79ec" dependencies = [ "arrayref", "bs58", @@ -4294,28 +4443,40 @@ dependencies = [ "percent-encoding 2.1.0", "serde", "static_assertions", - "unsigned-varint", - "url 2.2.0", + "unsigned-varint 0.7.0", + "url 2.2.1", ] [[package]] name = "parity-scale-codec" -version = "1.3.5" +version = "1.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b26b16c7687c3075982af47719e481815df30bc544f7a6690763a25ca16e9d" +dependencies = [ + "arrayvec 0.5.2", + "bitvec 0.17.4", + "byte-slice-cast 0.3.5", + "serde", +] + +[[package]] +name = "parity-scale-codec" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c740e5fbcb6847058b40ac7e5574766c6388f585e184d769910fe0d3a2ca861" +checksum = "0cd3dab59b5cf4bc81069ade0fc470341a1ef3ad5fa73e5a8943bed2ec12b2e8" dependencies = [ "arrayvec 0.5.2", - "bitvec", - "byte-slice-cast", + "bitvec 0.20.2", + "byte-slice-cast 1.0.0", "parity-scale-codec-derive", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "1.2.2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "198db82bb1c18fc00176004462dd809b2a6d851669550aa17af6dacd21ae0c14" +checksum = "fa04976a81fde04924b40cc4036c4d12841e8bb04325a5cf2ada75731a150a7d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4336,7 +4497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "libc", "log", "mio-named-pipes", @@ -4350,17 +4511,17 @@ dependencies = [ [[package]] name = "parity-util-mem" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297ff91fa36aec49ce183484b102f6b75b46776822bd81525bfc4cc9b0dd0f5c" +checksum = "664a8c6b8e62d8f9f2f937e391982eb433ab285b4cd9545b342441e04a906e42" dependencies = [ - "cfg-if 0.1.10", - "hashbrown 0.8.2", - "impl-trait-for-tuples", + "cfg-if 1.0.0", + "hashbrown", + "impl-trait-for-tuples 0.2.1", "parity-util-mem-derive", - "parking_lot 0.10.2", - "primitive-types 0.7.3", - "smallvec 1.5.1", + "parking_lot 0.11.1", + "primitive-types 0.9.0", + "smallvec 1.6.1", "winapi 0.3.9", ] @@ -4396,7 +4557,7 @@ dependencies = [ "rand 0.7.3", "sha-1 0.8.2", "slab", - "url 2.2.0", + "url 2.2.1", ] [[package]] @@ -4434,7 +4595,7 @@ checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", "lock_api 0.4.2", - "parking_lot_core 0.8.1", + "parking_lot_core 0.8.3", ] [[package]] @@ -4446,9 +4607,9 @@ dependencies = [ "cfg-if 0.1.10", "cloudabi", "libc", - "redox_syscall", + "redox_syscall 0.1.57", "rustc_version", - "smallvec 0.6.13", + "smallvec 0.6.14", "winapi 0.3.9", ] @@ -4461,22 +4622,22 @@ dependencies = [ "cfg-if 0.1.10", "cloudabi", "libc", - "redox_syscall", - "smallvec 1.5.1", + "redox_syscall 0.1.57", + "smallvec 1.6.1", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c6d9b8427445284a09c55be860a15855ab580a417ccad9da88f5a06787ced0" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", - "smallvec 1.5.1", + "redox_syscall 0.2.5", + "smallvec 1.6.1", "winapi 0.3.9", ] @@ -4490,6 +4651,12 @@ dependencies = [ "proc-macro-hack", ] +[[package]] +name = "paste" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d65c4d95931acda4498f675e332fcbdc9a06705cd07086c510e9b6009cd1c1" + [[package]] name = "paste-impl" version = "0.1.18" @@ -4606,11 +4773,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" +checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" dependencies = [ - "pin-project-internal 1.0.2", + "pin-project-internal 1.0.5", ] [[package]] @@ -4626,9 +4793,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" +checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" dependencies = [ "proc-macro2", "quote", @@ -4637,15 +4804,15 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.0" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b063f57ec186e6140e2b8b6921e5f1bd89c7356dda5b33acc5401203ca6131c" +checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" [[package]] name = "pin-utils" @@ -4690,11 +4857,12 @@ dependencies = [ [[package]] name = "polyval" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fd92d8e0c06d08525d2e2643cc2b5c80c69ae8eb12c18272d501cd7079ccc0" +checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" dependencies = [ "cpuid-bool 0.2.0", + "opaque-debug 0.3.0", "universal-hash", ] @@ -4711,8 +4879,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd39dcacf71411ba488570da7bbc89b717225e46478b30ba99b92db6b149809" dependencies = [ "fixed-hash 0.6.1", - "impl-codec", - "impl-serde", "uint 0.8.5", ] @@ -4723,17 +4889,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3824ae2c5e27160113b9e029a10ec9e3f0237bad8029f69c7724393c9fdefd8" dependencies = [ "fixed-hash 0.7.0", - "impl-codec", + "impl-codec 0.4.2", + "uint 0.9.0", +] + +[[package]] +name = "primitive-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adace" +dependencies = [ + "fixed-hash 0.7.0", + "impl-codec 0.5.0", + "impl-serde", "uint 0.9.0", ] [[package]] name = "primitives" -version = "2.0.0" +version = "3.0.0" dependencies = [ "frame-support", "frame-system", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "primitive-types 0.8.0", "serde", "sp-core", @@ -4784,9 +4962,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" @@ -4799,11 +4977,11 @@ dependencies = [ [[package]] name = "prometheus" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d70cf4412832bcac9cffe27906f4a66e450d323525e977168c70d1b36120ae" +checksum = "c8425533e7122f0c3cc7a37e6244b16ad3a2cc32ae7ac6276e2a75da0d9c200d" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "fnv", "lazy_static", "parking_lot 0.11.1", @@ -4813,40 +4991,40 @@ dependencies = [ [[package]] name = "prost" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" +checksum = "9e6984d2f1a23009bd270b8bb56d0926810a3d483f59c987d77969e9d8e840b2" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "prost-derive", ] [[package]] name = "prost-build" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26" +checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "heck", - "itertools 0.8.2", + "itertools", "log", "multimap", "petgraph", "prost", "prost-types", "tempfile", - "which", + "which 4.0.2", ] [[package]] name = "prost-derive" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" +checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" dependencies = [ "anyhow", - "itertools 0.8.2", + "itertools", "proc-macro2", "quote", "syn", @@ -4854,12 +5032,21 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.6.1" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b518d7cdd93dab1d1122cf07fa9a60771836c668dde9d9e2a139f957f0d9f1bb" +dependencies = [ + "bytes 1.0.1", + "prost", +] + +[[package]] +name = "psm" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1834f67c0697c001304b75be76f67add9c89742eda3a085ad8ee0bb38c3417aa" +checksum = "3abf49e5417290756acfd26501536358560c4a5cc4a0934d390939acb3e7083a" dependencies = [ - "bytes 0.5.6", - "prost", + "cc", ] [[package]] @@ -4893,14 +5080,14 @@ checksum = "77de3c815e5a160b1539c6592796801df2043ae35e123b46d73380cfa57af858" dependencies = [ "futures-core", "futures-sink", - "pin-project-lite 0.1.11", + "pin-project-lite 0.1.12", ] [[package]] name = "quote" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ "proc-macro2", ] @@ -4911,6 +5098,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + [[package]] name = "rand" version = "0.3.23" @@ -4940,23 +5133,24 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc", + "rand_hc 0.2.0", "rand_pcg", ] [[package]] name = "rand" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18519b42a40024d661e1714153e9ad0c3de27cd495760ceb09710920f1098b1e" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" dependencies = [ "libc", "rand_chacha 0.3.0", - "rand_core 0.6.1", + "rand_core 0.6.2", + "rand_hc 0.3.0", ] [[package]] @@ -4976,7 +5170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ "ppv-lite86", - "rand_core 0.6.1", + "rand_core 0.6.2", ] [[package]] @@ -5000,16 +5194,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", ] [[package]] name = "rand_core" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ - "getrandom 0.2.1", + "getrandom 0.2.2", ] [[package]] @@ -5030,6 +5224,15 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core 0.6.2", +] + [[package]] name = "rand_pcg" version = "0.2.1" @@ -5041,9 +5244,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "7.0.3" +version = "8.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" +checksum = "1fdf7d9dbd43f3d81d94a49c1c3df73cc2b3827995147e6cf7f89d4ec5483e73" dependencies = [ "bitflags", "cc", @@ -5076,7 +5279,7 @@ checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ "crossbeam-channel", "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.3", "lazy_static", "num_cpus", ] @@ -5096,31 +5299,50 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +[[package]] +name = "redox_syscall" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom 0.1.15", - "redox_syscall", + "getrandom 0.1.16", + "redox_syscall 0.1.57", "rust-argon2", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.2", + "redox_syscall 0.2.5", +] + [[package]] name = "ref-cast" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17626b2f4bcf35b84bf379072a66e28cfe5c3c6ae58b38e4914bb8891dabece" +checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.3" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c523ccaed8ac4b0288948849a350b37d3035827413c458b6a40ddb614bb4f72" +checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" dependencies = [ "proc-macro2", "quote", @@ -5129,20 +5351,20 @@ dependencies = [ [[package]] name = "regalloc" -version = "0.0.27" +version = "0.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ba8aaf5fe7cf307c6dbdaeed85478961d29e25e3bee5169e11b92fa9f027a8" +checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" dependencies = [ "log", "rustc-hash", - "smallvec 1.5.1", + "smallvec 1.6.1", ] [[package]] name = "regex" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "aho-corasick", "memchr", @@ -5162,9 +5384,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "region" @@ -5189,15 +5411,15 @@ dependencies = [ [[package]] name = "retain_mut" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e005d658ad26eacc2b6c506dfde519f4e277e328d0eb3379ca61647d70a8f531" +checksum = "53552c6c49e1e13f1a203ef0080ab3bbef0beb570a528993e83df057a9d9bba1" [[package]] name = "ring" -version = "0.16.19" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "024a1e66fea74c66c66624ee5622a7ff0e4b73a13b4f5c326ddb50c708944226" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", @@ -5220,9 +5442,9 @@ dependencies = [ [[package]] name = "rpassword" -version = "5.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d755237fc0f99d98641540e66abac8bc46a0652f19148ac9e21de2da06b326c9" +checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" dependencies = [ "libc", "winapi 0.3.9", @@ -5237,7 +5459,7 @@ dependencies = [ "base64 0.13.0", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.8.3", ] [[package]] @@ -5311,7 +5533,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "pin-project 0.4.27", "static_assertions", ] @@ -5333,26 +5555,26 @@ dependencies = [ [[package]] name = "salsa20" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f47b10fa80f6969bbbd9c8e7cc998f082979d402a9e10579e2303a87955395" +checksum = "399f290ffc409596022fce5ea5d4138184be4784f2b28c62c59f0d8389059a15" dependencies = [ - "stream-cipher", + "cipher", ] [[package]] name = "sc-authority-discovery" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "async-trait", "derive_more", "either", - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", "libp2p", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "prost", "prost-build", "rand 0.7.3", @@ -5370,13 +5592,13 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sc-block-builder", "sc-client-api", "sc-proposer-metrics", @@ -5393,15 +5615,14 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", - "sp-consensus", "sp-core", "sp-inherents", "sp-runtime", @@ -5410,11 +5631,11 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.0.1", "sc-chain-spec-derive", "sc-consensus-babe", "sc-consensus-epochs", @@ -5431,8 +5652,8 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5442,22 +5663,20 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "atty", "chrono", "fdlimit", - "futures 0.3.8", + "futures 0.3.13", "hex", "libp2p", "log", "names", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "rand 0.7.3", "regex", "rpassword", - "sc-cli-proc-macro", "sc-client-api", "sc-keystore", "sc-network", @@ -5477,37 +5696,23 @@ dependencies = [ "structopt", "thiserror", "tiny-bip39", - "tokio 0.2.24", - "tracing", - "tracing-log", - "tracing-subscriber", -] - -[[package]] -name = "sc-cli-proc-macro" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "tokio 0.2.25", ] [[package]] name = "sc-client-api" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", "fnv", - "futures 0.3.8", + "futures 0.3.13", "hash-db", "kvdb", "lazy_static", "log", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sc-executor", "sp-api", "sp-blockchain", @@ -5530,8 +5735,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "blake2-rfc", "hash-db", @@ -5541,9 +5746,9 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-util-mem", - "parking_lot 0.10.2", + "parking_lot 0.11.1", "sc-client-api", "sc-executor", "sc-state-db", @@ -5560,8 +5765,8 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "sc-client-api", "sp-blockchain", @@ -5571,20 +5776,20 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", "fork-tree", - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", "log", "merlin", "num-bigint", "num-rational", "num-traits", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "pdqselect", "rand 0.7.3", "retain_mut", @@ -5602,6 +5807,7 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-slots", "sp-consensus-vrf", "sp-core", "sp-inherents", @@ -5616,11 +5822,11 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", - "futures 0.3.8", + "futures 0.3.13", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -5640,12 +5846,12 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "fork-tree", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sc-client-api", "sp-blockchain", "sp-runtime", @@ -5653,14 +5859,14 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", "log", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sc-client-api", "sc-telemetry", "sp-api", @@ -5679,8 +5885,8 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "log", "sc-client-api", @@ -5693,16 +5899,16 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", "lazy_static", "libsecp256k1", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-wasm", - "parking_lot 0.10.2", + "parking_lot 0.11.1", "sc-executor-common", "sc-executor-wasmi", "sc-executor-wasmtime", @@ -5722,11 +5928,11 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-wasm", "sp-allocator", "sp-core", @@ -5738,11 +5944,11 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sc-executor-common", "sp-allocator", "sp-core", @@ -5753,11 +5959,11 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-wasm", "pwasm-utils", "sc-executor-common", @@ -5771,18 +5977,20 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", - "finality-grandpa", + "dyn-clone", + "finality-grandpa 0.14.0", "fork-tree", - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", + "linked-hash-map", "log", - "parity-scale-codec", - "parking_lot 0.10.2", - "pin-project 0.4.27", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", + "pin-project 1.0.5", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -5808,19 +6016,19 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d8c6b8454772f8ef3835c0297319c250103d7a3fba0406238c0d63b9c2f88e" +checksum = "145cb4dfafa73269565857c43e204d71f6334c7f1260b783bb5942a6a4e77831" dependencies = [ "derive_more", - "finality-grandpa", - "futures 0.3.8", + "finality-grandpa 0.13.0", + "futures 0.3.13", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "jsonrpc-pubsub", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sc-client-api", "sc-finality-grandpa", "sc-rpc", @@ -5833,11 +6041,11 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.8", + "futures 0.3.13", "log", "parity-util-mem", "sc-client-api", @@ -5851,16 +6059,16 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "async-trait", "derive_more", - "futures 0.3.8", + "futures 0.3.13", "futures-util", "hex", "merlin", - "parking_lot 0.10.2", + "parking_lot 0.11.1", "rand 0.7.3", "serde_json", "sp-application-crypto", @@ -5871,13 +6079,13 @@ dependencies = [ [[package]] name = "sc-light" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "hash-db", "lazy_static", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sc-client-api", "sc-executor", "sp-api", @@ -5890,22 +6098,23 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "async-std", "async-trait", + "asynchronous-codec 0.5.0", "bitflags", "bs58", - "bytes 0.5.6", + "bytes 1.0.1", + "cid", "derive_more", "either", "erased-serde", "fnv", "fork-tree", - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", - "futures_codec", "hex", "ip_network", "libp2p", @@ -5914,9 +6123,9 @@ dependencies = [ "log", "lru", "nohash-hasher", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parking_lot 0.11.1", - "pin-project 0.4.27", + "pin-project 1.0.5", "prost", "prost-build", "rand 0.7.3", @@ -5925,9 +6134,7 @@ dependencies = [ "sc-peerset", "serde", "serde_json", - "slog", - "slog_derive", - "smallvec 1.5.1", + "smallvec 1.6.1", "sp-arithmetic", "sp-blockchain", "sp-consensus", @@ -5936,7 +6143,7 @@ dependencies = [ "sp-utils", "substrate-prometheus-endpoint", "thiserror", - "unsigned-varint", + "unsigned-varint 0.6.0", "void", "wasm-timer", "zeroize", @@ -5944,34 +6151,35 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", "libp2p", "log", "lru", "sc-network", "sp-runtime", + "substrate-prometheus-endpoint", "wasm-timer", ] [[package]] name = "sc-offchain" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", - "hyper 0.13.9", + "hyper 0.13.10", "hyper-rustls", "log", "num_cpus", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "rand 0.7.3", "sc-client-api", "sc-keystore", @@ -5986,10 +6194,10 @@ dependencies = [ [[package]] name = "sc-peerset" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "libp2p", "log", "serde_json", @@ -5999,8 +6207,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -6008,16 +6216,16 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", "log", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sc-block-builder", "sc-client-api", "sc-executor", @@ -6042,18 +6250,18 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", - "futures 0.3.8", + "futures 0.3.13", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "jsonrpc-pubsub", "log", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "serde", "serde_json", "sp-chain-spec", @@ -6066,10 +6274,10 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", @@ -6084,23 +6292,23 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "directories 3.0.1", + "directories", "exit-future", - "futures 0.1.30", - "futures 0.3.8", + "futures 0.1.31", + "futures 0.3.13", "futures-timer 3.0.2", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", "lazy_static", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-util-mem", - "parking_lot 0.10.2", - "pin-project 0.4.27", + "parking_lot 0.11.1", + "pin-project 1.0.5", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -6119,7 +6327,6 @@ dependencies = [ "sc-transaction-pool", "serde", "serde_json", - "slog", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -6148,14 +6355,14 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-util-mem", "parity-util-mem-derive", - "parking_lot 0.10.2", + "parking_lot 0.11.1", "sc-client-api", "sp-core", "thiserror", @@ -6163,60 +6370,76 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", - "futures-timer 3.0.2", + "chrono", + "futures 0.3.13", "libp2p", "log", - "parking_lot 0.10.2", - "pin-project 0.4.27", + "parking_lot 0.11.1", + "pin-project 1.0.5", "rand 0.7.3", "serde", - "slog", - "slog-json", - "slog-scope", + "serde_json", + "sp-utils", "take_mut", + "tracing", + "tracing-subscriber", "void", "wasm-timer", ] [[package]] name = "sc-tracing" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "ansi_term 0.12.1", + "atty", "erased-serde", "lazy_static", "log", "once_cell", - "parking_lot 0.10.2", + "parking_lot 0.11.1", "regex", "rustc-hash", "sc-telemetry", + "sc-tracing-proc-macro", "serde", "serde_json", - "slog", "sp-tracing", + "thiserror", "tracing", "tracing-core", "tracing-log", "tracing-subscriber", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "sc-tracing-proc-macro" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "sc-transaction-graph" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", - "futures 0.3.8", + "futures 0.3.13", "linked-hash-map", "log", "parity-util-mem", - "parking_lot 0.10.2", + "parking_lot 0.11.1", "retain_mut", "serde", "sp-blockchain", @@ -6230,16 +6453,16 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "futures-diagnose", "intervalier", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-util-mem", - "parking_lot 0.10.2", + "parking_lot 0.11.1", "sc-client-api", "sc-transaction-graph", "sp-api", @@ -6272,8 +6495,8 @@ checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" dependencies = [ "arrayref", "arrayvec 0.5.2", - "curve25519-dalek 2.1.0", - "getrandom 0.1.15", + "curve25519-dalek 2.1.2", + "getrandom 0.1.16", "merlin", "rand 0.7.3", "rand_core 0.5.1", @@ -6306,9 +6529,9 @@ dependencies = [ [[package]] name = "scroll_derive" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12bd20b94c7cdfda8c7ba9b92ad0d9a56e3fa018c25fca83b51aa664c9b4c0d" +checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0" dependencies = [ "proc-macro2", "quote", @@ -6374,18 +6597,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.118" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.118" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b" dependencies = [ "proc-macro2", "quote", @@ -6394,9 +6617,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.61" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" +checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" dependencies = [ "itoa", "ryu", @@ -6417,9 +6640,9 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3cdf1b5e620a498ee6f2a171885ac7e22f0e12089ec4b3d22b84921792507c" +checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", @@ -6442,9 +6665,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8" +checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", @@ -6467,12 +6690,11 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4921be914e16899a80adefb821f8ddb7974e3f1250223575a44ed994882127" +checksum = "79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3" dependencies = [ "lazy_static", - "loom", ] [[package]] @@ -6483,9 +6705,9 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook" -version = "0.1.16" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed" +checksum = "8a7f3f92a1da3d6b1d32245d0cbcbbab0cfc45996d8df619c42bccfa6d2bbb5f" dependencies = [ "libc", "signal-hook-registry", @@ -6493,18 +6715,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce32ea0c6c56d5eacaeb814fbed9960547021d3edd010ded1425f180536b20ab" +checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" dependencies = [ "libc", ] [[package]] name = "signature" -version = "1.2.2" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f060a7d147e33490ec10da418795238fd7545bba241504d6b31a409f2e6210" +checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] name = "simba" @@ -6515,7 +6737,7 @@ dependencies = [ "approx", "num-complex", "num-traits", - "paste", + "paste 0.1.18", ] [[package]] @@ -6524,64 +6746,20 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -[[package]] -name = "slog" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" -dependencies = [ - "erased-serde", -] - -[[package]] -name = "slog-json" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc0d2aff1f8f325ef660d9a0eb6e6dcd20b30b3f581a5897f58bf42d061c37a" -dependencies = [ - "chrono", - "erased-serde", - "serde", - "serde_json", - "slog", -] - -[[package]] -name = "slog-scope" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c44c89dd8b0ae4537d1ae318353eaf7840b4869c536e31c41e963d1ea523ee6" -dependencies = [ - "arc-swap", - "lazy_static", - "slog", -] - -[[package]] -name = "slog_derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "smallvec" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" dependencies = [ "maybe-uninit", ] [[package]] name = "smallvec" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "snow" @@ -6596,16 +6774,16 @@ dependencies = [ "rand_core 0.5.1", "ring", "rustc_version", - "sha2 0.9.2", + "sha2 0.9.3", "subtle 2.4.0", "x25519-dalek", ] [[package]] name = "socket2" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97e0e9fd577458a4f61fb91fcb559ea2afecc54c934119421f9f5d3d5b1a1057" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ "cfg-if 1.0.0", "libc", @@ -6621,17 +6799,17 @@ dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.8", + "futures 0.3.13", "httparse", "log", "rand 0.7.3", - "sha-1 0.9.2", + "sha-1 0.9.4", ] [[package]] name = "sp-allocator" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "log", "sp-core", @@ -6642,11 +6820,11 @@ dependencies = [ [[package]] name = "sp-api" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "hash-db", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-api-proc-macro", "sp-core", "sp-runtime", @@ -6658,8 +6836,8 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -6670,10 +6848,10 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-core", "sp-io", @@ -6682,12 +6860,12 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-debug-derive", "sp-std", @@ -6695,10 +6873,10 @@ dependencies = [ [[package]] name = "sp-authority-discovery" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-api", "sp-application-crypto", "sp-runtime", @@ -6707,10 +6885,10 @@ dependencies = [ [[package]] name = "sp-authorship" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-inherents", "sp-runtime", "sp-std", @@ -6718,10 +6896,10 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-api", "sp-inherents", "sp-runtime", @@ -6730,14 +6908,14 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "log", "lru", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sp-api", "sp-consensus", "sp-database", @@ -6748,8 +6926,8 @@ dependencies = [ [[package]] name = "sp-chain-spec" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "serde", "serde_json", @@ -6757,15 +6935,15 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "futures-timer 3.0.2", "libp2p", "log", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "serde", "sp-api", "sp-core", @@ -6783,11 +6961,11 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "merlin", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-api", "sp-application-crypto", "sp-consensus", @@ -6803,19 +6981,20 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", + "sp-arithmetic", "sp-runtime", ] [[package]] name = "sp-consensus-vrf" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "schnorrkel", "sp-core", "sp-runtime", @@ -6824,15 +7003,15 @@ dependencies = [ [[package]] name = "sp-core" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "base58", "blake2-rfc", "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.8", + "futures 0.3.13", "hash-db", "hash256-std-hasher", "hex", @@ -6842,16 +7021,16 @@ dependencies = [ "log", "merlin", "num-traits", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-util-mem", - "parking_lot 0.10.2", - "primitive-types 0.7.3", + "parking_lot 0.11.1", + "primitive-types 0.9.0", "rand 0.7.3", "regex", "schnorrkel", "secrecy", "serde", - "sha2 0.8.2", + "sha2 0.9.3", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", @@ -6868,42 +7047,53 @@ dependencies = [ [[package]] name = "sp-database" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "kvdb", - "parking_lot 0.10.2", + "parking_lot 0.11.1", ] [[package]] name = "sp-debug-derive" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "sp-election-providers" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" +dependencies = [ + "parity-scale-codec 2.0.1", + "sp-arithmetic", + "sp-npos-elections", + "sp-std", +] + [[package]] name = "sp-externalities" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "environmental", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-std", "sp-storage", ] [[package]] name = "sp-finality-grandpa" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "finality-grandpa", + "finality-grandpa 0.14.0", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-api", "sp-application-crypto", @@ -6915,11 +7105,11 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sp-core", "sp-std", "thiserror", @@ -6927,15 +7117,15 @@ dependencies = [ [[package]] name = "sp-io" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "hash-db", "libsecp256k1", "log", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "sp-core", "sp-externalities", "sp-keystore", @@ -6951,8 +7141,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "lazy_static", "sp-core", @@ -6962,15 +7152,15 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "async-trait", "derive_more", - "futures 0.3.8", + "futures 0.3.13", "merlin", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "schnorrkel", "serde", "sp-core", @@ -6979,20 +7169,21 @@ dependencies = [ [[package]] name = "sp-npos-elections" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-arithmetic", + "sp-core", "sp-npos-elections-compact", "sp-std", ] [[package]] name = "sp-npos-elections-compact" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7002,8 +7193,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "sp-api", "sp-core", @@ -7012,16 +7203,16 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "backtrace", ] [[package]] name = "sp-rpc" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "serde", "sp-core", @@ -7029,16 +7220,16 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "either", "hash256-std-hasher", - "impl-trait-for-tuples", + "impl-trait-for-tuples 0.2.1", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "parity-util-mem", - "paste", + "paste 1.0.4", "rand 0.7.3", "serde", "sp-application-crypto", @@ -7050,12 +7241,12 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types 0.7.3", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.0.1", + "primitive-types 0.9.0", "sp-externalities", "sp-runtime-interface-proc-macro", "sp-std", @@ -7067,8 +7258,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "Inflector", "proc-macro-crate", @@ -7079,8 +7270,8 @@ dependencies = [ [[package]] name = "sp-serializer" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "serde", "serde_json", @@ -7088,10 +7279,10 @@ dependencies = [ [[package]] name = "sp-session" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-api", "sp-core", "sp-runtime", @@ -7101,26 +7292,26 @@ dependencies = [ [[package]] name = "sp-staking" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-runtime", "sp-std", ] [[package]] name = "sp-state-machine" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "hash-db", "log", "num-traits", - "parity-scale-codec", - "parking_lot 0.10.2", + "parity-scale-codec 2.0.1", + "parking_lot 0.11.1", "rand 0.7.3", - "smallvec 1.5.1", + "smallvec 1.6.1", "sp-core", "sp-externalities", "sp-panic-handler", @@ -7133,16 +7324,16 @@ dependencies = [ [[package]] name = "sp-std" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" [[package]] name = "sp-storage" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "impl-serde", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "ref-cast", "serde", "sp-debug-derive", @@ -7151,8 +7342,8 @@ dependencies = [ [[package]] name = "sp-tasks" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "log", "sp-core", @@ -7164,11 +7355,11 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.0.1", "sp-api", "sp-inherents", "sp-runtime", @@ -7178,11 +7369,11 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-std", "tracing", "tracing-core", @@ -7191,13 +7382,13 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "derive_more", - "futures 0.3.8", + "futures 0.3.13", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-api", "sp-blockchain", @@ -7207,12 +7398,12 @@ dependencies = [ [[package]] name = "sp-trie" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "hash-db", "memory-db", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sp-core", "sp-std", "trie-db", @@ -7221,10 +7412,10 @@ dependencies = [ [[package]] name = "sp-utils" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -7233,11 +7424,11 @@ dependencies = [ [[package]] name = "sp-version" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "impl-serde", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "serde", "sp-runtime", "sp-std", @@ -7245,11 +7436,11 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.0.1", "sp-std", "wasmi", ] @@ -7332,18 +7523,18 @@ dependencies = [ [[package]] name = "strum" -version = "0.16.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6138f8f88a16d90134763314e3fc76fa3ed6a7db4725d6acf9a3ef95a3188d22" +checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.16.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" +checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" dependencies = [ "heck", "proc-macro2", @@ -7375,16 +7566,16 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" -version = "2.0.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.8", + "futures 0.3.13", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "log", - "parity-scale-codec", + "parity-scale-codec 2.0.1", "sc-client-api", "sc-rpc-api", "serde", @@ -7398,16 +7589,16 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.8.0" -source = "git+https://github.com/galacticcouncil/substrate?branch=ss58#08af10c323e6a1cdf024bfdb87b641b1cedadd61" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate?rev=e84d2ae4e519d77f59ef68c8efd48909a70d58e8#e84d2ae4e519d77f59ef68c8efd48909a70d58e8" dependencies = [ "async-std", "derive_more", "futures-util", - "hyper 0.13.9", + "hyper 0.13.10", "log", "prometheus", - "tokio 0.2.24", + "tokio 0.2.25", ] [[package]] @@ -7430,9 +7621,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.54" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44" +checksum = "8fd9bc7ccc2688b3344c2f48b9b546648b25ce0b20fc717ee7fa7981a8ca9717" dependencies = [ "proc-macro2", "quote", @@ -7457,22 +7648,28 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "target-lexicon" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" +checksum = "422045212ea98508ae3d28025bc5aaa2bd4a9cdaecd442a08da2ee620ee9ea95" [[package]] name = "tempfile" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "rand 0.7.3", - "redox_syscall", + "rand 0.8.3", + "redox_syscall 0.2.5", "remove_dir_all", "winapi 0.3.9", ] @@ -7497,18 +7694,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" +checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" +checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" dependencies = [ "proc-macro2", "quote", @@ -7517,11 +7714,11 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -7556,7 +7753,7 @@ dependencies = [ "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", - "sha2 0.9.2", + "sha2 0.9.3", "thiserror", "unicode-normalization", "zeroize", @@ -7573,9 +7770,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f" +checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" dependencies = [ "tinyvec_macros", ] @@ -7593,7 +7790,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "mio", "num_cpus", "tokio-codec", @@ -7612,9 +7809,9 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" dependencies = [ "bytes 0.5.6", "fnv", @@ -7626,7 +7823,7 @@ dependencies = [ "mio", "mio-uds", "num_cpus", - "pin-project-lite 0.1.11", + "pin-project-lite 0.1.12", "signal-hook-registry", "slab", "winapi 0.3.9", @@ -7640,7 +7837,7 @@ checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ "bytes 0.4.12", "either", - "futures 0.1.30", + "futures 0.1.31", ] [[package]] @@ -7650,7 +7847,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "tokio-io", ] @@ -7660,7 +7857,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "tokio-executor", ] @@ -7671,7 +7868,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" dependencies = [ "crossbeam-utils 0.7.2", - "futures 0.1.30", + "futures 0.1.31", ] [[package]] @@ -7680,7 +7877,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "tokio-io", "tokio-threadpool", ] @@ -7692,7 +7889,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "log", ] @@ -7703,7 +7900,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "mio", "mio-named-pipes", "tokio 0.1.22", @@ -7716,7 +7913,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" dependencies = [ "crossbeam-utils 0.7.2", - "futures 0.1.30", + "futures 0.1.31", "lazy_static", "log", "mio", @@ -7736,7 +7933,7 @@ checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" dependencies = [ "futures-core", "rustls 0.18.1", - "tokio 0.2.24", + "tokio 0.2.25", "webpki", ] @@ -7746,7 +7943,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", ] [[package]] @@ -7756,7 +7953,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" dependencies = [ "fnv", - "futures 0.1.30", + "futures 0.1.31", ] [[package]] @@ -7766,7 +7963,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "iovec", "mio", "tokio-io", @@ -7782,7 +7979,7 @@ dependencies = [ "crossbeam-deque 0.7.3", "crossbeam-queue", "crossbeam-utils 0.7.2", - "futures 0.1.30", + "futures 0.1.31", "lazy_static", "log", "num_cpus", @@ -7797,7 +7994,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ "crossbeam-utils 0.7.2", - "futures 0.1.30", + "futures 0.1.31", "slab", "tokio-executor", ] @@ -7809,7 +8006,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "log", "mio", "tokio-codec", @@ -7824,7 +8021,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.31", "iovec", "libc", "log", @@ -7845,43 +8042,43 @@ dependencies = [ "futures-core", "futures-sink", "log", - "pin-project-lite 0.1.11", - "tokio 0.2.24", + "pin-project-lite 0.1.12", + "tokio 0.2.25", ] [[package]] name = "toml" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ "serde", ] [[package]] name = "tower-service" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.22" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" +checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.6", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" +checksum = "a8a9bd1db7706f2373a190b0d067146caa39350c486f3d455b0e33b431f94c07" dependencies = [ "proc-macro2", "quote", @@ -7899,19 +8096,19 @@ dependencies = [ [[package]] name = "tracing-futures" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 0.4.27", + "pin-project 1.0.5", "tracing", ] [[package]] name = "tracing-log" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0f8c7178e13481ff6765bd169b33e8d554c5d2bbede5e32c356194be02b9b9" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" dependencies = [ "lazy_static", "log", @@ -7930,9 +8127,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1fa8f0c8f4c594e4fc9debc1990deab13238077271ba84dd853d54902ee3401" +checksum = "8ab8966ac3ca27126141f7999361cc97dd6fb4b71da04c02044fa9045d98bb96" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -7942,7 +8139,7 @@ dependencies = [ "serde", "serde_json", "sharded-slab", - "smallvec 1.5.1", + "smallvec 1.6.1", "thread_local", "tracing", "tracing-core", @@ -7952,15 +8149,15 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.22.1" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e55f7ace33d6237e14137e386f4e1672e2a5c6bbc97fef9f438581a143971f0" +checksum = "ec051edf7f0fc9499a2cb0947652cab2148b9d7f61cee7605e312e9f970dacaf" dependencies = [ "hash-db", - "hashbrown 0.8.2", + "hashbrown", "log", "rustc-hex", - "smallvec 1.5.1", + "smallvec 1.6.1", ] [[package]] @@ -8045,9 +8242,9 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" dependencies = [ "tinyvec", ] @@ -8085,11 +8282,29 @@ name = "unsigned-varint" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" + +[[package]] +name = "unsigned-varint" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2" dependencies = [ - "bytes 0.5.6", + "asynchronous-codec 0.5.0", + "bytes 1.0.1", + "futures-io", + "futures-util", +] + +[[package]] +name = "unsigned-varint" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f8d425fafb8cd76bc3f22aace4af471d3156301d7508f2107e98fbeae10bc7f" +dependencies = [ + "asynchronous-codec 0.6.0", + "bytes 1.0.1", "futures-io", "futures-util", - "futures_codec", ] [[package]] @@ -8111,16 +8326,25 @@ dependencies = [ [[package]] name = "url" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" +checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" dependencies = [ "form_urlencoded", - "idna 0.2.0", + "idna 0.2.2", "matches", "percent-encoding 2.1.0", ] +[[package]] +name = "value-bag" +version = "1.0.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1" +dependencies = [ + "ctor", +] + [[package]] name = "vcpkg" version = "0.2.11" @@ -8163,7 +8387,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" dependencies = [ - "futures 0.1.30", + "futures 0.1.31", "log", "try-lock", ] @@ -8192,9 +8416,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.69" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" +checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -8202,9 +8426,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.69" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" +checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" dependencies = [ "bumpalo", "lazy_static", @@ -8217,9 +8441,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.19" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe9756085a84584ee9457a002b7cdfe0bfff169f45d2591d8be1345a6780e35" +checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -8229,9 +8453,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.69" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" +checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8239,9 +8463,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.69" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" +checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" dependencies = [ "proc-macro2", "quote", @@ -8252,9 +8476,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.69" +version = "0.2.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" +checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" [[package]] name = "wasm-timer" @@ -8262,7 +8486,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "js-sys", "parking_lot 0.11.1", "pin-utils", @@ -8296,33 +8520,31 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" - -[[package]] -name = "wasmparser" -version = "0.59.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" +checksum = "89a30c99437829ede826802bfcf28500cf58df00e66cb9114df98813bc145ff1" [[package]] name = "wasmtime" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd3c4f449382779ef6e0a7c3ec6752ae614e20a42e4100000c3efdc973100e2" +checksum = "7426055cb92bd9a1e9469b48154d8d6119cd8c498c8b70284e420342c05dc45d" dependencies = [ "anyhow", "backtrace", - "cfg-if 0.1.10", - "lazy_static", + "bincode", + "cfg-if 1.0.0", + "cpp_demangle", + "indexmap", "libc", "log", "region", "rustc-demangle", - "smallvec 1.5.1", + "serde", + "smallvec 1.6.1", "target-lexicon", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cache", "wasmtime-environ", "wasmtime-jit", "wasmtime-profiling", @@ -8331,74 +8553,101 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "wasmtime-cache" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c01d9287e36921e46f5887a47007824ae5dbb9b7517a2d565660ab4471478709" +dependencies = [ + "anyhow", + "base64 0.13.0", + "bincode", + "directories-next", + "errno", + "file-per-thread-logger", + "libc", + "log", + "serde", + "sha2 0.9.3", + "toml", + "winapi 0.3.9", + "zstd", +] + +[[package]] +name = "wasmtime-cranelift" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4134ed3a4316cd0de0e546c6004850afe472b0fa3fcdc2f2c15f8d449562d962" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-wasm", + "wasmtime-environ", +] + [[package]] name = "wasmtime-debug" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e634af9067a3af6cf2c7d33dc3b84767ddaf5d010ba68e80eecbcea73d4a349" +checksum = "e91fa931df6dd8af2b02606307674d3bad23f55473d5f4c809dddf7e4c4dc411" dependencies = [ "anyhow", - "gimli 0.21.0", + "gimli", "more-asserts", - "object 0.20.0", + "object 0.22.0", "target-lexicon", "thiserror", - "wasmparser 0.59.0", + "wasmparser", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f85619a94ee4034bd5bb87fc3dcf71fd2237b81c840809da1201061eec9ab3" +checksum = "a1098871dc3120aaf8190d79153e470658bb79f63ee9ca31716711e123c28220" dependencies = [ "anyhow", - "base64 0.12.3", - "bincode", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cranelift-codegen", "cranelift-entity", - "cranelift-frontend", "cranelift-wasm", - "directories 2.0.2", - "errno", - "file-per-thread-logger", + "gimli", "indexmap", - "libc", "log", "more-asserts", - "rayon", "serde", - "sha2 0.8.2", "thiserror", - "toml", - "wasmparser 0.59.0", - "winapi 0.3.9", - "zstd", + "wasmparser", ] [[package]] name = "wasmtime-jit" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e914c013c7a9f15f4e429d5431f2830fb8adb56e40567661b69c5ec1d645be23" +checksum = "738bfcd1561ede8bb174215776fd7d9a95d5f0a47ca3deabe0282c55f9a89f68" dependencies = [ + "addr2line", "anyhow", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.21.0", + "gimli", "log", "more-asserts", - "object 0.20.0", + "object 0.22.0", + "rayon", "region", + "serde", "target-lexicon", "thiserror", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cranelift", "wasmtime-debug", "wasmtime-environ", "wasmtime-obj", @@ -8409,13 +8658,13 @@ dependencies = [ [[package]] name = "wasmtime-obj" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e81d8e02e9bc9fe2da9b6d48bbc217f96e089f7df613f11a28a3958abc44641e" +checksum = "3e96d77f1801131c5e86d93e42a3cf8a35402107332c202c245c83f34888a906" dependencies = [ "anyhow", "more-asserts", - "object 0.20.0", + "object 0.22.0", "target-lexicon", "wasmtime-debug", "wasmtime-environ", @@ -8423,16 +8672,16 @@ dependencies = [ [[package]] name = "wasmtime-profiling" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8d4d1af8dd5f7096cfcc89dd668d358e52980c38cce199643372ffd6590e27" +checksum = "60bb672c9d894776d7b9250dd9b4fe890f8760201ee4f53e5f2da772b6c4debb" dependencies = [ "anyhow", - "cfg-if 0.1.10", - "gimli 0.21.0", + "cfg-if 1.0.0", + "gimli", "lazy_static", "libc", - "object 0.19.0", + "object 0.22.0", "scroll", "serde", "target-lexicon", @@ -8442,19 +8691,20 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a25f140bbbaadb07c531cba99ce1a966dba216138dc1b2a0ddecec851a01a93" +checksum = "a978086740949eeedfefcee667b57a9e98d9a7fc0de382fcfa0da30369e3530d" dependencies = [ "backtrace", "cc", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "indexmap", "lazy_static", "libc", "log", - "memoffset 0.5.6", + "memoffset 0.6.1", "more-asserts", + "psm", "region", "thiserror", "wasmtime-environ", @@ -8463,27 +8713,27 @@ dependencies = [ [[package]] name = "wast" -version = "30.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b79907b22f740634810e882d8d1d9d0f9563095a8ab94e786e370242bff5cd2" +checksum = "db5ae96da18bb5926341516fd409b5a8ce4e4714da7f0a1063d3b20ac9f9a1e1" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.31" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8279a02835bf12e61ed2b3c3cbc6ecf9918762fd97e036917c11a09ec20ca44" +checksum = "0b0fa059022c5dabe129f02b429d67086400deb8277f89c975555dacc1dadbcc" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.46" +version = "0.3.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" +checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b" dependencies = [ "js-sys", "wasm-bindgen", @@ -8526,6 +8776,16 @@ dependencies = [ "libc", ] +[[package]] +name = "which" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +dependencies = [ + "libc", + "thiserror", +] + [[package]] name = "winapi" version = "0.2.8" @@ -8579,24 +8839,30 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + [[package]] name = "x25519-dalek" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" dependencies = [ - "curve25519-dalek 3.0.0", + "curve25519-dalek 3.0.2", "rand_core 0.5.1", "zeroize", ] [[package]] name = "yamux" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aeb8c4043cac71c3c299dff107171c220d179492350ea198e109a414981b83c" +checksum = "1cc7bd8c983209ed5d527f44b01c41b7dc146fd960c61cf9e1d25399841dc271" dependencies = [ - "futures 0.3.8", + "futures 0.3.13", "log", "nohash-hasher", "parking_lot 0.11.1", @@ -8652,6 +8918,6 @@ checksum = "a1e6e8778706838f43f771d80d37787cb2fe06dafe89dd3aebaf6721b9eaec81" dependencies = [ "cc", "glob", - "itertools 0.9.0", + "itertools", "libc", ] diff --git a/Cargo.toml b/Cargo.toml index f653c612b..88f071c82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,85 +1,86 @@ [patch.crates-io] -frame-benchmarking = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -frame-benchmarking-cli = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -frame-executive = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -frame-support = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -frame-system = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -frame-system-benchmarking = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -frame-system-rpc-runtime-api = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-balances = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-grandpa = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-randomness-collective-flip = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-sudo = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-timestamp = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-tips = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-transaction-payment-rpc = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-transaction-payment-rpc-runtime-api = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-basic-authorship = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-chain-spec = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-cli = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-client-api = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-client-db = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-consensus = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-consensus-epochs = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-executor = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-finality-grandpa = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-informant = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-keystore = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-network = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-offchain = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-rpc = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-rpc-api = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-service = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-telemetry = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-transaction-pool = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-api = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-application-crypto = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-arithmetic = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-block-builder = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-blockchain = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-consensus = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-core = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-externalities = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-finality-grandpa = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-inherents = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-io = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-offchain = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-rpc = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-runtime = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-runtime-interface = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-session = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-staking = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-state-machine = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-std = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-storage = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-timestamp = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-tracing = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-transaction-pool = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-trie = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-version = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -substrate-frame-rpc-system = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} +frame-benchmarking = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +frame-benchmarking-cli = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +frame-executive = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +frame-support = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +frame-system = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +frame-system-benchmarking = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +frame-system-rpc-runtime-api = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-balances = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-grandpa = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-election-provider-multi-phase = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-randomness-collective-flip = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-sudo = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-timestamp = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-tips = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-transaction-payment-rpc = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-transaction-payment-rpc-runtime-api = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-basic-authorship = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-chain-spec = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-cli = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-client-api = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-client-db = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-consensus = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-consensus-epochs = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-executor = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-finality-grandpa = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-informant = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-keystore = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-network = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-offchain = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-rpc = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-rpc-api = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-service = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-telemetry = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-transaction-pool = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-api = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-application-crypto = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-arithmetic = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-block-builder = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-blockchain = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-consensus = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-core = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-externalities = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-finality-grandpa = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-inherents = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-io = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-offchain = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-rpc = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-runtime = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-runtime-interface = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-session = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-staking = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-state-machine = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-std = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-storage = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-timestamp = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-tracing = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-transaction-pool = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-trie = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-version = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +substrate-frame-rpc-system = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} -pallet-transaction-payment = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} +pallet-transaction-payment = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} #staking -pallet-authority-discovery = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-authorship = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-babe = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-collective = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-elections-phragmen = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-im-online = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-offences = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-session = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-staking = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-staking-reward-curve = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -pallet-treasury = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-authority-discovery = {git = "https://github.com/galacticcouncil/substrate.git", branch = 'ss58'} -sc-consensus-babe = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-consensus-babe-rpc = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sc-consensus-slots = {git = "https://github.com/galacticcouncil/substrate.git", branch = 'ss58'} -sp-authority-discovery = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-consensus-babe = {git = 'https://github.com/galacticcouncil/substrate', branch = 'ss58'} -sp-keystore = {git = "https://github.com/galacticcouncil/substrate.git", branch = 'ss58'} +pallet-authority-discovery = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-authorship = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-babe = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-collective = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-elections-phragmen = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-im-online = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-offences = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-session = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-staking = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-staking-reward-curve = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +pallet-treasury = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-authority-discovery = {git = "https://github.com/paritytech/substrate.git", rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-consensus-babe = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-consensus-babe-rpc = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sc-consensus-slots = {git = "https://github.com/paritytech/substrate.git", rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-authority-discovery = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-consensus-babe = {git = 'https://github.com/paritytech/substrate', rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} +sp-keystore = {git = "https://github.com/paritytech/substrate.git", rev = 'e84d2ae4e519d77f59ef68c8efd48909a70d58e8'} # ORML dependencies orml-currencies = {git = 'https://github.com/open-web3-stack/open-runtime-module-library', branch = 'master'} diff --git a/node/Cargo.toml b/node/Cargo.toml index aa7393e3b..2847cb62f 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -7,7 +7,7 @@ homepage = 'https://github.com/galacticcouncil/hydradx-node' license = 'Unlicense' name = 'hydra-dx' repository = 'https://github.com/galacticcouncil/hydradx-node' -version = '2.0.0' +version = '3.0.0' [[bin]] name = 'hydra-dx' @@ -24,50 +24,50 @@ serde_json = "1.0.61" structopt = '0.3.8' # local dependencies -hydra-dx-runtime = {path = '../runtime', version = '2.0.0'} -module-amm-rpc = {path = '../pallets/amm/rpc', version = '2.0.0'} -primitives = {path = '../primitives', version = '2.0.0'} +hydra-dx-runtime = {path = '../runtime'} +module-amm-rpc = {path = '../pallets/amm/rpc'} +primitives = {path = '../primitives'} # Substrate dependencies -frame-benchmarking = '2.0.0' -frame-benchmarking-cli = {version = '2.0.0', optional = true} +frame-benchmarking = '3.0.0' +frame-benchmarking-cli = {version = '3.0.0', optional = true} futures = '0.3.4' hex-literal = "0.3.1" -pallet-im-online = "2.0.0" -pallet-staking = '2.0.0' -pallet-transaction-payment-rpc = '2.0.0' -sc-authority-discovery = '0.8.0' -sc-basic-authorship = '0.8.0' -sc-cli = {features = ['wasmtime'], version = '0.8.0'} -sc-client-api = '2.0.0' -sc-consensus = '0.8.0' -sc-consensus-babe = '0.8.0' -sc-consensus-babe-rpc = '0.8.0' -sc-consensus-epochs = '0.8.0' -sc-consensus-slots = '0.8.0' -sc-executor = {features = ['wasmtime'], version = '0.8.0'} -sc-finality-grandpa = '=0.8.0' -sc-finality-grandpa-rpc = '=0.8.0' -sc-keystore = '2.0.0' -sc-network = '0.8.0' -sc-rpc = '2.0.0' -sc-rpc-api = '0.8.0' -sc-service = '0.8.0' -sc-telemetry = '2.0.0' -sc-transaction-pool = '2.0.0' -sp-api = '2.0.0' -sp-authority-discovery = '2.0.0' -sp-block-builder = '2.0.0' -sp-blockchain = '2.0.0' -sp-consensus = '0.8.0' -sp-consensus-babe = '0.8.0' -sp-core = '=2.0.0' -sp-finality-grandpa = '2.0.0' -sp-inherents = '2.0.0' -sp-keystore = '0.8.0' -sp-runtime = '2.0.0' -sp-transaction-pool = '2.0.0' -substrate-frame-rpc-system = '2.0.0' +pallet-im-online = "3.0.0" +pallet-staking = '3.0.0' +pallet-transaction-payment-rpc = '3.0.0' +sc-authority-discovery = '0.9.0' +sc-basic-authorship = '0.9.0' +sc-cli = {features = ['wasmtime'], version = '0.9.0'} +sc-client-api = '3.0.0' +sc-consensus = '0.9.0' +sc-consensus-babe = '0.9.0' +sc-consensus-babe-rpc = '0.9.0' +sc-consensus-epochs = '0.9.0' +sc-consensus-slots = '0.9.0' +sc-executor = {features = ['wasmtime'], version = '0.9.0'} +sc-finality-grandpa = '=0.9.0' +sc-finality-grandpa-rpc = '=0.9.0' +sc-keystore = '3.0.0' +sc-network = '0.9.0' +sc-rpc = '3.0.0' +sc-rpc-api = '0.9.0' +sc-service = '0.9.0' +sc-telemetry = '3.0.0' +sc-transaction-pool = '3.0.0' +sp-api = '3.0.0' +sp-authority-discovery = '3.0.0' +sp-block-builder = '3.0.0' +sp-blockchain = '3.0.0' +sp-consensus = '0.9.0' +sp-consensus-babe = '0.9.0' +sp-core = '=3.0.0' +sp-finality-grandpa = '3.0.0' +sp-inherents = '3.0.0' +sp-keystore = '0.9.0' +sp-runtime = '3.0.0' +sp-transaction-pool = '3.0.0' +substrate-frame-rpc-system = '3.0.0' [features] default = [ diff --git a/node/src/command.rs b/node/src/command.rs index 4bd75b3e4..443eb7e2e 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -152,6 +152,7 @@ pub fn run() -> sc_cli::Result<()> { Role::Light => service::new_light(config), _ => service::new_full(config).map(|(task_manager, _, _, _, _, _)| task_manager), } + .map_err(sc_cli::Error::Service) }) } } diff --git a/node/src/service.rs b/node/src/service.rs index e254765cc..383c94655 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -59,6 +59,7 @@ pub fn new_partial( let transaction_pool = sc_transaction_pool::BasicPool::new_full( config.transaction_pool.clone(), + config.role.is_authority().into(), config.prometheus_registry(), task_manager.spawn_handle(), client.clone(), @@ -80,7 +81,7 @@ pub fn new_partial( client.clone(), select_chain.clone(), inherent_data_providers.clone(), - &task_manager.spawn_handle(), + &task_manager.spawn_essential_handle(), config.prometheus_registry(), sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), )?; @@ -93,7 +94,8 @@ pub fn new_partial( let justification_stream = grandpa_link.justification_stream(); let shared_authority_set = grandpa_link.shared_authority_set().clone(); let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty(); - let finality_proof_provider = GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone()); + let finality_proof_provider = + GrandpaFinalityProofProvider::new_for_service(backend.clone(), Some(shared_authority_set.clone())); let rpc_setup = shared_voter_state.clone(); @@ -176,8 +178,8 @@ pub fn new_full( config .network - .notifications_protocols - .push(sc_finality_grandpa::GRANDPA_PROTOCOL_NAME.into()); + .extra_sets + .push(sc_finality_grandpa::grandpa_peers_set_config()); let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { @@ -205,9 +207,8 @@ pub fn new_full( let name = config.network.node_name.clone(); let enable_grandpa = !config.disable_grandpa; let prometheus_registry = config.prometheus_registry().cloned(); - let telemetry_connection_sinks = sc_service::TelemetryConnectionSinks::default(); - sc_service::spawn_tasks(sc_service::SpawnTasksParams { + let (_rpc_handlers, telemetry_connection_notifier) = sc_service::spawn_tasks(sc_service::SpawnTasksParams { config, backend: backend, client: client.clone(), @@ -218,9 +219,9 @@ pub fn new_full( task_manager: &mut task_manager, on_demand: None, remote_blockchain: None, - telemetry_connection_sinks: telemetry_connection_sinks.clone(), network_status_sinks: network_status_sinks.clone(), system_rpc_tx, + telemetry_span: None })?; let (block_import, grandpa_link, babe_link) = import_setup; @@ -301,7 +302,7 @@ pub fn new_full( name: Some(name), observer_enabled: false, keystore, - is_authority: role.is_network_authority(), + is_authority: role.is_authority(), }; if enable_grandpa { @@ -315,7 +316,7 @@ pub fn new_full( config: grandpa_config, link: grandpa_link, network: network.clone(), - telemetry_on_connect: Some(telemetry_connection_sinks.on_connect_stream()), + telemetry_on_connect: telemetry_connection_notifier.map(|x| x.on_connect_stream()), voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), prometheus_registry: prometheus_registry, shared_voter_state, @@ -371,7 +372,7 @@ pub fn new_light(config: Configuration) -> Result { client.clone(), select_chain, InherentDataProviders::new(), - &task_manager.spawn_handle(), + &task_manager.spawn_essential_handle(), config.prometheus_registry(), sp_consensus::NeverCanAuthor, )?; @@ -403,7 +404,6 @@ pub fn new_light(config: Configuration) -> Result { task_manager: &mut task_manager, on_demand: Some(on_demand), rpc_extensions_builder: Box::new(|_, _| ()), - telemetry_connection_sinks: sc_service::TelemetryConnectionSinks::default(), config, client, keystore: keystore_container.sync_keystore(), @@ -411,6 +411,7 @@ pub fn new_light(config: Configuration) -> Result { network, network_status_sinks, system_rpc_tx, + telemetry_span: None })?; network_starter.start_network(); diff --git a/pallets/amm/Cargo.toml b/pallets/amm/Cargo.toml index db25edb5d..059f03352 100644 --- a/pallets/amm/Cargo.toml +++ b/pallets/amm/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://github.com/galacticcouncil/hydradx-node' license = 'Unlicense' name = 'pallet-amm' repository = 'https://github.com/galacticcouncil/hydradx-node' -version = '2.1.0' +version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -19,7 +19,7 @@ wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0 default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] primitive-types = {default-features = false, version = '0.8.0'} @@ -28,25 +28,25 @@ serde = {features = ['derive'], optional = true, version = '1.0.101'} hydra-dx-math = {default-features = false, version = "1.0.0", git = "https://github.com/galacticcouncil/hydraDX-math", tag="v1.0.0"} # Local dependencies -pallet-asset-registry = {path = '../asset-registry', default-features = false, version = '2.0.0'} -primitives = {path = '../../primitives', default-features = false, version = '2.0.0'} +pallet-asset-registry = {path = '../asset-registry', default-features = false} +primitives = {path = '../../primitives', default-features = false} # ORML dependencies -orml-tokens = {default-features = false, version = "0.3.3-dev"} -orml-traits = {default-features = false, version = "0.3.3-dev"} -orml-utilities = {default-features = false, version = "0.3.3-dev"} +orml-tokens = {default-features = false, version = "0.4.1-dev"} +orml-traits = {default-features = false, version = "0.4.1-dev"} +orml-utilities = {default-features = false, version = "0.4.1-dev"} # Substrate dependencies -frame-benchmarking = {default-features = false, optional = true, version = '2.0.0'} -frame-support = {default-features = false, version = '2.0.0'} -frame-system = {default-features = false, version = '2.0.0'} -frame-system-benchmarking = {default-features = false, optional = true, version = '2.0.0'} -sp-core = {default-features = false, version = '2.0.0'} -sp-runtime = {default-features = false, version = '2.0.0'} -sp-std = {default-features = false, version = '2.0.0'} +frame-benchmarking = {default-features = false, optional = true, version = '3.0.0'} +frame-support = {default-features = false, version = '3.0.0'} +frame-system = {default-features = false, version = '3.0.0'} +frame-system-benchmarking = {default-features = false, optional = true, version = '3.0.0'} +sp-core = {default-features = false, version = '3.0.0'} +sp-runtime = {default-features = false, version = '3.0.0'} +sp-std = {default-features = false, version = '3.0.0'} [dev-dependencies] -sp-io = {default-features = false, version = '2.0.0'} +sp-io = {default-features = false, version = '3.0.0'} [features] default = ['std'] @@ -56,6 +56,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", ] std = [ + 'serde', 'codec/std', 'frame-support/std', 'frame-system/std', diff --git a/pallets/amm/rpc/Cargo.toml b/pallets/amm/rpc/Cargo.toml index bc4bc4060..0b519889a 100644 --- a/pallets/amm/rpc/Cargo.toml +++ b/pallets/amm/rpc/Cargo.toml @@ -2,13 +2,12 @@ authors = ['GalacticCouncil'] edition = "2018" name = "module-amm-rpc" -version = '2.0.0' +version = '3.0.0' [dependencies.module-amm-rpc-runtime-api] default-features = false package = 'module-amm-rpc-runtime-api' path = 'runtime-api' -version = '2.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -21,7 +20,7 @@ wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0 default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] jsonrpc-core = {default-features = false, version = '15.0.0'} @@ -30,10 +29,10 @@ jsonrpc-derive = {default-features = false, version = '15.0.0'} serde = {features = ['derive'], optional = true, version = '1.0.101'} # Substrate dependencies -sp-api = {default-features = false, version = '2.0.0'} -sp-blockchain = {default-features = false, version = '2.0.0'} -sp-runtime = {default-features = false, version = '2.0.0'} -sp-std = {default-features = false, version = '2.0.0'} +sp-api = {default-features = false, version = '3.0.0'} +sp-blockchain = {default-features = false, version = '3.0.0'} +sp-runtime = {default-features = false, version = '3.0.0'} +sp-std = {default-features = false, version = '3.0.0'} [features] default = ['std'] diff --git a/pallets/amm/rpc/runtime-api/Cargo.toml b/pallets/amm/rpc/runtime-api/Cargo.toml index 8ec03c364..c5a1fb55c 100644 --- a/pallets/amm/rpc/runtime-api/Cargo.toml +++ b/pallets/amm/rpc/runtime-api/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ['GalacticCouncil'] name = "module-amm-rpc-runtime-api" -version = '2.0.0' +version = '3.0.0' edition = "2018" [package.metadata.docs.rs] @@ -15,15 +15,15 @@ wasm-builder-runner = { package = 'substrate-wasm-builder-runner', version = '1. default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] serde = { features = ['derive'], optional = true, version = '1.0.101' } # Substrate dependencies -sp-std = { default-features = false, version = '2.0.0' } -sp-api = { default-features = false, version = '2.0.0' } -sp-runtime = { default-features = false, version = '2.0.0' } +sp-std = { default-features = false, version = '3.0.0' } +sp-api = { default-features = false, version = '3.0.0' } +sp-runtime = { default-features = false, version = '3.0.0' } [features] default = ["std"] diff --git a/pallets/amm/rpc/runtime-api/src/lib.rs b/pallets/amm/rpc/runtime-api/src/lib.rs index 8ee182405..d4d9e73a7 100644 --- a/pallets/amm/rpc/runtime-api/src/lib.rs +++ b/pallets/amm/rpc/runtime-api/src/lib.rs @@ -4,6 +4,7 @@ // The `too_many_arguments` warning originates from `decl_runtime_apis` macro. #![allow(clippy::too_many_arguments)] #![allow(clippy::unnecessary_mut_passed)] +#![allow(clippy::upper_case_acronyms)] use codec::{Codec, Decode, Encode}; #[cfg(feature = "std")] diff --git a/pallets/amm/rpc/src/lib.rs b/pallets/amm/rpc/src/lib.rs index 6b1478302..a13adfde5 100644 --- a/pallets/amm/rpc/src/lib.rs +++ b/pallets/amm/rpc/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(clippy::upper_case_acronyms)] + use codec::Codec; use jsonrpc_core::{Error as RpcError, ErrorCode, Result}; use jsonrpc_derive::rpc; diff --git a/pallets/amm/src/benchmarking.rs b/pallets/amm/src/benchmarking.rs index 00b9153fd..3046a6747 100644 --- a/pallets/amm/src/benchmarking.rs +++ b/pallets/amm/src/benchmarking.rs @@ -20,8 +20,8 @@ use super::*; use frame_benchmarking::{account, benchmarks}; +use frame_system::RawOrigin; use sp_std::prelude::*; -use system::RawOrigin; use crate::Module as AMM; @@ -37,9 +37,6 @@ fn funded_account(name: &'static str, index: u32) -> T::AccountId { } benchmarks! { - _ { - } - create_pool { let caller = funded_account::("caller", 0); diff --git a/pallets/amm/src/lib.rs b/pallets/amm/src/lib.rs index 6db3d1157..041978f10 100644 --- a/pallets/amm/src/lib.rs +++ b/pallets/amm/src/lib.rs @@ -1,13 +1,14 @@ #![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::unused_unit)] +#![allow(clippy::upper_case_acronyms)] + use frame_support::sp_runtime::{ traits::{Hash, Zero}, DispatchError, FixedPointNumber, }; -use frame_support::{ - decl_error, decl_event, decl_module, decl_storage, dispatch, dispatch::DispatchResult, ensure, traits::Get, -}; -use frame_system::{self as system, ensure_signed}; +use frame_support::{dispatch::DispatchResult, ensure, traits::Get, transactional}; +use frame_system::ensure_signed; use primitives::{asset::AssetPair, fee, traits::AMM, AssetId, Balance, Price, MAX_IN_RATIO, MAX_OUT_RATIO}; use sp_std::{marker::PhantomData, vec, vec::Vec}; @@ -22,104 +23,52 @@ use orml_utilities::with_transaction_result; #[cfg(test)] mod mock; -mod benchmarking; #[cfg(test)] mod tests; +mod benchmarking; + pub mod weights; use weights::WeightInfo; -/// The pallet's configuration trait. -pub trait Config: frame_system::Config + pallet_asset_registry::Config { - type Event: From> + Into<::Event>; - - /// Share token support - type AssetPairAccountId: AssetPairAccountIdFor; +// Re-export pallet items so that they can be accessed from the crate namespace. +pub use pallet::*; - /// Multi currency for transfer of currencies - type Currency: MultiCurrencyExtended; +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::OriginFor; - /// Native Asset Id - type HDXAssetId: Get; + #[pallet::pallet] + pub struct Pallet(_); - /// Weight information for the extrinsics. - type WeightInfo: WeightInfo; + #[pallet::hooks] + impl Hooks for Pallet {} - /// Trading fee rate - type GetExchangeFee: Get; -} + #[pallet::config] + pub trait Config: frame_system::Config + pallet_asset_registry::Config { + type Event: From> + IsType<::Event>; -pub trait AssetPairAccountIdFor { - fn from_assets(asset_a: AssetId, asset_b: AssetId) -> AccountId; -} + /// Share token support + type AssetPairAccountId: AssetPairAccountIdFor; -pub struct AssetPairAccountId(PhantomData); + /// Multi currency for transfer of currencies + type Currency: MultiCurrencyExtended; -impl AssetPairAccountIdFor for AssetPairAccountId -where - T::AccountId: UncheckedFrom + AsRef<[u8]>, -{ - fn from_assets(asset_a: AssetId, asset_b: AssetId) -> T::AccountId { - let mut buf = Vec::new(); - buf.extend_from_slice(b"hydradx"); - if asset_a < asset_b { - buf.extend_from_slice(&asset_a.to_le_bytes()); - buf.extend_from_slice(&asset_b.to_le_bytes()); - } else { - buf.extend_from_slice(&asset_b.to_le_bytes()); - buf.extend_from_slice(&asset_a.to_le_bytes()); - } - T::AccountId::unchecked_from(T::Hashing::hash(&buf[..])) - } -} + /// Native Asset Id + type HDXAssetId: Get; -// This pallet's storage items. -decl_storage! { - trait Store for Module as AMM { - /// Asset id storage for each shared token - ShareToken get(fn share_token): map hasher(blake2_128_concat) T::AccountId => AssetId; + /// Weight information for the extrinsics. + type WeightInfo: WeightInfo; - /// Total liquidity for shared token - TotalLiquidity get(fn total_liquidity): map hasher(blake2_128_concat) T::AccountId => Balance; - - /// Assair pair for each shared token in the pool - PoolAssets get(fn pool_assets): map hasher(blake2_128_concat) T::AccountId => (AssetId, AssetId); + /// Trading fee rate + type GetExchangeFee: Get; } -} - -// The pallet's events -decl_event!( - pub enum Event - where - AccountId = ::AccountId, - AssetId = AssetId, - Balance = Balance, - { - /// AddLiquidity - /// who, asset_a, asset_b, amount_a, amount_b - AddLiquidity(AccountId, AssetId, AssetId, Balance, Balance), - /// who, asset_a, asset_b, shares - RemoveLiquidity(AccountId, AssetId, AssetId, Balance), - - /// Pool creation - who, asset a, asset b, liquidity - CreatePool(AccountId, AssetId, AssetId, Balance), - - /// Pool destroyed - who, asset a, asset b - PoolDestroyed(AccountId, AssetId, AssetId), - - /// Sell token - who, asset in, asset out, amount, sale price - Sell(AccountId, AssetId, AssetId, Balance, Balance), - - /// Buy token - who, asset out, asset in, amount, buy price - Buy(AccountId, AssetId, AssetId, Balance, Balance), - } -); - -// The pallet's errors -decl_error! { - pub enum Error for Module { + #[pallet::error] + pub enum Error { /// Create pool errors CannotCreatePoolWithSameAssets, CannotCreatePoolWithZeroLiquidity, @@ -136,7 +85,7 @@ decl_error! { AssetBalanceLimitExceeded, InsufficientAssetBalance, InsufficientPoolAssetBalance, // No tests - InsufficientHDXBalance, // No tests + InsufficientHDXBalance, // No tests /// Pool existence errors TokenPoolNotFound, @@ -145,60 +94,85 @@ decl_error! { /// Calculation errors AddAssetAmountInvalid, // no tests RemoveAssetAmountInvalid, // no tests - SellAssetAmountInvalid, // no tests - BuyAssetAmountInvalid, // no tests - FeeAmountInvalid, // no tests + SellAssetAmountInvalid, // no tests + BuyAssetAmountInvalid, // no tests + FeeAmountInvalid, // no tests CannotApplyDiscount, /// Trading Limit errors MaxOutRatioExceeded, MaxInRatioExceeded, } -} -// The pallet's dispatchable functions. -decl_module! { - /// The module declaration. - pub struct Module for enum Call where origin: T::Origin { - // Initializing errors - // this includes information about your errors in the node's metadata. - type Error = Error; + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { + /// AddLiquidity + /// who, asset_a, asset_b, amount_a, amount_b + AddLiquidity(T::AccountId, AssetId, AssetId, Balance, Balance), - // Initializing events - fn deposit_event() = default; + /// who, asset_a, asset_b, shares + RemoveLiquidity(T::AccountId, AssetId, AssetId, Balance), - #[weight = ::WeightInfo::create_pool()] + /// Pool creation - who, asset a, asset b, liquidity + CreatePool(T::AccountId, AssetId, AssetId, Balance), + + /// Pool destroyed - who, asset a, asset b + PoolDestroyed(T::AccountId, AssetId, AssetId), + + /// Sell token - who, asset in, asset out, amount, sale price + Sell(T::AccountId, AssetId, AssetId, Balance, Balance), + + /// Buy token - who, asset out, asset in, amount, buy price + Buy(T::AccountId, AssetId, AssetId, Balance, Balance), + } + + /// Asset id storage for each shared token + #[pallet::storage] + #[pallet::getter(fn share_token)] + pub type ShareToken = StorageMap<_, Blake2_128Concat, T::AccountId, AssetId, ValueQuery>; + + /// Total liquidity for shared token + #[pallet::storage] + #[pallet::getter(fn total_liquidity)] + pub type TotalLiquidity = StorageMap<_, Blake2_128Concat, T::AccountId, Balance, ValueQuery>; + + /// Assair pair for each shared token in the pool + #[pallet::storage] + #[pallet::getter(fn pool_assets)] + pub type PoolAssets = StorageMap<_, Blake2_128Concat, T::AccountId, (AssetId, AssetId), ValueQuery>; + + #[pallet::call] + impl Pallet { + #[pallet::weight(::WeightInfo::create_pool())] + #[transactional] pub fn create_pool( - origin, + origin: OriginFor, asset_a: AssetId, asset_b: AssetId, amount: Balance, - initial_price: Price - ) -> dispatch::DispatchResult { + initial_price: Price, + ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!( - !amount.is_zero(), - Error::::CannotCreatePoolWithZeroLiquidity - ); + ensure!(!amount.is_zero(), Error::::CannotCreatePoolWithZeroLiquidity); ensure!( !initial_price.is_zero(), Error::::CannotCreatePoolWithZeroInitialPrice ); - ensure!( - asset_a != asset_b, - Error::::CannotCreatePoolWithSameAssets - ); + ensure!(asset_a != asset_b, Error::::CannotCreatePoolWithSameAssets); - let asset_pair = AssetPair{asset_in: asset_a, asset_out: asset_b}; + let asset_pair = AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }; - ensure!( - !Self::exists(asset_pair), - Error::::TokenPoolAlreadyExists - ); + ensure!(!Self::exists(asset_pair), Error::::TokenPoolAlreadyExists); - let asset_b_amount = initial_price.checked_mul_int(amount).ok_or(Error::::CreatePoolAssetAmountInvalid)?; + let asset_b_amount = initial_price + .checked_mul_int(amount) + .ok_or(Error::::CreatePoolAssetAmountInvalid)?; let shares_added = if asset_a < asset_b { amount } else { asset_b_amount }; ensure!( @@ -215,51 +189,44 @@ decl_module! { let token_name = asset_pair.name(); - with_transaction_result(|| { - let share_token = >::get_or_create_asset(token_name)?.into(); + let share_token = >::get_or_create_asset(token_name)?.into(); - >::insert(&pair_account, &share_token); - >::insert(&pair_account, (asset_a, asset_b)); + >::insert(&pair_account, &share_token); + >::insert(&pair_account, (asset_a, asset_b)); - T::Currency::transfer(asset_a, &who, &pair_account, amount)?; - T::Currency::transfer(asset_b, &who, &pair_account, asset_b_amount)?; + T::Currency::transfer(asset_a, &who, &pair_account, amount)?; + T::Currency::transfer(asset_b, &who, &pair_account, asset_b_amount)?; - T::Currency::deposit(share_token, &who, shares_added)?; + T::Currency::deposit(share_token, &who, shares_added)?; - >::insert(&pair_account, shares_added); + >::insert(&pair_account, shares_added); - Self::deposit_event(RawEvent::CreatePool(who, asset_a, asset_b, shares_added)); + Self::deposit_event(Event::CreatePool(who, asset_a, asset_b, shares_added)); - Ok(()) - }) + Ok(().into()) } - #[weight = ::WeightInfo::add_liquidity()] + #[pallet::weight(::WeightInfo::add_liquidity())] + #[transactional] pub fn add_liquidity( - origin, + origin: OriginFor, asset_a: AssetId, asset_b: AssetId, amount_a: Balance, - amount_b_max_limit: Balance - ) -> dispatch::DispatchResult { + amount_b_max_limit: Balance, + ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - let asset_pair = AssetPair{asset_in: asset_a, asset_out: asset_b}; + let asset_pair = AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }; - ensure!( - Self::exists(asset_pair), - Error::::TokenPoolNotFound - ); + ensure!(Self::exists(asset_pair), Error::::TokenPoolNotFound); - ensure!( - !amount_a.is_zero(), - Error::::CannotAddZeroLiquidity - ); + ensure!(!amount_a.is_zero(), Error::::CannotAddZeroLiquidity); - ensure!( - !amount_b_max_limit.is_zero(), - Error::::CannotAddZeroLiquidity - ); + ensure!(!amount_b_max_limit.is_zero(), Error::::CannotAddZeroLiquidity); ensure!( T::Currency::free_balance(asset_a, &who) >= amount_a, @@ -280,9 +247,7 @@ decl_module! { let total_liquidity = Self::total_liquidity(&pair_account); let amount_b_required = hydra_dx_math::calculate_liquidity_in(asset_a_reserve, asset_b_reserve, amount_a) - .map_err(|_| { - Error::::AddAssetAmountInvalid - })?; + .map_err(|_| Error::::AddAssetAmountInvalid)?; let shares_added = if asset_a < asset_b { amount_a } else { amount_b_required }; @@ -291,12 +256,11 @@ decl_module! { Error::::AssetBalanceLimitExceeded ); - ensure!( - shares_added > Zero::zero(), - Error::::InvalidMintedLiquidity - ); + ensure!(shares_added > Zero::zero(), Error::::InvalidMintedLiquidity); - let liquidity_amount = total_liquidity.checked_add(shares_added).ok_or(Error::::InvalidLiquidityAmount)?; + let liquidity_amount = total_liquidity + .checked_add(shares_added) + .ok_or(Error::::InvalidLiquidityAmount)?; let asset_b_balance = T::Currency::free_balance(asset_b, &who); @@ -305,42 +269,36 @@ decl_module! { Error::::InsufficientAssetBalance ); - with_transaction_result(|| { - - T::Currency::transfer(asset_a, &who, &pair_account, amount_a)?; - T::Currency::transfer(asset_b, &who, &pair_account, amount_b_required)?; - - T::Currency::deposit(share_token, &who, shares_added)?; + T::Currency::transfer(asset_a, &who, &pair_account, amount_a)?; + T::Currency::transfer(asset_b, &who, &pair_account, amount_b_required)?; - >::insert(&pair_account, liquidity_amount); + T::Currency::deposit(share_token, &who, shares_added)?; - Self::deposit_event(RawEvent::AddLiquidity(who, asset_a, asset_b, amount_a, amount_b_required)); + >::insert(&pair_account, liquidity_amount); - Ok(()) + Self::deposit_event(Event::AddLiquidity(who, asset_a, asset_b, amount_a, amount_b_required)); - }) + Ok(().into()) } - #[weight = ::WeightInfo::remove_liquidity()] + #[pallet::weight(::WeightInfo::remove_liquidity())] + #[transactional] pub fn remove_liquidity( - origin, + origin: OriginFor, asset_a: AssetId, asset_b: AssetId, - liquidity_amount: Balance - ) -> dispatch::DispatchResult { + liquidity_amount: Balance, + ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - let asset_pair = AssetPair{asset_in: asset_a, asset_out: asset_b}; + let asset_pair = AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }; - ensure!( - !liquidity_amount.is_zero(), - Error::::CannotRemoveLiquidityWithZero - ); + ensure!(!liquidity_amount.is_zero(), Error::::CannotRemoveLiquidityWithZero); - ensure!( - Self::exists(asset_pair), - Error::::TokenPoolNotFound - ); + ensure!(Self::exists(asset_pair), Error::::TokenPoolNotFound); let pair_account = Self::get_pair_id(asset_pair); @@ -348,28 +306,25 @@ decl_module! { let total_shares = Self::total_liquidity(&pair_account); - ensure!( - total_shares >= liquidity_amount, - Error::::InsufficientAssetBalance - ); + ensure!(total_shares >= liquidity_amount, Error::::InsufficientAssetBalance); ensure!( T::Currency::free_balance(share_token, &who) >= liquidity_amount, Error::::InsufficientAssetBalance ); - ensure!( - !total_shares.is_zero(), - Error::::CannotRemoveLiquidityWithZero - ); + ensure!(!total_shares.is_zero(), Error::::CannotRemoveLiquidityWithZero); let asset_a_reserve = T::Currency::free_balance(asset_a, &pair_account); let asset_b_reserve = T::Currency::free_balance(asset_b, &pair_account); - let liquidity_out = hydra_dx_math::calculate_liquidity_out(asset_a_reserve, asset_b_reserve, liquidity_amount, total_shares) - .map_err(|_| { - Error::::RemoveAssetAmountInvalid - })?; + let liquidity_out = hydra_dx_math::calculate_liquidity_out( + asset_a_reserve, + asset_b_reserve, + liquidity_amount, + total_shares, + ) + .map_err(|_| Error::::RemoveAssetAmountInvalid)?; let (remove_amount_a, remove_amount_b) = liquidity_out; @@ -382,60 +337,88 @@ decl_module! { Error::::InsufficientPoolAssetBalance ); - let liquidity_left = total_shares.checked_sub(liquidity_amount).ok_or(Error::::InvalidLiquidityAmount)?; + let liquidity_left = total_shares + .checked_sub(liquidity_amount) + .ok_or(Error::::InvalidLiquidityAmount)?; - with_transaction_result( || { - T::Currency::transfer(asset_a, &pair_account, &who, remove_amount_a)?; - T::Currency::transfer(asset_b, &pair_account, &who, remove_amount_b)?; + T::Currency::transfer(asset_a, &pair_account, &who, remove_amount_a)?; + T::Currency::transfer(asset_b, &pair_account, &who, remove_amount_b)?; - T::Currency::withdraw(share_token, &who, liquidity_amount)?; + T::Currency::withdraw(share_token, &who, liquidity_amount)?; - >::insert(&pair_account, liquidity_left); + >::insert(&pair_account, liquidity_left); - Self::deposit_event(RawEvent::RemoveLiquidity(who.clone(), asset_a, asset_b, liquidity_amount)); + Self::deposit_event(Event::RemoveLiquidity(who.clone(), asset_a, asset_b, liquidity_amount)); - if liquidity_left == 0 { - >::remove(&pair_account); - >::remove(&pair_account); + if liquidity_left == 0 { + >::remove(&pair_account); + >::remove(&pair_account); - Self::deposit_event(RawEvent::PoolDestroyed(who, asset_a, asset_b)); - } + Self::deposit_event(Event::PoolDestroyed(who, asset_a, asset_b)); + } - Ok(()) - }) + Ok(().into()) } - #[weight = ::WeightInfo::sell()] + #[pallet::weight(::WeightInfo::sell())] pub fn sell( - origin, + origin: OriginFor, asset_in: AssetId, asset_out: AssetId, amount: Balance, max_limit: Balance, discount: bool, - ) -> dispatch::DispatchResult { + ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - >::sell(&who, AssetPair{asset_in, asset_out}, amount, max_limit, discount) + >::sell(&who, AssetPair { asset_in, asset_out }, amount, max_limit, discount)?; + + Ok(().into()) } - #[weight = ::WeightInfo::buy()] + #[pallet::weight(::WeightInfo::buy())] pub fn buy( - origin, + origin: OriginFor, asset_out: AssetId, asset_in: AssetId, amount: Balance, max_limit: Balance, discount: bool, - ) -> dispatch::DispatchResult { + ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - >::buy(&who, AssetPair{asset_in, asset_out}, amount, max_limit, discount) + >::buy(&who, AssetPair { asset_in, asset_out }, amount, max_limit, discount)?; + + Ok(().into()) } } } -impl Module { +pub trait AssetPairAccountIdFor { + fn from_assets(asset_a: AssetId, asset_b: AssetId) -> AccountId; +} + +pub struct AssetPairAccountId(PhantomData); + +impl AssetPairAccountIdFor for AssetPairAccountId +where + T::AccountId: UncheckedFrom + AsRef<[u8]>, +{ + fn from_assets(asset_a: AssetId, asset_b: AssetId) -> T::AccountId { + let mut buf = Vec::new(); + buf.extend_from_slice(b"hydradx"); + if asset_a < asset_b { + buf.extend_from_slice(&asset_a.to_le_bytes()); + buf.extend_from_slice(&asset_b.to_le_bytes()); + } else { + buf.extend_from_slice(&asset_b.to_le_bytes()); + buf.extend_from_slice(&asset_a.to_le_bytes()); + } + T::AccountId::unchecked_from(T::Hashing::hash(&buf[..])) + } +} + +impl Pallet { pub fn get_pool_balances(pool_address: T::AccountId) -> Option> { let mut balances = Vec::new(); @@ -467,7 +450,7 @@ impl Module { } } -impl AMM for Module { +impl AMM for Pallet { fn exists(assets: AssetPair) -> bool { let pair_account = T::AssetPairAccountId::from_assets(assets.asset_in, assets.asset_out); >::contains_key(&pair_account) diff --git a/pallets/amm/src/mock.rs b/pallets/amm/src/mock.rs index 6e1826fba..df55b9450 100644 --- a/pallets/amm/src/mock.rs +++ b/pallets/amm/src/mock.rs @@ -1,8 +1,8 @@ // Creating mock runtime here -use super::*; -use crate::{AssetPairAccountIdFor, Config, Module}; -use frame_support::{impl_outer_event, impl_outer_origin, parameter_types}; +use crate as amm; +use crate::{AssetPairAccountIdFor, Config}; +use frame_support::parameter_types; use frame_system as system; use orml_traits::parameter_type_with_key; use sp_core::H256; @@ -11,8 +11,10 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup, Zero}, }; +use frame_support::traits::GenesisBuild; use primitives::{fee, AssetId, Balance}; +pub type Amount = i128; pub type AccountId = u64; pub const ALICE: AccountId = 1; @@ -22,32 +24,27 @@ pub const HDX: AssetId = 1000; pub const DOT: AssetId = 2000; pub const ACA: AssetId = 3000; -mod amm { - pub use super::super::*; -} +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; -impl_outer_event! { - pub enum TestEvent for Test{ - system, - amm, - orml_tokens, - } -} +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + AMM: amm::{Module, Call, Storage, Event}, + Currency: orml_tokens::{Module, Event}, + AssetRegistry: pallet_asset_registry::{Module, Storage}, + } -impl_outer_origin! { - pub enum Origin for Test {} -} +); -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. -#[derive(Clone, Eq, PartialEq)] -pub struct Test; parameter_types! { pub const BlockHashCount: u64 = 250; - + pub const SS58Prefix: u8 = 63; pub const HDXAssetId: AssetId = HDX; - pub ExchangeFeeRate: fee::Fee = fee::Fee::default(); } @@ -60,7 +57,7 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -68,27 +65,26 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = TestEvent; + type Event = Event; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); + type SS58Prefix = (); } -pub type Amount = i128; - parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: AssetId| -> Balance { + pub ExistentialDeposits: |_currency_id: AssetId| -> Balance { Zero::zero() }; } impl orml_tokens::Config for Test { - type Event = TestEvent; + type Event = Event; type Balance = Balance; type Amount = Amount; type CurrencyId = AssetId; @@ -97,8 +93,6 @@ impl orml_tokens::Config for Test { type OnDust = (); } -pub type Currency = orml_tokens::Module; - pub struct AssetPairAccountIdTest(); impl AssetPairAccountIdFor for AssetPairAccountIdTest { @@ -115,15 +109,13 @@ impl AssetPairAccountIdFor for AssetPairAccountIdTest { } impl Config for Test { - type Event = TestEvent; + type Event = Event; type AssetPairAccountId = AssetPairAccountIdTest; type Currency = Currency; type HDXAssetId = HDXAssetId; type WeightInfo = (); type GetExchangeFee = ExchangeFeeRate; } -pub type AMM = Module; -pub type System = system::Module; pub struct ExtBuilder { endowed_accounts: Vec<(AccountId, AssetId, Balance)>, diff --git a/pallets/amm/src/tests.rs b/pallets/amm/src/tests.rs index f0ac68e73..360530212 100644 --- a/pallets/amm/src/tests.rs +++ b/pallets/amm/src/tests.rs @@ -1,5 +1,5 @@ use super::*; -pub use crate::mock::{Currency, ExtBuilder, Origin, System, Test, TestEvent, ACA, ALICE, AMM, BOB, DOT, HDX}; +pub use crate::mock::{Currency, Event as TestEvent, ExtBuilder, Origin, System, Test, ACA, ALICE, AMM, BOB, DOT, HDX}; use frame_support::{assert_noop, assert_ok}; use hydra_dx_math::MathError; use primitives::traits::AMM as AMMPool; @@ -11,7 +11,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities { } fn last_events(n: usize) -> Vec { - system::Module::::events() + frame_system::Module::::events() .into_iter() .rev() .take(n) @@ -50,9 +50,7 @@ fn create_pool_should_work() { assert_eq!(Currency::free_balance(share_token, &ALICE), 100000000000000); assert_eq!(AMM::total_liquidity(&pair_account), 100000000000000); - expect_events(vec![ - RawEvent::CreatePool(ALICE, asset_a, asset_b, 100000000000000).into() - ]); + expect_events(vec![Event::CreatePool(ALICE, asset_a, asset_b, 100000000000000).into()]); }); } @@ -74,7 +72,7 @@ fn create_same_pool_should_not_work() { AMM::create_pool(Origin::signed(user), asset_b, asset_a, 100, Price::from(2)), Error::::TokenPoolAlreadyExists ); - expect_events(vec![RawEvent::CreatePool(ALICE, asset_b, asset_a, 200).into()]); + expect_events(vec![Event::CreatePool(ALICE, asset_b, asset_a, 200).into()]); }); } @@ -134,8 +132,8 @@ fn add_liquidity_should_work() { assert_eq!(AMM::total_liquidity(&pair_account), 1004000000000); expect_events(vec![ - RawEvent::CreatePool(ALICE, asset_a, asset_b, 1000000000000).into(), - RawEvent::AddLiquidity(ALICE, asset_a, asset_b, 400000, 4000000000).into(), + Event::CreatePool(ALICE, asset_a, asset_b, 1000000000000).into(), + Event::AddLiquidity(ALICE, asset_a, asset_b, 400000, 4000000000).into(), ]); }); } @@ -190,9 +188,9 @@ fn add_liquidity_as_another_user_should_work() { assert_eq!(AMM::total_liquidity(&pair_account), 1014000000000); expect_events(vec![ - RawEvent::CreatePool(ALICE, asset_b, asset_a, 1000000000000).into(), - RawEvent::AddLiquidity(ALICE, asset_b, asset_a, 400000, 4000000000).into(), - RawEvent::AddLiquidity(BOB, asset_b, asset_a, 1000000, 10000000000).into(), + Event::CreatePool(ALICE, asset_b, asset_a, 1000000000000).into(), + Event::AddLiquidity(ALICE, asset_b, asset_a, 400000, 4000000000).into(), + Event::AddLiquidity(BOB, asset_b, asset_a, 1000000, 10000000000).into(), ]); }); } @@ -232,8 +230,8 @@ fn remove_liquidity_should_work() { assert_eq!(AMM::total_liquidity(&pair_account), 99645000); expect_events(vec![ - RawEvent::CreatePool(ALICE, asset_a, asset_b, 100000000).into(), - RawEvent::RemoveLiquidity(ALICE, asset_a, asset_b, 355_000).into(), + Event::CreatePool(ALICE, asset_a, asset_b, 100000000).into(), + Event::RemoveLiquidity(ALICE, asset_a, asset_b, 355_000).into(), ]); }); } @@ -329,8 +327,8 @@ fn sell_test() { assert_eq!(Currency::free_balance(asset_b, &pair_account), 598636510197744); expect_events(vec![ - RawEvent::CreatePool(ALICE, asset_a, asset_b, 600000000000000).into(), - RawEvent::Sell(ALICE, asset_a, asset_b, 456444678, 1363489802256).into(), + Event::CreatePool(ALICE, asset_a, asset_b, 600000000000000).into(), + Event::Sell(ALICE, asset_a, asset_b, 456444678, 1363489802256).into(), ]); }); } @@ -496,13 +494,13 @@ fn work_flow_happy_path_should_work() { assert_eq!(AMM::total_liquidity(&pair_account), 649_999_962_000); expect_events(vec![ - RawEvent::CreatePool(user_1, asset_a, asset_b, 350_000_000_000).into(), - RawEvent::AddLiquidity(user_2, asset_a, asset_b, 300_000_000_000, 12_000_000_000_000).into(), - RawEvent::Sell(user_2, asset_a, asset_b, 216_666_666_666, 6_490_245_122_554).into(), - RawEvent::Sell(ALICE, asset_a, asset_b, 288_888_888_888, 4_870_118_901_375).into(), - RawEvent::RemoveLiquidity(user_2, asset_a, asset_b, 10_000).into(), - RawEvent::RemoveLiquidity(user_2, asset_b, asset_a, 10_000).into(), - RawEvent::RemoveLiquidity(user_2, asset_a, asset_b, 18_000).into(), + Event::CreatePool(user_1, asset_a, asset_b, 350_000_000_000).into(), + Event::AddLiquidity(user_2, asset_a, asset_b, 300_000_000_000, 12_000_000_000_000).into(), + Event::Sell(user_2, asset_a, asset_b, 216_666_666_666, 6_490_245_122_554).into(), + Event::Sell(ALICE, asset_a, asset_b, 288_888_888_888, 4_870_118_901_375).into(), + Event::RemoveLiquidity(user_2, asset_a, asset_b, 10_000).into(), + Event::RemoveLiquidity(user_2, asset_b, asset_a, 10_000).into(), + Event::RemoveLiquidity(user_2, asset_a, asset_b, 18_000).into(), ]); }); } @@ -570,8 +568,8 @@ fn sell_with_correct_fees_should_work() { assert_eq!(Currency::free_balance(asset_a, &user_1), 999999989900000); assert_eq!(Currency::free_balance(asset_b, &user_1), 999998019762768,); expect_events(vec![ - RawEvent::CreatePool(user_1, asset_a, asset_b, 2000000000).into(), - RawEvent::Sell(user_1, asset_a, asset_b, 100000, 19762768).into(), + Event::CreatePool(user_1, asset_a, asset_b, 2000000000).into(), + Event::Sell(user_1, asset_a, asset_b, 100000, 19762768).into(), ]); }); } @@ -638,9 +636,10 @@ fn discount_sell_fees_should_work() { assert_eq!(Currency::free_balance(HDX, &user_1), 989_986); expect_events(vec![ - RawEvent::CreatePool(user_1, asset_a, HDX, 10_000).into(), - RawEvent::CreatePool(user_1, asset_a, asset_b, 60_000).into(), - RawEvent::Sell(user_1, asset_a, asset_b, 10_000, 14_993).into(), + Event::CreatePool(user_1, asset_a, HDX, 10_000).into(), + frame_system::Event::NewAccount(pair_account).into(), + Event::CreatePool(user_1, asset_a, asset_b, 60_000).into(), + Event::Sell(user_1, asset_a, asset_b, 10_000, 14_993).into(), ]); }); } @@ -689,8 +688,8 @@ fn single_buy_should_work() { assert_eq!(Currency::free_balance(asset_b, &pair_account), 960_960_953_747); expect_events(vec![ - RawEvent::CreatePool(user_1, asset_a, asset_b, 640000000000).into(), - RawEvent::Buy(user_1, asset_a, asset_b, 66666666, 320960953747).into(), + Event::CreatePool(user_1, asset_a, asset_b, 640000000000).into(), + Event::Buy(user_1, asset_a, asset_b, 66666666, 320960953747).into(), ]); }); } @@ -718,6 +717,11 @@ fn single_buy_with_discount_should_work() { Price::from(2) )); + let hdx_pair_account = AMM::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: HDX, + }); + let pair_account = AMM::get_pair_id(AssetPair { asset_in: asset_a, asset_out: asset_b, @@ -753,9 +757,10 @@ fn single_buy_with_discount_should_work() { assert_eq!(Currency::free_balance(HDX, &user_1), 999_899_999_906_668); expect_events(vec![ - RawEvent::CreatePool(user_1, asset_a, asset_b, 640_000_000_000).into(), - RawEvent::CreatePool(user_1, asset_a, HDX, 100_000_000_000).into(), - RawEvent::Buy(user_1, asset_a, asset_b, 66_666_666, 320_336_108_035).into(), + Event::CreatePool(user_1, asset_a, asset_b, 640_000_000_000).into(), + frame_system::Event::NewAccount(hdx_pair_account).into(), + Event::CreatePool(user_1, asset_a, HDX, 100_000_000_000).into(), + Event::Buy(user_1, asset_a, asset_b, 66_666_666, 320_336_108_035).into(), ]); }); } @@ -877,9 +882,7 @@ fn create_pool_small_fixed_point_amount_should_work() { assert_eq!(Currency::free_balance(share_token, &ALICE), 100000000000000); assert_eq!(AMM::total_liquidity(&pair_account), 100000000000000); - expect_events(vec![ - RawEvent::CreatePool(ALICE, asset_a, asset_b, 100000000000000).into() - ]); + expect_events(vec![Event::CreatePool(ALICE, asset_a, asset_b, 100000000000000).into()]); }); } @@ -909,12 +912,12 @@ fn create_pool_fixed_point_amount_should_work() { assert_eq!(Currency::free_balance(share_token, &ALICE), 100000000000); assert_eq!(AMM::total_liquidity(&pair_account), 100000000000); - expect_events(vec![RawEvent::CreatePool(ALICE, asset_a, asset_b, 100000000000).into()]); + expect_events(vec![Event::CreatePool(ALICE, asset_a, asset_b, 100000000000).into()]); }); } #[test] -fn destry_pool_on_remove_liquidity_and_recreate_should_work() { +fn destroy_pool_on_remove_liquidity_and_recreate_should_work() { new_test_ext().execute_with(|| { let user = ALICE; let asset_a = HDX; @@ -959,10 +962,12 @@ fn destry_pool_on_remove_liquidity_and_recreate_should_work() { )); expect_events(vec![ - RawEvent::CreatePool(user, asset_a, asset_b, 100_000_000).into(), - RawEvent::RemoveLiquidity(user, asset_a, asset_b, 100_000_000).into(), - RawEvent::PoolDestroyed(user, asset_a, asset_b).into(), - RawEvent::CreatePool(user, asset_a, asset_b, 100_000_000).into(), + Event::CreatePool(user, asset_a, asset_b, 100_000_000).into(), + frame_system::Event::KilledAccount(pair_account).into(), + Event::RemoveLiquidity(user, asset_a, asset_b, 100_000_000).into(), + Event::PoolDestroyed(user, asset_a, asset_b).into(), + frame_system::Event::NewAccount(pair_account).into(), + Event::CreatePool(user, asset_a, asset_b, 100_000_000).into(), ]); }); } diff --git a/pallets/amm/src/weights.rs b/pallets/amm/src/weights.rs index 3e73ab9e3..bf6aaf3c8 100644 --- a/pallets/amm/src/weights.rs +++ b/pallets/amm/src/weights.rs @@ -37,6 +37,7 @@ #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] use frame_support::{ traits::Get, diff --git a/pallets/asset-registry/Cargo.toml b/pallets/asset-registry/Cargo.toml index e8e74b52d..95bf2b9d6 100644 --- a/pallets/asset-registry/Cargo.toml +++ b/pallets/asset-registry/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://github.com/galacticcouncil/hydradx-node' license = 'Unlicense' name = 'pallet-asset-registry' repository = 'https://github.com/galacticcouncil/hydradx-node' -version = '2.0.0' +version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -19,24 +19,24 @@ wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0 default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] primitive-types = {default-features = false, version = '0.8.0'} serde = {features = ['derive'], optional = true, version = '1.0.101'} # Local dependencies -primitives = {path = '../../primitives', default-features = false, version = '2.0.0'} +primitives = {path = '../../primitives', default-features = false} # Substrate dependencies -frame-support = {default-features = false, version = '2.0.0'} -frame-system = {default-features = false, version = '2.0.0'} -sp-core = {default-features = false, version = '2.0.0'} -sp-runtime = {default-features = false, version = '2.0.0'} -sp-std = {default-features = false, version = '2.0.0'} +frame-support = {default-features = false, version = '3.0.0'} +frame-system = {default-features = false, version = '3.0.0'} +sp-core = {default-features = false, version = '3.0.0'} +sp-runtime = {default-features = false, version = '3.0.0'} +sp-std = {default-features = false, version = '3.0.0'} [dev-dependencies] -sp-io = {default-features = false, version = '2.0.0'} +sp-io = {default-features = false, version = '3.0.0'} [features] default = ['std'] diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index cb538c174..ccef36d09 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -1,8 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::sp_runtime::traits::{AtLeast32Bit, CheckedAdd, Member, One}; -use frame_support::{decl_error, decl_module, decl_storage, dispatch::DispatchError, Parameter}; -use frame_system::{self as system}; +use frame_support::dispatch::DispatchError; +use frame_support::sp_runtime::traits::{AtLeast32Bit, CheckedAdd, One}; use sp_std::vec::Vec; #[cfg(test)] @@ -11,38 +10,80 @@ mod mock; #[cfg(test)] mod tests; -pub trait Config: system::Config { - /// Asset type - type AssetId: Parameter + Member + Into + AtLeast32Bit + Default + Copy; -} - -decl_storage! { - trait Store for Module as AssetRegistry { - /// Core Asset Id - pub CoreAssetId get(fn core_asset_id) config(): T::AssetId; +// Re-export pallet items so that they can be accessed from the crate namespace. +pub use pallet::*; - /// Current asset id. Note: This must set so it does not clash with the CoreAssetId! - pub NextAssetId get(fn next_asset_id) config(): T::AssetId; +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; - /// Created assets - pub AssetIds get(fn asset_ids) config(): map hasher(twox_64_concat) Vec => Option; + #[pallet::config] + pub trait Config: frame_system::Config { + /// Asset type + type AssetId: Parameter + Member + Into + AtLeast32Bit + Default + Copy + MaybeSerializeDeserialize; } -} -decl_error! { - pub enum Error for Module { + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::hooks] + impl Hooks for Pallet {} + + #[pallet::call] + impl Pallet {} + + #[pallet::error] + pub enum Error { /// Next Asset ID is not available. Happens when it reaches the MAX of given id type. - NoIdAvailable + NoIdAvailable, } -} -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - type Error = Error; + /// Core Asset Id + #[pallet::storage] + #[pallet::getter(fn core_asset_id)] + pub type CoreAssetId = StorageValue<_, T::AssetId, ValueQuery>; + + /// Current asset id. Note: This must set so it does not clash with the CoreAssetId! + #[pallet::storage] + #[pallet::getter(fn next_asset_id)] + pub type NextAssetId = StorageValue<_, T::AssetId, ValueQuery>; + + /// Created assets + #[pallet::storage] + #[pallet::getter(fn asset_ids)] + pub type AssetIds = StorageMap<_, Twox64Concat, Vec, Option, ValueQuery>; + + #[pallet::genesis_config] + pub struct GenesisConfig { + pub core_asset_id: T::AssetId, + pub next_asset_id: T::AssetId, + pub asset_ids: Vec<(Vec, T::AssetId)>, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig { + core_asset_id: Default::default(), + next_asset_id: Default::default(), + asset_ids: vec![], + } + } + } + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + CoreAssetId::::put(self.core_asset_id); + NextAssetId::::put(self.next_asset_id); + self.asset_ids.iter().for_each(|(name, asset_id)| { + AssetIds::::insert(name, Some(asset_id)); + }) + } } } -impl Module { +impl Pallet { /// Create assset for given name or return existing AssetId if already exists. pub fn get_or_create_asset(name: Vec) -> Result { match >::contains_key(&name) { @@ -51,7 +92,7 @@ impl Module { let asset_id = Self::next_asset_id(); let next_id = asset_id.checked_add(&One::one()).ok_or(Error::::NoIdAvailable)?; >::put(next_id); - >::insert(name, asset_id); + >::insert(name, Some(asset_id)); Ok(asset_id) } } diff --git a/pallets/asset-registry/src/mock.rs b/pallets/asset-registry/src/mock.rs index bc2bf82f8..c173d5e14 100644 --- a/pallets/asset-registry/src/mock.rs +++ b/pallets/asset-registry/src/mock.rs @@ -1,5 +1,6 @@ -use crate::{Config, Module}; -use frame_support::{impl_outer_origin, parameter_types}; +#![cfg(test)] + +use frame_support::parameter_types; use frame_system as system; use sp_core::H256; use sp_runtime::{ @@ -7,14 +8,26 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, }; -impl_outer_origin! { - pub enum Origin for Test {} -} +use crate::{self as asset_registry, Config, Module}; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + Registry: asset_registry::{Module, Call, Storage}, + } + +); -#[derive(Clone, Eq, PartialEq)] -pub struct Test; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const SS58Prefix: u8 = 63; } impl system::Config for Test { @@ -22,7 +35,7 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -34,11 +47,12 @@ impl system::Config for Test { type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); + type SS58Prefix = SS58Prefix; } impl Config for Test { type AssetId = u32; diff --git a/pallets/claims/Cargo.toml b/pallets/claims/Cargo.toml index dd8f453cf..a0ed25a22 100644 --- a/pallets/claims/Cargo.toml +++ b/pallets/claims/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://github.com/galacticcouncil/hack.hydradx-node' license = 'Unlicense' name = 'pallet-claims' repository = 'https://github.com/galacticcouncil/hack.hydradx-node' -version = '2.0.1' +version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -16,34 +16,34 @@ targets = ['x86_64-unknown-linux-gnu'] default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] # Substrate dependencies -frame-support = { default-features = false, version = '2.0.0' } -frame-system = { default-features = false, version = '2.0.0' } -frame-benchmarking = { version = "2.0.0", default-features = false, optional = true } +frame-support = { default-features = false, version = '3.0.0' } +frame-system = { default-features = false, version = '3.0.0' } +frame-benchmarking = { version = "3.0.0", default-features = false, optional = true } rustc-hex = { version = '2.1.0', default-features = false } serde = { optional = true, version = '1.0.101', features = ['derive'] } -sp-io = { default-features = false, version = '2.0.0' } -sp-runtime = { default-features = false, version = '2.0.0' } -sp-std = { default-features = false, version = '2.0.0' } +sp-io = { default-features = false, version = '3.0.0' } +sp-runtime = { default-features = false, version = '3.0.0' } +sp-std = { default-features = false, version = '3.0.0' } hex = {default-features = false, version = "0.4.2"} hex-literal = '0.3.1' lazy_static = {features = ['spin_no_std'], version = "1.4.0"} # Local dependencies -primitives = {path = '../../primitives', default-features = false, version = '2.0.0'} +primitives = {path = '../../primitives', default-features = false} # ORML dependencies -orml-traits = { default-features = false, version = '0.3.3-dev' } -orml-tokens = { default-features = false, version = '0.3.3-dev' } -orml-utilities = { default-features = false, version = '0.3.3-dev' } +orml-traits = { default-features = false, version = '0.4.1-dev' } +orml-tokens = { default-features = false, version = '0.4.1-dev' } +orml-utilities = { default-features = false, version = '0.4.1-dev' } [dev-dependencies] -sp-core = { default-features = false, version = '2.0.0' } +sp-core = { default-features = false, version = '3.0.0' } hex-literal = '0.3.1' -pallet-balances = { version = "2.0.0" } +pallet-balances = { version = "3.0.0" } [features] default = ['std'] diff --git a/pallets/claims/src/benchmarking.rs b/pallets/claims/src/benchmarking.rs index f6384a09c..f0856c1d5 100644 --- a/pallets/claims/src/benchmarking.rs +++ b/pallets/claims/src/benchmarking.rs @@ -8,8 +8,6 @@ use frame_system::RawOrigin; use hex_literal::hex; benchmarks! { - _ {} - claim { let alice_id = hex!["d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"]; let signature = hex!["bcae7d4f96f71cf974c173ae936a1a79083af7f76232efbf8a568b7f990eceed73c2465bba769de959b7f6ac5690162b61eb90949901464d0fa158a83022a0741c"]; @@ -21,7 +19,7 @@ benchmarks! { let caller = T::AccountId::decode(&mut &alice_id[..]).unwrap_or_default(); let eth_address = EthereumAddress(hex!["8202c0af5962b750123ce1a9b12e1c30a4973557"]); - Claims::::insert(eth_address, T::CurrencyBalance::from(1_000_000_000_000_000_000_u128)); + Claims::::insert(eth_address, T::CurrencyBalance::from(1_000_000_000_000_000_000_u128).into()); }: _(RawOrigin::Signed(caller.clone()), EcdsaSignature(signature)) verify { let expected_balance = T::CurrencyBalance::from(2_000_000_000_000_000_000_u128); diff --git a/pallets/claims/src/lib.rs b/pallets/claims/src/lib.rs index a6fdaf42b..740f468fa 100644 --- a/pallets/claims/src/lib.rs +++ b/pallets/claims/src/lib.rs @@ -1,8 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] -use codec::{Decode, Encode, EncodeLike}; -use core::fmt::Debug; + +#![allow(clippy::unused_unit)] + +use codec::{Decode, Encode}; use frame_support::{ - decl_error, decl_event, decl_module, decl_storage, dispatch::DispatchResult, ensure, sp_runtime::{ @@ -31,45 +32,50 @@ mod mock; #[cfg(test)] mod tests; -pub trait Config: frame_system::Config { - type Event: From> + Into<::Event>; - type Prefix: Get<&'static [u8]>; - type WeightInfo: WeightInfo; - type Currency: Currency; - // This type is needed to convert from Currency to Balance - type CurrencyBalance: From + EncodeLike> + Debug + Into>; -} - pub type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; -decl_storage! { - trait Store for Module as Claims { - Claims get(fn claims): map hasher(blake2_128_concat) EthereumAddress => BalanceOf; +// Re-export pallet items so that they can be accessed from the crate namespace. +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::OriginFor; + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::hooks] + impl Hooks for Pallet { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + migration::import_initial_claims::(&claims_data::CLAIMS_DATA) + } } - add_extra_genesis { - config(claims): Vec<(EthereumAddress, BalanceOf)>; + #[pallet::config] + pub trait Config: frame_system::Config { + type Event: From> + IsType<::Event>; - build(|config: &GenesisConfig| { - config.claims.iter().for_each(|(eth_address, initial_balance)| { - Claims::::mutate(eth_address, |amount| *amount += *initial_balance) - }) - }) + type Prefix: Get<&'static [u8]>; + + type WeightInfo: WeightInfo; + + type Currency: Currency; + + // This type is needed to convert from Currency to Balance + type CurrencyBalance: From + + Into<::AccountId>>::Balance>; } -} -decl_event!( - pub enum Event - where - AccountId = ::AccountId, - Balance = BalanceOf, - { - Claim(AccountId, EthereumAddress, Balance), + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { + Claim(T::AccountId, EthereumAddress, BalanceOf), } -); -decl_error! { - pub enum Error for Module { + #[pallet::error] + pub enum Error { /// Ethereum signature is not valid InvalidEthereumSignature, /// Claim is not valid @@ -77,37 +83,49 @@ decl_error! { /// Value reached maximum and cannot be incremented further BalanceOverflow, } -} -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - type Error = Error; + /// Asset id storage for each shared token + #[pallet::storage] + #[pallet::getter(fn claims)] + pub type Claims = StorageMap<_, Blake2_128Concat, EthereumAddress, BalanceOf, ValueQuery>; - fn deposit_event() = default; + #[pallet::genesis_config] + pub struct GenesisConfig { + pub claims: Vec<(EthereumAddress, BalanceOf)>, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig { claims: vec![] } + } + } - /// The Prefix that is used in signed Ethereum messages for this network - const Prefix: &[u8] = T::Prefix::get(); + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + self.claims.iter().for_each(|(eth_address, initial_balance)| { + Claims::::mutate(eth_address, |amount| *amount += *initial_balance) + }) + } + } - /// Claim a balance - /// Verify an Ethereum signature and deposit the corresponding balance into the account's free balance. - /// The dispatch origin of this call must match the address in the signed message. - /// This is feeless transaction. - #[weight = (::WeightInfo::claim(), DispatchClass::Normal, Pays::No)] - fn claim(origin, ethereum_signature: EcdsaSignature) { + #[pallet::call] + impl Pallet { + #[pallet::weight((::WeightInfo::claim(), DispatchClass::Normal, Pays::No))] + pub fn claim(origin: OriginFor, ethereum_signature: EcdsaSignature) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; let (balance_due, address) = Self::validate_claim(&sender, ðereum_signature)?; Self::process_claim(sender, balance_due, address)?; - } - fn on_runtime_upgrade() -> frame_support::weights::Weight { - migration::import_initial_claims::(&claims_data::CLAIMS_DATA) + Ok(().into()) } } } -impl Module { +impl Pallet { fn validate_claim( who: &T::AccountId, signature: &EcdsaSignature, @@ -138,7 +156,7 @@ impl Module { Claims::::mutate(address, |bal| *bal = Zero::zero()); - Self::deposit_event(RawEvent::Claim(dest, address, balance_due)); + Self::deposit_event(Event::Claim(dest, address, balance_due)); Ok(()) } diff --git a/pallets/claims/src/mock.rs b/pallets/claims/src/mock.rs index 2b0ca4a7f..1836fe95b 100644 --- a/pallets/claims/src/mock.rs +++ b/pallets/claims/src/mock.rs @@ -1,5 +1,6 @@ -use crate::{Config, EthereumAddress, GenesisConfig, Module}; -use frame_support::{impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types}; +use crate as claims; +use crate::{Config, EthereumAddress}; +use frame_support::parameter_types; use frame_system; use hex_literal::hex; use primitives::Balance; @@ -9,19 +10,22 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, }; -impl_outer_origin! { - pub enum Origin for Test {} -} +use frame_support::traits::GenesisBuild; -impl_outer_dispatch! { - pub enum Call for Test where origin: Origin { - pallet_claims::ClaimsModule, - frame_system::System, - } -} +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; -#[derive(Clone, Eq, PartialEq)] -pub struct Test; +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + ClaimsModule: claims::{Module, Call, Storage, Event}, + Balances: pallet_balances::{Module, Event}, + } +); parameter_types! { pub const BlockHashCount: u64 = 250; @@ -40,21 +44,22 @@ impl frame_system::Config for Test { type AccountId = AccountId; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type Event = Event; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); + type SS58Prefix = (); } impl pallet_balances::Config for Test { type MaxLocks = (); type Balance = Balance; - type Event = (); + type Event = Event; type DustRemoval = (); type ExistentialDeposit = (); type AccountStore = frame_system::Module; @@ -66,24 +71,13 @@ parameter_types! { } impl Config for Test { - type Event = (); + type Event = Event; type Currency = Balances; type Prefix = Prefix; type WeightInfo = (); type CurrencyBalance = Balance; } -impl_outer_event! { - pub enum Event for Test{ - frame_system, - pallet_balances, - } -} - -pub type System = frame_system::Module; -pub type ClaimsModule = Module; -pub type Balances = pallet_balances::Module; - pub type AccountId = u64; pub const ALICE: AccountId = 42; pub const BOB: AccountId = 43; @@ -104,7 +98,7 @@ impl ExtBuilder { .assimilate_storage(&mut t) .unwrap(); - GenesisConfig:: { + claims::GenesisConfig:: { claims: vec![( // Test seed: "image stomach entry drink rice hen abstract moment nature broken gadget flash" // private key (m/44'/60'/0'/0/0) : 0xdd75dd5f4a9e964d1c4cc929768947859a98ae2c08100744878a4b6b6d853cc0 diff --git a/pallets/claims/src/traits.rs b/pallets/claims/src/traits.rs index 7f6eb51ff..90e0a0cca 100644 --- a/pallets/claims/src/traits.rs +++ b/pallets/claims/src/traits.rs @@ -1,3 +1,5 @@ +#![allow(clippy::redundant_slicing)] + use codec::{Decode, Encode}; use sp_io::{crypto::secp256k1_ecdsa_recover, hashing::keccak_256}; diff --git a/pallets/claims/src/weights.rs b/pallets/claims/src/weights.rs index 07cb55424..535a143a4 100644 --- a/pallets/claims/src/weights.rs +++ b/pallets/claims/src/weights.rs @@ -37,6 +37,7 @@ #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] use frame_support::{ traits::Get, diff --git a/pallets/exchange/Cargo.toml b/pallets/exchange/Cargo.toml index 8bb09e63d..fefc95620 100644 --- a/pallets/exchange/Cargo.toml +++ b/pallets/exchange/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://github.com/galacticcouncil/hydradx-node' license = 'Unlicense' name = 'pallet-exchange' repository = 'https://github.com/galacticcouncil/hydradx-node' -version = '2.0.0' +version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -19,7 +19,7 @@ wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0 default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] primitive-types = {default-features = false, version = '0.8.0'} @@ -27,27 +27,28 @@ serde = {features = ['derive'], optional = true, version = '1.0.101'} # Local dependencies pallet-amm = {path = '../amm', default-features = false } -pallet-asset-registry = {path = '../asset-registry', default-features = false, version = '2.0.0'} -primitives = {path = '../../primitives', default-features = false, version = '2.0.0'} +pallet-asset-registry = {path = '../asset-registry', default-features = false} +primitives = {path = '../../primitives', default-features = false} # ORML dependencies -orml-tokens = {default-features = false, version = "0.3.3-dev"} -orml-traits = {default-features = false, version = "0.3.3-dev"} +orml-tokens = {default-features = false, version = "0.4.1-dev"} +orml-traits = {default-features = false, version = "0.4.1-dev"} # Substrate dependencies -frame-support = {default-features = false, version = '2.0.0'} -frame-system = {default-features = false, version = '2.0.0'} -sp-std = {default-features = false, version = '2.0.0'} +frame-support = {default-features = false, version = '3.0.0'} +frame-system = {default-features = false, version = '3.0.0'} +sp-std = {default-features = false, version = '3.0.0'} -sp-core = {default-features = false, version = '2.0.0'} -sp-runtime = {default-features = false, version = '2.0.0'} +sp-core = {default-features = false, version = '3.0.0'} +sp-runtime = {default-features = false, version = '3.0.0'} [dev-dependencies] -sp-io = {default-features = false, version = '2.0.0'} +sp-io = {default-features = false, version = '3.0.0'} [features] default = ['std'] std = [ + 'serde', 'codec/std', 'frame-support/std', 'frame-system/std', @@ -56,4 +57,6 @@ std = [ 'primitives/std', 'orml-tokens/std', 'orml-traits/std', + 'pallet-amm/std', + 'pallet-asset-registry/std', ] diff --git a/pallets/exchange/benchmarking/Cargo.toml b/pallets/exchange/benchmarking/Cargo.toml index 84f06fbfe..33ae97aa5 100644 --- a/pallets/exchange/benchmarking/Cargo.toml +++ b/pallets/exchange/benchmarking/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://github.com/galacticcouncil/hydra-dx' license = 'Unlicense' name = 'pallet-exchange-benchmarking' repository = 'https://github.com/galacticcouncil/hydra-dx' -version = '2.0.0' +version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -19,37 +19,38 @@ wasm-builder-runner = { package = 'substrate-wasm-builder-runner', version = '1. default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] serde = { features = ['derive'], optional = true, version = '1.0.101' } # Local dependencies -primitives = { path = '../../../primitives', default-features = false, version = '2.0.0' } -pallet-asset-registry= { path = '../../asset-registry', default-features = false, version = '2.0.0' } +primitives = { path = '../../../primitives', default-features = false } +pallet-asset-registry= { path = '../../asset-registry', default-features = false } pallet-amm = { path = '../../amm', default-features = false } -pallet-exchange = { path = '../../exchange', default-features = false, version = '2.0.0' } +pallet-exchange = { path = '../../exchange', default-features = false} # ORML dependencies -orml-traits = { default-features = false, version = "0.3.3-dev" } -orml-tokens = { default-features = false, version = "0.3.3-dev" } +orml-traits = { default-features = false, version = "0.4.1-dev" } +orml-tokens = { default-features = false, version = "0.4.1-dev" } # Substrate dependencies -frame-system = { default-features = false, version = '2.0.0' } -frame-support = { default-features = false, version = '2.0.0' } -frame-benchmarking = { default-features = false, version = '2.0.0' } -frame-system-benchmarking = { default-features = false, version = '2.0.0' } -sp-std = { default-features = false, version = '2.0.0' } +frame-system = { default-features = false, version = '3.0.0' } +frame-support = { default-features = false, version = '3.0.0' } +frame-benchmarking = { default-features = false, version = '3.0.0' } +frame-system-benchmarking = { default-features = false, version = '3.0.0' } +sp-std = { default-features = false, version = '3.0.0' } -sp-core = { default-features = false, version = '2.0.0' } -sp-runtime = { default-features = false, version = '2.0.0' } +sp-core = { default-features = false, version = '3.0.0' } +sp-runtime = { default-features = false, version = '3.0.0' } [dev-dependencies] -sp-io = { default-features = false, version = '2.0.0' } +sp-io = { default-features = false, version = '3.0.0' } [features] default = ['std'] std = [ + 'serde', 'codec/std', 'frame-support/std', 'frame-system/std', @@ -58,5 +59,5 @@ std = [ 'primitives/std', 'pallet-exchange/std', 'pallet-asset-registry/std', - "frame-benchmarking/std", + 'frame-benchmarking/std', ] diff --git a/pallets/exchange/benchmarking/src/lib.rs b/pallets/exchange/benchmarking/src/lib.rs index d1bb149b1..ebae5e226 100644 --- a/pallets/exchange/benchmarking/src/lib.rs +++ b/pallets/exchange/benchmarking/src/lib.rs @@ -1,5 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::unnecessary_wraps)] + mod amounts; mod mock; @@ -19,6 +21,7 @@ use sp_runtime::traits::{BlakeTwo256, Hash}; use amounts::INTENTION_AMOUNTS; +use frame_support::dispatch; use pallet_amm as ammpool; pub struct Module(pallet_exchange::Module); @@ -37,8 +40,6 @@ pub const DOLLARS: Balance = 100 * CENTS; fn funded_account(name: &'static str, index: u32) -> T::AccountId { let caller: T::AccountId = account(name, index, SEED); - //::Currency::update_balance(0, &caller, 1_000_000_000_000_000).unwrap(); - ::Currency::update_balance(1, &caller, 1_000_000_000_000_000).unwrap(); ::Currency::update_balance(2, &caller, 1_000_000_000_000_000).unwrap(); @@ -52,10 +53,10 @@ fn initialize_pool( asset_b: AssetId, amount: Balance, price: Price, -) -> Result<(), DispatchError> { +) -> dispatch::DispatchResultWithPostInfo { ammpool::Module::::create_pool(RawOrigin::Signed(caller).into(), asset_a, asset_b, amount, price)?; - Ok(()) + Ok(().into()) } const SELL_INTENTION_AMOUNT: Balance = 1_000_000_000; @@ -68,7 +69,7 @@ fn feed_intentions( asset_b: AssetId, number: u32, amounts: &[u32], -) -> Result<(), DispatchError> { +) -> dispatch::DispatchResultWithPostInfo { for idx in 0..number / 2 { let user = funded_account::("user", idx + 2); pallet_exchange::Module::::sell( @@ -91,7 +92,7 @@ fn feed_intentions( )?; } - Ok(()) + Ok(().into()) } fn validate_finalize( @@ -118,8 +119,6 @@ fn validate_finalize( } benchmarks! { - _ { } - known_overhead_for_on_finalize { let t: u32 = 5; }: { Exchange::::on_finalize(t.into()); } diff --git a/pallets/exchange/benchmarking/src/mock.rs b/pallets/exchange/benchmarking/src/mock.rs index b236664b3..0958d19cc 100644 --- a/pallets/exchange/benchmarking/src/mock.rs +++ b/pallets/exchange/benchmarking/src/mock.rs @@ -1,7 +1,8 @@ #![cfg(test)] use super::*; -use frame_support::{impl_outer_origin, parameter_types}; +use frame_support::parameter_types; +use frame_support::traits::GenesisBuild; use frame_system as system; use orml_traits::parameter_type_with_key; use sp_core::H256; @@ -27,29 +28,36 @@ pub const HDX: AssetId = 1000; pub const DOT: AssetId = 2000; pub const ETH: AssetId = 3000; -impl_outer_origin! { - pub enum Origin for Test where system = frame_system {} -} +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + Exchange: pallet_exchange::{Module, Call, Storage, Event}, + AMMModule: pallet_amm::{Module, Call, Storage, Event}, + Currency: orml_tokens::{Module, Event}, + AssetRegistry: pallet_asset_registry::{Module, Storage}, + } -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. -#[derive(Clone, Eq, PartialEq)] -pub struct Test; +); parameter_types! { pub const BlockHashCount: u64 = 250; - pub const HDXAssetId: AssetId = HDX; - pub ExchangeFeeRate: fee::Fee = fee::Fee::default(); } + impl system::Config for Test { type BaseCallFilter = (); type BlockWeights = (); type BlockLength = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -57,25 +65,26 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type Event = Event; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); + type SS58Prefix = (); } parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: AssetId| -> Balance { + pub ExistentialDeposits: |_currency_id: AssetId| -> Balance { Zero::zero() }; } impl orml_tokens::Config for Test { - type Event = (); + type Event = Event; type Balance = Balance; type Amount = Amount; type CurrencyId = AssetId; @@ -84,8 +93,6 @@ impl orml_tokens::Config for Test { type OnDust = (); } -pub type Currency = orml_tokens::Module; - pub struct AssetPairAccountIdTest(); impl AssetPairAccountIdFor for AssetPairAccountIdTest { @@ -106,7 +113,7 @@ impl pallet_asset_registry::Config for Test { } impl pallet_amm::Config for Test { - type Event = (); + type Event = Event; type AssetPairAccountId = AssetPairAccountIdTest; type Currency = Currency; type HDXAssetId = HDXAssetId; @@ -114,11 +121,8 @@ impl pallet_amm::Config for Test { type GetExchangeFee = ExchangeFeeRate; } -pub type AMMModule = pallet_amm::Module; -pub type System = system::Module; - impl pallet_exchange::Config for Test { - type Event = (); + type Event = Event; type AMMPool = AMMModule; type Currency = Currency; type Resolver = pallet_exchange::Module; diff --git a/pallets/exchange/src/direct.rs b/pallets/exchange/src/direct.rs index 1c032d24e..bff792d22 100644 --- a/pallets/exchange/src/direct.rs +++ b/pallets/exchange/src/direct.rs @@ -233,7 +233,7 @@ impl<'a, T: Config> DirectTradeData<'a, T> { /// Send pallet event in case of insufficient balance. fn send_insufficient_balance_event(intention: &Intention, asset: AssetId) { - Module::::deposit_event(RawEvent::InsufficientAssetBalanceEvent( + Module::::deposit_event(Event::InsufficientAssetBalanceEvent( intention.who.clone(), asset, intention.sell_or_buy, @@ -244,7 +244,7 @@ impl<'a, T: Config> DirectTradeData<'a, T> { /// Send pallet event after a fee is transferred. fn send_trade_fee_event(from: &T::AccountId, to: &T::AccountId, asset: AssetId, amount: Balance) { - Module::::deposit_event(RawEvent::IntentionResolvedDirectTradeFees( + Module::::deposit_event(Event::IntentionResolvedDirectTradeFees( from.clone(), to.clone(), asset, @@ -254,7 +254,7 @@ impl<'a, T: Config> DirectTradeData<'a, T> { /// Send event after successful direct trade. fn send_direct_trade_resolve_event(&self) { - Module::::deposit_event(RawEvent::IntentionResolvedDirectTrade( + Module::::deposit_event(Event::IntentionResolvedDirectTrade( self.intention_a.who.clone(), self.intention_b.who.clone(), self.intention_a.intention_id, diff --git a/pallets/exchange/src/lib.rs b/pallets/exchange/src/lib.rs index cf668da46..9878bb52f 100644 --- a/pallets/exchange/src/lib.rs +++ b/pallets/exchange/src/lib.rs @@ -1,7 +1,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![allow(clippy::comparison_chain)] -use frame_support::{decl_error, decl_event, decl_module, decl_storage, dispatch, ensure, storage::IterableStorageMap}; +#![allow(clippy::unused_unit)] +#![allow(clippy::upper_case_acronyms)] +#![allow(clippy::unnecessary_wraps)] + +use frame_support::{dispatch, ensure}; use frame_system::{self as system, ensure_signed}; use codec::Encode; @@ -38,80 +42,121 @@ mod tests; type IntentionId = ::Hash; pub type Intention = ExchangeIntention<::AccountId, Balance, IntentionId>; -/// The pallet's configuration trait. -pub trait Config: system::Config { - type Event: From> + Into<::Event>; +// Re-export pallet items so that they can be accessed from the crate namespace. +pub use pallet::*; - /// AMM pool implementation - type AMMPool: AMM; +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::OriginFor; - /// Intention resolver - type Resolver: Resolver, Error>; + #[pallet::pallet] + pub struct Pallet(_); - /// Currency for transfers - type Currency: MultiCurrencyExtended - + MultiReservableCurrency; + #[pallet::hooks] + impl Hooks for Pallet { + /// Finalize and resolve all registered intentions. + /// Group/match intentions which can be directly traded. + fn on_finalize(_n: T::BlockNumber) { + for ((asset_1, asset_2), count) in ExchangeAssetsIntentionCount::::iter() { + // If no intention registered for asset1/2, move onto next one + if count == 0u32 { + continue; + } + let pair = AssetPair { + asset_in: asset_1, + asset_out: asset_2, + }; - /// Weight information for the extrinsics. - type WeightInfo: WeightInfo; -} + let pair_account = T::AMMPool::get_pair_id(pair); + + let asset_a_ins = >::get((asset_2, asset_1)); + let asset_b_ins = >::get((asset_1, asset_2)); + + //TODO: we can short circuit here if nothing in asset_b_sells and just resolve asset_a sells. + + Self::process_exchange_intentions(&pair_account, &asset_a_ins, &asset_b_ins); + } -// This pallet's storage items. -decl_storage! { - trait Store for Module as Exchange { + ExchangeAssetsIntentionCount::::remove_all(); + ExchangeAssetsIntentions::::remove_all(); + } + + fn on_initialize(_n: T::BlockNumber) -> Weight { + T::WeightInfo::known_overhead_for_on_finalize() + } + } + + #[pallet::config] + pub trait Config: frame_system::Config { + type Event: From> + IsType<::Event>; + + /// AMM pool implementation + type AMMPool: AMM; + + /// Intention resolver + type Resolver: Resolver, Error>; - /// Intention count for current block - ExchangeAssetsIntentionCount get(fn get_intentions_count): map hasher(blake2_128_concat) (AssetId, AssetId) => u32; + /// Currency for transfers + type Currency: MultiCurrencyExtended + + MultiReservableCurrency; - /// Registered intentions for current block - /// Stored as ( asset_a, asset_b ) combination where asset_a is meant to be exchanged for asset_b ( asset_a < asset_b) - ExchangeAssetsIntentions get(fn get_intentions): map hasher(blake2_128_concat) (AssetId, AssetId) => Vec>; + /// Weight information for the extrinsics. + type WeightInfo: WeightInfo; } -} -// The pallet's events -decl_event!( - pub enum Event - where - AccountId = ::AccountId, - IntentionID = IntentionId, - { + #[pallet::event] + #[pallet::generate_deposit(pub (crate) fn deposit_event)] + pub enum Event { /// Intention registered event /// who, asset a, asset b, amount, intention type, intention id - IntentionRegistered(AccountId, AssetId, AssetId, Balance, IntentionType, IntentionID), + IntentionRegistered(T::AccountId, AssetId, AssetId, Balance, IntentionType, IntentionId), /// Intention resolved as AMM Trade /// who, intention type, intention id, amount, amount sold/bought - IntentionResolvedAMMTrade(AccountId, IntentionType, IntentionID, Balance, Balance), + IntentionResolvedAMMTrade(T::AccountId, IntentionType, IntentionId, Balance, Balance), /// Intention resolved as Direct Trade /// who, who - account between which direct trade happens /// intention id, intention id - intentions which are being resolved ( fully or partially ) /// Balance, Balance - corresponding amounts - IntentionResolvedDirectTrade(AccountId, AccountId, IntentionID, IntentionID, Balance, Balance), + IntentionResolvedDirectTrade( + T::AccountId, + T::AccountId, + IntentionId, + IntentionId, + Balance, + Balance, + ), /// Paid fees event /// who, account paid to, asset, amount - IntentionResolvedDirectTradeFees(AccountId, AccountId, AssetId, Balance), + IntentionResolvedDirectTradeFees(T::AccountId, T::AccountId, AssetId, Balance), /// Error event - insuficient balance of specified asset /// who, asset, intention type, intention id, error detail - InsufficientAssetBalanceEvent(AccountId, AssetId, IntentionType, IntentionID, dispatch::DispatchError), + InsufficientAssetBalanceEvent( + T::AccountId, + AssetId, + IntentionType, + IntentionId, + dispatch::DispatchError, + ), /// Intetion Error Event /// who, assets, sell or buy, intention id, error detail IntentionResolveErrorEvent( - AccountId, + T::AccountId, AssetPair, IntentionType, - IntentionID, + IntentionId, dispatch::DispatchError, ), } -); -decl_error! { - pub enum Error for Module { + #[pallet::error] + pub enum Error { ///Token pool does not exist. TokenPoolNotFound, @@ -125,41 +170,48 @@ decl_error! { ZeroSpotPrice, /// Minimum trading limit is not enough - MinimumTradeLimitNotReached + MinimumTradeLimitNotReached, } -} - -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - - type Error = Error; - - fn deposit_event() = default; + /// Intention count for current block + #[pallet::storage] + #[pallet::getter(fn get_intentions_count)] + pub type ExchangeAssetsIntentionCount = + StorageMap<_, Blake2_128Concat, (AssetId, AssetId), u32, ValueQuery>; + + /// Registered intentions for current block + /// Stored as ( asset_a, asset_b ) combination where asset_a is meant to be exchanged for asset_b ( asset_a < asset_b) + #[pallet::storage] + #[pallet::getter(fn get_intentions)] + pub type ExchangeAssetsIntentions = + StorageMap<_, Blake2_128Concat, (AssetId, AssetId), Vec>, ValueQuery>; + + #[pallet::call] + impl Pallet { /// Create sell intention /// Calculate current spot price, create an intention and store in ```ExchangeAssetsIntentions``` - #[weight = ::WeightInfo::sell_intention() + ::WeightInfo::on_finalize_for_one_sell_extrinsic() - ::WeightInfo::known_overhead_for_on_finalize()] + #[pallet::weight(< T as Config >::WeightInfo::sell_intention() + < T as Config >::WeightInfo::on_finalize_for_one_sell_extrinsic() - < T as Config >::WeightInfo::known_overhead_for_on_finalize())] pub fn sell( - origin, + origin: OriginFor, asset_sell: AssetId, asset_buy: AssetId, amount_sell: Balance, min_bought: Balance, discount: bool, - ) -> dispatch::DispatchResult { + ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!{ + ensure! { amount_sell >= MIN_TRADING_LIMIT, Error::::MinimumTradeLimitNotReached }; - let assets = AssetPair{asset_in: asset_sell, asset_out: asset_buy}; + let assets = AssetPair { + asset_in: asset_sell, + asset_out: asset_buy, + }; - ensure!( - T::AMMPool::exists(assets), - Error::::TokenPoolNotFound - ); + ensure!(T::AMMPool::exists(assets), Error::::TokenPoolNotFound); ensure!( T::Currency::free_balance(asset_sell, &who) >= amount_sell, @@ -168,53 +220,49 @@ decl_module! { let amount_buy = T::AMMPool::get_spot_price_unchecked(asset_sell, asset_buy, amount_sell); - ensure!( - amount_buy != 0, - Error::::ZeroSpotPrice - ); + ensure!(amount_buy != 0, Error::::ZeroSpotPrice); Self::register_intention( - &who, - IntentionType::SELL, - assets, - amount_sell, - amount_buy, - min_bought, - discount - ) + &who, + IntentionType::SELL, + assets, + amount_sell, + amount_buy, + min_bought, + discount, + )?; + + Ok(().into()) } /// Create buy intention /// Calculate current spot price, create an intention and store in ```ExchangeAssetsIntentions``` - #[weight = ::WeightInfo::buy_intention() + ::WeightInfo::on_finalize_for_one_buy_extrinsic() - ::WeightInfo::known_overhead_for_on_finalize()] + #[pallet::weight(::WeightInfo::buy_intention() + ::WeightInfo::on_finalize_for_one_buy_extrinsic() - ::WeightInfo::known_overhead_for_on_finalize())] pub fn buy( - origin, + origin: OriginFor, asset_buy: AssetId, asset_sell: AssetId, amount_buy: Balance, max_sold: Balance, discount: bool, - ) -> dispatch::DispatchResult { + ) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!{ + ensure! { amount_buy >= MIN_TRADING_LIMIT, Error::::MinimumTradeLimitNotReached }; - let assets = AssetPair{asset_in: asset_sell, asset_out: asset_buy}; + let assets = AssetPair { + asset_in: asset_sell, + asset_out: asset_buy, + }; - ensure!( - T::AMMPool::exists(assets), - Error::::TokenPoolNotFound - ); + ensure!(T::AMMPool::exists(assets), Error::::TokenPoolNotFound); let amount_sell = T::AMMPool::get_spot_price_unchecked(asset_buy, asset_sell, amount_buy); - ensure!( - amount_sell != 0, - Error::::ZeroSpotPrice - ); + ensure!(amount_sell != 0, Error::::ZeroSpotPrice); ensure!( T::Currency::free_balance(asset_sell, &who) >= amount_sell, @@ -222,49 +270,22 @@ decl_module! { ); Self::register_intention( - &who, - IntentionType::BUY, - assets, - amount_sell, - amount_buy, - max_sold, - discount - ) - } - - fn on_initialize() -> Weight { - T::WeightInfo::known_overhead_for_on_finalize() - } - - /// Finalize and resolve all registered intentions. - /// Group/match intentions which can be directly traded. - fn on_finalize(){ - - for ((asset_1,asset_2), count) in ExchangeAssetsIntentionCount::iter() { - // If no intention registered for asset1/2, move onto next one - if count == 0u32 { - continue; - } - let pair = AssetPair{asset_in: asset_1, asset_out: asset_2}; - - let pair_account = T::AMMPool::get_pair_id(pair); - - let asset_a_ins = >::get((asset_2, asset_1)); - let asset_b_ins = >::get((asset_1, asset_2)); - - //TODO: we can short circuit here if nothing in asset_b_sells and just resolve asset_a sells. - - Self::process_exchange_intentions(&pair_account, &asset_a_ins, &asset_b_ins); - } - - ExchangeAssetsIntentionCount::remove_all(); - ExchangeAssetsIntentions::::remove_all(); + &who, + IntentionType::BUY, + assets, + amount_sell, + amount_buy, + max_sold, + discount, + )?; + + Ok(().into()) } } } // "Internal" functions, callable by code. -impl Module { +impl Pallet { /// Register SELL or BUY intention fn register_intention( who: &T::AccountId, @@ -275,7 +296,7 @@ impl Module { limit: Balance, discount: bool, ) -> dispatch::DispatchResult { - let intention_count = ExchangeAssetsIntentionCount::get(assets.ordered_pair()); + let intention_count = ExchangeAssetsIntentionCount::::get(assets.ordered_pair()); let intention_id = Self::generate_intention_id(who, intention_count, &assets); @@ -292,11 +313,11 @@ impl Module { // Note: cannot use ordered tuple pair, as this must be stored as (in,out) pair >::append((assets.asset_in, assets.asset_out), intention); - ExchangeAssetsIntentionCount::mutate(assets.ordered_pair(), |total| *total += 1u32); + ExchangeAssetsIntentionCount::::mutate(assets.ordered_pair(), |total| *total += 1u32); match intention_type { IntentionType::SELL => { - Self::deposit_event(RawEvent::IntentionRegistered( + Self::deposit_event(Event::IntentionRegistered( who.clone(), assets.asset_in, assets.asset_out, @@ -306,7 +327,7 @@ impl Module { )); } IntentionType::BUY => { - Self::deposit_event(RawEvent::IntentionRegistered( + Self::deposit_event(Event::IntentionRegistered( who.clone(), assets.asset_out, assets.asset_in, @@ -378,7 +399,7 @@ impl Module { IntentionType::SELL => { T::AMMPool::execute_sell(transfer)?; - Self::deposit_event(RawEvent::IntentionResolvedAMMTrade( + Self::deposit_event(Event::IntentionResolvedAMMTrade( transfer.origin.clone(), IntentionType::SELL, intention_id, @@ -389,7 +410,7 @@ impl Module { IntentionType::BUY => { T::AMMPool::execute_buy(transfer)?; - Self::deposit_event(RawEvent::IntentionResolvedAMMTrade( + Self::deposit_event(Event::IntentionResolvedAMMTrade( transfer.origin.clone(), IntentionType::BUY, intention_id, @@ -406,7 +427,7 @@ impl Module { /// /// Send event with error detail for intention that failed. fn send_intention_error_event(intention: &Intention, error: dispatch::DispatchError) { - Self::deposit_event(RawEvent::IntentionResolveErrorEvent( + Self::deposit_event(Event::IntentionResolveErrorEvent( intention.who.clone(), intention.assets, intention.sell_or_buy, @@ -428,7 +449,7 @@ impl Module { intention.discount, ) { Err(error) => { - Self::deposit_event(RawEvent::IntentionResolveErrorEvent( + Self::deposit_event(Event::IntentionResolveErrorEvent( intention.who.clone(), intention.assets, intention.sell_or_buy, @@ -449,7 +470,7 @@ impl Module { intention.discount, ) { Err(error) => { - Self::deposit_event(RawEvent::IntentionResolveErrorEvent( + Self::deposit_event(Event::IntentionResolveErrorEvent( intention.who.clone(), intention.assets, intention.sell_or_buy, @@ -470,7 +491,7 @@ impl Module { } } -impl Resolver, Error> for Module { +impl Resolver, Error> for Pallet { /// Resolve intention via AMM pool. fn resolve_single_intention(intention: &Intention) { let amm_transfer = match intention.sell_or_buy { diff --git a/pallets/exchange/src/mock.rs b/pallets/exchange/src/mock.rs index 555a9e583..8e93aab25 100644 --- a/pallets/exchange/src/mock.rs +++ b/pallets/exchange/src/mock.rs @@ -1,7 +1,9 @@ // Creating mock runtime here -use crate::{Config, Module}; -use frame_support::{impl_outer_event, impl_outer_origin, parameter_types}; +use crate as exchange; + +use crate::Config; +use frame_support::parameter_types; use frame_system as system; use orml_traits::parameter_type_with_key; use sp_core::H256; @@ -12,6 +14,7 @@ use sp_runtime::{ use pallet_amm as amm; +use frame_support::traits::GenesisBuild; use pallet_amm::AssetPairAccountIdFor; use primitives::{fee, AssetId, Balance}; @@ -29,30 +32,27 @@ pub const HDX: AssetId = 1000; pub const DOT: AssetId = 2000; pub const ETH: AssetId = 3000; -mod exchange { - pub use super::super::*; -} +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; -impl_outer_event! { - pub enum TestEvent for Test{ - system, - amm, - orml_tokens, - exchange, - } -} +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + Exchange: exchange::{Module, Call, Storage, Event}, + AMM: pallet_amm::{Module, Call, Storage, Event}, + Currency: orml_tokens::{Module, Event}, + AssetRegistry: pallet_asset_registry::{Module, Storage}, + } -impl_outer_origin! { - pub enum Origin for Test {} -} +); -// For testing the pallet, we construct most of a mock runtime. This means -// first constructing a configuration type (`Test`) which `impl`s each of the -// configuration traits of pallets we want to use. -#[derive(Clone, Eq, PartialEq)] -pub struct Test; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const SS58Prefix: u8 = 63; pub const HDXAssetId: AssetId = HDX; @@ -63,7 +63,7 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -71,25 +71,26 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = TestEvent; + type Event = Event; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); + type SS58Prefix = SS58Prefix; } parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: AssetId| -> Balance { + pub ExistentialDeposits: |_currency_id: AssetId| -> Balance { Zero::zero() }; } impl orml_tokens::Config for Test { - type Event = TestEvent; + type Event = Event; type Balance = Balance; type Amount = Amount; type CurrencyId = AssetId; @@ -98,8 +99,6 @@ impl orml_tokens::Config for Test { type OnDust = (); } -pub type Currency = orml_tokens::Module; - impl pallet_asset_registry::Config for Test { type AssetId = AssetId; } @@ -120,7 +119,7 @@ impl AssetPairAccountIdFor for AssetPairAccountIdTest { } impl amm::Config for Test { - type Event = TestEvent; + type Event = Event; type AssetPairAccountId = AssetPairAccountIdTest; type Currency = Currency; type HDXAssetId = HDXAssetId; @@ -128,17 +127,13 @@ impl amm::Config for Test { type GetExchangeFee = ExchangeFeeRate; } -pub type AMMModule = amm::Module; -pub type System = system::Module; - impl Config for Test { - type Event = TestEvent; - type AMMPool = AMMModule; + type Event = Event; + type AMMPool = AMM; type Currency = Currency; type Resolver = exchange::Module; type WeightInfo = (); } -pub type Exchange = Module; pub struct ExtBuilder { endowed_accounts: Vec<(AccountId, AssetId, Balance)>, diff --git a/pallets/exchange/src/tests.rs b/pallets/exchange/src/tests.rs index 70bd27902..abe765df0 100644 --- a/pallets/exchange/src/tests.rs +++ b/pallets/exchange/src/tests.rs @@ -1,5 +1,8 @@ use super::*; -use crate::mock::*; +pub use crate::mock::{ + Currency, Event as TestEvent, Exchange, ExtBuilder, Origin, System, Test, ALICE, AMM as AMMModule, BOB, CHARLIE, + DAVE, DOT, ETH, FERDIE, GEORGE, HDX, +}; use frame_support::sp_runtime::traits::Hash; use frame_support::traits::OnFinalize; use frame_support::{assert_noop, assert_ok}; @@ -60,11 +63,12 @@ fn initialize_pool(asset_a: u32, asset_b: u32, user: u64, amount: u128, price: P price.checked_mul_int(amount).unwrap() }; - expect_event(TestEvent::amm(amm::RawEvent::CreatePool( - user, asset_a, asset_b, shares, - ))); + expect_event(amm::Event::CreatePool(user, asset_a, asset_b, shares)); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); let share_token = AMMModule::share_token(pair_account); let amount_b = price.saturating_mul_int(amount); @@ -81,13 +85,7 @@ fn initialize_pool(asset_a: u32, asset_b: u32, user: u64, amount: u128, price: P assert_eq!(Currency::free_balance(share_token, &user), shares); // Advance blockchain so that we kill old events - System::initialize( - &1, - &[0u8; 32].into(), - &[0u8; 32].into(), - &Default::default(), - InitKind::Full, - ); + System::initialize(&1, &[0u8; 32].into(), &Default::default(), InitKind::Full); } #[test] @@ -101,7 +99,10 @@ fn sell_test_pool_finalization_states() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -142,7 +143,7 @@ fn sell_test_pool_finalization_states() { >::on_finalize(9); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -151,7 +152,7 @@ fn sell_test_pool_finalization_states() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_a, asset_b, @@ -160,7 +161,7 @@ fn sell_test_pool_finalization_states() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_2, user_3, user_2_sell_intention_id, @@ -169,10 +170,10 @@ fn sell_test_pool_finalization_states() { 2000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_b, 4000000000).into(), - TestEvent::amm(amm::RawEvent::Sell(user_2, 3000, 2000, 1000000000000, 1976336046259)), - RawEvent::IntentionResolvedAMMTrade( + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_b, 4000000000).into(), + amm::Event::Sell(user_2, 3000, 2000, 1000000000000, 1976336046259).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::SELL, user_2_sell_intention_id, @@ -209,7 +210,10 @@ fn sell_test_standard() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -255,7 +259,7 @@ fn sell_test_standard() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -264,7 +268,7 @@ fn sell_test_standard() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_a, asset_b, @@ -273,7 +277,7 @@ fn sell_test_standard() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_2, user_3, user_2_sell_intention_id, @@ -282,10 +286,10 @@ fn sell_test_standard() { 2000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_b, 4000000000).into(), - TestEvent::amm(amm::RawEvent::Sell(user_2, 3000, 2000, 1000000000000, 1976336046259)), - RawEvent::IntentionResolvedAMMTrade( + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_b, 4000000000).into(), + amm::Event::Sell(user_2, 3000, 2000, 1000000000000, 1976336046259).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::SELL, user_2_sell_intention_id, @@ -308,7 +312,10 @@ fn sell_test_inverse_standard() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -356,7 +363,7 @@ fn sell_test_inverse_standard() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -365,7 +372,7 @@ fn sell_test_inverse_standard() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -374,8 +381,8 @@ fn sell_test_inverse_standard() { user_3_sell_intention_id, ) .into(), - TestEvent::amm(amm::RawEvent::Sell(3, 2000, 3000, 2000000000000, 988138378978)), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Sell(3, 2000, 3000, 2000000000000, 988138378978).into(), + Event::IntentionResolvedAMMTrade( user_3, IntentionType::SELL, user_3_sell_intention_id, @@ -383,7 +390,7 @@ fn sell_test_inverse_standard() { 988138378978, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_2, user_3, user_2_sell_intention_id, @@ -392,8 +399,8 @@ fn sell_test_inverse_standard() { 2000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 2000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 2000000000).into(), ]); }); } @@ -409,7 +416,10 @@ fn sell_test_exact_match() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -454,7 +464,7 @@ fn sell_test_exact_match() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -463,7 +473,7 @@ fn sell_test_exact_match() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -472,7 +482,7 @@ fn sell_test_exact_match() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_2, user_3, user_2_sell_intention_id, @@ -481,8 +491,8 @@ fn sell_test_exact_match() { 2000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 2000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 2000000000).into(), ]); }); } @@ -498,7 +508,10 @@ fn sell_test_single_eth_sells() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -541,7 +554,7 @@ fn sell_test_single_eth_sells() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -550,7 +563,7 @@ fn sell_test_single_eth_sells() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_a, asset_b, @@ -559,14 +572,8 @@ fn sell_test_single_eth_sells() { user_3_sell_intention_id, ) .into(), - TestEvent::amm(amm::RawEvent::Sell( - user_3, - asset_a, - asset_b, - 2000000000000, - 3913878975647, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Sell(user_3, asset_a, asset_b, 2000000000000, 3913878975647).into(), + Event::IntentionResolvedAMMTrade( user_3, IntentionType::SELL, user_3_sell_intention_id, @@ -574,14 +581,8 @@ fn sell_test_single_eth_sells() { 3913878975647, ) .into(), - TestEvent::amm(amm::RawEvent::Sell( - user_2, - asset_a, - asset_b, - 1000000000000, - 1899978143094, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Sell(user_2, asset_a, asset_b, 1000000000000, 1899978143094).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::SELL, user_2_sell_intention_id, @@ -604,7 +605,10 @@ fn sell_test_single_dot_sells() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -647,7 +651,7 @@ fn sell_test_single_dot_sells() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_b, asset_a, @@ -656,7 +660,7 @@ fn sell_test_single_dot_sells() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -665,14 +669,8 @@ fn sell_test_single_dot_sells() { user_3_sell_intention_id, ) .into(), - TestEvent::amm(amm::RawEvent::Sell( - user_3, - asset_b, - asset_a, - 2000000000000, - 988138378978, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Sell(user_3, asset_b, asset_a, 2000000000000, 988138378978).into(), + Event::IntentionResolvedAMMTrade( user_3, IntentionType::SELL, user_3_sell_intention_id, @@ -680,14 +678,8 @@ fn sell_test_single_dot_sells() { 988138378978, ) .into(), - TestEvent::amm(amm::RawEvent::Sell( - user_2, - asset_b, - asset_a, - 1000000000000, - 486772470162, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Sell(user_2, asset_b, asset_a, 1000000000000, 486772470162).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::SELL, user_2_sell_intention_id, @@ -738,7 +730,7 @@ fn sell_trade_limits_respected_for_matched_intention() { >::on_finalize(9); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -747,7 +739,7 @@ fn sell_trade_limits_respected_for_matched_intention() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -756,7 +748,7 @@ fn sell_trade_limits_respected_for_matched_intention() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionResolveErrorEvent( + Event::IntentionResolveErrorEvent( user_3, AssetPair { asset_in: asset_b, @@ -765,20 +757,14 @@ fn sell_trade_limits_respected_for_matched_intention() { IntentionType::SELL, user_3_sell_intention_id, DispatchError::Module { - index: 0, + index: 1, error: 2, message: None, }, ) .into(), - TestEvent::amm(amm::RawEvent::Sell( - user_2, - asset_a, - asset_b, - 1000000000000, - 1976276757956, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Sell(user_2, asset_a, asset_b, 1000000000000, 1976276757956).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::SELL, user_2_sell_intention_id, @@ -805,7 +791,10 @@ fn sell_test_single_multiple_sells() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -877,7 +866,7 @@ fn sell_test_single_multiple_sells() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -886,7 +875,7 @@ fn sell_test_single_multiple_sells() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -895,7 +884,7 @@ fn sell_test_single_multiple_sells() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_4, asset_a, asset_b, @@ -904,7 +893,7 @@ fn sell_test_single_multiple_sells() { user_4_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_5, asset_b, asset_a, @@ -913,7 +902,7 @@ fn sell_test_single_multiple_sells() { user_5_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_6, asset_b, asset_a, @@ -922,7 +911,7 @@ fn sell_test_single_multiple_sells() { user_6_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_2, user_6, user_2_sell_intention_id, @@ -931,9 +920,9 @@ fn sell_test_single_multiple_sells() { 2000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_6, pair_account, asset_a, 2000000000).into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_6, pair_account, asset_a, 2000000000).into(), + Event::IntentionResolvedDirectTrade( user_4, user_3, user_4_sell_intention_id, @@ -942,16 +931,10 @@ fn sell_test_single_multiple_sells() { 1000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 2000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 1000000000).into(), - TestEvent::amm(amm::RawEvent::Sell( - user_4, - asset_a, - asset_b, - 500000000000, - 993044854829, - )), - RawEvent::IntentionResolvedAMMTrade( + Event::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 2000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 1000000000).into(), + amm::Event::Sell(user_4, asset_a, asset_b, 500000000000, 993044854829).into(), + Event::IntentionResolvedAMMTrade( user_4, IntentionType::SELL, user_4_sell_intention_id, @@ -959,14 +942,8 @@ fn sell_test_single_multiple_sells() { 993044854829, ) .into(), - TestEvent::amm(amm::RawEvent::Sell( - user_5, - asset_b, - asset_a, - 1000000000000, - 501482500933, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Sell(user_5, asset_b, asset_a, 1000000000000, 501482500933).into(), + Event::IntentionResolvedAMMTrade( user_5, IntentionType::SELL, user_5_sell_intention_id, @@ -991,7 +968,10 @@ fn sell_test_group_sells() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -1045,7 +1025,7 @@ fn sell_test_group_sells() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_b, asset_a, @@ -1054,7 +1034,7 @@ fn sell_test_group_sells() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -1063,7 +1043,7 @@ fn sell_test_group_sells() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_4, asset_a, asset_b, @@ -1072,7 +1052,7 @@ fn sell_test_group_sells() { user_4_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_4, user_2, user_4_sell_intention_id, @@ -1081,9 +1061,9 @@ fn sell_test_group_sells() { 5000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 10000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_a, 5000000000).into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 10000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_a, 5000000000).into(), + Event::IntentionResolvedDirectTrade( user_4, user_3, user_4_sell_intention_id, @@ -1092,16 +1072,10 @@ fn sell_test_group_sells() { 3000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 6000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 3000000000).into(), - TestEvent::amm(amm::RawEvent::Sell( - user_4, - asset_a, - asset_b, - 6000000000000, - 11299443450697, - )), - RawEvent::IntentionResolvedAMMTrade( + Event::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 6000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 3000000000).into(), + amm::Event::Sell(user_4, asset_a, asset_b, 6000000000000, 11299443450697).into(), + Event::IntentionResolvedAMMTrade( user_4, IntentionType::SELL, user_4_sell_intention_id, @@ -1181,7 +1155,10 @@ fn sell_test_mixed_buy_sells() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -1235,7 +1212,7 @@ fn sell_test_mixed_buy_sells() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_b, asset_a, @@ -1244,7 +1221,7 @@ fn sell_test_mixed_buy_sells() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -1253,7 +1230,7 @@ fn sell_test_mixed_buy_sells() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_4, asset_a, asset_b, @@ -1262,7 +1239,7 @@ fn sell_test_mixed_buy_sells() { user_4_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_4, user_3, user_4_sell_intention_id, @@ -1271,16 +1248,10 @@ fn sell_test_mixed_buy_sells() { 3000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 6000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 3000000000).into(), - TestEvent::amm(amm::RawEvent::Sell( - user_4, - asset_a, - asset_b, - 8500000000000, - 15639353446528, - )), - RawEvent::IntentionResolvedAMMTrade( + Event::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 6000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 3000000000).into(), + amm::Event::Sell(user_4, asset_a, asset_b, 8500000000000, 15639353446528).into(), + Event::IntentionResolvedAMMTrade( user_4, IntentionType::SELL, user_4_sell_intention_id, @@ -1288,14 +1259,8 @@ fn sell_test_mixed_buy_sells() { 15639353446528, ) .into(), - TestEvent::amm(amm::RawEvent::Buy( - user_2, - asset_b, - asset_a, - 5000000000000, - 3030832926719, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Buy(user_2, asset_b, asset_a, 5000000000000, 3030832926719).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::BUY, user_2_sell_intention_id, @@ -1320,7 +1285,10 @@ fn discount_tests_no_discount() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -1374,7 +1342,7 @@ fn discount_tests_no_discount() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_b, asset_a, @@ -1383,7 +1351,7 @@ fn discount_tests_no_discount() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -1392,7 +1360,7 @@ fn discount_tests_no_discount() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_4, asset_a, asset_b, @@ -1401,7 +1369,7 @@ fn discount_tests_no_discount() { user_4_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_4, user_3, user_4_sell_intention_id, @@ -1410,16 +1378,10 @@ fn discount_tests_no_discount() { 3000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 6000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 3000000000).into(), - TestEvent::amm(amm::RawEvent::Sell( - user_4, - asset_a, - asset_b, - 8500000000000, - 15639353446528, - )), - RawEvent::IntentionResolvedAMMTrade( + Event::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 6000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 3000000000).into(), + amm::Event::Sell(user_4, asset_a, asset_b, 8500000000000, 15639353446528).into(), + Event::IntentionResolvedAMMTrade( user_4, IntentionType::SELL, user_4_sell_intention_id, @@ -1427,14 +1389,8 @@ fn discount_tests_no_discount() { 15639353446528, ) .into(), - TestEvent::amm(amm::RawEvent::Buy( - user_2, - asset_b, - asset_a, - 5000000000000, - 3030832926719, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Buy(user_2, asset_b, asset_a, 5000000000000, 3030832926719).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::BUY, user_2_sell_intention_id, @@ -1459,7 +1415,10 @@ fn discount_tests_with_discount() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); initialize_pool(asset_a, HDX, user_2, pool_amount, initial_price); @@ -1519,7 +1478,7 @@ fn discount_tests_with_discount() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_b, asset_a, @@ -1528,7 +1487,7 @@ fn discount_tests_with_discount() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -1537,7 +1496,7 @@ fn discount_tests_with_discount() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_4, asset_a, asset_b, @@ -1546,7 +1505,7 @@ fn discount_tests_with_discount() { user_4_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_4, user_3, user_4_sell_intention_id, @@ -1555,16 +1514,10 @@ fn discount_tests_with_discount() { 3000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 6000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 3000000000).into(), - TestEvent::amm(amm::RawEvent::Sell( - user_4, - asset_a, - asset_b, - 8500000000000, - 15658130468064, - )), - RawEvent::IntentionResolvedAMMTrade( + Event::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 6000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 3000000000).into(), + amm::Event::Sell(user_4, asset_a, asset_b, 8500000000000, 15658130468064).into(), + Event::IntentionResolvedAMMTrade( user_4, IntentionType::SELL, user_4_sell_intention_id, @@ -1572,14 +1525,8 @@ fn discount_tests_with_discount() { 15658130468064, ) .into(), - TestEvent::amm(amm::RawEvent::Buy( - user_2, - asset_b, - asset_a, - 5000000000000, - 3027107914884, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Buy(user_2, asset_b, asset_a, 5000000000000, 3027107914884).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::BUY, user_2_sell_intention_id, @@ -1602,7 +1549,10 @@ fn buy_test_exact_match() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -1644,7 +1594,7 @@ fn buy_test_exact_match() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -1653,7 +1603,7 @@ fn buy_test_exact_match() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -1662,7 +1612,7 @@ fn buy_test_exact_match() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_3, user_2, user_3_sell_intention_id, @@ -1671,8 +1621,8 @@ fn buy_test_exact_match() { 2000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 2000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 2000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4000000000).into(), ]); }); } @@ -1690,7 +1640,10 @@ fn buy_test_group_buys() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -1744,7 +1697,7 @@ fn buy_test_group_buys() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_b, asset_a, @@ -1753,7 +1706,7 @@ fn buy_test_group_buys() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -1762,7 +1715,7 @@ fn buy_test_group_buys() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_4, asset_a, asset_b, @@ -1771,14 +1724,8 @@ fn buy_test_group_buys() { user_4_sell_intention_id, ) .into(), - TestEvent::amm(amm::RawEvent::Buy( - user_4, - asset_a, - asset_b, - 7500000000000, - 16251283991999, - )), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Buy(user_4, asset_a, asset_b, 7500000000000, 16251283991999).into(), + Event::IntentionResolvedAMMTrade( user_4, IntentionType::BUY, user_4_sell_intention_id, @@ -1786,7 +1733,7 @@ fn buy_test_group_buys() { 16251283991999, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_2, user_4, user_2_sell_intention_id, @@ -1795,16 +1742,10 @@ fn buy_test_group_buys() { 5000000000000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_a, 5000000000).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 10000000000).into(), - TestEvent::amm(amm::RawEvent::Buy( - user_3, - asset_b, - asset_a, - 3000000000000, - 1303930316730, - )), - RawEvent::IntentionResolvedAMMTrade( + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_a, 5000000000).into(), + Event::IntentionResolvedDirectTradeFees(user_4, pair_account, asset_b, 10000000000).into(), + amm::Event::Buy(user_3, asset_b, asset_a, 3000000000000, 1303930316730).into(), + Event::IntentionResolvedAMMTrade( user_3, IntentionType::BUY, user_3_sell_intention_id, @@ -1829,7 +1770,10 @@ fn discount_tests_with_error() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -1887,7 +1831,7 @@ fn discount_tests_with_error() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_b, asset_a, @@ -1896,7 +1840,7 @@ fn discount_tests_with_error() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -1905,7 +1849,7 @@ fn discount_tests_with_error() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_4, asset_a, asset_b, @@ -1914,7 +1858,7 @@ fn discount_tests_with_error() { user_4_sell_intention_id, ) .into(), - RawEvent::IntentionResolveErrorEvent( + Event::IntentionResolveErrorEvent( user_4, AssetPair { asset_in: asset_a, @@ -1923,13 +1867,13 @@ fn discount_tests_with_error() { IntentionType::SELL, user_4_sell_intention_id, DispatchError::Module { - index: 0, + index: 2, error: 19, message: None, }, ) .into(), - RawEvent::IntentionResolveErrorEvent( + Event::IntentionResolveErrorEvent( user_2, AssetPair { asset_in: asset_a, @@ -1938,13 +1882,13 @@ fn discount_tests_with_error() { IntentionType::BUY, user_2_sell_intention_id, DispatchError::Module { - index: 0, + index: 2, error: 19, message: None, }, ) .into(), - RawEvent::IntentionResolveErrorEvent( + Event::IntentionResolveErrorEvent( user_3, AssetPair { asset_in: asset_b, @@ -1953,7 +1897,7 @@ fn discount_tests_with_error() { IntentionType::SELL, user_3_sell_intention_id, DispatchError::Module { - index: 0, + index: 2, error: 19, message: None, }, @@ -1974,7 +1918,10 @@ fn simple_sell_sell() { let pool_amount = 100_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -2012,7 +1959,7 @@ fn simple_sell_sell() { assert_eq!(Currency::free_balance(asset_b, &pair_account), 199997008); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -2021,7 +1968,7 @@ fn simple_sell_sell() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -2030,7 +1977,7 @@ fn simple_sell_sell() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_2, user_3, user_2_sell_intention_id, @@ -2039,11 +1986,10 @@ fn simple_sell_sell() { 1000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 1).into(), - TestEvent::amm(amm::RawEvent::Sell(2, 3000, 2000, 1500, 2994)), - RawEvent::IntentionResolvedAMMTrade(user_2, IntentionType::SELL, user_2_sell_intention_id, 1500, 2994) - .into(), + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 1).into(), + amm::Event::Sell(2, 3000, 2000, 1500, 2994).into(), + Event::IntentionResolvedAMMTrade(user_2, IntentionType::SELL, user_2_sell_intention_id, 1500, 2994).into(), ]); }); } @@ -2059,7 +2005,10 @@ fn simple_buy_buy() { let pool_amount = 100_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -2097,7 +2046,7 @@ fn simple_buy_buy() { assert_eq!(Currency::free_balance(asset_b, &pair_account), 200003009); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -2106,7 +2055,7 @@ fn simple_buy_buy() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -2115,10 +2064,9 @@ fn simple_buy_buy() { user_3_sell_intention_id, ) .into(), - TestEvent::amm(amm::RawEvent::Buy(2, 3000, 2000, 1500, 3007)), - RawEvent::IntentionResolvedAMMTrade(user_2, IntentionType::BUY, user_2_sell_intention_id, 1500, 3007) - .into(), - RawEvent::IntentionResolvedDirectTrade( + amm::Event::Buy(2, 3000, 2000, 1500, 3007).into(), + Event::IntentionResolvedAMMTrade(user_2, IntentionType::BUY, user_2_sell_intention_id, 1500, 3007).into(), + Event::IntentionResolvedDirectTrade( user_3, user_2, user_3_sell_intention_id, @@ -2127,8 +2075,8 @@ fn simple_buy_buy() { 1000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 1).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_a, 1).into(), + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2).into(), ]); }); } @@ -2144,7 +2092,10 @@ fn simple_sell_buy() { let pool_amount = 100_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -2183,7 +2134,7 @@ fn simple_sell_buy() { assert_eq!(Currency::free_balance(asset_b, &pair_account), 199998010); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -2192,7 +2143,7 @@ fn simple_sell_buy() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_a, asset_b, @@ -2201,7 +2152,7 @@ fn simple_sell_buy() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionResolvedDirectTrade( + Event::IntentionResolvedDirectTrade( user_2, user_3, user_2_sell_intention_id, @@ -2210,11 +2161,10 @@ fn simple_sell_buy() { 2000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_b, 4).into(), - TestEvent::amm(amm::RawEvent::Sell(2, 3000, 2000, 1000, 1996)), - RawEvent::IntentionResolvedAMMTrade(user_2, IntentionType::SELL, user_2_sell_intention_id, 1000, 1996) - .into(), + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 2).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_b, 4).into(), + amm::Event::Sell(2, 3000, 2000, 1000, 1996).into(), + Event::IntentionResolvedAMMTrade(user_2, IntentionType::SELL, user_2_sell_intention_id, 1000, 1996).into(), ]); }); } @@ -2230,7 +2180,10 @@ fn simple_buy_sell() { let pool_amount = 100_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -2269,7 +2222,7 @@ fn simple_buy_sell() { assert_eq!(Currency::free_balance(asset_b, &pair_account), 200002011); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -2278,7 +2231,7 @@ fn simple_buy_sell() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_a, asset_b, @@ -2287,10 +2240,9 @@ fn simple_buy_sell() { user_3_sell_intention_id, ) .into(), - TestEvent::amm(amm::RawEvent::Buy(user_2, 3000, 2000, 1000, 2005)), - RawEvent::IntentionResolvedAMMTrade(user_2, IntentionType::BUY, user_2_sell_intention_id, 1000, 2005) - .into(), - RawEvent::IntentionResolvedDirectTrade( + amm::Event::Buy(user_2, 3000, 2000, 1000, 2005).into(), + Event::IntentionResolvedAMMTrade(user_2, IntentionType::BUY, user_2_sell_intention_id, 1000, 2005).into(), + Event::IntentionResolvedDirectTrade( user_3, user_2, user_3_sell_intention_id, @@ -2299,8 +2251,8 @@ fn simple_buy_sell() { 2000, ) .into(), - RawEvent::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_b, 2).into(), - RawEvent::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4).into(), + Event::IntentionResolvedDirectTradeFees(user_3, pair_account, asset_b, 2).into(), + Event::IntentionResolvedDirectTradeFees(user_2, pair_account, asset_b, 4).into(), ]); }); } @@ -2315,7 +2267,10 @@ fn single_sell_intention_test() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -2345,7 +2300,7 @@ fn single_sell_intention_test() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -2354,8 +2309,8 @@ fn single_sell_intention_test() { user_2_sell_intention_id, ) .into(), - TestEvent::amm(amm::RawEvent::Sell(2, 3000, 2000, 2000000000000, 3913878975647)), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Sell(2, 3000, 2000, 2000000000000, 3913878975647).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::SELL, user_2_sell_intention_id, @@ -2377,7 +2332,10 @@ fn single_buy_intention_test() { let pool_amount = 100_000_000_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -2408,7 +2366,7 @@ fn single_buy_intention_test() { assert_eq!(Exchange::get_intentions_count((asset_b, asset_a)), 0); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -2417,8 +2375,8 @@ fn single_buy_intention_test() { user_2_sell_intention_id, ) .into(), - TestEvent::amm(amm::RawEvent::Buy(2, 3000, 2000, 2000000000000, 4089962855627)), - RawEvent::IntentionResolvedAMMTrade( + amm::Event::Buy(2, 3000, 2000, 2000000000000, 4089962855627).into(), + Event::IntentionResolvedAMMTrade( user_2, IntentionType::BUY, user_2_sell_intention_id, @@ -2441,7 +2399,10 @@ fn simple_sell_sell_with_error_should_not_pass() { let pool_amount = 100_000_000; let initial_price = Price::from(2); - let pair_account = AMMModule::get_pair_id(AssetPair{asset_in: asset_a, asset_out: asset_b}); + let pair_account = AMMModule::get_pair_id(AssetPair { + asset_in: asset_a, + asset_out: asset_b, + }); initialize_pool(asset_a, asset_b, user_1, pool_amount, initial_price); @@ -2482,7 +2443,7 @@ fn simple_sell_sell_with_error_should_not_pass() { assert_eq!(Currency::free_balance(asset_b, &pair_account), 200000000); expect_events(vec![ - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_2, asset_a, asset_b, @@ -2491,7 +2452,7 @@ fn simple_sell_sell_with_error_should_not_pass() { user_2_sell_intention_id, ) .into(), - RawEvent::IntentionRegistered( + Event::IntentionRegistered( user_3, asset_b, asset_a, @@ -2500,7 +2461,7 @@ fn simple_sell_sell_with_error_should_not_pass() { user_3_sell_intention_id, ) .into(), - RawEvent::IntentionResolveErrorEvent( + Event::IntentionResolveErrorEvent( user_2, AssetPair { asset_in: asset_a, @@ -2509,13 +2470,13 @@ fn simple_sell_sell_with_error_should_not_pass() { IntentionType::SELL, user_2_sell_intention_id, DispatchError::Module { - index: 0, + index: 2, error: 8, message: None, }, ) .into(), - RawEvent::IntentionResolveErrorEvent( + Event::IntentionResolveErrorEvent( user_3, AssetPair { asset_in: asset_b, @@ -2524,7 +2485,7 @@ fn simple_sell_sell_with_error_should_not_pass() { IntentionType::SELL, user_3_sell_intention_id, DispatchError::Module { - index: 0, + index: 2, error: 8, message: None, }, diff --git a/pallets/exchange/src/weights.rs b/pallets/exchange/src/weights.rs index ef72bf024..fcc8f5491 100644 --- a/pallets/exchange/src/weights.rs +++ b/pallets/exchange/src/weights.rs @@ -35,166 +35,155 @@ // --output=weights.rs // --template=.maintain/pallet-weight-template.hbs - #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; use sp_std::marker::PhantomData; /// Weight functions needed for exchange. pub trait WeightInfo { -fn known_overhead_for_on_finalize() -> Weight; -fn sell_intention() -> Weight; -fn buy_intention() -> Weight; -fn on_finalize(t: u32, ) -> Weight; -fn on_finalize_buys_no_matches(t: u32, ) -> Weight; -fn on_finalize_sells_no_matches(t: u32, ) -> Weight; -fn sell_extrinsic() -> Weight; -fn on_finalize_for_one_sell_extrinsic() -> Weight; -fn buy_extrinsic() -> Weight; -fn on_finalize_for_one_buy_extrinsic() -> Weight; + fn known_overhead_for_on_finalize() -> Weight; + fn sell_intention() -> Weight; + fn buy_intention() -> Weight; + fn on_finalize(t: u32) -> Weight; + fn on_finalize_buys_no_matches(t: u32) -> Weight; + fn on_finalize_sells_no_matches(t: u32) -> Weight; + fn sell_extrinsic() -> Weight; + fn on_finalize_for_one_sell_extrinsic() -> Weight; + fn buy_extrinsic() -> Weight; + fn on_finalize_for_one_buy_extrinsic() -> Weight; } /// Weights for exchange using the hydraDX node and recommended hardware. pub struct HydraWeight(PhantomData); - impl WeightInfo for HydraWeight { - fn known_overhead_for_on_finalize() -> Weight { - (14_283_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - } - fn sell_intention() -> Weight { - (132_316_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn buy_intention() -> Weight { - (131_863_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - } - fn on_finalize(t: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 91_000 - .saturating_add((168_120_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(t as - Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(t as - Weight))) - } - fn on_finalize_buys_no_matches(t: u32, ) -> Weight { - (8_505_000 as Weight) - // Standard Error: 92_000 - .saturating_add((190_583_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(t as - Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(t as - Weight))) - } - fn on_finalize_sells_no_matches(t: u32, ) -> Weight { - (16_195_000 as Weight) - // Standard Error: 44_000 - .saturating_add((166_063_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(T::DbWeight::get().reads(4 as Weight)) - .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(t as - Weight))) - .saturating_add(T::DbWeight::get().writes(2 as Weight)) - .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(t as - Weight))) - } - fn sell_extrinsic() -> Weight { - (177_280_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn on_finalize_for_one_sell_extrinsic() -> Weight { - (232_319_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - fn buy_extrinsic() -> Weight { - (176_376_000 as Weight) - .saturating_add(T::DbWeight::get().reads(5 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn on_finalize_for_one_buy_extrinsic() -> Weight { - (257_266_000 as Weight) - .saturating_add(T::DbWeight::get().reads(9 as Weight)) - .saturating_add(T::DbWeight::get().writes(6 as Weight)) - } - } +impl WeightInfo for HydraWeight { + fn known_overhead_for_on_finalize() -> Weight { + (14_283_000 as Weight).saturating_add(T::DbWeight::get().reads(1 as Weight)) + } + fn sell_intention() -> Weight { + (132_316_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn buy_intention() -> Weight { + (131_863_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn on_finalize(t: u32) -> Weight { + (0 as Weight) + // Standard Error: 91_000 + .saturating_add((168_120_000 as Weight).saturating_mul(t as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(t as Weight))) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(t as Weight))) + } + fn on_finalize_buys_no_matches(t: u32) -> Weight { + (8_505_000 as Weight) + // Standard Error: 92_000 + .saturating_add((190_583_000 as Weight).saturating_mul(t as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(t as Weight))) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(t as Weight))) + } + fn on_finalize_sells_no_matches(t: u32) -> Weight { + (16_195_000 as Weight) + // Standard Error: 44_000 + .saturating_add((166_063_000 as Weight).saturating_mul(t as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(t as Weight))) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(t as Weight))) + } + fn sell_extrinsic() -> Weight { + (177_280_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn on_finalize_for_one_sell_extrinsic() -> Weight { + (232_319_000 as Weight) + .saturating_add(T::DbWeight::get().reads(9 as Weight)) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) + } + fn buy_extrinsic() -> Weight { + (176_376_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn on_finalize_for_one_buy_extrinsic() -> Weight { + (257_266_000 as Weight) + .saturating_add(T::DbWeight::get().reads(9 as Weight)) + .saturating_add(T::DbWeight::get().writes(6 as Weight)) + } +} - // For backwards compatibility and tests - impl WeightInfo for () { - fn known_overhead_for_on_finalize() -> Weight { - (14_283_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - } - fn sell_intention() -> Weight { - (132_316_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - fn buy_intention() -> Weight { - (131_863_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - } - fn on_finalize(t: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 91_000 - .saturating_add((168_120_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(t as - Weight))) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(t as - Weight))) - } - fn on_finalize_buys_no_matches(t: u32, ) -> Weight { - (8_505_000 as Weight) - // Standard Error: 92_000 - .saturating_add((190_583_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(t as - Weight))) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(t as - Weight))) - } - fn on_finalize_sells_no_matches(t: u32, ) -> Weight { - (16_195_000 as Weight) - // Standard Error: 44_000 - .saturating_add((166_063_000 as Weight).saturating_mul(t as Weight)) - .saturating_add(RocksDbWeight::get().reads(4 as Weight)) - .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(t as - Weight))) - .saturating_add(RocksDbWeight::get().writes(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(t as - Weight))) - } - fn sell_extrinsic() -> Weight { - (177_280_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - } - fn on_finalize_for_one_sell_extrinsic() -> Weight { - (232_319_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) - } - fn buy_extrinsic() -> Weight { - (176_376_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(5 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - } - fn on_finalize_for_one_buy_extrinsic() -> Weight { - (257_266_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(9 as Weight)) - .saturating_add(RocksDbWeight::get().writes(6 as Weight)) - } - } \ No newline at end of file +// For backwards compatibility and tests +impl WeightInfo for () { + fn known_overhead_for_on_finalize() -> Weight { + (14_283_000 as Weight).saturating_add(RocksDbWeight::get().reads(1 as Weight)) + } + fn sell_intention() -> Weight { + (132_316_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(6 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + fn buy_intention() -> Weight { + (131_863_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(6 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + fn on_finalize(t: u32) -> Weight { + (0 as Weight) + // Standard Error: 91_000 + .saturating_add((168_120_000 as Weight).saturating_mul(t as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(t as Weight))) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(t as Weight))) + } + fn on_finalize_buys_no_matches(t: u32) -> Weight { + (8_505_000 as Weight) + // Standard Error: 92_000 + .saturating_add((190_583_000 as Weight).saturating_mul(t as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(t as Weight))) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(t as Weight))) + } + fn on_finalize_sells_no_matches(t: u32) -> Weight { + (16_195_000 as Weight) + // Standard Error: 44_000 + .saturating_add((166_063_000 as Weight).saturating_mul(t as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(t as Weight))) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(t as Weight))) + } + fn sell_extrinsic() -> Weight { + (177_280_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn on_finalize_for_one_sell_extrinsic() -> Weight { + (232_319_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(9 as Weight)) + .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + } + fn buy_extrinsic() -> Weight { + (176_376_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn on_finalize_for_one_buy_extrinsic() -> Weight { + (257_266_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(9 as Weight)) + .saturating_add(RocksDbWeight::get().writes(6 as Weight)) + } +} diff --git a/pallets/faucet/Cargo.toml b/pallets/faucet/Cargo.toml index 51b32e48e..8e6d7c1c9 100644 --- a/pallets/faucet/Cargo.toml +++ b/pallets/faucet/Cargo.toml @@ -6,7 +6,7 @@ homepage = 'https://github.com/galacticcouncil/hydradx-node' license = 'Unlicense' name = 'pallet-faucet' repository = 'https://github.com/galacticcouncil/hydradx-node' -version = '2.0.0' +version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -19,29 +19,29 @@ wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0 default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] primitive-types = {default-features = false, version = '0.7.2'} serde = {features = ['derive'], optional = true, version = '1.0.101'} # Local dependencies -primitives = {path = '../../primitives', default-features = false, version = '2.0.0'} +primitives = {path = '../../primitives', default-features = false} # ORML dependencies -orml-tokens = {default-features = false, version = "0.3.3-dev"} -orml-traits = {default-features = false, version = "0.3.3-dev"} +orml-tokens = {default-features = false, version = "0.4.1-dev"} +orml-traits = {default-features = false, version = "0.4.1-dev"} # Substrate dependencies -frame-support = {default-features = false, version = '2.0.0'} -frame-system = {default-features = false, version = '2.0.0'} -sp-std = {default-features = false, version = '2.0.0'} +frame-support = {default-features = false, version = '3.0.0'} +frame-system = {default-features = false, version = '3.0.0'} +sp-std = {default-features = false, version = '3.0.0'} -sp-core = {default-features = false, version = '2.0.0'} -sp-runtime = {default-features = false, version = '2.0.0'} +sp-core = {default-features = false, version = '3.0.0'} +sp-runtime = {default-features = false, version = '3.0.0'} [dev-dependencies] -sp-io = {default-features = false, version = '2.0.0'} +sp-io = {default-features = false, version = '3.0.0'} [features] default = ['std'] @@ -51,4 +51,5 @@ std = [ 'sp-std/std', 'frame-support/std', 'frame-system/std', + 'orml-tokens/std', ] diff --git a/pallets/faucet/src/lib.rs b/pallets/faucet/src/lib.rs index d2f546a15..34c013e24 100644 --- a/pallets/faucet/src/lib.rs +++ b/pallets/faucet/src/lib.rs @@ -1,7 +1,9 @@ #![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::unused_unit)] + use frame_support::{ - decl_error, decl_event, decl_module, decl_storage, dispatch, ensure, + ensure, weights::{DispatchClass, Pays}, }; use frame_system::ensure_signed; @@ -15,61 +17,115 @@ mod mock; #[cfg(test)] mod tests; -pub trait Config: frame_system::Config { - type Event: From> + Into<::Event>; - type Currency: MultiCurrencyExtended; -} +// Re-export pallet items so that they can be accessed from the crate namespace. +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::OriginFor; -decl_storage! { - trait Store for Module as Faucet { - pub Minted get(fn minted): u8; - pub MintLimit get(fn mint_limit) config(): u8; - pub Rampage get(fn rampage) config(): bool; - pub MintableCurrencies get(fn mintable_currencies) config(): Vec; + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::hooks] + impl Hooks for Pallet { + fn on_finalize(_p: T::BlockNumber) { + Minted::::set(0u8); + } } -} -decl_event!( - pub enum Event - where - AccountId = ::AccountId, - AssetId = AssetId, - Balance = Balance, - { - RampageMint(AccountId, AssetId, Balance), - Mint(AccountId), + #[pallet::config] + pub trait Config: frame_system::Config { + type Event: From> + IsType<::Event>; + + type Currency: MultiCurrencyExtended; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { + RampageMint(T::AccountId, AssetId, Balance), + Mint(T::AccountId), } -); -decl_error! { - pub enum Error for Module { + #[pallet::error] + pub enum Error { RampageMintNotAllowed, - MaximumMintLimitReached + MaximumMintLimitReached, + } + #[pallet::storage] + #[pallet::getter(fn minted)] + pub type Minted = StorageValue<_, u8, ValueQuery>; + + #[pallet::storage] + #[pallet::getter(fn mint_limit)] + pub type MintLimit = StorageValue<_, u8, ValueQuery>; + + #[pallet::storage] + #[pallet::getter(fn rampage)] + pub type Rampage = StorageValue<_, bool, ValueQuery>; + + #[pallet::storage] + #[pallet::getter(fn mintable_currencies)] + pub type MintableCurrencies = StorageValue<_, Vec, ValueQuery>; + + #[pallet::genesis_config] + pub struct GenesisConfig { + pub mint_limit: u8, + pub rampage: bool, + pub mintable_currencies: Vec, } -} -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - type Error = Error; + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig { + mint_limit: Default::default(), + rampage: Default::default(), + mintable_currencies: vec![], + } + } + } + + #[cfg(feature = "std")] + impl GenesisConfig { + /// Direct implementation to not break dependency + pub fn build_storage(&self) -> Result { + >::build_storage(self) + } - fn deposit_event() = default; + /// Direct implementation to not break dependency + pub fn assimilate_storage(&self, storage: &mut sp_runtime::Storage) -> Result<(), String> { + >::assimilate_storage(self, storage) + } + } - #[weight = (0, DispatchClass::Normal, Pays::No)] - pub fn rampage_mint(origin, asset: AssetId, amount: Balance) -> dispatch::DispatchResult { + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + MintLimit::::put(self.mint_limit); + Rampage::::put(self.rampage); + MintableCurrencies::::put(self.mintable_currencies.clone()); + } + } + + #[pallet::call] + impl Pallet { + #[pallet::weight((0, DispatchClass::Normal, Pays::No))] + pub fn rampage_mint(origin: OriginFor, asset: AssetId, amount: Balance) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!( - Self::rampage(), - Error::::RampageMintNotAllowed - ); + ensure!(Self::rampage(), Error::::RampageMintNotAllowed); T::Currency::deposit(asset, &who, amount)?; - Self::deposit_event(RawEvent::RampageMint(who, asset, amount)); + Self::deposit_event(Event::RampageMint(who, asset, amount)); - Ok(()) + Ok(().into()) } - #[weight = (0, DispatchClass::Normal, Pays::No)] - pub fn mint(origin) -> dispatch::DispatchResult { + #[pallet::weight((0, DispatchClass::Normal, Pays::No))] + pub fn mint(origin: OriginFor) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; ensure!(Self::minted() < Self::mint_limit(), Error::::MaximumMintLimitReached); @@ -78,15 +134,11 @@ decl_module! { T::Currency::deposit(i, &who, 1_000_000_000_000_000)?; } - Minted::set(Self::minted() + 1); + Minted::::set(Self::minted() + 1); - Self::deposit_event(RawEvent::Mint(who)); - - Ok(()) - } + Self::deposit_event(Event::Mint(who)); - fn on_finalize(){ - Minted::set(0u8); + Ok(().into()) } } } diff --git a/pallets/faucet/src/mock.rs b/pallets/faucet/src/mock.rs index 7e571014d..90e8edbbd 100644 --- a/pallets/faucet/src/mock.rs +++ b/pallets/faucet/src/mock.rs @@ -1,5 +1,7 @@ -use crate::{Config, Module}; -use frame_support::{impl_outer_origin, parameter_types}; +use crate as faucet; +use crate::Config; +use frame_support::parameter_types; +use frame_support::traits::GenesisBuild; use frame_system as system; use orml_traits::parameter_type_with_key; use primitives::{AssetId, Balance}; @@ -9,16 +11,24 @@ use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup, Zero}, }; -impl_outer_origin! { - pub enum Origin for Test {} -} - -// Configure a mock runtime to test the pallet. +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + Faucet: faucet::{Module, Call,Config, Storage, Event}, + Currency: orml_tokens::{Module, Event}, + } +); -#[derive(Clone, Eq, PartialEq)] -pub struct Test; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const SS58Prefix: u8 = 63; } impl system::Config for Test { @@ -26,7 +36,7 @@ impl system::Config for Test { type BlockWeights = (); type BlockLength = (); type Origin = Origin; - type Call = (); + type Call = Call; type Index = u64; type BlockNumber = u64; type Hash = H256; @@ -38,17 +48,18 @@ impl system::Config for Test { type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); + type SS58Prefix = SS58Prefix; } pub type Amount = i128; parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: AssetId| -> Balance { + pub ExistentialDeposits: |_currency_id: AssetId| -> Balance { Zero::zero() }; } @@ -63,15 +74,11 @@ impl orml_tokens::Config for Test { type OnDust = (); } -pub type Currency = orml_tokens::Module; - impl Config for Test { type Event = (); type Currency = Currency; } -pub type Faucet = Module; - pub type AccountId = u64; pub const ALICE: AccountId = 1; @@ -101,12 +108,12 @@ impl ExtBuilder { .assimilate_storage(&mut t) .unwrap(); - crate::GenesisConfig { + faucet::GenesisConfig { rampage: true, mintable_currencies: vec![2000, 3000], mint_limit: 5, } - .assimilate_storage(&mut t) + .assimilate_storage::(&mut t) .unwrap(); t.into() @@ -120,7 +127,7 @@ impl ExtBuilder { mintable_currencies: vec![2000, 3000], mint_limit: 5, } - .assimilate_storage(&mut t) + .assimilate_storage::(&mut t) .unwrap(); orml_tokens::GenesisConfig:: { diff --git a/pallets/transaction-multi-payment/Cargo.toml b/pallets/transaction-multi-payment/Cargo.toml index 32ee68626..d62fba21d 100644 --- a/pallets/transaction-multi-payment/Cargo.toml +++ b/pallets/transaction-multi-payment/Cargo.toml @@ -19,37 +19,37 @@ wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0 default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] primitive-types = {default-features = false, version = '0.8.0'} serde = {features = ['derive'], optional = true, version = '1.0.101'} # Local dependecies -primitives = {path = '../../primitives', default-features = false, version = '2.0.0'} +primitives = {path = '../../primitives', default-features = false} +pallet-asset-registry = {path = '../asset-registry', default-features = false} +pallet-amm = {path = '../amm', default-features = false } # ORML dependencies -orml-tokens = {default-features = false, version = "0.3.3-dev"} -orml-traits = {default-features = false, version = "0.3.3-dev"} -orml-utilities = {default-features = false, version = "0.3.3-dev"} +orml-tokens = {default-features = false, version = "0.4.1-dev"} +orml-traits = {default-features = false, version = "0.4.1-dev"} +orml-utilities = {default-features = false, version = "0.4.1-dev"} # Substrate dependencies -frame-support = {default-features = false, version = '2.0.0'} -frame-system = {default-features = false, version = '2.0.0'} -sp-std = {default-features = false, version = '2.0.0'} -pallet-transaction-payment = {default-features = false, version = '2.0.0'} +frame-support = {default-features = false, version = '3.0.0'} +frame-system = {default-features = false, version = '3.0.0'} +sp-std = {default-features = false, version = '3.0.0'} +sp-core = {default-features = false, version = '3.0.0'} +sp-runtime = {default-features = false, version = '3.0.0'} +sp-api= {default-features = false, version = '3.0.0'} -sp-core = {default-features = false, version = '2.0.0'} -sp-runtime = {default-features = false, version = '2.0.0'} -sp-api= {default-features = false, version = '2.0.0'} -pallet-balances = {default-features = false, version = '2.0.0' } -pallet-asset-registry = {path = '../asset-registry', default-features = false, version = '2.0.0'} -pallet-amm = {path = '../amm', default-features = false } +pallet-balances = {default-features = false, version = '3.0.0' } +pallet-transaction-payment = {default-features = false, version = '3.0.0'} [dev-dependencies] -sp-io = {default-features = false, version = '2.0.0'} -pallet-transaction-payment = {default-features = false, version = '2.0.0' } -orml-currencies = {default-features = false, version = "0.3.3-dev"} +sp-io = {default-features = false, version = '3.0.0'} +pallet-transaction-payment = {default-features = false, version = '3.0.0' } +orml-currencies = {default-features = false, version = "0.4.1-dev"} [features] default = ['std'] diff --git a/pallets/transaction-multi-payment/benchmarking/Cargo.toml b/pallets/transaction-multi-payment/benchmarking/Cargo.toml index fc9ea5ebf..e808f0828 100644 --- a/pallets/transaction-multi-payment/benchmarking/Cargo.toml +++ b/pallets/transaction-multi-payment/benchmarking/Cargo.toml @@ -19,41 +19,42 @@ wasm-builder-runner = { package = 'substrate-wasm-builder-runner', version = '1. default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] serde = { features = ['derive'], optional = true, version = '1.0.101' } # Local dependencies -primitives = { path = '../../../primitives', default-features = false, version = '2.0.0' } -pallet-asset-registry= { path = '../../asset-registry', default-features = false, version = '2.0.0' } +primitives = { path = '../../../primitives', default-features = false } +pallet-asset-registry= { path = '../../asset-registry', default-features = false } pallet-amm = { path = '../../amm', default-features = false } -pallet-transaction-multi-payment = { path = '../../transaction-multi-payment', default-features = false, version = '3.0.0' } +pallet-transaction-multi-payment = { path = '../../transaction-multi-payment', default-features = false } # ORML dependencies -orml-traits = { default-features = false, version = "0.3.3-dev" } -orml-tokens = { default-features = false, version = "0.3.3-dev" } -orml-currencies= { default-features = false, version = "0.3.3-dev" } -orml-utilities = {default-features = false, version = "0.3.3-dev"} +orml-traits = { default-features = false, version = "0.4.1-dev" } +orml-tokens = { default-features = false, version = "0.4.1-dev" } +orml-currencies= { default-features = false, version = "0.4.1-dev" } +orml-utilities = {default-features = false, version = "0.4.1-dev"} # Substrate dependencies -frame-system = { default-features = false, version = '2.0.0' } -frame-support = { default-features = false, version = '2.0.0' } -frame-benchmarking = { default-features = false, version = '2.0.0' } -frame-system-benchmarking = { default-features = false, version = '2.0.0' } -pallet-transaction-payment = {default-features = false, version = '2.0.0'} -sp-std = { default-features = false, version = '2.0.0' } -pallet-balances = {default-features = false, version = '2.0.0' } +frame-system = { default-features = false, version = '3.0.0' } +frame-support = { default-features = false, version = '3.0.0' } +frame-benchmarking = { default-features = false, version = '3.0.0' } +frame-system-benchmarking = { default-features = false, version = '3.0.0' } +pallet-transaction-payment = {default-features = false, version = '3.0.0'} +sp-std = { default-features = false, version = '3.0.0' } +pallet-balances = {default-features = false, version = '3.0.0' } -sp-core = { default-features = false, version = '2.0.0' } -sp-runtime = { default-features = false, version = '2.0.0' } +sp-core = { default-features = false, version = '3.0.0' } +sp-runtime = { default-features = false, version = '3.0.0' } [dev-dependencies] -sp-io = { default-features = false, version = '2.0.0' } +sp-io = { default-features = false, version = '3.0.0' } [features] default = ['std'] std = [ + 'serde', 'codec/std', 'frame-support/std', 'frame-system/std', diff --git a/pallets/transaction-multi-payment/benchmarking/src/lib.rs b/pallets/transaction-multi-payment/benchmarking/src/lib.rs index 086c44b4e..671bcd56e 100644 --- a/pallets/transaction-multi-payment/benchmarking/src/lib.rs +++ b/pallets/transaction-multi-payment/benchmarking/src/lib.rs @@ -11,8 +11,8 @@ use orml_traits::{MultiCurrency, MultiCurrencyExtended}; use orml_utilities::OrderedSet; use pallet_transaction_multi_payment::Module as MultiPaymentModule; use primitives::{Amount, AssetId, Balance, Price}; -use sp_runtime::DispatchError; +use frame_support::dispatch; use pallet_amm as ammpool; pub struct Module(pallet_transaction_multi_payment::Module); @@ -43,14 +43,12 @@ fn initialize_pool( asset: AssetId, amount: Balance, price: Price, -) -> Result<(), DispatchError> { +) -> dispatch::DispatchResultWithPostInfo { ammpool::Module::::create_pool(RawOrigin::Signed(caller).into(), HDX, asset, amount, price)?; - Ok(()) + Ok(().into()) } benchmarks! { - _ { } - swap_currency { let maker = funded_account::("maker", 1); initialize_pool::(maker.clone(), ASSET_ID, 1000, Price::from(1))?; diff --git a/pallets/transaction-multi-payment/benchmarking/src/mock.rs b/pallets/transaction-multi-payment/benchmarking/src/mock.rs index 117fd4b89..6dfd6aeaf 100644 --- a/pallets/transaction-multi-payment/benchmarking/src/mock.rs +++ b/pallets/transaction-multi-payment/benchmarking/src/mock.rs @@ -1,7 +1,8 @@ #![cfg(test)] use crate::Config; -use frame_support::{impl_outer_dispatch, impl_outer_origin, parameter_types}; +use frame_support::parameter_types; +use frame_support::traits::GenesisBuild; use frame_system as system; use orml_traits::parameter_type_with_key; use sp_core::H256; @@ -36,23 +37,26 @@ impl Get for ExtrinsicBaseWeight { } } -impl_outer_origin! { - pub enum Origin for Test {} -} +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; -mod multi_payment { - pub use super::super::*; -} +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + PaymentModule: pallet_transaction_multi_payment::{Module, Call, Storage, Event}, + AMMModule: pallet_amm::{Module, Call, Storage, Event}, + Balances: pallet_balances::{Module,Call, Storage,Config, Event}, + Currencies: orml_currencies::{Module, Event}, + Tokens: orml_tokens::{Module, Event}, + AssetRegistry: pallet_asset_registry::{Module, Storage}, + } -impl_outer_dispatch! { - pub enum Call for Test where origin: Origin { - pallet_balances::Balances, - frame_system::System, - } -} +); -#[derive(Clone, Eq, PartialEq)] -pub struct Test; parameter_types! { pub const BlockHashCount: u64 = 250; @@ -77,20 +81,21 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = (); + type Event = Event; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); + type SS58Prefix = (); } impl Config for Test {} impl pallet_transaction_multi_payment::Config for Test { - type Event = (); + type Event = Event; type Currency = Balances; type MultiCurrency = Currencies; type AMMPool = AMMModule; @@ -108,7 +113,7 @@ impl pallet_balances::Config for Test { type Balance = Balance; type DustRemoval = (); /// The ubiquitous event type. - type Event = (); + type Event = Event; type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); @@ -138,7 +143,7 @@ impl AssetPairAccountIdFor for AssetPairAccountIdTest { } impl pallet_amm::Config for Test { - type Event = (); + type Event = Event; type AssetPairAccountId = AssetPairAccountIdTest; type Currency = Currencies; type HDXAssetId = HdxAssetId; @@ -147,13 +152,13 @@ impl pallet_amm::Config for Test { } parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: AssetId| -> Balance { + pub ExistentialDeposits: |_currency_id: AssetId| -> Balance { Zero::zero() }; } impl orml_tokens::Config for Test { - type Event = (); + type Event = Event; type Balance = Balance; type Amount = Amount; type CurrencyId = AssetId; @@ -163,21 +168,13 @@ impl orml_tokens::Config for Test { } impl orml_currencies::Config for Test { - type Event = (); + type Event = Event; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; type GetNativeCurrencyId = HdxAssetId; type WeightInfo = (); } -pub type AMMModule = pallet_amm::Module; -pub type Tokens = orml_tokens::Module; -pub type Currencies = orml_currencies::Module; -pub type Balances = pallet_balances::Module; - -pub type PaymentModule = pallet_transaction_multi_payment::Module; -pub type System = system::Module; - pub struct ExtBuilder { base_weight: u64, native_balances: Vec<(AccountId, Balance)>, diff --git a/pallets/transaction-multi-payment/src/lib.rs b/pallets/transaction-multi-payment/src/lib.rs index d7bf34043..80eea4ced 100644 --- a/pallets/transaction-multi-payment/src/lib.rs +++ b/pallets/transaction-multi-payment/src/lib.rs @@ -1,4 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::unused_unit)] pub mod weights; @@ -11,12 +12,10 @@ mod mock; mod tests; use frame_support::{ - decl_error, decl_event, decl_module, decl_storage, dispatch::DispatchResult, ensure, - traits::{ - Currency, ExistenceRequirement, Get, GetPalletVersion, Imbalance, OnUnbalanced, PalletVersion, WithdrawReasons, - }, + traits::{Currency, ExistenceRequirement, Get, Imbalance, OnUnbalanced, WithdrawReasons}, + transactional, weights::DispatchClass, weights::WeightToFeePolynomial, }; @@ -36,65 +35,75 @@ use primitives::asset::AssetPair; use primitives::traits::{CurrencySwap, AMM}; use primitives::{Amount, AssetId, Balance, CORE_ASSET_ID}; -use orml_utilities::with_transaction_result; use orml_utilities::OrderedSet; type NegativeImbalanceOf = ::AccountId>>::NegativeImbalance; +// Re-export pallet items so that they can be accessed from the crate namespace. +pub use pallet::*; -pub trait Config: frame_system::Config + pallet_transaction_payment::Config { - /// Because this pallet emits events, it depends on the runtime's definition of an event. - type Event: From> + Into<::Event>; +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::OriginFor; - /// The currency type in which fees will be paid. - type Currency: Currency + Send + Sync; + #[pallet::pallet] + pub struct Pallet(_); - /// Multi Currency - type MultiCurrency: MultiCurrency - + MultiCurrencyExtended; + #[pallet::hooks] + impl Hooks for Pallet {} - /// AMM pool to swap for native currency - type AMMPool: AMM; + #[pallet::config] + pub trait Config: frame_system::Config + pallet_transaction_payment::Config { + /// Because this pallet emits events, it depends on the runtime's definition of an event. + type Event: From> + IsType<::Event>; - /// Weight information for the extrinsics. - type WeightInfo: WeightInfo; + /// The currency type in which fees will be paid. + type Currency: Currency + Send + Sync; - /// Should fee be paid for setting a currency - type WithdrawFeeForSetCurrency: Get; + /// Multi Currency + type MultiCurrency: MultiCurrency + + MultiCurrencyExtended; - /// Convert a weight value into a deductible fee based on the currency type. - type WeightToFee: WeightToFeePolynomial; -} + /// AMM pool to swap for native currency + type AMMPool: AMM; + + /// Weight information for the extrinsics. + type WeightInfo: WeightInfo; -decl_event!( - pub enum Event - where - AccountId = ::AccountId, - { + /// Should fee be paid for setting a currency + type WithdrawFeeForSetCurrency: Get; + + /// Convert a weight value into a deductible fee based on the currency type. + type WeightToFee: WeightToFeePolynomial; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { /// CurrencySet /// [who, currency] - CurrencySet(AccountId, AssetId), + CurrencySet(T::AccountId, AssetId), /// New accepted currency added /// [who, currency] - CurrencyAdded(AccountId, AssetId), + CurrencyAdded(T::AccountId, AssetId), /// Accepted currency removed /// [who, currency] - CurrencyRemoved(AccountId, AssetId), + CurrencyRemoved(T::AccountId, AssetId), /// Member added /// [who] - MemberAdded(AccountId), + MemberAdded(T::AccountId), /// Member removed /// [who] - MemberRemoved(AccountId), + MemberRemoved(T::AccountId), } -); -// The pallet's errors -decl_error! { - pub enum Error for Module { + #[pallet::error] + pub enum Error { /// Selected currency is not supported UnsupportedCurrency, @@ -115,164 +124,136 @@ decl_error! { /// Account is not a member of authorities NotAMember, + } + + /// Account currency map + #[pallet::storage] + #[pallet::getter(fn get_currency)] + pub type AccountCurrencyMap = StorageMap<_, Blake2_128Concat, T::AccountId, Option, ValueQuery>; + /// Curated list of currencies which fees can be paid with + #[pallet::storage] + #[pallet::getter(fn currencies)] + pub type AcceptedCurrencies = StorageValue<_, OrderedSet, ValueQuery>; + + #[pallet::storage] + #[pallet::getter(fn authorities)] + pub type Authorities = StorageValue<_, Vec, ValueQuery>; + + #[pallet::genesis_config] + pub struct GenesisConfig { + pub currencies: OrderedSet, + pub authorities: Vec, } -} -decl_storage! { - trait Store for Module as TransactionPayment { - /// Account currency map - pub AccountCurrencyMap get(fn get_currency): map hasher(blake2_128_concat) T::AccountId => Option; - pub AcceptedCurrencies get(fn currencies) config(): OrderedSet; - pub Authorities get(fn authorities) config(): Vec; + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + GenesisConfig { + currencies: OrderedSet::new(), + authorities: vec![], + } + } } -} -decl_module! { - pub struct Module for enum Call where origin: T::Origin { - // Errors must be initialized if they are used by the pallet. - type Error = Error; - - // Events must be initialized if they are used by the pallet. - fn deposit_event() = default; - - /// Set currency in which transaction fees are paid. - /// This is feeless transaction. - /// Selected currency must have non-zero balance otherwise is not allowed to be set. - #[weight = (::WeightInfo::set_currency(), Pays::No)] - pub fn set_currency( - origin, - currency: AssetId, - ) -> DispatchResult{ + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + Authorities::::put(self.authorities.clone()); + AcceptedCurrencies::::put(self.currencies.clone()); + } + } + #[pallet::call] + impl Pallet { + #[pallet::weight((::WeightInfo::set_currency(), DispatchClass::Normal, Pays::No))] + #[transactional] + pub fn set_currency(origin: OriginFor, currency: AssetId) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - if currency == CORE_ASSET_ID || Self::currencies().contains(¤cy){ - if T::MultiCurrency::free_balance(currency, &who) == Balance::zero(){ + if currency == CORE_ASSET_ID || Self::currencies().contains(¤cy) { + if T::MultiCurrency::free_balance(currency, &who) == Balance::zero() { return Err(Error::::ZeroBalance.into()); } - return with_transaction_result(|| { - >::insert(who.clone(), currency); + >::insert(who.clone(), Some(currency)); - if T::WithdrawFeeForSetCurrency::get() == Pays::Yes{ - Self::withdraw_set_fee(&who, currency)?; - } + if T::WithdrawFeeForSetCurrency::get() == Pays::Yes { + Self::withdraw_set_fee(&who, currency)?; + } - Self::deposit_event(RawEvent::CurrencySet(who, currency)); + Self::deposit_event(Event::CurrencySet(who, currency)); - Ok(()) - }); + return Ok(().into()); } Err(Error::::UnsupportedCurrency.into()) } - /// Add additional currency to the list of supported currencies which fees can be paid in - /// Only selected members can perform this action - #[weight = (::WeightInfo::add_currency(), Pays::No)] - pub fn add_currency(origin, currency: AssetId) -> DispatchResult{ + #[pallet::weight((::WeightInfo::add_currency(), DispatchClass::Normal, Pays::No))] + pub fn add_currency(origin: OriginFor, currency: AssetId) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!( - currency != CORE_ASSET_ID, - Error::::CoreAssetNotAllowed - ); + ensure!(currency != CORE_ASSET_ID, Error::::CoreAssetNotAllowed); // Only selected accounts can perform this action - ensure!( - Self::authorities().contains(&who), - Error::::NotAllowed - ); - - if AcceptedCurrencies::mutate(|x| x.insert(currency)) { - Self::deposit_event(RawEvent::CurrencyAdded(who, currency)); - return Ok(()); + ensure!(Self::authorities().contains(&who), Error::::NotAllowed); + + if AcceptedCurrencies::::mutate(|x| x.insert(currency)) { + Self::deposit_event(Event::CurrencyAdded(who, currency)); + return Ok(().into()); } Err(Error::::AlreadyAccepted.into()) } /// Remove currency from the list of supported currencies /// Only selected members can perform this action - #[weight = (::WeightInfo::remove_currency(), Pays::No)] - pub fn remove_currency(origin, currency: AssetId) -> DispatchResult{ - + #[pallet::weight((::WeightInfo::remove_currency(), DispatchClass::Normal, Pays::No))] + pub fn remove_currency(origin: OriginFor, currency: AssetId) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!( - currency != CORE_ASSET_ID, - Error::::CoreAssetNotAllowed - ); + ensure!(currency != CORE_ASSET_ID, Error::::CoreAssetNotAllowed); // Only selected accounts can perform this action - ensure!( - Self::authorities().contains(&who), - Error::::NotAllowed - ); - - if AcceptedCurrencies::mutate(|x| x.remove(¤cy)) { - Self::deposit_event(RawEvent::CurrencyRemoved(who, currency)); - return Ok(()); + ensure!(Self::authorities().contains(&who), Error::::NotAllowed); + + if AcceptedCurrencies::::mutate(|x| x.remove(¤cy)) { + Self::deposit_event(Event::CurrencyRemoved(who, currency)); + return Ok(().into()); } Err(Error::::UnsupportedCurrency.into()) } /// Add an account as member to list of authorities who can manage list of accepted currencies - #[weight = (::WeightInfo::add_member(), Pays::No)] - pub fn add_member(origin, member: T::AccountId) -> DispatchResult{ + #[pallet::weight((::WeightInfo::add_member(), DispatchClass::Normal, Pays::No))] + pub fn add_member(origin: OriginFor, member: T::AccountId) -> DispatchResultWithPostInfo { ensure_root(origin)?; - ensure!( - ! Self::authorities().contains(&member), - Error::::AlreadyMember - ); + ensure!(!Self::authorities().contains(&member), Error::::AlreadyMember); Self::add_new_member(&member); - Self::deposit_event(RawEvent::MemberAdded(member)); + Self::deposit_event(Event::MemberAdded(member)); - Ok(()) + Ok(().into()) } - /// Add an account as member to list of authorities who can manage list of accepted currencies - #[weight = (::WeightInfo::remove_member(), Pays::No)] - pub fn remove_member(origin, member: T::AccountId) -> DispatchResult{ + #[pallet::weight((::WeightInfo::remove_member(), DispatchClass::Normal, Pays::No))] + pub fn remove_member(origin: OriginFor, member: T::AccountId) -> DispatchResultWithPostInfo { ensure_root(origin)?; - ensure!( - Self::authorities().contains(&member), - Error::::NotAMember - ); + ensure!(Self::authorities().contains(&member), Error::::NotAMember); Authorities::::mutate(|x| x.retain(|val| *val != member)); - Self::deposit_event(RawEvent::MemberRemoved(member)); + Self::deposit_event(Event::MemberRemoved(member)); - Ok(()) - } - - fn on_runtime_upgrade() -> frame_support::weights::Weight { - mod previous { - pub struct Module(sp_std::marker::PhantomData); - frame_support::decl_storage! { - trait Store for Module as TransactionPayment { - pub AcceptedCurrencies get(fn currencies) config(): super::Vec; - } - } - } - let version = ::storage_version(); - - if version == None || version == Some(PalletVersion::new(2, 0, 0)) { - previous::AcceptedCurrencies::kill(); - AcceptedCurrencies::put(OrderedSet::::new()); - T::BlockWeights::get().max_block - } else { - 0 - } + Ok(().into()) } } } -impl Module { + +impl Pallet { pub fn swap_currency(who: &T::AccountId, fee: Balance) -> DispatchResult { // Let's determine currency in which user would like to pay the fee let fee_currency = match Module::::get_currency(who) { @@ -320,7 +301,7 @@ impl Module { } } -impl CurrencySwap<::AccountId, Balance> for Module { +impl CurrencySwap<::AccountId, Balance> for Pallet { fn swap_currency(who: &T::AccountId, fee: u128) -> DispatchResult { Self::swap_currency(who, fee) } diff --git a/pallets/transaction-multi-payment/src/mock.rs b/pallets/transaction-multi-payment/src/mock.rs index 6ae087493..cd4f0f923 100644 --- a/pallets/transaction-multi-payment/src/mock.rs +++ b/pallets/transaction-multi-payment/src/mock.rs @@ -1,8 +1,7 @@ use super::*; -use crate::{Config, Module, MultiCurrencyAdapter}; -use frame_support::{ - impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types, weights::DispatchClass, -}; +use crate as multi_payment; +use crate::{Config, MultiCurrencyAdapter}; +use frame_support::{parameter_types, weights::DispatchClass}; use frame_system as system; use orml_traits::parameter_type_with_key; use sp_core::H256; @@ -20,6 +19,7 @@ use primitives::{Amount, AssetId, Balance}; use pallet_amm::AssetPairAccountIdFor; use std::cell::RefCell; +use frame_support::traits::{GenesisBuild, Get}; use primitives::fee; pub type AccountId = u64; @@ -48,35 +48,29 @@ impl Get for ExtrinsicBaseWeight { } } -impl_outer_origin! { - pub enum Origin for Test {} -} - -mod multi_payment { - pub use super::super::*; -} - -impl_outer_event! { - pub enum TestEvent for Test{ - system, - multi_payment, - pallet_amm, - pallet_balances, - orml_tokens, - orml_currencies, - } -} -impl_outer_dispatch! { - pub enum Call for Test where origin: Origin { - pallet_balances::Balances, - frame_system::System, - } -} +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Module, Call, Config, Storage, Event}, + PaymentModule: multi_payment::{Module, Call, Storage, Event}, + AMMModule: pallet_amm::{Module, Call, Storage, Event}, + Balances: pallet_balances::{Module,Call, Storage,Config, Event}, + Currencies: orml_currencies::{Module, Event}, + AssetRegistry: pallet_asset_registry::{Module, Storage}, + Tokens: orml_tokens::{Module, Event}, + } + +); -#[derive(Clone, Eq, PartialEq)] -pub struct Test; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const SS58Prefix: u8 = 63; pub const HdxAssetId: u32 = 0; pub const ExistentialDeposit: u128 = 0; @@ -101,8 +95,7 @@ parameter_types! { .build_or_panic(); pub ExchangeFeeRate: fee::Fee = fee::Fee::default(); - - pub PayForSetCurrency : Pays = Pays::No; + pub PayForSetCurrency : Pays = Pays::No; } impl system::Config for Test { @@ -118,19 +111,20 @@ impl system::Config for Test { type AccountId = u64; type Lookup = IdentityLookup; type Header = Header; - type Event = TestEvent; + type Event = Event; type BlockHashCount = BlockHashCount; type DbWeight = (); type Version = (); - type PalletInfo = (); + type PalletInfo = PalletInfo; type AccountData = pallet_balances::AccountData; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); + type SS58Prefix = SS58Prefix; } impl Config for Test { - type Event = TestEvent; + type Event = Event; type Currency = Balances; type MultiCurrency = Currencies; type AMMPool = AMMModule; @@ -148,7 +142,7 @@ impl pallet_balances::Config for Test { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = TestEvent; + type Event = Event; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -177,7 +171,7 @@ impl AssetPairAccountIdFor for AssetPairAccountIdTest { } impl pallet_amm::Config for Test { - type Event = TestEvent; + type Event = Event; type AssetPairAccountId = AssetPairAccountIdTest; type Currency = Currencies; type HDXAssetId = HdxAssetId; @@ -186,13 +180,13 @@ impl pallet_amm::Config for Test { } parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: AssetId| -> Balance { + pub ExistentialDeposits: |_currency_id: AssetId| -> Balance { Zero::zero() }; } impl orml_tokens::Config for Test { - type Event = TestEvent; + type Event = Event; type Balance = Balance; type Amount = Amount; type CurrencyId = AssetId; @@ -202,21 +196,13 @@ impl orml_tokens::Config for Test { } impl orml_currencies::Config for Test { - type Event = TestEvent; + type Event = Event; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; type GetNativeCurrencyId = HdxAssetId; type WeightInfo = (); } -pub type AMMModule = pallet_amm::Module; -pub type Tokens = orml_tokens::Module; -pub type Currencies = orml_currencies::Module; -pub type Balances = pallet_balances::Module; - -pub type PaymentModule = Module; -pub type System = system::Module; - pub struct ExtBuilder { base_weight: u64, native_balances: Vec<(AccountId, Balance)>, diff --git a/pallets/transaction-multi-payment/src/weights.rs b/pallets/transaction-multi-payment/src/weights.rs index fc430ed16..d64ce7f20 100644 --- a/pallets/transaction-multi-payment/src/weights.rs +++ b/pallets/transaction-multi-payment/src/weights.rs @@ -35,88 +35,91 @@ // --output=weights.rs // --template=.maintain/pallet-weight-template.hbs - #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; use sp_std::marker::PhantomData; /// Weight functions needed for transaction_multi_payment. pub trait WeightInfo { -fn swap_currency() -> Weight; -fn set_currency() -> Weight; -fn add_currency() -> Weight; -fn remove_currency() -> Weight; -fn add_member() -> Weight; -fn remove_member() -> Weight; + fn swap_currency() -> Weight; + fn set_currency() -> Weight; + fn add_currency() -> Weight; + fn remove_currency() -> Weight; + fn add_member() -> Weight; + fn remove_member() -> Weight; } /// Weights for transaction_multi_payment using the hydraDX node and recommended hardware. pub struct HydraWeight(PhantomData); - impl WeightInfo for HydraWeight { - fn swap_currency() -> Weight { - (176_475_000 as Weight) - .saturating_add(T::DbWeight::get().reads(6 as Weight)) - .saturating_add(T::DbWeight::get().writes(4 as Weight)) - } - fn set_currency() -> Weight { - (44_552_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn add_currency() -> Weight { - (34_724_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_currency() -> Weight { - (35_529_000 as Weight) - .saturating_add(T::DbWeight::get().reads(2 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn add_member() -> Weight { - (30_411_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - fn remove_member() -> Weight { - (33_172_000 as Weight) - .saturating_add(T::DbWeight::get().reads(1 as Weight)) - .saturating_add(T::DbWeight::get().writes(1 as Weight)) - } - } +impl WeightInfo for HydraWeight { + fn swap_currency() -> Weight { + (176_475_000 as Weight) + .saturating_add(T::DbWeight::get().reads(6 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn set_currency() -> Weight { + (44_552_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn add_currency() -> Weight { + (34_724_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn remove_currency() -> Weight { + (35_529_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn add_member() -> Weight { + (30_411_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn remove_member() -> Weight { + (33_172_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} - // For backwards compatibility and tests - impl WeightInfo for () { - fn swap_currency() -> Weight { - (176_475_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(6 as Weight)) - .saturating_add(RocksDbWeight::get().writes(4 as Weight)) - } - fn set_currency() -> Weight { - (44_552_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn add_currency() -> Weight { - (34_724_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn remove_currency() -> Weight { - (35_529_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(2 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn add_member() -> Weight { - (30_411_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - fn remove_member() -> Weight { - (33_172_000 as Weight) - .saturating_add(RocksDbWeight::get().reads(1 as Weight)) - .saturating_add(RocksDbWeight::get().writes(1 as Weight)) - } - } \ No newline at end of file +// For backwards compatibility and tests +impl WeightInfo for () { + fn swap_currency() -> Weight { + (176_475_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(6 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn set_currency() -> Weight { + (44_552_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn add_currency() -> Weight { + (34_724_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn remove_currency() -> Weight { + (35_529_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn add_member() -> Weight { + (30_411_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn remove_member() -> Weight { + (33_172_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } +} diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index d72656756..7b3a079a8 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -2,7 +2,7 @@ authors = ['GalacticCouncil'] edition = '2018' name = 'primitives' -version = '2.0.0' +version = '3.0.0' [build-dependencies] wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0.5'} @@ -12,21 +12,21 @@ wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0 default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] primitive-types = {default-features = false, version = '0.8.0'} serde = {features = ['derive'], optional = true, version = '1.0.101'} # Substrate dependencies -frame-support = {default-features = false, version = '2.0.0'} -frame-system = {default-features = false, version = '2.0.0'} -sp-std = {default-features = false, version = '2.0.0'} +frame-support = {default-features = false, version = '3.0.0'} +frame-system = {default-features = false, version = '3.0.0'} +sp-std = {default-features = false, version = '3.0.0'} [dev-dependencies] -sp-core = {default-features = false, version = '2.0.0'} -sp-io = {default-features = false, version = '2.0.0'} -sp-runtime = {default-features = false, version = '2.0.0'} +sp-core = {default-features = false, version = '3.0.0'} +sp-io = {default-features = false, version = '3.0.0'} +sp-runtime = {default-features = false, version = '3.0.0'} [features] default = ['std'] diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 8735a0e32..69754ce61 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -1,5 +1,7 @@ #![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::upper_case_acronyms)] + use codec::{Decode, Encode}; use frame_support::sp_runtime::FixedU128; diff --git a/primitives/src/traits.rs b/primitives/src/traits.rs index 4759753e3..67040823b 100644 --- a/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -1,3 +1,5 @@ +#![allow(clippy::upper_case_acronyms)] + use frame_support::dispatch; use frame_support::dispatch::DispatchResult; use sp_std::vec::Vec; diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index e2167c2ac..e6c2f03b2 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -5,7 +5,7 @@ homepage = 'https://github.com/galacticcouncil/hydradx-node' license = 'Unlicense' name = 'hydra-dx-runtime' repository = 'https://github.com/galacticcouncil/hydradx-node' -version = '2.0.0' +version = '3.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] @@ -18,7 +18,7 @@ wasm-builder-runner = {package = 'substrate-wasm-builder-runner', version = '1.0 default-features = false features = ['derive'] package = 'parity-scale-codec' -version = '1.3.4' +version = '2.0.0' [dependencies] hex-literal = {optional = true, version = '0.3.1'} @@ -26,63 +26,64 @@ serde = {features = ['derive'], optional = true, version = '1.0.101'} tracing-core = {optional = true, version = '0.1.17'} # local dependencies -module-amm-rpc-runtime-api = {path = '../pallets/amm/rpc/runtime-api', default-features = false, version = '2.0.0'} -pallet-amm = {path = '../pallets/amm', default-features = false} -pallet-asset-registry = {path = '../pallets/asset-registry', default-features = false, version = '2.0.0'} +module-amm-rpc-runtime-api = {path = '../pallets/amm/rpc/runtime-api', default-features = false} +pallet-amm = {path = '../pallets/amm', default-features = false } +pallet-asset-registry = {path = '../pallets/asset-registry', default-features = false} pallet-claims = {path = '../pallets/claims', default-features = false} -pallet-exchange = {path = '../pallets/exchange', default-features = false, version = '2.0.0'} -pallet-exchange-benchmarking = {path = '../pallets/exchange/benchmarking', default-features = false, optional = true, version = '2.0.0'} -pallet-faucet = {path = '../pallets/faucet', default-features = false, version = '2.0.0'} -pallet-multi-payment-benchmarking = {path = '../pallets/transaction-multi-payment/benchmarking', default-features = false, optional = true, version = '3.0.0'} -pallet-transaction-multi-payment = {path = '../pallets/transaction-multi-payment', default-features = false, version = '3.0.0'} -primitives = {path = '../primitives', default-features = false, version = '2.0.0'} +pallet-exchange = {path = '../pallets/exchange', default-features = false} +pallet-exchange-benchmarking = {path = '../pallets/exchange/benchmarking', default-features = false, optional = true} +pallet-faucet = {path = '../pallets/faucet', default-features = false} +pallet-multi-payment-benchmarking = {path = '../pallets/transaction-multi-payment/benchmarking', default-features = false, optional = true} +pallet-transaction-multi-payment = {path = '../pallets/transaction-multi-payment', default-features = false} +primitives = {path = '../primitives', default-features = false} # ORML dependencies -orml-currencies = {default-features = false, version = '0.3.3-dev'} -orml-tokens = {default-features = false, version = '0.3.3-dev'} -orml-traits = {default-features = false, version = '0.3.3-dev'} +orml-currencies = {default-features = false, version = '0.4.1-dev'} +orml-tokens = {default-features = false, version = '0.4.1-dev'} +orml-traits = {default-features = false, version = '0.4.1-dev'} # Staking dependencies -pallet-authority-discovery = {default-features = false, version = '2.0.0'} -pallet-authorship = {default-features = false, version = '2.0.0'} -pallet-babe = {default-features = false, version = '2.0.0'} -pallet-collective = {default-features = false, version = '2.0.0'} -pallet-elections-phragmen = {default-features = false, version = '2.0.0'} -pallet-im-online = {default-features = false, version = '2.0.0'} -pallet-offences = {default-features = false, version = '2.0.0'} -pallet-session = {default-features = false, version = '2.0.0'} -pallet-staking = {default-features = false, version = '2.0.0'} -pallet-staking-reward-curve = {default-features = false, version = '2.0.0'} -pallet-tips = {default-features = false, version = '=2.0.0'} -pallet-treasury = {default-features = false, version = '2.0.0'} -sp-authority-discovery = {default-features = false, version = '2.0.0'} -sp-consensus-babe = {default-features = false, version = '0.8.0'} +pallet-authority-discovery = {default-features = false, version = '3.0.0'} +pallet-authorship = {default-features = false, version = '3.0.0'} +pallet-babe = {default-features = false, version = '3.0.0'} +pallet-collective = {default-features = false, version = '3.0.0'} +pallet-elections-phragmen = {default-features = false, version = '3.0.0'} +pallet-election-provider-multi-phase = {default-features = false, version = '3.0.0'} +pallet-im-online = {default-features = false, version = '3.0.0'} +pallet-offences = {default-features = false, version = '3.0.0'} +pallet-session = {default-features = false, version = '3.0.0'} +pallet-staking = {default-features = false, version = '3.0.0'} +pallet-staking-reward-curve = {default-features = false, version = '3.0.0'} +pallet-tips = {default-features = false, version = '=3.0.0'} +pallet-treasury = {default-features = false, version = '3.0.0'} +sp-authority-discovery = {default-features = false, version = '3.0.0'} +sp-consensus-babe = {default-features = false, version = '0.9.0'} # Substrate dependencies -frame-benchmarking = {default-features = false, optional = true, version = '2.0.0'} -frame-executive = {default-features = false, version = '2.0.0'} -frame-support = {default-features = false, version = '2.0.0'} -frame-system = {default-features = false, version = '2.0.0'} -frame-system-benchmarking = {default-features = false, optional = true, version = '2.0.0'} -frame-system-rpc-runtime-api = {default-features = false, version = '2.0.0'} -pallet-balances = {default-features = false, version = '2.0.0'} -pallet-grandpa = {default-features = false, version = '2.0.0'} -pallet-randomness-collective-flip = {default-features = false, version = '2.0.0'} -pallet-sudo = {default-features = false, version = '2.0.0'} -pallet-timestamp = {default-features = false, version = '2.0.0'} -pallet-transaction-payment = {default-features = false, version = '2.0.0'} -pallet-transaction-payment-rpc-runtime-api = {default-features = false, version = '2.0.0'} -sp-api = {default-features = false, version = '2.0.0'} -sp-block-builder = {default-features = false, version = '2.0.0'} -sp-core = {default-features = false, version = '2.0.0'} -sp-inherents = {default-features = false, version = '2.0.0'} -sp-offchain = {default-features = false, version = '2.0.0'} -sp-runtime = {default-features = false, version = '2.0.0'} -sp-session = {default-features = false, version = '2.0.0'} -sp-staking = {default-features = false, version = '2.0.0'} -sp-std = {default-features = false, version = '2.0.0'} -sp-transaction-pool = {default-features = false, version = '2.0.0'} -sp-version = {default-features = false, version = '2.0.0'} +frame-benchmarking = {default-features = false, optional = true, version = '3.0.0'} +frame-executive = {default-features = false, version = '3.0.0'} +frame-support = {default-features = false, version = '3.0.0'} +frame-system = {default-features = false, version = '3.0.0'} +frame-system-benchmarking = {default-features = false, optional = true, version = '3.0.0'} +frame-system-rpc-runtime-api = {default-features = false, version = '3.0.0'} +pallet-balances = {default-features = false, version = '3.0.0'} +pallet-grandpa = {default-features = false, version = '3.0.0'} +pallet-randomness-collective-flip = {default-features = false, version = '3.0.0'} +pallet-sudo = {default-features = false, version = '3.0.0'} +pallet-timestamp = {default-features = false, version = '3.0.0'} +pallet-transaction-payment = {default-features = false, version = '3.0.0'} +pallet-transaction-payment-rpc-runtime-api = {default-features = false, version = '3.0.0'} +sp-api = {default-features = false, version = '3.0.0'} +sp-block-builder = {default-features = false, version = '3.0.0'} +sp-core = {default-features = false, version = '3.0.0'} +sp-inherents = {default-features = false, version = '3.0.0'} +sp-offchain = {default-features = false, version = '3.0.0'} +sp-runtime = {default-features = false, version = '3.0.0'} +sp-session = {default-features = false, version = '3.0.0'} +sp-staking = {default-features = false, version = '3.0.0'} +sp-std = {default-features = false, version = '3.0.0'} +sp-transaction-pool = {default-features = false, version = '3.0.0'} +sp-version = {default-features = false, version = '3.0.0'} [features] default = ['std'] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 0d9454f3f..f5b6b2569 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -3,6 +3,8 @@ #![recursion_limit = "256"] #![allow(clippy::type_complexity)] #![allow(clippy::large_enum_variant)] +#![allow(clippy::upper_case_acronyms)] +#![allow(clippy::from_over_into)] // Make the WASM binary available. #[cfg(feature = "std")] @@ -31,7 +33,7 @@ use sp_std::prelude::*; use sp_version::NativeVersion; use sp_version::RuntimeVersion; -use frame_system::limits; +use frame_system::{limits}; // A few exports that help ease life for downstream crates. pub use frame_support::{ construct_runtime, parameter_types, @@ -129,8 +131,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydra-dx"), impl_name: create_runtime_str!("hydra-dx"), authoring_version: 1, - spec_version: 2, - impl_version: 2, + spec_version: 3, + impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, }; @@ -182,6 +184,7 @@ impl Filter for BaseFilter { | Call::Grandpa(_) | Call::AuthorityDiscovery(_) | Call::ImOnline(_) + | Call::ElectionProviderMultiPhase(_) | Call::Sudo(_) => true, } } @@ -215,6 +218,7 @@ parameter_types! { pub ExtrinsicPaymentExtraWeight: Weight = ::WeightInfo::swap_currency(); pub ExtrinsicBaseWeight: Weight = frame_support::weights::constants::ExtrinsicBaseWeight::get() + ExtrinsicPaymentExtraWeight::get(); + pub const SS58Prefix: u8 = 63; } // Configure FRAME pallets to include in runtime. @@ -264,6 +268,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; /// Weight information for the extrinsics of this pallet. type SystemWeightInfo = (); + type SS58Prefix = SS58Prefix; } impl pallet_grandpa::Config for Runtime { @@ -340,7 +345,7 @@ impl pallet_sudo::Config for Runtime { } parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: AssetId| -> Balance { + pub ExistentialDeposits: |_currency_id: AssetId| -> Balance { Zero::zero() }; } @@ -454,6 +459,7 @@ impl pallet_staking::Config for Runtime { type Currency = Balances; type UnixTime = Timestamp; type CurrencyToVote = U128CurrencyToVote; + type ElectionProvider = ElectionProviderMultiPhase; type RewardRemainder = Treasury; type Event = Event; type Slash = Treasury; @@ -472,8 +478,45 @@ impl pallet_staking::Config for Runtime { type MinSolutionScoreBump = MinSolutionScoreBump; type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator; type UnsignedPriority = StakingUnsignedPriority; - type WeightInfo = (); type OffchainSolutionWeightLimit = OffchainSolutionWeightLimit; + type WeightInfo = (); +} + +parameter_types! { + // phase durations. 1/4 of the last session for each. + pub const SignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; + pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; + + // fallback: no need to do on-chain phragmen initially. + pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy = + pallet_election_provider_multi_phase::FallbackStrategy::Nothing; + + pub SolutionImprovementThreshold: Perbill = Perbill::from_rational_approximation(1u32, 10_000); + + // miner configs + pub const MultiPhaseUnsignedPriority: TransactionPriority = StakingUnsignedPriority::get() - 1u64; + pub const MinerMaxIterations: u32 = 10; + pub MinerMaxWeight: Weight = BlockWeights::get() + .get(DispatchClass::Normal) + .max_extrinsic.expect("Normal extrinsics have a weight limit configured; qed") + .saturating_sub(BlockExecutionWeight::get()); +} + +impl pallet_election_provider_multi_phase::Config for Runtime { + type Event = Event; + type Currency = Balances; + type SignedPhase = SignedPhase; + type UnsignedPhase = UnsignedPhase; + type SolutionImprovementThreshold = MinSolutionScoreBump; + type MinerMaxIterations = MinerMaxIterations; + type MinerMaxWeight = MinerMaxWeight; + type MinerTxPriority = MultiPhaseUnsignedPriority; + type DataProvider = Staking; + type OnChainAccuracy = Perbill; + type CompactSolution = pallet_staking::CompactAssignments; + type Fallback = Fallback; + type WeightInfo = pallet_election_provider_multi_phase::weights::SubstrateWeight; + type BenchmarkingConfig = (); } parameter_types! { @@ -571,9 +614,9 @@ impl pallet_elections_phragmen::Config for Runtime { type InitializeMembers = Council; type CurrencyToVote = U128CurrencyToVote; type CandidacyBond = CandidacyBond; - type VotingBond = VotingBond; + type VotingBondBase = (); + type VotingBondFactor = (); type LoserCandidate = (); - type BadReport = (); type KickedMember = (); type DesiredMembers = DesiredMembers; type DesiredRunnersUp = DesiredRunnersUp; @@ -584,6 +627,8 @@ impl pallet_elections_phragmen::Config for Runtime { parameter_types! { pub const EpochDuration: u64 = EPOCH_DURATION_IN_BLOCKS as u64; pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; + pub const ReportLongevity: u64 = + BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); } impl pallet_babe::Config for Runtime { @@ -599,7 +644,7 @@ impl pallet_babe::Config for Runtime { type KeyOwnerIdentification = >::IdentificationTuple; - type HandleEquivocation = pallet_babe::EquivocationHandler; + type HandleEquivocation = pallet_babe::EquivocationHandler; type WeightInfo = (); } @@ -643,6 +688,7 @@ impl pallet_im_online::Config for Runtime { type AuthorityId = ImOnlineId; type Event = Event; type SessionDuration = SessionDuration; + type ValidatorSet = Historical; type ReportUnresponsiveness = Offences; type UnsignedPriority = ImOnlineUnsignedPriority; type WeightInfo = (); @@ -677,8 +723,9 @@ construct_runtime!( //Staking related modules Authorship: pallet_authorship::{Module, Call, Storage, Inherent}, Staking: pallet_staking::{Module, Call, Config, Storage, Event, ValidateUnsigned}, + ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Module, Call, Storage, Event, ValidateUnsigned}, Treasury: pallet_treasury::{Module, Call, Storage, Config, Event}, - Babe: pallet_babe::{Module, Call, Storage, Config, Inherent, ValidateUnsigned}, + Babe: pallet_babe::{Module, Call, Storage, Config, ValidateUnsigned}, Session: pallet_session::{Module, Call, Storage, Event, Config}, Elections: pallet_elections_phragmen::{Module, Call, Storage, Event, Config}, Council: pallet_collective::::{Module, Call, Storage, Origin, Event, Config}, @@ -749,12 +796,20 @@ impl_runtime_apis! { } } - fn current_epoch_start() -> sp_consensus_babe::SlotNumber { + fn current_epoch_start() -> sp_consensus_babe::Slot { Babe::current_epoch_start() } + fn current_epoch() -> sp_consensus_babe::Epoch { + Babe::current_epoch() + } + + fn next_epoch() -> sp_consensus_babe::Epoch { + Babe::next_epoch() + } + fn generate_key_ownership_proof( - _slot_number: sp_consensus_babe::SlotNumber, + _slot_number: sp_consensus_babe::Slot, authority_id: sp_consensus_babe::AuthorityId, ) -> Option { use codec::Encode; @@ -895,6 +950,10 @@ impl_runtime_apis! { ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { TransactionPayment::query_info(uxt, len) } + + fn query_fee_details(uxt: ::Extrinsic, len: u32) -> pallet_transaction_payment_rpc_runtime_api::FeeDetails { + TransactionPayment::query_fee_details(uxt, len) + } } impl amm_rpc::AMMApi<