diff --git a/Cargo.lock b/Cargo.lock index c77f73a472aae..b602f7e79c82a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,23 +40,11 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5" dependencies = [ - "aes-soft 0.4.0", - "aesni 0.7.0", + "aes-soft", + "aesni", "block-cipher", ] -[[package]] -name = "aes-ctr" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" -dependencies = [ - "aes-soft 0.3.3", - "aesni 0.6.0", - "ctr", - "stream-cipher 0.3.2", -] - [[package]] name = "aes-gcm" version = "0.6.0" @@ -70,17 +58,6 @@ dependencies = [ "subtle 2.2.3", ] -[[package]] -name = "aes-soft" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" -dependencies = [ - "block-cipher-trait", - "byteorder 1.3.4", - "opaque-debug 0.2.3", -] - [[package]] name = "aes-soft" version = "0.4.0" @@ -92,17 +69,6 @@ dependencies = [ "opaque-debug 0.2.3", ] -[[package]] -name = "aesni" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" -dependencies = [ - "block-cipher-trait", - "opaque-debug 0.2.3", - "stream-cipher 0.3.2", -] - [[package]] name = "aesni" version = "0.7.0" @@ -370,9 +336,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.53.3" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5" +checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" dependencies = [ "bitflags", "cexpr", @@ -504,15 +470,6 @@ dependencies = [ "generic-array 0.14.3", ] -[[package]] -name = "block-cipher-trait" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" -dependencies = [ - "generic-array 0.12.3", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -703,6 +660,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "cloudabi" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" +dependencies = [ + "bitflags", +] + [[package]] name = "concurrent-queue" version = "1.1.2" @@ -944,16 +910,6 @@ dependencies = [ "sct", ] -[[package]] -name = "ctr" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" -dependencies = [ - "block-cipher-trait", - "stream-cipher 0.3.2", -] - [[package]] name = "cuckoofilter" version = "0.3.2" @@ -1095,9 +1051,9 @@ dependencies = [ [[package]] name = "either" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "env_logger" @@ -1205,9 +1161,9 @@ checksum = "36a9cb09840f81cd211e435d00a4e487edd263dc3c8ff815c32dd76ad668ebed" [[package]] name = "fdlimit" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da54a593b34c71b889ee45f5b5bb900c74148c5f7f8c6a9479ee7899f69603c" +checksum = "47bc6e222b8349b2bd0acb85a1d16d22852376b3ceed2a7f09c2692c3d8a78d0" dependencies = [ "libc", ] @@ -1276,16 +1232,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98d7f1c606d158d5af4479f2971f259d8dd262f03f6f7b5b37e92eec7b8de396" dependencies = [ "parity-scale-codec", ] [[package]] name = "frame-benchmarking" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a5e3fe43568300fdca1c1bfd45ea463a12cca8fbe6172a4f6d58cd54e3fbcc" dependencies = [ "frame-support", "frame-system", @@ -1300,15 +1258,36 @@ dependencies = [ "sp-storage", ] +[[package]] +name = "frame-benchmarking-cli" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9337ff68053dc7f7af821bdd241f367c17deb2213cc1b88cda7b856e796b6690" +dependencies = [ + "frame-benchmarking", + "parity-scale-codec", + "sc-cli", + "sc-client-db", + "sc-executor", + "sc-service", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-state-machine", + "structopt", +] + [[package]] name = "frame-executive" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c843800f05a7ad4653bc0db53a15e3d9bdd1cf14103e15c29e8aca200dbb1188" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -1317,8 +1296,9 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "11.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b5640bfcb7111643807c63cd38ecdcc923d3253e525f23ab6b366002bf8ecd5" dependencies = [ "parity-scale-codec", "serde", @@ -1328,8 +1308,9 @@ dependencies = [ [[package]] name = "frame-support" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "807c32da14bd0e5fb751095335a07938cda6f1488f57d7b0539118e3434980a8" dependencies = [ "bitmask", "frame-metadata", @@ -1353,8 +1334,9 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "508dc2eb44a802f1876e3dc97a76aed8f18b993f75f6cb1975cb83cf45a5d981" dependencies = [ "frame-support-procedural-tools", "proc-macro2", @@ -1364,8 +1346,9 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f6d1dd14477123180c47024bcc24c1a624ea8631b4f00080d14089907397f4" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1376,8 +1359,9 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad38379ecedd632f286c7b94a4b9a15bffb635194de4dbf2b4458bc46cee28f" dependencies = [ "proc-macro2", "quote", @@ -1386,8 +1370,9 @@ dependencies = [ [[package]] name = "frame-system" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d172404f0e44b867f5fd14465a27f298b8828b53d7a7a555d3759e1dec3c8f0d" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1400,10 +1385,26 @@ dependencies = [ "sp-version", ] +[[package]] +name = "frame-system-benchmarking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e3a70ce89455777c5a93c60943e8a404c0be66bd3f53605c4a4e79baa80e91" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "frame-system-rpc-runtime-api" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b128f689fd9d497c3a7e881be524a8a1e2d80e2661754add6e36c9dfdcbe373" dependencies = [ "parity-scale-codec", "sp-api", @@ -1866,22 +1867,15 @@ checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" [[package]] name = "hex-literal" -version = "0.2.1" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" -dependencies = [ - "hex-literal-impl", - "proc-macro-hack", -] +checksum = "5af1f635ef1bc545d78392b136bfe1c9809e029023c84a3638a864a10b8819c8" [[package]] -name = "hex-literal-impl" -version = "0.2.2" +name = "hex_fmt" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853f769599eb31de176303197b7ba4973299c38c7a7604a6bc88c3eef05b9b46" -dependencies = [ - "proc-macro-hack", -] +checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" [[package]] name = "hmac" @@ -2066,15 +2060,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "impl-serde" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e3cae7e99c7ff5a995da2cf78dd0a5383740eda71d98cf7b1910c301ac69b8" -dependencies = [ - "serde", -] - [[package]] name = "impl-serde" version = "0.3.1" @@ -2106,6 +2091,15 @@ dependencies = [ "serde", ] +[[package]] +name = "instant" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" +dependencies = [ + "cfg-if", +] + [[package]] name = "integer-sqrt" version = "0.1.3" @@ -2187,9 +2181,9 @@ dependencies = [ [[package]] name = "jsonrpc-client-transports" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecbdaacc17243168d9d1fa6b2bd7556a27e1e60a621d8a2a6e590ae2b145d158" +checksum = "c6f7b1cdf66312002e15682a24430728bd13036c641163c016bc53fb686a7c2d" dependencies = [ "failure", "futures 0.1.29", @@ -2203,9 +2197,9 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62" +checksum = "f30b12567a31d48588a65b6cf870081e6ba1d7b2ae353977cb9820d512e69c70" dependencies = [ "futures 0.1.29", "log", @@ -2216,18 +2210,18 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713" +checksum = "d175ca0cf77439b5495612bf216c650807d252d665b4b70ab2eebd895a88fac1" dependencies = [ "jsonrpc-client-transports", ] [[package]] name = "jsonrpc-derive" -version = "14.2.1" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fadf6945e227246825a583514534d864554e9f23d80b3c77d034b10983db5ef" +checksum = "c2cc6ea7f785232d9ca8786a44e9fa698f92149dcdc1acc4aa1fc69c4993d79e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2237,9 +2231,9 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da906d682799df05754480dac1b9e70ec92e12c19ebafd2662a5ea1c9fd6522" +checksum = "9996b26c0c7a59626d0ed6c5ec8bf06218e62ce1474bd2849f9b9fd38a0158c0" dependencies = [ "hyper 0.12.35", "jsonrpc-core", @@ -2252,9 +2246,9 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dedccd693325d833963b549e959137f30a7a0ea650cde92feda81dc0c1393cb5" +checksum = "b8e8f2278fb2b277175b6e21b23e7ecf30e78daff5ee301d0a2a411d9a821a0a" dependencies = [ "jsonrpc-core", "jsonrpc-server-utils", @@ -2266,9 +2260,9 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986" +checksum = "f389c5cd1f3db258a99296892c21047e21ae73ff4c0e2d39650ea86fe994b4c7" dependencies = [ "jsonrpc-core", "log", @@ -2279,9 +2273,9 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56cbfb462e7f902e21121d9f0d1c2b77b2c5b642e1a4e8f4ebfa2e15b94402bb" +checksum = "c623e1895d0d9110cb0ea7736cfff13191ff52335ad33b21bd5c775ea98b27af" dependencies = [ "bytes 0.4.12", "globset", @@ -2295,16 +2289,16 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" -version = "14.2.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903d3109fe7c4acb932b567e1e607e0f524ed04741b09fb0e61841bc40a022fc" +checksum = "436a92034d0137ab3e3c64a7a6350b428f31cb4d7d1a89f284bcdbcd98a7bc56" dependencies = [ "jsonrpc-core", "jsonrpc-server-utils", "log", + "parity-ws", "parking_lot 0.10.2", "slab", - "ws", ] [[package]] @@ -2355,9 +2349,9 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c341ef15cfb1f923fa3b5138bfbd2d4813a2c1640b473727a53351c7f0b0fa2" +checksum = "44947dd392f09475af614d740fe0320b66d01cb5b977f664bbbb5e45a70ea4c1" dependencies = [ "fs-swap", "kvdb", @@ -2413,10 +2407,11 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.22.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0306a49ee6a89468f96089906f36b0eef82c988dcfc8acf3e2dcd6ad1c859f85" +checksum = "571f5a4604c1a40d75651da141dfde29ad15329f537a779528803297d2220274" dependencies = [ + "atomic", "bytes 0.5.6", "futures 0.3.5", "lazy_static", @@ -2430,12 +2425,11 @@ dependencies = [ "libp2p-kad", "libp2p-mdns", "libp2p-mplex", - "libp2p-noise 0.21.0", + "libp2p-noise", "libp2p-ping", "libp2p-plaintext", "libp2p-pnet", "libp2p-request-response", - "libp2p-secio", "libp2p-swarm", "libp2p-tcp", "libp2p-uds", @@ -2450,43 +2444,11 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "libp2p" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1ebb6c031584a5af181fe3a1e4b074af5d0b1a3b31663200f0251f4bcff6b5c" -dependencies = [ - "atomic", - "bytes 0.5.6", - "futures 0.3.5", - "lazy_static", - "libp2p-core", - "libp2p-core-derive", - "libp2p-dns", - "libp2p-identify", - "libp2p-kad", - "libp2p-mdns", - "libp2p-mplex", - "libp2p-noise 0.22.0", - "libp2p-ping", - "libp2p-swarm", - "libp2p-tcp", - "libp2p-wasm-ext", - "libp2p-websocket", - "libp2p-yamux", - "multihash", - "parity-multiaddr", - "parking_lot 0.10.2", - "pin-project", - "smallvec 1.4.1", - "wasm-timer", -] - [[package]] name = "libp2p-core" -version = "0.20.1" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a694fd76d7c33a45a0e6e1525e9b9b5d11127c9c94e560ac0f8abba54ed80af" +checksum = "52f13ba8c7df0768af2eb391696d562c7de88cc3a35122531aaa6a7d77754d25" dependencies = [ "asn1_der", "bs58", @@ -2518,9 +2480,9 @@ dependencies = [ [[package]] name = "libp2p-core-derive" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "515c4a7cba5d321bb88ed3ed803997bdd5634ce35c9c5e8e9ace9c512e57eceb" +checksum = "f753d9324cd3ec14bf04b8a8cd0d269c87f294153d6bf2a84497a63a5ad22213" dependencies = [ "quote", "syn", @@ -2528,9 +2490,9 @@ dependencies = [ [[package]] name = "libp2p-deflate" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abeff37fa533fead23fc71b14ed0a2aced36c0c65c3d0078aff07821fb71029e" +checksum = "74029ae187f35f4b8ddf26b9779a68b340045d708528a103917cdca49a296db5" dependencies = [ "flate2", "futures 0.3.5", @@ -2539,9 +2501,9 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751924b6b98e350005e0b87a822beb246792a3fb878c684e088f866158120ac" +checksum = "7cf319822e08dd65c8e060d2354e9f952895bbc433f5706c75ed010c152aee5e" dependencies = [ "futures 0.3.5", "libp2p-core", @@ -2550,9 +2512,9 @@ dependencies = [ [[package]] name = "libp2p-floodsub" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d4f310a02441b681075037ffb41649ee8836619559311b801ef3d5cdbe14cf" +checksum = "d8a9acb43a3e4a4e413e0c4abe0fa49308df7c6335c88534757b647199cb8a51" dependencies = [ "cuckoofilter", "fnv", @@ -2567,9 +2529,9 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70f76b6c53ae9c97c234498c799802e43f91766bcf4a2a1f94f9339617d713b" +checksum = "ab20fcb60edebe3173bbb708c6ac3444afdf1e3152dc2866b10c4f5497f17467" dependencies = [ "base64 0.11.0", "byteorder 1.3.4", @@ -2577,10 +2539,11 @@ dependencies = [ "fnv", "futures 0.3.5", "futures_codec", + "hex_fmt", "libp2p-core", "libp2p-swarm", "log", - "lru", + "lru_time_cache", "prost", "prost-build", "rand 0.7.3", @@ -2592,9 +2555,9 @@ dependencies = [ [[package]] name = "libp2p-identify" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912c00a7bf67e0e765daf0cc37e08f675ea26aba3d6d1fbfaee81f19a4c23049" +checksum = "56396ee63aa9164eacf40c2c5d2bda8c4133c2f57e1b0425d51d3a4e362583b1" dependencies = [ "futures 0.3.5", "libp2p-core", @@ -2608,9 +2571,9 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44ed3a4c8111c570ab2bffb30c6353178d7603ce3787e3c5f2493c8d3d16d1f0" +checksum = "cc7fa9047f8b8f544278a35c2d9d45d3b2c1785f2d86d4e1629d6edf97be3955" dependencies = [ "arrayvec 0.5.1", "bytes 0.5.6", @@ -2635,9 +2598,9 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd004c668160fd922f7268b2cd1e4550ff69165d9c744e9eb5770086eb753d02" +checksum = "3173b5a6b2f690c29ae07798d85b9441a131ac76ddae9015ef22905b623d0c69" dependencies = [ "async-std", "data-encoding", @@ -2657,9 +2620,9 @@ dependencies = [ [[package]] name = "libp2p-mplex" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14ae0ffacd30f073f96cd518b2c9cd2cb18ac27c3d136a4b23cf1af99f33e541" +checksum = "8a73a799cc8410b36e40b8f4c4b6babbcb9efd3727111bf517876e4acfa612d3" dependencies = [ "bytes 0.5.6", "fnv", @@ -2673,31 +2636,9 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f353f8966bbaaf7456535fffd3f366f153148773a0cf04b2ec3860955cb720e" -dependencies = [ - "bytes 0.5.6", - "curve25519-dalek", - "futures 0.3.5", - "lazy_static", - "libp2p-core", - "log", - "prost", - "prost-build", - "rand 0.7.3", - "sha2 0.8.2", - "snow", - "static_assertions", - "x25519-dalek", - "zeroize", -] - -[[package]] -name = "libp2p-noise" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e594f2de0c23c2b7ad14802c991a2e68e95315c6a6c7715e53801506f20135d" +checksum = "6ef6c490042f549fb1025f2892dfe6083d97a77558f450c1feebe748ca9eb15a" dependencies = [ "bytes 0.5.6", "curve25519-dalek", @@ -2717,9 +2658,9 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70130cf130e4ba6dc177366e72dd9f86f9e3588fa1a0c4145247e676f16affad" +checksum = "ad063c21dfcea4518ac9e8bd4119d33a5b26c41e674f602f41f05617a368a5c8" dependencies = [ "futures 0.3.5", "libp2p-core", @@ -2732,9 +2673,9 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53f0308a97f6fdd37a2bc388070e471c3ce9d92aa45c99d75c87c2dc5d5cac96" +checksum = "903a12e99c72dbebefea258de887982adeacc7025baa1ceb10b7fa9928f54791" dependencies = [ "bytes 0.5.6", "futures 0.3.5", @@ -2764,54 +2705,31 @@ dependencies = [ [[package]] name = "libp2p-request-response" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f48682b48a96545a323edd150c1d64fc1e250240bba02866e9f902e3dc032a9" +checksum = "9c0c9e8a4cd69d97e9646c54313d007512f411aba8c5226cfcda16df6a6e84a3" dependencies = [ "async-trait", + "bytes 0.5.6", "futures 0.3.5", "libp2p-core", "libp2p-swarm", - "smallvec 1.4.1", - "wasm-timer", -] - -[[package]] -name = "libp2p-secio" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ff43513c383f7cdab2736eb98465fc4c5dd5d1988df89749dc8a68950349d56" -dependencies = [ - "aes-ctr", - "ctr", - "futures 0.3.5", - "hmac", - "js-sys", - "lazy_static", - "libp2p-core", "log", - "parity-send-wrapper", - "pin-project", - "prost", - "prost-build", - "quicksink", + "lru 0.6.0", + "minicbor", "rand 0.7.3", - "ring", - "rw-stream-sink", - "sha2 0.8.2", - "static_assertions", - "twofish", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", + "smallvec 1.4.1", + "unsigned-varint 0.5.1", + "wasm-timer", ] [[package]] name = "libp2p-swarm" -version = "0.20.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88d5e2a090a2aadf042cd33484e2f015c6dab212567406a59deece5dedbd133" +checksum = "7193e444210132237b81b755ec7fe53f1c4bd2f53cf719729b94c0c72eb6eaa1" dependencies = [ + "either", "futures 0.3.5", "libp2p-core", "log", @@ -2823,9 +2741,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1fa2bbad054020cb875546a577a66a65a5bf42eff55ed5265f92ffee3cc052" +checksum = "44f42ec130d7a37a7e47bf4398026b7ad9185c08ed26972e2720f8b94112796f" dependencies = [ "async-std", "futures 0.3.5", @@ -2839,9 +2757,9 @@ dependencies = [ [[package]] name = "libp2p-uds" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9db9fce9e3588c3118475d9ca761c5c133b639a624a7341e2a61e4b28c376b8" +checksum = "dea7acb0a034f70d7db94c300eba3f65c0f6298820105624088a9609c9974d77" dependencies = [ "async-std", "futures 0.3.5", @@ -2851,9 +2769,9 @@ dependencies = [ [[package]] name = "libp2p-wasm-ext" -version = "0.20.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0feb99e32fea20ffb1bbf56a6fb2614bff7325ff44a515728385170b3420d2c3" +checksum = "34c1faac6f92c21fbe155417957863ea822fba9e9fd5eb24c0912336a100e63f" dependencies = [ "futures 0.3.5", "js-sys", @@ -2865,9 +2783,9 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.21.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046a5201f6e471f22b22b394e4d084269ed1e28cf7300f7b49874385db84c7bd" +checksum = "d650534ebd99f48f6fa292ed5db10d30df2444943afde4407ceeddab8e513fca" dependencies = [ "async-tls", "either", @@ -2885,22 +2803,22 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.20.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46ae9bf2f7d8a4be9c7e9b61df9de9dc1bd66419d669098f22f81f8d9571029a" +checksum = "781d9b9f043dcdabc40640807125368596b849fd4d96cdca2dcf052fdf6f33fd" dependencies = [ "futures 0.3.5", "libp2p-core", - "parking_lot 0.10.2", + "parking_lot 0.11.0", "thiserror", "yamux", ] [[package]] name = "librocksdb-sys" -version = "6.7.4" +version = "6.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883213ae3d09bfc3d104aefe94b25ebb183b6f4d3a515b23b14817e1f4854005" +checksum = "eb5b56f651c204634b936be2f92dbb42c36867e00ff7fe2405591f3b9fa66f09" dependencies = [ "bindgen", "cc", @@ -2980,6 +2898,15 @@ dependencies = [ "scopeguard 1.1.0", ] +[[package]] +name = "lock_api" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" +dependencies = [ + "scopeguard 1.1.0", +] + [[package]] name = "log" version = "0.4.11" @@ -2998,6 +2925,21 @@ dependencies = [ "hashbrown 0.6.3", ] +[[package]] +name = "lru" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "111b945ac72ec09eb7bc62a0fbdc3cc6e80555a7245f52a69d3921a75b53b153" +dependencies = [ + "hashbrown 0.8.1", +] + +[[package]] +name = "lru_time_cache" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb241df5c4caeb888755363fc95f8a896618dc0d435e9e775f7930cb099beab" + [[package]] name = "mach" version = "0.3.2" @@ -3091,6 +3033,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "minicbor" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc03ad6f8f548db7194a5ff5a6f96342ecae4e3ef67d2bf18bacc0e245cd041" +dependencies = [ + "minicbor-derive", +] + +[[package]] +name = "minicbor-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c214bf3d90099b52f3e4b328ae0fe34837fd0fab683ad1e10fceb4629106df48" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "miniz_oxide" version = "0.4.0" @@ -3269,11 +3231,13 @@ dependencies = [ [[package]] name = "node-template" -version = "2.0.0-rc6" +version = "2.0.0" dependencies = [ + "frame-benchmarking", + "frame-benchmarking-cli", "jsonrpc-core", "node-template-runtime", - "pallet-generic-asset", + "pallet-assets 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-transaction-payment-rpc", "sc-basic-authorship", "sc-cli", @@ -3303,15 +3267,18 @@ dependencies = [ [[package]] name = "node-template-runtime" -version = "2.0.0-rc6" +version = "2.0.0" dependencies = [ + "frame-benchmarking", "frame-executive", "frame-support", "frame-system", + "frame-system-benchmarking", "frame-system-rpc-runtime-api", + "hex-literal", + "pallet-assets 2.0.0", "pallet-aura", "pallet-balances", - "pallet-generic-asset", "pallet-grandpa", "pallet-randomness-collective-flip", "pallet-sudo", @@ -3483,10 +3450,37 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "pallet-assets" +version = "2.0.0" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-assets" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8096df10f954c2c55886ea0ba39361a0dfc0994479684b2f0eb87116deb825" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-runtime", +] + [[package]] name = "pallet-aura" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3150af311603b2fd78d948c8e2346d6b2530403c3971ae684ccc46021c1ea198" dependencies = [ "frame-support", "frame-system", @@ -3504,8 +3498,9 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65706c382ae14ef2768e7411c5faaf1e0a310b4a86d17c3a93dfacb2c5987576" dependencies = [ "frame-support", "frame-system", @@ -3519,8 +3514,9 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56bf116724c3adb7eee6ae49adfc28d3d38d9d34bbfdcc009497120256309a37" dependencies = [ "frame-benchmarking", "frame-support", @@ -3533,8 +3529,9 @@ dependencies = [ [[package]] name = "pallet-finality-tracker" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9414e60c78b94ae77ea8ccc4a86e3d5ebd1de93c236d3dd899abacefe5d7e82" dependencies = [ "frame-support", "frame-system", @@ -3547,22 +3544,11 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-generic-asset" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-grandpa" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8a3b81d434ce9ef2c34adf61afa5ecf2a6e386cd626369deda1ca2f7a3b076" dependencies = [ "frame-benchmarking", "frame-support", @@ -3583,8 +3569,9 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b62b8adc02901769b7756b054fa732b6d1aad01e8a2d6873a70fdcd38c59a1" dependencies = [ "frame-support", "frame-system", @@ -3596,8 +3583,9 @@ dependencies = [ [[package]] name = "pallet-session" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8abf520fc0c3259be05f164d43d34d52c86aeef8e8c5fded40145394394fc75d" dependencies = [ "frame-support", "frame-system", @@ -3616,8 +3604,9 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13642cbbb2ea520ca2021299baec604de102a1d033dd32812c946cb03f48f47e" dependencies = [ "frame-support", "frame-system", @@ -3630,7 +3619,7 @@ dependencies = [ [[package]] name = "pallet-template" -version = "2.0.0-rc6" +version = "2.0.0" dependencies = [ "frame-support", "frame-system", @@ -3642,8 +3631,9 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccddd55b713f541dff6ccf063cc7ddbc4fc41e92a9fdad8ec9562a0e3b465016" dependencies = [ "frame-benchmarking", "frame-support", @@ -3652,6 +3642,7 @@ dependencies = [ "parity-scale-codec", "serde", "sp-inherents", + "sp-io", "sp-runtime", "sp-std", "sp-timestamp", @@ -3659,8 +3650,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fe2fc67f2eb123199a5b8fb89a8e1c30e5d6d6b1d98e0330bac85c0d8c46f1" dependencies = [ "frame-support", "frame-system", @@ -3676,8 +3668,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fb0463589eeb1be8a3237e7260d139240e7d113950904f5a3cae5502576078" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -3694,8 +3687,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76c8b6676df5a4b411a283b9ea22551094710180fa5caebeae9eea8e9dbfa620" dependencies = [ "frame-support", "parity-scale-codec", @@ -3707,11 +3701,11 @@ dependencies = [ [[package]] name = "pallet-xyk" -version = "2.0.0-rc6" +version = "0.1.0" dependencies = [ "frame-support", "frame-system", - "pallet-generic-asset", + "pallet-assets 2.0.0", "parity-scale-codec", "sp-core", "sp-io", @@ -3734,9 +3728,9 @@ dependencies = [ [[package]] name = "parity-multiaddr" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc20af3143a62c16e7c9e92ea5c6ae49f7d271d97d4d8fe73afc28f0514a3d0f" +checksum = "2165a93382a93de55868dcbfa11e4a8f99676a9164eee6a2b4a9479ad319c257" dependencies = [ "arrayref", "bs58", @@ -3827,12 +3821,30 @@ dependencies = [ "synstructure", ] -[[package]] -name = "parity-wasm" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" - +[[package]] +name = "parity-wasm" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" + +[[package]] +name = "parity-ws" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e02a625dd75084c2a7024f07c575b61b782f729d18702dabb3cdbf31911dc61" +dependencies = [ + "byteorder 1.3.4", + "bytes 0.4.12", + "httparse", + "log", + "mio", + "mio-extras", + "rand 0.7.3", + "sha-1", + "slab", + "url 2.1.1", +] + [[package]] name = "parking" version = "1.0.6" @@ -3870,6 +3882,17 @@ dependencies = [ "parking_lot_core 0.7.2", ] +[[package]] +name = "parking_lot" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" +dependencies = [ + "instant", + "lock_api 0.4.1", + "parking_lot_core 0.8.0", +] + [[package]] name = "parking_lot_core" version = "0.4.0" @@ -3890,7 +3913,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ "cfg-if", - "cloudabi", + "cloudabi 0.0.3", "libc", "redox_syscall", "rustc_version", @@ -3905,7 +3928,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ "cfg-if", - "cloudabi", + "cloudabi 0.0.3", + "libc", + "redox_syscall", + "smallvec 1.4.1", + "winapi 0.3.9", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" +dependencies = [ + "cfg-if", + "cloudabi 0.1.0", + "instant", "libc", "redox_syscall", "smallvec 1.4.1", @@ -4047,7 +4085,7 @@ checksum = "c55c21c64d0eaa4d7ed885d959ef2d62d9e488c27c0e02d9aa5ce6c877b7d5f8" dependencies = [ "fixed-hash", "impl-codec", - "impl-serde 0.3.1", + "impl-serde", "uint", ] @@ -4109,14 +4147,15 @@ dependencies = [ [[package]] name = "prometheus" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0ced56dee39a6e960c15c74dc48849d614586db2eaada6497477af7c7811cd" +checksum = "30d70cf4412832bcac9cffe27906f4a66e450d323525e977168c70d1b36120ae" dependencies = [ "cfg-if", "fnv", "lazy_static", - "spin", + "parking_lot 0.11.0", + "regex", "thiserror", ] @@ -4243,7 +4282,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" dependencies = [ - "cloudabi", + "cloudabi 0.0.3", "fuchsia-cprng", "libc", "rand_core 0.3.1", @@ -4371,7 +4410,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" dependencies = [ - "cloudabi", + "cloudabi 0.0.3", "fuchsia-cprng", "libc", "rand_core 0.4.2", @@ -4555,27 +4594,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rental" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f" -dependencies = [ - "rental-impl", - "stable_deref_trait", -] - -[[package]] -name = "rental-impl" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "retain_mut" version = "0.1.1" @@ -4599,9 +4617,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61aa17a99a2413cd71c1106691bf59dad7de0cd5099127f90e9d99c429c40d4a" +checksum = "23d83c02c429044d58474eaf5ae31e062d0de894e21125b47437ec0edc1397e6" dependencies = [ "libc", "librocksdb-sys", @@ -4729,8 +4747,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527f6822cf592ac2b4a6ca7d04601c48d6728b8c03d9a9cc0488e4b535c69c6d" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -4753,8 +4772,9 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bee59dc560f30e72ee95c224e3e75299b53b619e659a38af9db2639803c08ee" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -4770,10 +4790,12 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d0e4d53e723ee6bad8cadec9651086887d1d920996e1589ee7dfa767a7cba9" dependencies = [ "impl-trait-for-tuples", + "parity-scale-codec", "sc-chain-spec-derive", "sc-network", "sc-telemetry", @@ -4786,8 +4808,9 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38af2ca789e2d2fa2aa0ec16d27dc648fa4d64ecb10760d2f552b2c86ea7a403" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4797,20 +4820,20 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2ce2952f155bd72b85ff866c588b6bae8f1bc183275f1a7a54eee55535a640" dependencies = [ "ansi_term 0.12.1", "atty", "bip39", "chrono", "derive_more", - "env_logger", "fdlimit", "futures 0.3.5", "hex", "lazy_static", - "libp2p 0.22.0", + "libp2p", "log", "names", "nix", @@ -4840,12 +4863,16 @@ dependencies = [ "substrate-prometheus-endpoint", "time", "tokio 0.2.22", + "tracing", + "tracing-log", + "tracing-subscriber", ] [[package]] name = "sc-client-api" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fafb2b2861e847657c4656d2ae2249c9f3f6a76fb92a22f750325b77e1fb4c8" dependencies = [ "derive_more", "fnv", @@ -4880,8 +4907,9 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bc82e81fafb162ceda7635932c8b5d65b8bc7b021e49546ab913e2e2458524d" dependencies = [ "blake2-rfc", "hash-db", @@ -4910,8 +4938,9 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6dd5b4e7a37bf78e85161bd6f01a09f0eb7cf49f2961d136885659ad6e30d49" dependencies = [ "sc-client-api", "sp-blockchain", @@ -4921,8 +4950,9 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0b4fbf217f3942ae545ad70cd5b5d567b4519b9acb07b35e0de5cce7e7ef195" dependencies = [ "derive_more", "futures 0.3.5", @@ -4952,8 +4982,9 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69a334a099d5cac9054ea1ef1db4be8ed5518270027798f96d2a68c5bf69af8e" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -4975,8 +5006,9 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af77c7fda9659559e257fe330af26e7c2e8f61583c2a5c45f4c9db73d58a902b" dependencies = [ "derive_more", "lazy_static", @@ -5003,8 +5035,9 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6663e4d1d2f8255e6c1994ce548365a7631a82f7ab231d0b8a122cc2a0011949" dependencies = [ "derive_more", "log", @@ -5020,8 +5053,9 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78aeea37a28b83af11fe621ee047758e125341db96efaf7f553a4180fe48d6b8" dependencies = [ "log", "parity-scale-codec", @@ -5035,8 +5069,9 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5c7d29c1932c5c3281d5324ead624709c1798031df72908ce6012b3651dea0a" dependencies = [ "log", "parity-scale-codec", @@ -5053,8 +5088,9 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4095b26b5717265d3dca8e2d70f977dfd4085f1c352dbf82217953da90a96e46" dependencies = [ "derive_more", "finality-grandpa", @@ -5090,8 +5126,9 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81dbdbba0420bb4c0bf2a79bcbb78de5bd1349aad8467b3115f82be579b2972" dependencies = [ "ansi_term 0.12.1", "futures 0.3.5", @@ -5108,8 +5145,9 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bbf8b58ed80e1d375aaa8ee5dedf17f68fea30c900440a695fb630a1757283" dependencies = [ "derive_more", "hex", @@ -5124,8 +5162,9 @@ dependencies = [ [[package]] name = "sc-light" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00ce4c6f21d572549b8b8a55757a0e548ddd670ab89d9415125a4e09c0ffa74" dependencies = [ "hash-db", "lazy_static", @@ -5143,10 +5182,12 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e58ccd69ea8dd0c1e1d98e5e7ed2969aaf14d45dcf98416c679a968e752850" dependencies = [ "async-std", + "async-trait", "bitflags", "bs58", "bytes 0.5.6", @@ -5160,11 +5201,11 @@ dependencies = [ "futures_codec", "hex", "ip_network", - "libp2p 0.23.0", + "libp2p", "linked-hash-map", "linked_hash_set", "log", - "lru", + "lru 0.4.3", "nohash-hasher", "parity-scale-codec", "parking_lot 0.10.2", @@ -5196,14 +5237,15 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ddb2a1cb6cd53b46e76f61c662d1561da4a7dc16a375c37849fd1f429b6803" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", - "libp2p 0.23.0", + "libp2p", "log", - "lru", + "lru 0.4.3", "sc-network", "sp-runtime", "wasm-timer", @@ -5211,8 +5253,9 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79495bd858351489fcebeb4e47821e15329ad5606f0d7983836e069005c3d9dd" dependencies = [ "bytes 0.5.6", "fnv", @@ -5238,11 +5281,12 @@ dependencies = [ [[package]] name = "sc-peerset" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfaa3d62db8ad549e6d21b6e353e00e2e7338c8623c01c79e8f36b035266a4b" dependencies = [ "futures 0.3.5", - "libp2p 0.23.0", + "libp2p", "log", "serde_json", "sp-utils", @@ -5251,8 +5295,9 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d42c942480b516b4bd4a32d1434f634126220cb00c8d482658700cc58dc22c6f" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -5260,8 +5305,9 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc3793d8ff10dbeb0b683151a1ea33570dc994195cc29451e0b72ce35179adc" dependencies = [ "futures 0.3.5", "hash-db", @@ -5292,8 +5338,9 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfb4b79b9b6b410c745a00eb4ead11b2ef0819e6eac970a5ec6415abf82777be" dependencies = [ "derive_more", "futures 0.3.5", @@ -5316,9 +5363,11 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9118867e60870b99cc1877edb4c35878babe6696335841e5b636dcba2fdb3d" dependencies = [ + "futures 0.1.29", "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", @@ -5328,12 +5377,14 @@ dependencies = [ "serde", "serde_json", "sp-runtime", + "substrate-prometheus-endpoint", ] [[package]] name = "sc-service" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04b2096d7dac26c52656cd2c85bc208d2ca3316ea2185fd775763d558a980da" dependencies = [ "derive_more", "directories", @@ -5381,6 +5432,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-state-machine", + "sp-tracing", "sp-transaction-pool", "sp-trie", "sp-utils", @@ -5393,8 +5445,9 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56341f78caf54af053889d1e863ca9b03004a3f471947805226fa8a6be9c9a59" dependencies = [ "log", "parity-scale-codec", @@ -5407,12 +5460,13 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5883219d0ccec3e4d50079ba63f8accc71659b93537cff66de326a382b138c4b" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", - "libp2p 0.23.0", + "libp2p", "log", "parking_lot 0.10.2", "pin-project", @@ -5428,8 +5482,9 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "695f005588c8b6957e56c86bc4624969a0c1a8e4e4d2f4fe0bb4039a26a10503" dependencies = [ "erased-serde", "log", @@ -5441,13 +5496,15 @@ dependencies = [ "slog", "sp-tracing", "tracing", + "tracing-core", "tracing-subscriber", ] [[package]] name = "sc-transaction-graph" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31fed765b519362f7ae824a2d3a2e6ee9912ac972e8ff61838d4ff0831cb3077" dependencies = [ "derive_more", "futures 0.3.5", @@ -5467,8 +5524,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248d4bcde22c936b462e4aa6c32e0f49a96942b123a1a46bc60cd02fbf907002" dependencies = [ "derive_more", "futures 0.3.5", @@ -5872,8 +5930,9 @@ dependencies = [ [[package]] name = "sp-allocator" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79a1db780708b6b71e9914e2b1d11b3e61c9bfb492c88b1024115e1a6661da" dependencies = [ "derive_more", "log", @@ -5884,8 +5943,9 @@ dependencies = [ [[package]] name = "sp-api" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953a3296335d9761311763dbe6855109ea4bea915e27cf5633d8b01057898302" dependencies = [ "hash-db", "parity-scale-codec", @@ -5899,8 +5959,9 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8247ca24a2a881af2ac675c8ec33584944965d6d45645bbec16fe327ce42dce6" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -5911,8 +5972,9 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "885eca124aa6ce0bba57c08bc48c4357096996d630a77f572580ef8e2e4df034" dependencies = [ "parity-scale-codec", "serde", @@ -5923,8 +5985,9 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "667775bc50eb214225df18c92e4ec57acc7e2dc78d7d210eb4dd930db1a73995" dependencies = [ "integer-sqrt", "num-traits", @@ -5936,8 +5999,9 @@ dependencies = [ [[package]] name = "sp-authorship" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58623adee1ed41752d76151762c80801758f88f85e4016d0338f2b01f4e7bd44" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -5947,8 +6011,9 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07d7fca8aa126a9d295843d592f44b48d8cf93880862baeff2968164598ab26c" dependencies = [ "parity-scale-codec", "sp-api", @@ -5959,12 +6024,13 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e37387284973e2edceefaa673930282801ea238e5892a2cc6aa02f7f2e7601df" dependencies = [ "derive_more", "log", - "lru", + "lru 0.4.3", "parity-scale-codec", "parking_lot 0.10.2", "sp-block-builder", @@ -5976,8 +6042,9 @@ dependencies = [ [[package]] name = "sp-chain-spec" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "150ce7661d02d4d0509a4a8364ab3b71a5ef2faf3f97d22d4b76bc0786d9e28b" dependencies = [ "serde", "serde_json", @@ -5985,13 +6052,14 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b460103293bbf2f4193e43c4f031fdc099c5e27c782369bbb4dacc7765e84057" dependencies = [ "derive_more", "futures 0.3.5", "futures-timer 3.0.2", - "libp2p 0.23.0", + "libp2p", "log", "parity-scale-codec", "parking_lot 0.10.2", @@ -6011,8 +6079,9 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dc270d5c9c74960f44be4fe3e2e04886edf6a4a6fa85a57d381b242ce8b41e0" dependencies = [ "parity-scale-codec", "sp-api", @@ -6025,8 +6094,9 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83ea323ccf4ec8aad353fbc9016a1cb8cbf0d872d33bc8874cb0753b014fb7fc" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -6034,8 +6104,9 @@ dependencies = [ [[package]] name = "sp-core" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e92ac5c674ee2cd9219d084301b4cbb82b28a94a0f3087bf4bea0ef3067ebb5c" dependencies = [ "base58", "blake2-rfc", @@ -6047,7 +6118,7 @@ dependencies = [ "hash-db", "hash256-std-hasher", "hex", - "impl-serde 0.3.1", + "impl-serde", "lazy_static", "libsecp256k1", "log", @@ -6078,8 +6149,9 @@ dependencies = [ [[package]] name = "sp-database" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c1c352eceefe5bcdfc27f13a2fd038fc571b7aca5146f2cd651d40e9d2457dd" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -6087,8 +6159,9 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3750b084e0f4677f6e834a974f30b1ba97fc2fe00185c9d03611a2228446dc" dependencies = [ "proc-macro2", "quote", @@ -6097,8 +6170,9 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d87fcd0e0fc5e025459cfe769803488d4894e36d0f8cef80b5239d2e7ef6580" dependencies = [ "environmental", "parity-scale-codec", @@ -6108,8 +6182,9 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "789d960506306f34fb0a2da547956ba1f23d6a29032291a7284c943906feddcb" dependencies = [ "finality-grandpa", "log", @@ -6124,8 +6199,9 @@ dependencies = [ [[package]] name = "sp-finality-tracker" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5433473273a116241010551b9acfdbd7d33a9fdcda45c390eb707971568154" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -6134,8 +6210,9 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "365e5aee23640631e63e8634f1d804e33c8fcb521f4052910f29abaa2df1c1cf" dependencies = [ "derive_more", "parity-scale-codec", @@ -6146,8 +6223,9 @@ dependencies = [ [[package]] name = "sp-io" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e1dee9244eb6cba1bef9b3a4ec288185e1380e455f1fd348b60252592c1cf0" dependencies = [ "futures 0.3.5", "hash-db", @@ -6163,12 +6241,15 @@ dependencies = [ "sp-tracing", "sp-trie", "sp-wasm-interface", + "tracing", + "tracing-core", ] [[package]] name = "sp-keyring" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f76feeb27b218d58523931ea2d708b622c3bd96a3be1c3a5895bba0f7a54c13" dependencies = [ "lazy_static", "sp-core", @@ -6178,8 +6259,9 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbd5e101b2510ad84adaeb4589e6a94fdc741242ab1e39b89c87a647133205ad" dependencies = [ "sp-api", "sp-core", @@ -6188,8 +6270,9 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "492126eb766b3b6740e4e4929d6527d37708598b7296a664f3680c0f0c1fc573" dependencies = [ "backtrace", "log", @@ -6197,8 +6280,9 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c6678f4b42421e6dcdf3896a0c81a403c29ef1cf8d74b046d59125d40da911" dependencies = [ "serde", "sp-core", @@ -6206,8 +6290,9 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62542f8ce9d5fcb43a4dd3c3a53326d33aacf9b0bc9d353d6fe9fd5ff3031747" dependencies = [ "either", "hash256-std-hasher", @@ -6228,8 +6313,9 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7e363c480cc8c9019b84f85d10c0b56a184079d5d840d2d1d55087ad835dc6" dependencies = [ "parity-scale-codec", "primitive-types", @@ -6244,8 +6330,9 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cf56a38544293e54dbe0aa7b6aed1e046bfc704b6fc3de7255897dca98ccb1" dependencies = [ "Inflector", "proc-macro-crate", @@ -6256,8 +6343,9 @@ dependencies = [ [[package]] name = "sp-serializer" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643933e971979094c9d4b27b015c7250985a262e405bb9ad090336d8ceb5b2b9" dependencies = [ "serde", "serde_json", @@ -6265,8 +6353,9 @@ dependencies = [ [[package]] name = "sp-session" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d138b1f548933003feaa967de49ed87066643073bcc41be45ef2daaa0991c133" dependencies = [ "parity-scale-codec", "sp-api", @@ -6278,8 +6367,9 @@ dependencies = [ [[package]] name = "sp-staking" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b06f9839d8b4312486626bde31d6cd7763dd9b7d93ea9e70c01ca30f0998032" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -6288,11 +6378,11 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f58335de98bca196683a8ef22195a8a43b457b8bc705dba3124138ffc2ee720" dependencies = [ "hash-db", - "itertools 0.9.0", "log", "num-traits", "parity-scale-codec", @@ -6302,6 +6392,7 @@ dependencies = [ "sp-core", "sp-externalities", "sp-panic-handler", + "sp-std", "sp-trie", "trie-db", "trie-root", @@ -6309,15 +6400,17 @@ dependencies = [ [[package]] name = "sp-std" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2d6e166cead2d3b1d3d8fe0e787d076b7d0296b1760a0d7d340846d0ba42c5" [[package]] name = "sp-storage" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4625e6f8f40995939560f48f89028f658b7929657c68d01c571c81ab5619ff" dependencies = [ - "impl-serde 0.2.3", + "impl-serde", "parity-scale-codec", "ref-cast", "serde", @@ -6327,8 +6420,9 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb398f0a5d2798ad4e02450b3089534547b448d22ebe6f3b2c03f74170f58d1" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -6341,18 +6435,23 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9a5c42c5450991ca3a28c190e75122f5ccedbcb024953e7c357e7aa2afd8534" dependencies = [ "log", - "rental", + "parity-scale-codec", + "sp-std", "tracing", + "tracing-core", + "tracing-subscriber", ] [[package]] name = "sp-transaction-pool" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b34ee48341c17c6e2f1e55f6076918f46b0c4505a99ad69ab1edda8b45bbd8" dependencies = [ "derive_more", "futures 0.3.5", @@ -6366,8 +6465,9 @@ dependencies = [ [[package]] name = "sp-trie" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3aae57c8ae81ba978503137a8c625d2963eb425dd90dec0d96b4ed18d8bfd55" dependencies = [ "hash-db", "memory-db", @@ -6380,8 +6480,9 @@ dependencies = [ [[package]] name = "sp-utils" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84310a02e2ac89b5e288d7af980414fd88753e3caba92aab1983cd2819991150" dependencies = [ "futures 0.3.5", "futures-core", @@ -6392,10 +6493,11 @@ dependencies = [ [[package]] name = "sp-version" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21935199c8765f0d02facc718f9c83149a70ea684fb03612e5161c682b38a301" dependencies = [ - "impl-serde 0.2.3", + "impl-serde", "parity-scale-codec", "serde", "sp-runtime", @@ -6404,8 +6506,9 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c28225e8b7ec7e260f8b46443f8731abda206334cb75c740d2407693f38167" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -6520,28 +6623,31 @@ dependencies = [ [[package]] name = "substrate-bip39" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c004e8166d6e0aa3a9d5fa673e5b7098ff25f930de1013a21341988151e681bb" +checksum = "bed6646a0159b9935b5d045611560eeef842b78d7adc3ba36f5ca325a13a0236" dependencies = [ "hmac", "pbkdf2", "schnorrkel", "sha2 0.8.2", + "zeroize", ] [[package]] name = "substrate-build-script-utils" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f14feab86fe31e7d0a485d53d7c1c634c426f7ae5b8ce4f705b2e49a35713fcb" dependencies = [ "platforms", ] [[package]] name = "substrate-frame-rpc-system" -version = "2.0.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44e6202803178f25f71a3218a69341289d38c1369cc63e78dfe51577599163f7" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.5", @@ -6563,8 +6669,9 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.8.0-rc6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3e361741d066bfc29554b9f1bc8e4ac927eb4bd33dd8bb0486969edd8b0b5a" dependencies = [ "async-std", "derive_more", @@ -6578,7 +6685,8 @@ dependencies = [ [[package]] name = "substrate-wasm-builder-runner" version = "1.0.6" -source = "git+https://github.com/paritytech/substrate.git?tag=v2.0.0-rc6#be8bb186d87b9d2b47a2907c9b51ae1e252362c3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a965994514ab35d3893e9260245f2947fd1981cdd4fffd2c6e6d1a9ce02e6a" [[package]] name = "subtle" @@ -7074,9 +7182,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db63662723c316b43ca36d833707cc93dff82a02ba3d7e354f342682cc8b3545" +checksum = "5bcf46c1f1f06aeea2d6b81f3c863d0930a596c86ad1920d4e5bad6dd1d7119a" dependencies = [ "lazy_static", ] @@ -7151,17 +7259,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "twofish" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" -dependencies = [ - "block-cipher-trait", - "byteorder 1.3.4", - "opaque-debug 0.2.3", -] - [[package]] name = "twox-hash" version = "1.5.0" @@ -7262,6 +7359,16 @@ dependencies = [ "futures_codec", ] +[[package]] +name = "unsigned-varint" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" +dependencies = [ + "futures-io", + "futures-util", +] + [[package]] name = "untrusted" version = "0.7.1" @@ -7736,24 +7843,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "ws" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a2c47b5798ccc774ffb93ff536aec7c4275d722fd9c740c83cdd1af1f2d94" -dependencies = [ - "byteorder 1.3.4", - "bytes 0.4.12", - "httparse", - "log", - "mio", - "mio-extras", - "rand 0.7.3", - "sha-1", - "slab", - "url 2.1.1", -] - [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -7777,14 +7866,14 @@ dependencies = [ [[package]] name = "yamux" -version = "0.4.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd37e58a1256a0b328ce9c67d8b62ecdd02f4803ba443df478835cb1a41a637c" +checksum = "9aeb8c4043cac71c3c299dff107171c220d179492350ea198e109a414981b83c" dependencies = [ "futures 0.3.5", "log", "nohash-hasher", - "parking_lot 0.10.2", + "parking_lot 0.11.0", "rand 0.7.3", "static_assertions", ] diff --git a/node/Cargo.toml b/node/Cargo.toml index d94c444d9fbfb..b634ec47a7175 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -7,148 +7,52 @@ homepage = 'https://substrate.dev' license = 'Unlicense' name = 'node-template' repository = 'https://github.com/substrate-developer-hub/substrate-node-template/' -version = '2.0.0-rc6' - -[package.metadata.docs.rs] -targets = ['x86_64-unknown-linux-gnu'] +version = '2.0.0' [[bin]] name = 'node-template' -[dependencies.node-template-runtime] -path = '../runtime' -version = '2.0.0-rc6' - -[dependencies.pallet-transaction-payment-rpc] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sc-basic-authorship] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sc-cli] -features = ['wasmtime'] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sc-client-api] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sc-consensus] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sc-consensus-aura] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sc-executor] -features = ['wasmtime'] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sc-finality-grandpa] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sc-rpc] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sc-rpc-api] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sc-service] -features = ['wasmtime'] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sc-transaction-pool] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-api] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-block-builder] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-blockchain] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-consensus] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sp-consensus-aura] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sp-core] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-finality-grandpa] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-inherents] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-runtime] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-transaction-pool] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.substrate-frame-rpc-system] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' +[package.metadata.docs.rs] +targets = ['x86_64-unknown-linux-gnu'] -[dependencies.generic-asset] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'pallet-generic-asset' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' +[build-dependencies] +substrate-build-script-utils = '2.0.0' [dependencies] -jsonrpc-core = '14.0.3' +jsonrpc-core = '15.0.0' structopt = '0.3.8' -[build-dependencies.substrate-build-script-utils] -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' +# local dependencies +node-template-runtime = { path = '../runtime', version = '2.0.0' } + +# Substrate dependencies +frame-benchmarking = '2.0.0' +frame-benchmarking-cli = '2.0.0' +pallet-transaction-payment-rpc = '2.0.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-aura = '0.8.0' +sc-executor = { features = ['wasmtime'], version = '0.8.0' } +sc-finality-grandpa = '0.8.0' +sc-rpc = '2.0.0' +sc-rpc-api = '0.8.0' +sc-service = { features = ['wasmtime'], version = '0.8.0' } +sc-transaction-pool = '2.0.0' +sp-api = '2.0.0' +sp-block-builder = '2.0.0' +sp-blockchain = '2.0.0' +sp-consensus = '0.8.0' +sp-consensus-aura = '0.8.0' +sp-core = '2.0.0' +sp-finality-grandpa = '2.0.0' +sp-inherents = '2.0.0' +sp-runtime = '2.0.0' +sp-transaction-pool = '2.0.0' +substrate-frame-rpc-system = '2.0.0' +pallet-assets = { default-features = false, version = '2.0.0' } + +[features] +default = [] +runtime-benchmarks = ['node-template-runtime/runtime-benchmarks'] diff --git a/node/src/cli.rs b/node/src/cli.rs index 0091ef7d75912..f2faf17e4ddf4 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -1,5 +1,5 @@ -use sc_cli::{RunCmd, Subcommand}; use structopt::StructOpt; +use sc_cli::RunCmd; #[derive(Debug, StructOpt)] pub struct Cli { @@ -9,3 +9,31 @@ pub struct Cli { #[structopt(flatten)] pub run: RunCmd, } + +#[derive(Debug, StructOpt)] +pub enum Subcommand { + /// Build a chain specification. + BuildSpec(sc_cli::BuildSpecCmd), + + /// Validate blocks. + CheckBlock(sc_cli::CheckBlockCmd), + + /// Export blocks. + ExportBlocks(sc_cli::ExportBlocksCmd), + + /// Export the state of a given block into a chain spec. + ExportState(sc_cli::ExportStateCmd), + + /// Import blocks. + ImportBlocks(sc_cli::ImportBlocksCmd), + + /// Remove the whole chain. + PurgeChain(sc_cli::PurgeChainCmd), + + /// Revert the chain to a previous state. + Revert(sc_cli::RevertCmd), + + /// The custom benchmark subcommmand benchmarking runtime pallets. + #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")] + Benchmark(frame_benchmarking_cli::BenchmarkCmd), +} diff --git a/node/src/command.rs b/node/src/command.rs index 9cd2248d6547a..2efca03837108 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -15,12 +15,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::chain_spec; -use crate::cli::Cli; -use crate::service; +use crate::{chain_spec, service}; +use crate::cli::{Cli, Subcommand}; use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec}; use sc_service::PartialComponents; -use crate::service::new_partial; +use node_template_runtime::Block; impl SubstrateCli for Cli { fn impl_name() -> String { @@ -66,15 +65,65 @@ impl SubstrateCli for Cli { pub fn run() -> sc_cli::Result<()> { let cli = Cli::from_args(); - match cli.subcommand { - Some(ref subcommand) => { - let runner = cli.create_runner(subcommand)?; - runner.run_subcommand(subcommand, |config| { - let PartialComponents { client, backend, task_manager, import_queue, .. } - = new_partial(&config)?; - Ok((client, backend, import_queue, task_manager)) + match &cli.subcommand { + Some(Subcommand::BuildSpec(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) + }, + Some(Subcommand::CheckBlock(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, import_queue, ..} + = service::new_partial(&config)?; + Ok((cmd.run(client, import_queue), task_manager)) }) - } + }, + Some(Subcommand::ExportBlocks(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, ..} + = service::new_partial(&config)?; + Ok((cmd.run(client, config.database), task_manager)) + }) + }, + Some(Subcommand::ExportState(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, ..} + = service::new_partial(&config)?; + Ok((cmd.run(client, config.chain_spec), task_manager)) + }) + }, + Some(Subcommand::ImportBlocks(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, import_queue, ..} + = service::new_partial(&config)?; + Ok((cmd.run(client, import_queue), task_manager)) + }) + }, + Some(Subcommand::PurgeChain(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|config| cmd.run(config.database)) + }, + Some(Subcommand::Revert(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, backend, ..} + = service::new_partial(&config)?; + Ok((cmd.run(client, backend), task_manager)) + }) + }, + Some(Subcommand::Benchmark(cmd)) => { + if cfg!(feature = "runtime-benchmarks") { + let runner = cli.create_runner(cmd)?; + + runner.sync_run(|config| cmd.run::(config)) + } else { + Err("Benchmarking wasn't enabled when building the node. \ + You can enable it with `--features runtime-benchmarks`.".into()) + } + }, None => { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| match config.role { diff --git a/node/src/service.rs b/node/src/service.rs index 8fa935c375021..3de31dc61ab51 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -16,6 +16,7 @@ native_executor_instance!( pub Executor, node_template_runtime::api::dispatch, node_template_runtime::native_version, + frame_benchmarking::benchmarking::HostFunctions, ); type FullClient = sc_service::TFullClient; diff --git a/pallets/assets/Cargo.toml b/pallets/assets/Cargo.toml new file mode 100644 index 0000000000000..702c5b6f43c63 --- /dev/null +++ b/pallets/assets/Cargo.toml @@ -0,0 +1,38 @@ +[package] +name = "pallet-assets" +version = "2.0.0" +authors = ["Parity Technologies "] +edition = "2018" +license = "Apache-2.0" +homepage = "https://substrate.dev" +repository = "https://github.com/paritytech/substrate/" +description = "FRAME asset management pallet" +readme = "README.md" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +serde = { version = "1.0.101", optional = true } +codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } +# Needed for various traits. In our case, `OnFinalize`. +sp-runtime = { default-features = false, version = '2.0.0' } +# Needed for type-safe access to storage DB. +frame-support = { default-features = false, version = '2.0.0' } +# `system` module provides us with all sorts of useful stuff and macros depend on it being around. +frame-system = { default-features = false, version = '2.0.0' } + +[dev-dependencies] +sp-core = { default-features = false, version = '2.0.0' } +sp-std = { default-features = false, version = '2.0.0' } +sp-io = { default-features = false, version = '2.0.0' } + +[features] +default = ["std"] +std = [ + "serde", + "codec/std", + "sp-runtime/std", + "frame-support/std", + "frame-system/std", +] diff --git a/pallets/assets/README.md b/pallets/assets/README.md new file mode 100644 index 0000000000000..6b3fe21e52775 --- /dev/null +++ b/pallets/assets/README.md @@ -0,0 +1,116 @@ +# Assets Module + +A simple, secure module for dealing with fungible assets. + +## Overview + +The Assets module provides functionality for asset management of fungible asset classes +with a fixed supply, including: + +* Asset Issuance +* Asset Transfer +* Asset Destruction + +To use it in your runtime, you need to implement the assets [`Trait`](https://docs.rs/pallet-assets/latest/pallet_assets/trait.Trait.html). + +The supported dispatchable functions are documented in the [`Call`](https://docs.rs/pallet-assets/latest/pallet_assets/enum.Call.html) enum. + +### Terminology + +* **Asset issuance:** The creation of a new asset, whose total supply will belong to the + account that issues the asset. +* **Asset transfer:** The action of transferring assets from one account to another. +* **Asset destruction:** The process of an account removing its entire holding of an asset. +* **Fungible asset:** An asset whose units are interchangeable. +* **Non-fungible asset:** An asset for which each unit has unique characteristics. + +### Goals + +The assets system in Substrate is designed to make the following possible: + +* Issue a unique asset to its creator's account. +* Move assets between accounts. +* Remove an account's balance of an asset when requested by that account's owner and update + the asset's total supply. + +## Interface + +### Dispatchable Functions + +* `issue` - Issues the total supply of a new fungible asset to the account of the caller of the function. +* `transfer` - Transfers an `amount` of units of fungible asset `id` from the balance of +the function caller's account (`origin`) to a `target` account. +* `destroy` - Destroys the entire holding of a fungible asset `id` associated with the account +that called the function. + +Please refer to the [`Call`](https://docs.rs/pallet-assets/latest/pallet_assets/enum.Call.html) enum and its associated variants for documentation on each function. + +### Public Functions + + +* `balance` - Get the asset `id` balance of `who`. +* `total_supply` - Get the total supply of an asset `id`. + +Please refer to the [`Module`](https://docs.rs/pallet-assets/latest/pallet_assets/struct.Module.html) struct for details on publicly available functions. + +## Usage + +The following example shows how to use the Assets module in your runtime by exposing public functions to: + +* Issue a new fungible asset for a token distribution event (airdrop). +* Query the fungible asset holding balance of an account. +* Query the total supply of a fungible asset that has been issued. + +### Prerequisites + +Import the Assets module and types and derive your runtime's configuration traits from the Assets module trait. + +### Simple Code Snippet + +```rust +use pallet_assets as assets; +use frame_support::{decl_module, dispatch, ensure}; +use frame_system::ensure_signed; + +pub trait Trait: assets::Trait { } + +decl_module! { + pub struct Module for enum Call where origin: T::Origin { + pub fn issue_token_airdrop(origin) -> dispatch::DispatchResult { + let sender = ensure_signed(origin).map_err(|e| e.as_str())?; + + const ACCOUNT_ALICE: u64 = 1; + const ACCOUNT_BOB: u64 = 2; + const COUNT_AIRDROP_RECIPIENTS: u64 = 2; + const TOKENS_FIXED_SUPPLY: u64 = 100; + + ensure!(!COUNT_AIRDROP_RECIPIENTS.is_zero(), "Divide by zero error."); + + let asset_id = Self::next_asset_id(); + + >::mutate(|asset_id| *asset_id += 1); + >::insert((asset_id, &ACCOUNT_ALICE), TOKENS_FIXED_SUPPLY / COUNT_AIRDROP_RECIPIENTS); + >::insert((asset_id, &ACCOUNT_BOB), TOKENS_FIXED_SUPPLY / COUNT_AIRDROP_RECIPIENTS); + >::insert(asset_id, TOKENS_FIXED_SUPPLY); + + Self::deposit_event(RawEvent::Issued(asset_id, sender, TOKENS_FIXED_SUPPLY)); + Ok(()) + } + } +} +``` + +## Assumptions + +Below are assumptions that must be held when using this module. If any of +them are violated, the behavior of this module is undefined. + +* The total count of assets should be less than + `Trait::AssetId::max_value()`. + +## Related Modules + +* [`System`](https://docs.rs/frame-system/latest/frame_system/) +* [`Support`](https://docs.rs/frame-support/latest/frame_support/) + +License: Apache-2.0 \ No newline at end of file diff --git a/pallets/assets/src/lib.rs b/pallets/assets/src/lib.rs new file mode 100644 index 0000000000000..17a9203abe0d3 --- /dev/null +++ b/pallets/assets/src/lib.rs @@ -0,0 +1,450 @@ +// This file is part of Substrate. + +// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! # Assets Module +//! +//! A simple, secure module for dealing with fungible assets. +//! +//! ## Overview +//! +//! The Assets module provides functionality for asset management of fungible asset classes +//! with a fixed supply, including: +//! +//! * Asset Issuance +//! * Asset Transfer +//! * Asset Destruction +//! +//! To use it in your runtime, you need to implement the assets [`Trait`](./trait.Trait.html). +//! +//! The supported dispatchable functions are documented in the [`Call`](./enum.Call.html) enum. +//! +//! ### Terminology +//! +//! * **Asset issuance:** The creation of a new asset, whose total supply will belong to the +//! account that issues the asset. +//! * **Asset transfer:** The action of transferring assets from one account to another. +//! * **Asset destruction:** The process of an account removing its entire holding of an asset. +//! * **Fungible asset:** An asset whose units are interchangeable. +//! * **Non-fungible asset:** An asset for which each unit has unique characteristics. +//! +//! ### Goals +//! +//! The assets system in Substrate is designed to make the following possible: +//! +//! * Issue a unique asset to its creator's account. +//! * Move assets between accounts. +//! * Remove an account's balance of an asset when requested by that account's owner and update +//! the asset's total supply. +//! +//! ## Interface +//! +//! ### Dispatchable Functions +//! +//! * `issue` - Issues the total supply of a new fungible asset to the account of the caller of the function. +//! * `transfer` - Transfers an `amount` of units of fungible asset `id` from the balance of +//! the function caller's account (`origin`) to a `target` account. +//! * `destroy` - Destroys the entire holding of a fungible asset `id` associated with the account +//! that called the function. +//! +//! Please refer to the [`Call`](./enum.Call.html) enum and its associated variants for documentation on each function. +//! +//! ### Public Functions +//! +//! +//! * `balance` - Get the asset `id` balance of `who`. +//! * `total_supply` - Get the total supply of an asset `id`. +//! +//! Please refer to the [`Module`](./struct.Module.html) struct for details on publicly available functions. +//! +//! ## Usage +//! +//! The following example shows how to use the Assets module in your runtime by exposing public functions to: +//! +//! * Issue a new fungible asset for a token distribution event (airdrop). +//! * Query the fungible asset holding balance of an account. +//! * Query the total supply of a fungible asset that has been issued. +//! +//! ### Prerequisites +//! +//! Import the Assets module and types and derive your runtime's configuration traits from the Assets module trait. +//! +//! ### Simple Code Snippet +//! +//! ```rust,ignore +//! use pallet_assets as assets; +//! use frame_support::{decl_module, dispatch, ensure}; +//! use frame_system::ensure_signed; +//! +//! pub trait Trait: assets::Trait { } +//! +//! decl_module! { +//! pub struct Module for enum Call where origin: T::Origin { +//! pub fn issue_token_airdrop(origin) -> dispatch::DispatchResult { +//! let sender = ensure_signed(origin).map_err(|e| e.as_str())?; +//! +//! const ACCOUNT_ALICE: u64 = 1; +//! const ACCOUNT_BOB: u64 = 2; +//! const COUNT_AIRDROP_RECIPIENTS: u64 = 2; +//! const TOKENS_FIXED_SUPPLY: u64 = 100; +//! +//! ensure!(!COUNT_AIRDROP_RECIPIENTS.is_zero(), "Divide by zero error."); +//! +//! let asset_id = Self::next_asset_id(); +//! +//! >::mutate(|asset_id| *asset_id += 1); +//! >::insert((asset_id, &ACCOUNT_ALICE), TOKENS_FIXED_SUPPLY / COUNT_AIRDROP_RECIPIENTS); +//! >::insert((asset_id, &ACCOUNT_BOB), TOKENS_FIXED_SUPPLY / COUNT_AIRDROP_RECIPIENTS); +//! >::insert(asset_id, TOKENS_FIXED_SUPPLY); +//! +//! Self::deposit_event(RawEvent::Issued(asset_id, sender, TOKENS_FIXED_SUPPLY)); +//! Ok(()) +//! } +//! } +//! } +//! ``` +//! +//! ## Assumptions +//! +//! Below are assumptions that must be held when using this module. If any of +//! them are violated, the behavior of this module is undefined. +//! +//! * The total count of assets should be less than +//! `Trait::AssetId::max_value()`. +//! +//! ## Related Modules +//! +//! * [`System`](../frame_system/index.html) +//! * [`Support`](../frame_support/index.html) + +// Ensure we're `no_std` when compiling for Wasm. +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::{Parameter, decl_module, decl_event, decl_storage, decl_error, ensure, dispatch::DispatchResult}; +use sp_runtime::traits::{Member, AtLeast32Bit, AtLeast32BitUnsigned, Zero, StaticLookup}; +use frame_system::ensure_signed; +use sp_runtime::traits::One; + +/// The module configuration trait. +pub trait Trait: frame_system::Trait { + /// The overarching event type. + type Event: From> + Into<::Event>; + + /// The units in which we record balances. + type Balance: Member + Parameter + AtLeast32BitUnsigned + Default + Copy; + + /// The arithmetic type of asset identifier. + type AssetId: Parameter + AtLeast32Bit + Default + Copy; +} + +decl_module! { + pub struct Module for enum Call where origin: T::Origin { + type Error = Error; + + fn deposit_event() = default; + /// Issue a new class of fungible assets. There are, and will only ever be, `total` + /// such assets and they'll all belong to the `origin` initially. It will have an + /// identifier `AssetId` instance: this will be specified in the `Issued` event. + /// + /// # + /// - `O(1)` + /// - 1 storage mutation (codec `O(1)`). + /// - 2 storage writes (condec `O(1)`). + /// - 1 event. + /// # + #[weight = 0] + pub fn issue(origin, #[compact] total: T::Balance) { + let origin = ensure_signed(origin)?; + + let id = Self::next_asset_id(); + >::mutate(|id| *id += One::one()); + + >::insert((id, &origin), total); + >::insert(id, total); + + Self::deposit_event(RawEvent::Issued(id, origin, total)); + } + + /// Move some assets from one holder to another. + /// + /// # + /// - `O(1)` + /// - 1 static lookup + /// - 2 storage mutations (codec `O(1)`). + /// - 1 event. + /// # + #[weight = 0] + fn transfer(origin, + #[compact] id: T::AssetId, + target: ::Source, + #[compact] amount: T::Balance + ) { + let origin = ensure_signed(origin)?; + let origin_account = (id, origin.clone()); + let origin_balance = >::get(&origin_account); + let target = T::Lookup::lookup(target)?; + ensure!(!amount.is_zero(), Error::::AmountZero); + ensure!(origin_balance >= amount, Error::::BalanceLow); + + Self::deposit_event(RawEvent::Transferred(id, origin, target.clone(), amount)); + >::insert(origin_account, origin_balance - amount); + >::mutate((id, target), |balance| *balance += amount); + } + + /// Destroy any assets of `id` owned by `origin`. + /// + /// # + /// - `O(1)` + /// - 1 storage mutation (codec `O(1)`). + /// - 1 storage deletion (codec `O(1)`). + /// - 1 event. + /// # + #[weight = 0] + fn destroy(origin, #[compact] id: T::AssetId) { + let origin = ensure_signed(origin)?; + let balance = >::take((id, &origin)); + ensure!(!balance.is_zero(), Error::::BalanceZero); + + >::mutate(id, |total_supply| *total_supply -= balance); + Self::deposit_event(RawEvent::Destroyed(id, origin, balance)); + } + } +} + +decl_event! { + pub enum Event where + ::AccountId, + ::Balance, + ::AssetId, + { + /// Some assets were issued. \[asset_id, owner, total_supply\] + Issued(AssetId, AccountId, Balance), + /// Some assets were transferred. \[asset_id, from, to, amount\] + Transferred(AssetId, AccountId, AccountId, Balance), + /// Some assets were destroyed. \[asset_id, owner, balance\] + Destroyed(AssetId, AccountId, Balance), + } +} + +decl_error! { + pub enum Error for Module { + /// Transfer amount should be non-zero + AmountZero, + /// Account balance must be greater than or equal to the transfer amount + BalanceLow, + /// Balance should be non-zero + BalanceZero, + } +} + +decl_storage! { + trait Store for Module as Assets { + /// The number of units of assets held by any given account. + Balances: map hasher(blake2_128_concat) (T::AssetId, T::AccountId) => T::Balance; + /// The next asset identifier up for grabs. + pub NextAssetId get(fn next_asset_id): T::AssetId; + /// The total unit supply of an asset. + /// + /// TWOX-NOTE: `AssetId` is trusted, so this is safe. + TotalSupply: map hasher(twox_64_concat) T::AssetId => T::Balance; + } +} + +// The main implementation block for the module. +impl Module { + // Public immutables + + /// Get the asset `id` balance of `who`. + pub fn balance(id: T::AssetId, who: T::AccountId) -> T::Balance { + >::get((id, who)) + } + + /// Get the total supply of an asset `id`. + pub fn total_supply(id: T::AssetId) -> T::Balance { + >::get(id) + } + + pub fn assets_next_asset_id() -> T::AssetId { >::get() } + + pub fn assets_transfer(id: &T::AssetId, from: &T::AccountId, to: &T::AccountId, amount: &T::Balance) -> DispatchResult { + let origin_account = (id, from); + let origin_balance = >::get(origin_account); + ensure!(!amount.is_zero(), Error::::AmountZero); + ensure!(origin_balance >= *amount, Error::::BalanceLow); + + // Self::deposit_event(RawEvent::Transferred(id, origin, target.clone(), amount)); + >::insert(origin_account, origin_balance - *amount); + >::mutate((id, to), |balance| *balance += *amount); + + Ok(()) + } + + pub fn assets_mint(id: &T::AssetId, to: &T::AccountId, amount: &T::Balance) -> T::Balance { + >::mutate((id, to), |balance| *balance += *amount); + >::get((id, to)) + } + + pub fn assets_burn(id: &T::AssetId, to: &T::AccountId, amount: &T::Balance) -> T::Balance { + //TODO ensure amount + >::mutate((id, to), |balance| *balance -= *amount); + >::get((id, to)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + use frame_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types, weights::Weight}; + use sp_core::H256; + use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header}; + + impl_outer_origin! { + pub enum Origin for Test where system = frame_system {} + } + + #[derive(Clone, Eq, PartialEq)] + pub struct Test; + parameter_types! { + pub const BlockHashCount: u64 = 250; + pub const MaximumBlockWeight: Weight = 1024; + pub const MaximumBlockLength: u32 = 2 * 1024; + pub const AvailableBlockRatio: Perbill = Perbill::one(); + } + impl frame_system::Trait for Test { + type BaseCallFilter = (); + type Origin = Origin; + type Index = u64; + type Call = (); + type BlockNumber = u64; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Header = Header; + type Event = (); + type BlockHashCount = BlockHashCount; + type MaximumBlockWeight = MaximumBlockWeight; + type DbWeight = (); + type BlockExecutionWeight = (); + type ExtrinsicBaseWeight = (); + type MaximumExtrinsicWeight = MaximumBlockWeight; + type AvailableBlockRatio = AvailableBlockRatio; + type MaximumBlockLength = MaximumBlockLength; + type Version = (); + type PalletInfo = (); + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + } + impl Trait for Test { + type Event = (); + type Balance = u64; + type AssetId = u32; + } + type Assets = Module; + + fn new_test_ext() -> sp_io::TestExternalities { + frame_system::GenesisConfig::default().build_storage::().unwrap().into() + } + + #[test] + fn issuing_asset_units_to_issuer_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::issue(Origin::signed(1), 100)); + assert_eq!(Assets::balance(0, 1), 100); + }); + } + + #[test] + fn querying_total_supply_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::issue(Origin::signed(1), 100)); + assert_eq!(Assets::balance(0, 1), 100); + assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Assets::balance(0, 1), 50); + assert_eq!(Assets::balance(0, 2), 50); + assert_ok!(Assets::transfer(Origin::signed(2), 0, 3, 31)); + assert_eq!(Assets::balance(0, 1), 50); + assert_eq!(Assets::balance(0, 2), 19); + assert_eq!(Assets::balance(0, 3), 31); + assert_ok!(Assets::destroy(Origin::signed(3), 0)); + assert_eq!(Assets::total_supply(0), 69); + }); + } + + #[test] + fn transferring_amount_above_available_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::issue(Origin::signed(1), 100)); + assert_eq!(Assets::balance(0, 1), 100); + assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Assets::balance(0, 1), 50); + assert_eq!(Assets::balance(0, 2), 50); + }); + } + + #[test] + fn transferring_amount_more_than_available_balance_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::issue(Origin::signed(1), 100)); + assert_eq!(Assets::balance(0, 1), 100); + assert_ok!(Assets::transfer(Origin::signed(1), 0, 2, 50)); + assert_eq!(Assets::balance(0, 1), 50); + assert_eq!(Assets::balance(0, 2), 50); + assert_ok!(Assets::destroy(Origin::signed(1), 0)); + assert_eq!(Assets::balance(0, 1), 0); + assert_noop!(Assets::transfer(Origin::signed(1), 0, 1, 50), Error::::BalanceLow); + }); + } + + #[test] + fn transferring_less_than_one_unit_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::issue(Origin::signed(1), 100)); + assert_eq!(Assets::balance(0, 1), 100); + assert_noop!(Assets::transfer(Origin::signed(1), 0, 2, 0), Error::::AmountZero); + }); + } + + #[test] + fn transferring_more_units_than_total_supply_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::issue(Origin::signed(1), 100)); + assert_eq!(Assets::balance(0, 1), 100); + assert_noop!(Assets::transfer(Origin::signed(1), 0, 2, 101), Error::::BalanceLow); + }); + } + + #[test] + fn destroying_asset_balance_with_positive_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::issue(Origin::signed(1), 100)); + assert_eq!(Assets::balance(0, 1), 100); + assert_ok!(Assets::destroy(Origin::signed(1), 0)); + }); + } + + #[test] + fn destroying_asset_balance_with_zero_balance_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Assets::issue(Origin::signed(1), 100)); + assert_eq!(Assets::balance(0, 2), 0); + assert_noop!(Assets::destroy(Origin::signed(2), 0), Error::::BalanceZero); + }); + } +} diff --git a/pallets/template/Cargo.toml b/pallets/template/Cargo.toml index 107772232af33..dc4846863a3d7 100644 --- a/pallets/template/Cargo.toml +++ b/pallets/template/Cargo.toml @@ -6,46 +6,26 @@ homepage = 'https://substrate.dev' license = 'Unlicense' name = 'pallet-template' repository = 'https://github.com/substrate-developer-hub/substrate-node-template/' -version = '2.0.0-rc6' +version = '2.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] +# alias "parity-scale-code" to "codec" [dependencies.codec] default-features = false features = ['derive'] package = 'parity-scale-codec' version = '1.3.4' -[dependencies.frame-support] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dev-dependencies.sp-core] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dev-dependencies.sp-io] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' +[dependencies] +frame-support = { default-features = false, version = '2.0.0' } +frame-system = { default-features = false, version = '2.0.0' } -[dev-dependencies.sp-runtime] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' +[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' } [features] default = ['std'] diff --git a/pallets/template/src/mock.rs b/pallets/template/src/mock.rs index 8c3bf2b40473c..a3dff240e4847 100644 --- a/pallets/template/src/mock.rs +++ b/pallets/template/src/mock.rs @@ -42,7 +42,7 @@ impl system::Trait for Test { type MaximumBlockLength = MaximumBlockLength; type AvailableBlockRatio = AvailableBlockRatio; type Version = (); - type ModuleToIndex = (); + type PalletInfo = (); type AccountData = (); type OnNewAccount = (); type OnKilledAccount = (); diff --git a/pallets/xyk/Cargo.toml b/pallets/xyk/Cargo.toml index ee40adc750a3b..93f5df6d0a6dd 100644 --- a/pallets/xyk/Cargo.toml +++ b/pallets/xyk/Cargo.toml @@ -2,59 +2,32 @@ authors = ['Block Unison'] edition = '2018' name = 'pallet-xyk' -version = '2.0.0-rc6' +version = '0.1.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] -[features] -default = ['std'] -std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'sp-runtime/std', -] - +# alias "parity-scale-code" to "codec" [dependencies.codec] default-features = false features = ['derive'] package = 'parity-scale-codec' version = '1.3.4' -[dependencies.frame-support] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-io] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' +[dependencies] +frame-support = { default-features = false, version = '2.0.0' } +frame-system = { default-features = false, version = '2.0.0' } +pallet-assets = { path = '../assets', default-features = false, version = '2.0.0' } +sp-runtime = { default-features = false, version = '2.0.0' } -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' +[dev-dependencies] +sp-core = { default-features = false, version = '2.0.0' } +sp-io = { default-features = false, version = '2.0.0' } -[dependencies.generic-asset] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'pallet-generic-asset' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' +[features] +default = ['std'] +std = [ + 'codec/std', + 'frame-support/std', + 'frame-system/std', +] diff --git a/pallets/xyk/src/lib.rs b/pallets/xyk/src/lib.rs index ab35b2daeb40f..b0abdfbd5a703 100644 --- a/pallets/xyk/src/lib.rs +++ b/pallets/xyk/src/lib.rs @@ -11,7 +11,7 @@ use frame_support::{ traits::Randomness, StorageMap, }; -use generic_asset::{AssetOptions, Owner, PermissionLatest}; +use pallet_assets as assets; use frame_system::ensure_signed; #[cfg(test)] @@ -20,10 +20,8 @@ mod mock; #[cfg(test)] mod tests; -pub trait Trait: generic_asset::Trait { +pub trait Trait: assets::Trait { // TODO: Add other types and constants required configure this module. - // type Hashing = BlakeTwo256; - type Randomness: Randomness; type Event: From> + Into<::Event>; } @@ -107,11 +105,11 @@ decl_module! { Error::::PoolAlreadyExists, ); ensure!( - >::free_balance(&first_asset_id, &sender) >= first_asset_amount, + >::balance(first_asset_id, sender.clone()) >= first_asset_amount, Error::::NotEnoughAssets, ); ensure!( - >::free_balance(&second_asset_id, &sender) >= second_asset_amount, + >::balance(second_asset_id, sender.clone()) >= second_asset_amount, Error::::NotEnoughAssets, ); >::insert( @@ -120,7 +118,8 @@ decl_module! { >::insert( (second_asset_id, first_asset_id), second_asset_amount ); - let liquidity_asset_id = >::next_asset_id(); + //let liquidity_asset_id = >::next_asset_id(); + let liquidity_asset_id = >::assets_next_asset_id(); >::insert( (first_asset_id, second_asset_id), liquidity_asset_id ); @@ -130,17 +129,17 @@ decl_module! { let initial_liquidity = first_asset_amount + second_asset_amount; //for example, doesn't really matter Self::create_asset(origin, initial_liquidity); - >::make_transfer_with_event( + >::assets_transfer( &first_asset_id, &sender, &vault_address, - first_asset_amount + &first_asset_amount )?; - >::make_transfer_with_event( + >::assets_transfer( &second_asset_id, &sender, &vault_address, - second_asset_amount + &second_asset_amount )?; Ok(()) } @@ -167,21 +166,21 @@ decl_module! { sold_asset_amount, ); ensure!( - >::free_balance(&sold_asset_id, &sender) >= sold_asset_amount, + >::balance(sold_asset_id, sender.clone()) >= sold_asset_amount, Error::::NotEnoughAssets, ); let vault = >::get(); - >::make_transfer_with_event( + >::assets_transfer( &sold_asset_id, &sender, &vault, - sold_asset_amount, + &sold_asset_amount, )?; - >::make_transfer_with_event( + >::assets_transfer( &bought_asset_id, &vault, &sender, - bought_asset_amount, + &bought_asset_amount, )?; >::insert( (sold_asset_id, bought_asset_id), @@ -220,21 +219,21 @@ decl_module! { bought_asset_amount, ); ensure!( - >::free_balance(&sold_asset_id, &sender) >= sold_asset_amount, + >::balance(sold_asset_id, sender.clone()) >= sold_asset_amount, Error::::NotEnoughAssets, ); let vault = >::get(); - >::make_transfer_with_event( + >::assets_transfer( &sold_asset_id, &sender, &vault, - sold_asset_amount, + &sold_asset_amount, )?; - >::make_transfer_with_event( + >::assets_transfer( &bought_asset_id, &vault, &sender, - bought_asset_amount, + &bought_asset_amount, )?; >::insert( (sold_asset_id, bought_asset_id), @@ -273,7 +272,7 @@ decl_module! { let first_asset_reserve = >::get((first_asset_id, second_asset_id)); let second_asset_reserve = >::get((second_asset_id, first_asset_id)); let second_asset_amount = first_asset_amount * second_asset_reserve / first_asset_reserve + 1.saturated_into::(); - let total_liquidity_assets = >::total_issuance(liquidity_asset_id); + let total_liquidity_assets = >::total_supply(liquidity_asset_id); let liquidity_assets_minted = first_asset_amount * total_liquidity_assets / first_asset_reserve; ensure!( @@ -281,26 +280,26 @@ decl_module! { Error::::ZeroAmount, ); ensure!( - >::free_balance(&first_asset_id, &sender) >= first_asset_amount, + >::balance(first_asset_id, sender.clone()) >= first_asset_amount, Error::::NotEnoughAssets, ); ensure!( - >::free_balance(&second_asset_id, &sender) >= second_asset_amount, + >::balance(second_asset_id, sender.clone()) >= second_asset_amount, Error::::NotEnoughAssets, ); - >::make_transfer_with_event( + >::assets_transfer( &first_asset_id, &sender, &vault, - first_asset_amount, + &first_asset_amount, )?; - >::make_transfer_with_event( + >::assets_transfer( &second_asset_id, &sender, &vault, - second_asset_amount, + &second_asset_amount, )?; >::insert( @@ -313,12 +312,18 @@ decl_module! { second_asset_reserve + second_asset_amount, ); - >::mint_free( - &liquidity_asset_id, - &vault, - &sender, - &liquidity_assets_minted, - )?; +//TODO alter issue function to work with mintable tokens + //>::mint_free( + // &liquidity_asset_id, + // &vault, + // &sender, + // &liquidity_assets_minted, + //)?; + >::assets_mint( + &liquidity_asset_id, + &sender, + &liquidity_assets_minted + ); Ok(()) } @@ -342,27 +347,27 @@ decl_module! { ); ensure!( - >::free_balance(&liquidity_asset_id, &sender) >= liquidity_asset_amount, + >::balance(liquidity_asset_id, sender.clone()) >= liquidity_asset_amount, Error::::NotEnoughAssets, ); let first_asset_reserve = >::get((first_asset_id, second_asset_id)); let second_asset_reserve = >::get((second_asset_id, first_asset_id)); - let first_asset_amount = first_asset_reserve * liquidity_asset_amount / >::total_issuance(liquidity_asset_id); - let second_asset_amount = second_asset_reserve * liquidity_asset_amount / >::total_issuance(liquidity_asset_id); + let first_asset_amount = first_asset_reserve * liquidity_asset_amount / >::total_supply(liquidity_asset_id); + let second_asset_amount = second_asset_reserve * liquidity_asset_amount / >::total_supply(liquidity_asset_id); - >::make_transfer_with_event( + >::assets_transfer( &first_asset_id, &vault, &sender, - first_asset_amount, + &first_asset_amount, )?; - >::make_transfer_with_event( + >::assets_transfer( &second_asset_id, &vault, &sender, - second_asset_amount, + &second_asset_amount, )?; >::insert( @@ -376,12 +381,14 @@ decl_module! { ); //TODO burn_free of liqudity_pool_id asset to sender in an amount of += liquidity_assets_minted - >::burn_free( - &liquidity_asset_id, - &vault, - &sender, - &liquidity_asset_amount, - )?; + //TODO introduce burn function to only portion of holder's tokens + //>::burn_free( + // &liquidity_asset_id, + // &vault, + // &sender, + // &liquidity_asset_amount, + //)?; + >::assets_burn(&liquidity_asset_id, &sender, &liquidity_asset_amount); Ok(()) } @@ -447,22 +454,24 @@ impl Module { amount: T::Balance ) -> DispatchResult { let vault: T::AccountId = >::get(); - let sender = ensure_signed(origin)?; - - let default_permission = generic_asset::PermissionLatest { - update: Owner::Address(vault.clone()), - mint: Owner::Address(vault.clone()), - burn: Owner::Address(vault.clone()), - }; - - >::create_asset( - None, - Some(sender), - generic_asset::AssetOptions { - initial_issuance: amount, - permissions: default_permission, - }, - )?; + let sender = ensure_signed(origin.clone())?; + + //let default_permission = generic_asset::PermissionLatest { + // update: Owner::Address(vault.clone()), + // mint: Owner::Address(vault.clone()), + // burn: Owner::Address(vault.clone()), + //}; + + //>::create_asset( + // None, + // Some(sender), + // generic_asset::AssetOptions { + // initial_issuance: amount, + // permissions: default_permission, + // }, + //)?; + + >::issue(origin, amount); Ok(()) } @@ -471,13 +480,13 @@ impl Module { assetId: T::AssetId, from: T::AccountId ) -> T::Balance { - return >::free_balance(&assetId, &from); + return >::balance(assetId, from); } fn get_total_issuance( assetId: T::AssetId ) -> T::Balance { - return >::total_issuance(&assetId); + return >::total_supply(assetId); } // //Read-only function to be used by RPC // pub fn get_exchange_input_price( diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index f5a9749993c51..0e783c701c1cd 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -5,183 +5,72 @@ homepage = 'https://substrate.dev' license = 'Unlicense' name = 'node-template-runtime' repository = 'https://github.com/substrate-developer-hub/substrate-node-template/' -version = '2.0.0-rc6' +version = '2.0.0' [package.metadata.docs.rs] targets = ['x86_64-unknown-linux-gnu'] +[build-dependencies] +wasm-builder-runner = { package = 'substrate-wasm-builder-runner', version = '1.0.5' } + +# alias "parity-scale-code" to "codec" [dependencies.codec] default-features = false features = ['derive'] package = 'parity-scale-codec' version = '1.3.4' -[dependencies.frame-executive] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.frame-support] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.frame-system] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.frame-system-rpc-runtime-api] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.pallet-aura] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.pallet-balances] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.pallet-grandpa] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.pallet-randomness-collective-flip] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.pallet-sudo] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.pallet-timestamp] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.pallet-transaction-payment] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.pallet-transaction-payment-rpc-runtime-api] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.serde] -features = ['derive'] -optional = true -version = '1.0.101' - -[dependencies.sp-api] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-block-builder] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-consensus-aura] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '0.8.0-rc6' - -[dependencies.sp-core] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-inherents] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-offchain] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-runtime] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-session] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-std] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-transaction-pool] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.sp-version] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.template] -default-features = false -package = 'pallet-template' -path = '../pallets/template' -version = '2.0.0-rc6' - -[dependencies.generic-asset] -default-features = false -git = 'https://github.com/paritytech/substrate.git' -package = 'pallet-generic-asset' -tag = 'v2.0.0-rc6' -version = '2.0.0-rc6' - -[dependencies.xyk] -default-features = false -package = 'pallet-xyk' -path = '../pallets/xyk' -version = '2.0.0-rc6' +[dependencies] +hex-literal = { optional = true, version = '0.3.1' } +serde = { features = ['derive'], optional = true, version = '1.0.101' } + +# local dependencies +pallet-template = { path = '../pallets/template', default-features = false, version = '2.0.0' } +pallet-xyk = { path = '../pallets/xyk', default-features = false, version = '0.1.0' } +pallet-assets = { path = '../pallets/assets', default-features = false, version = '2.0.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-aura = { 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-consensus-aura = { default-features = false, version = '0.8.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-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' } [features] default = ['std'] +runtime-benchmarks = [ + 'hex-literal', + 'frame-benchmarking', + 'frame-support/runtime-benchmarks', + 'frame-system-benchmarking', + 'frame-system/runtime-benchmarks', + 'pallet-balances/runtime-benchmarks', + 'pallet-timestamp/runtime-benchmarks', + 'sp-runtime/runtime-benchmarks', +] std = [ 'codec/std', + 'serde', 'frame-executive/std', 'frame-support/std', 'frame-system/std', @@ -191,10 +80,10 @@ std = [ 'pallet-grandpa/std', 'pallet-randomness-collective-flip/std', 'pallet-sudo/std', + 'pallet-template/std', 'pallet-timestamp/std', 'pallet-transaction-payment/std', 'pallet-transaction-payment-rpc-runtime-api/std', - 'serde', 'sp-api/std', 'sp-block-builder/std', 'sp-consensus-aura/std', @@ -206,11 +95,4 @@ std = [ 'sp-std/std', 'sp-transaction-pool/std', 'sp-version/std', - 'template/std', ] - -[build-dependencies.wasm-builder-runner] -git = 'https://github.com/paritytech/substrate.git' -package = 'substrate-wasm-builder-runner' -tag = 'v2.0.0-rc6' -version = '1.0.5' diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 633b9cdc5d74f..f7b83723c54be 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -39,9 +39,9 @@ pub use frame_support::{ }; /// Import the template pallet. -pub use template; -pub use xyk; -use generic_asset; +pub use pallet_template; +pub use pallet_xyk; +pub use pallet_assets; /// An index to a block. pub type BlockNumber = u32; @@ -183,7 +183,7 @@ impl frame_system::Trait for Runtime { /// Converts a module to the index of the module in `construct_runtime!`. /// /// This type is being generated by `construct_runtime!`. - type ModuleToIndex = ModuleToIndex; + type PalletInfo = PalletInfo; /// What to do if a new account is created. type OnNewAccount = (); /// What to do if an account is fully reaped from the system. @@ -213,6 +213,8 @@ impl pallet_grandpa::Trait for Runtime { )>>::IdentificationTuple; type HandleEquivocation = (); + + type WeightInfo = (); } parameter_types! { @@ -229,9 +231,11 @@ impl pallet_timestamp::Trait for Runtime { parameter_types! { pub const ExistentialDeposit: u128 = 500; + pub const MaxLocks: u32 = 50; } impl pallet_balances::Trait for Runtime { + type MaxLocks = MaxLocks; /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. @@ -259,19 +263,19 @@ impl pallet_sudo::Trait for Runtime { type Call = Call; } -impl generic_asset::Trait for Runtime { +impl pallet_assets::Trait for Runtime { /// The type for recording an account's balance. type Balance = Balance; type AssetId = u32; type Event = Event; } -/// Configure the pallet template in pallets/template. -impl template::Trait for Runtime { +/// Configure the template pallet in pallets/template. +impl pallet_template::Trait for Runtime { type Event = Event; } -impl xyk::Trait for Runtime { +impl pallet_xyk::Trait for Runtime { type Event = Event; type Randomness = RandomnessCollectiveFlip; } @@ -291,10 +295,10 @@ construct_runtime!( Balances: pallet_balances::{Module, Call, Storage, Config, Event}, TransactionPayment: pallet_transaction_payment::{Module, Storage}, Sudo: pallet_sudo::{Module, Call, Config, Storage, Event}, - GenericAsset: generic_asset::{Module, Call, Storage, Event}, + Assets: pallet_assets::{Module, Call, Storage, Event}, // Include the custom logic from the template pallet in the runtime. - TemplateModule: template::{Module, Call, Storage, Event}, - Xyk: xyk::{Module, Call, Storage, Event}, + TemplateModule: pallet_template::{Module, Call, Storage, Event}, + Xyk: pallet_xyk::{Module, Call, Storage, Event}, } ); @@ -439,7 +443,7 @@ impl_runtime_apis! { None } } - + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Index { System::account_nonce(account) @@ -454,4 +458,39 @@ impl_runtime_apis! { TransactionPayment::query_info(uxt, len) } } + + #[cfg(feature = "runtime-benchmarks")] + impl frame_benchmarking::Benchmark for Runtime { + fn dispatch_benchmark( + config: frame_benchmarking::BenchmarkConfig + ) -> Result, sp_runtime::RuntimeString> { + use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; + + use frame_system_benchmarking::Module as SystemBench; + impl frame_system_benchmarking::Trait for Runtime {} + + let whitelist: Vec = vec![ + // Block Number + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), + // Total Issuance + hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(), + // Execution Phase + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), + // Event Count + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), + // System Events + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), + ]; + + let mut batches = Vec::::new(); + let params = (&config, &whitelist); + + add_benchmark!(params, batches, frame_system, SystemBench::); + add_benchmark!(params, batches, pallet_balances, Balances); + add_benchmark!(params, batches, pallet_timestamp, Timestamp); + + if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } + Ok(batches) + } + } }