From f325656c80b455e11d4f02189a8709474ef9dfc2 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Mon, 19 Apr 2021 11:09:13 +0300 Subject: [PATCH] New token pallet (#134) * Updates * Updates * Merge pallet_assets w/ orml_tokens * Pallets compile, node doesn't * [wip] comment out frontier for now * Comment out EVM/Frontier, get node compiling * remove frontier service file from git * Newlines * ups (#133) * Test updates * Fix merge account * Fix no_op test * Updates, dust test not working * Fix all tests Co-authored-by: Shady Khalifa --- Cargo.lock | 3611 ++++++++++++++------------ Cargo.toml | 269 +- node/Cargo.toml | 18 +- node/src/chain_spec.rs | 45 +- node/src/command.rs | 5 +- node/src/rpc.rs | 120 +- node/src/service.rs | 520 ++-- pallets/merkle/src/mock.rs | 7 +- pallets/mixer/Cargo.toml | 7 +- pallets/mixer/src/lib.rs | 33 +- pallets/mixer/src/mock.rs | 75 +- pallets/mixer/src/tests.rs | 12 +- pallets/tokens/Cargo.toml | 46 + pallets/tokens/src/basic_currency.rs | 177 ++ pallets/tokens/src/imbalance.rs | 174 ++ pallets/tokens/src/lib.rs | 2093 +++++++++++++++ pallets/tokens/src/mock.rs | 182 ++ pallets/tokens/src/tests.rs | 1040 ++++++++ pallets/tokens/src/traits.rs | 11 + pallets/tokens/src/types.rs | 132 + pallets/tokens/src/weights.rs | 295 +++ runtime/Cargo.toml | 23 +- runtime/src/lib.rs | 543 ++-- 23 files changed, 6993 insertions(+), 2445 deletions(-) create mode 100644 pallets/tokens/Cargo.toml create mode 100644 pallets/tokens/src/basic_currency.rs create mode 100644 pallets/tokens/src/imbalance.rs create mode 100644 pallets/tokens/src/lib.rs create mode 100644 pallets/tokens/src/mock.rs create mode 100644 pallets/tokens/src/tests.rs create mode 100644 pallets/tokens/src/traits.rs create mode 100644 pallets/tokens/src/types.rs create mode 100644 pallets/tokens/src/weights.rs diff --git a/Cargo.lock b/Cargo.lock index e2d9de49..93868ac9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,6 +96,17 @@ dependencies = [ "memchr", ] +[[package]] +name = "alga" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2" +dependencies = [ + "approx 0.3.2", + "num-complex 0.2.4", + "num-traits", +] + [[package]] name = "ansi_term" version = "0.11.0" @@ -116,9 +127,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1" +checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" [[package]] name = "approx" @@ -129,6 +140,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "approx" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" +dependencies = [ + "num-traits", +] + [[package]] name = "arrayref" version = "0.3.6" @@ -150,6 +170,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "arrayvec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7" + [[package]] name = "asn1_der" version = "0.6.3" @@ -292,6 +318,20 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "async-std-resolver" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665c56111e244fe38e7708ee10948a4356ad6a548997c21f5a63a0f4e0edc4d" +dependencies = [ + "async-std", + "async-trait", + "futures-io", + "futures-util", + "pin-utils", + "trust-dns-resolver", +] + [[package]] name = "async-task" version = "4.0.3" @@ -377,7 +417,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.23.0", + "object", "rustc-demangle", ] @@ -413,11 +453,10 @@ checksum = "7dfdb4953a096c551ce9ace855a604d702e6e62d77fac690575ae347571717f5" [[package]] name = "bincode" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d175dfa69e619905c4c3cdb7c3c203fa3bdd5d51184e3afdb2742c0280493772" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "byteorder", "serde", ] @@ -451,16 +490,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -[[package]] -name = "bitvec" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" -dependencies = [ - "either", - "radium 0.3.0", -] - [[package]] name = "bitvec" version = "0.20.2" @@ -468,7 +497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f682656975d3a682daff957be4ddeb65d6ad656737cd821f2d00685ae466af1" dependencies = [ "funty", - "radium 0.6.2", + "radium", "tap", "wyz", ] @@ -647,9 +676,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -825,6 +854,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.7.0" @@ -865,18 +900,18 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-bforest" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4066fd63b502d73eb8c5fa6bcab9c7962b05cd580f6b149ee83a8e730d8ce7fb" +checksum = "bcee7a5107071484772b89fdf37f0f460b7db75f476e43ea7a684fd942470bcf" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a54e4beb833a3c873a18a8fe735d73d732044004c7539a072c8faa35ccb0c60" +checksum = "654ab96f0f1cab71c0d323618a58360a492da2c341eb2c1f977fc195c664001b" dependencies = [ "byteorder", "cranelift-bforest", @@ -894,9 +929,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54cac7cacb443658d8f0ff36a3545822613fa202c946c0891897843bc933810" +checksum = "65994cfc5be9d5fd10c5fc30bcdddfa50c04bb79c91329287bff846434ff8f14" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -904,24 +939,27 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a109760aff76788b2cdaeefad6875a73c2b450be13906524f6c2a81e05b8d83c" +checksum = "889d720b688b8b7df5e4903f9b788c3c59396050f5548e516e58ccb7312463ab" +dependencies = [ + "serde", +] [[package]] name = "cranelift-entity" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b044234aa32531f89a08b487630ddc6744696ec04c8123a1ad388de837f5de3" +checksum = "1a2e6884a363e42a9ba980193ea8603a4272f8a92bd8bbaf9f57a94dbea0ff96" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5452b3e4e97538ee5ef2cc071301c69a86c7adf2770916b9d04e9727096abd93" +checksum = "e6f41e2f9b57d2c030e249d0958f1cdc2c3cd46accf8c0438b3d1944e9153444" dependencies = [ "cranelift-codegen", "log", @@ -931,25 +969,24 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f68035c10b2e80f26cc29c32fa824380877f38483504c2a47b54e7da311caaf3" +checksum = "aab70ba7575665375d31cbdea2462916ce58be887834e1b83c860b43b51af637" dependencies = [ "cranelift-codegen", - "raw-cpuid", "target-lexicon", ] [[package]] name = "cranelift-wasm" -version = "0.69.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a530eb9d1c95b3309deb24c3d179d8b0ba5837ed98914a429787c395f614949d" +checksum = "f2fc3d2e70da6439adf97648dcdf81834363154f2907405345b6fbe7ca38918c" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.0", "log", "serde", "smallvec 1.6.1", @@ -968,9 +1005,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils 0.8.3", @@ -1022,7 +1059,7 @@ dependencies = [ "cfg-if 1.0.0", "crossbeam-utils 0.8.3", "lazy_static", - "memoffset 0.6.1", + "memoffset 0.6.3", "scopeguard", ] @@ -1096,9 +1133,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f45d9ad417bcef4817d614a501ab55cdd96a6fdb24f49aab89a54acfd66b19" +checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" dependencies = [ "quote", "syn", @@ -1170,10 +1207,11 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.11" +version = "0.99.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" +checksum = "f82b1b72f1263f214c0f823371768776c4f5841b942c9883aa8e5ec584fd0ba6" dependencies = [ + "convert_case", "proc-macro2", "quote", "syn", @@ -1304,6 +1342,18 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "enum-as-inner" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "env_logger" version = "0.7.1" @@ -1353,18 +1403,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ethbloom" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a6567e6fd35589fea0c63b94b4cf2e55573e413901bdbe60ab15cf0e25e5df" -dependencies = [ - "crunchy", - "fixed-hash 0.6.1", - "impl-rlp 0.2.1", - "tiny-keccak", -] - [[package]] name = "ethbloom" version = "0.11.0" @@ -1372,9 +1410,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "779864b9c7f7ead1f092972c3257496c6a84b46dba2ce131dd8a282cb2cc5972" dependencies = [ "crunchy", - "fixed-hash 0.7.0", - "impl-codec 0.5.0", - "impl-rlp 0.3.0", + "fixed-hash", + "impl-codec", + "impl-rlp", "impl-serde", "tiny-keccak", ] @@ -1385,44 +1423,31 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567ce064a8232c16e2b2c2173a936b91fbe35c2f2c5278871f5a1a31688b42e9" dependencies = [ - "ethereum-types 0.11.0", + "ethereum-types", "funty", "hash-db", "hash256-std-hasher", - "parity-scale-codec 2.0.1", - "rlp 0.5.0", + "parity-scale-codec 2.1.0", + "rlp", "rlp-derive", "serde", "sha3 0.9.1", "triehash", ] -[[package]] -name = "ethereum-types" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473aecff686bd8e7b9db0165cbbb53562376b39bf35b427f0c60446a9e1634b0" -dependencies = [ - "ethbloom 0.9.2", - "fixed-hash 0.6.1", - "impl-rlp 0.2.1", - "primitive-types 0.7.3", - "uint 0.8.5", -] - [[package]] name = "ethereum-types" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f64b5df66a228d85e4b17e5d6c6aa43b0310898ffe8a85988c4c032357aaabfd" dependencies = [ - "ethbloom 0.11.0", - "fixed-hash 0.7.0", - "impl-codec 0.5.0", - "impl-rlp 0.3.0", + "ethbloom", + "fixed-hash", + "impl-codec", + "impl-rlp", "impl-serde", - "primitive-types 0.9.0", - "uint 0.9.0", + "primitive-types", + "uint", ] [[package]] @@ -1433,86 +1458,53 @@ checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" [[package]] name = "evm" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0467250a12bb144ad7b2f41e03e8675e38b971ab73f6d42ede6b78af07657e7b" +checksum = "1b4bd1fb06a4962a243c8be285d8a9b2493ffa79acb32633ad07a0bc523b1acd" dependencies = [ "ethereum", - "evm-core 0.24.0", - "evm-gasometer 0.24.0", - "evm-runtime 0.24.0", + "evm-core", + "evm-gasometer", + "evm-runtime", "log", - "parity-scale-codec 2.0.1", - "primitive-types 0.9.0", - "rlp 0.5.0", + "parity-scale-codec 2.1.0", + "primitive-types", + "rlp", "serde", "sha3 0.8.2", ] [[package]] name = "evm-core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc372feb219651f8ae872e6ec0f84b346053c058bd0e8408b1f44a2a796bfecd" -dependencies = [ - "parity-scale-codec 1.3.7", - "primitive-types 0.8.0", - "serde", -] - -[[package]] -name = "evm-core" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0db0394d7b497bf97be3d9ece9c828f8b7670a065fc9f3106c9598cce6556d" +checksum = "6b4eea3882c798813a6f92e8855ec1fc3f5ababd8b274cb81d4bedee701b478e" dependencies = [ "funty", - "parity-scale-codec 2.0.1", - "primitive-types 0.9.0", + "parity-scale-codec 2.1.0", + "primitive-types", "serde", ] [[package]] name = "evm-gasometer" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5737059b7a570b3e28a0126b02e0e36e218cc828b29dddbbae73d0b97fce1e0a" -dependencies = [ - "evm-core 0.23.0", - "evm-runtime 0.23.0", - "primitive-types 0.8.0", -] - -[[package]] -name = "evm-gasometer" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c617616408f87be6826bda72cee7625aa8cbc09b759f05b1dccd329fb61b2077" -dependencies = [ - "evm-core 0.24.0", - "evm-runtime 0.24.0", - "primitive-types 0.9.0", -] - -[[package]] -name = "evm-runtime" -version = "0.23.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95726118dbc5f76ed1ee300e685950e58e52a1c4db454a7635aba636c7002186" +checksum = "0a8f04dcc8b0296652eabfa443a08ebed6071a1178e0f42a7f7b63a612bddf0b" dependencies = [ - "evm-core 0.23.0", - "primitive-types 0.8.0", - "sha3 0.8.2", + "evm-core", + "evm-runtime", + "primitive-types", ] [[package]] name = "evm-runtime" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8447504daa86bc5a7ae982b9b5c53225aa0ebcfba636b785cf0f53406eaa4d87" +checksum = "54c302f29ca8bba82a382aa52d427869964179e4f24eae57bde70958ce9b7607" dependencies = [ - "evm-core 0.24.0", - "primitive-types 0.9.0", + "evm-core", + "primitive-types", "sha3 0.8.2", ] @@ -1522,7 +1514,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", ] [[package]] @@ -1568,117 +1560,6 @@ dependencies = [ "instant", ] -[[package]] -name = "fc-consensus" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" -dependencies = [ - "derive_more", - "fc-db", - "fp-consensus", - "fp-rpc", - "futures 0.3.13", - "log", - "parity-scale-codec 2.0.1", - "sc-client-api", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-timestamp", - "substrate-prometheus-endpoint", -] - -[[package]] -name = "fc-db" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" -dependencies = [ - "kvdb", - "kvdb-rocksdb", - "parity-scale-codec 2.0.1", - "parking_lot 0.11.1", - "sp-core", - "sp-database", - "sp-runtime", -] - -[[package]] -name = "fc-mapping-sync" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" -dependencies = [ - "fc-consensus", - "fc-db", - "fp-consensus", - "fp-rpc", - "futures 0.3.13", - "futures-timer 3.0.2", - "log", - "sc-client-api", - "sp-api", - "sp-blockchain", - "sp-runtime", -] - -[[package]] -name = "fc-rpc" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" -dependencies = [ - "ethereum", - "ethereum-types 0.11.0", - "fc-consensus", - "fc-db", - "fc-rpc-core", - "fp-consensus", - "fp-evm", - "fp-rpc", - "fp-storage", - "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 14.2.0", - "jsonrpc-derive 14.2.2", - "jsonrpc-pubsub 15.1.0", - "libsecp256k1", - "log", - "pallet-ethereum", - "pallet-evm", - "parity-scale-codec 2.0.1", - "rand 0.7.3", - "rlp 0.5.0", - "rustc-hex", - "sc-client-api", - "sc-network", - "sc-rpc", - "sc-service", - "sha3 0.8.2", - "sp-api", - "sp-blockchain", - "sp-io", - "sp-runtime", - "sp-storage", - "sp-transaction-pool", -] - -[[package]] -name = "fc-rpc-core" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" -dependencies = [ - "ethereum-types 0.11.0", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 14.2.0", - "jsonrpc-derive 14.2.2", - "jsonrpc-pubsub 15.1.0", - "rustc-hex", - "serde", - "serde_json", -] - [[package]] name = "fdlimit" version = "0.2.1" @@ -1705,26 +1586,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6447e2f8178843749e8c8003206def83ec124a7859475395777a28b5338647c" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", ] -[[package]] -name = "fixed-hash" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11498d382790b7a8f2fd211780bec78619bba81cdad3a283997c0c41f836759c" -dependencies = [ - "byteorder", - "rand 0.7.3", - "rustc-hex", - "static_assertions", -] - [[package]] name = "fixed-hash" version = "0.7.0" @@ -1765,9 +1634,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", ] [[package]] @@ -1782,182 +1651,244 @@ dependencies = [ [[package]] name = "fp-consensus" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "parity-scale-codec 2.0.1", - "rlp 0.5.0", + "parity-scale-codec 2.1.0", + "rlp", "sha3 0.8.2", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fp-evm" -version = "0.8.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "evm", "impl-trait-for-tuples 0.1.3", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fp-rpc" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "ethereum-types 0.11.0", + "ethereum-types", "fp-evm", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "fp-storage" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "ethereum-types 0.9.2", + "ethereum-types", "fp-evm", - "parity-scale-codec 1.3.7", - "sp-api", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "frame-benchmarking" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +version = "3.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "linregress", - "parity-scale-codec 2.0.1", - "paste 1.0.4", - "sp-api", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std 3.0.0", - "sp-storage", + "log", + "parity-scale-codec 2.1.0", + "paste", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "frame-benchmarking" version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70fe99487f84579a3f2c4ba52650fec875492eea41be0e4eea8019187f105052" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "linregress", - "parity-scale-codec 2.0.1", - "paste 1.0.4", - "sp-api", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std 3.0.0", - "sp-storage", + "log", + "parity-scale-codec 2.1.0", + "paste", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "frame-benchmarking-cli" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "Inflector", "chrono", - "frame-benchmarking 3.0.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "handlebars", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-cli", "sc-client-db", "sc-executor", "sc-service", "serde", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime", - "sp-state-machine", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "structopt", ] [[package]] name = "frame-executive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "frame-metadata" +version = "13.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", - "sp-tracing", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "frame-metadata" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "frame-support" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", + "bitflags", + "frame-metadata 13.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-support-procedural 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "impl-trait-for-tuples 0.2.1", + "log", + "once_cell", + "parity-scale-codec 2.1.0", + "paste", "serde", - "sp-core", - "sp-std 3.0.0", + "smallvec 1.6.1", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "frame-support" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "bitflags", - "frame-metadata", - "frame-support-procedural", + "frame-metadata 13.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support-procedural 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "impl-trait-for-tuples 0.2.1", "log", "once_cell", - "parity-scale-codec 2.0.1", - "paste 1.0.4", + "parity-scale-codec 2.1.0", + "paste", "serde", "smallvec 1.6.1", - "sp-arithmetic", - "sp-core", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-state-machine", - "sp-std 3.0.0", - "sp-tracing", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "frame-support-procedural" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "Inflector", + "frame-support-procedural-tools 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "frame-support-procedural" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "Inflector", - "frame-support-procedural-tools", + "frame-support-procedural-tools 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -1966,10 +1897,20 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-support-procedural-tools-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-support-procedural-tools-derive", - "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1978,7 +1919,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "proc-macro2", "quote", @@ -1988,17 +1929,35 @@ dependencies = [ [[package]] name = "frame-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "impl-trait-for-tuples 0.2.1", + "log", + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "frame-system" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", + "log", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", - "sp-version", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -2007,29 +1966,29 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e93602f58cdab9820b6d607b7b50834d9b878efa33405a65c89ebfb5a596b584" dependencies = [ - "frame-benchmarking 3.1.0", - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "frame-system-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-api", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "fs-swap" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5839fda247e24ca4919c87c71dd5ca658f1f39e4f06829f80e3f15c3bafcfc2c" +checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" dependencies = [ "lazy_static", "libc", @@ -2083,9 +2042,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" +checksum = "a9d5813545e459ad3ca1bff9915e9ad7f1a47dc6a91b627ce321d5863b7dd253" dependencies = [ "futures-channel", "futures-core", @@ -2098,9 +2057,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" +checksum = "ce79c6a52a299137a6013061e0cf0e688fce5d7f1bc60125f520912fdb29ec25" dependencies = [ "futures-core", "futures-sink", @@ -2108,9 +2067,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" +checksum = "098cd1c6dda6ca01650f1a37a794245eb73181d0d4d4e955e2f3c37db7af1815" [[package]] name = "futures-cpupool" @@ -2129,20 +2088,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ "futures 0.1.31", - "futures 0.3.13", + "futures 0.3.14", "lazy_static", "log", "parking_lot 0.9.0", - "pin-project 0.4.27", + "pin-project 0.4.28", "serde", "serde_json", ] [[package]] name = "futures-executor" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1" +checksum = "10f6cb7042eda00f0049b1d2080aa4b93442997ee507eb3828e8bd7577f94c9d" dependencies = [ "futures-core", "futures-task", @@ -2152,9 +2111,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" +checksum = "365a1a1fb30ea1c03a830fdb2158f5236833ac81fa0ad12fe35b29cddc35cb04" [[package]] name = "futures-lite" @@ -2173,9 +2132,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" +checksum = "668c6733a182cd7deb4f1de7ba3bf2120823835b3bcfbeacf7d2c4a773c1bb8b" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -2196,15 +2155,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" +checksum = "5c5629433c555de3d82861a7a4e3794a4c40040390907cfbfd7143a92a426c23" [[package]] name = "futures-task" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" +checksum = "ba7aa51095076f3ba6d9a1f702f74bd05ec65f555d70d2033d55ba8d69f581bc" [[package]] name = "futures-timer" @@ -2220,9 +2179,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" +checksum = "3c144ad54d60f23927f0a6b6d816e4271278b64f005ad65e4e35291d2de9c025" dependencies = [ "futures 0.1.31", "futures-channel", @@ -2377,7 +2336,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.3", + "http 0.2.4", "indexmap", "slab", "tokio 0.2.25", @@ -2388,9 +2347,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "3.5.3" +version = "3.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb0867bbc5a3da37a753e78021d5fcf8a4db00e18dd2dd90fd36e24190e162d" +checksum = "580b6f551b29a3a02436318aed09ba1c58eea177dc49e39beac627ad356730a5" dependencies = [ "log", "pest", @@ -2491,6 +2450,17 @@ dependencies = [ "hmac 0.7.1", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi 0.3.9", +] + [[package]] name = "http" version = "0.1.21" @@ -2504,9 +2474,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ "bytes 1.0.1", "fnv", @@ -2532,14 +2502,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.3", + "http 0.2.4", ] [[package]] name = "httparse" -version = "1.3.5" +version = "1.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "bc35c995b9d93ec174cf9a27d425c7892722101e14993cd227fdb51d70cf9589" [[package]] name = "httpdate" @@ -2597,13 +2567,13 @@ dependencies = [ "futures-core", "futures-util", "h2 0.2.7", - "http 0.2.3", + "http 0.2.4", "http-body 0.3.1", "httparse", "httpdate", "itoa", - "pin-project 1.0.5", - "socket2", + "pin-project 1.0.6", + "socket2 0.3.19", "tokio 0.2.25", "tower-service", "tracing", @@ -2673,12 +2643,12 @@ dependencies = [ [[package]] name = "if-watch" -version = "0.1.8" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b8538953a3f0d0d3868f0a706eb4273535e10d72acb5c82c1c23ae48835c85" +checksum = "6a6d52908d4ea4ab2bc22474ba149bf1011c8e2c3ebc1ff593ae28ac44f494b6" dependencies = [ "async-io", - "futures 0.3.13", + "futures 0.3.14", "futures-lite", "if-addrs", "ipnet", @@ -2687,31 +2657,13 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "impl-codec" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" -dependencies = [ - "parity-scale-codec 1.3.7", -] - [[package]] name = "impl-codec" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df170efa359aebdd5cb7fe78edcc67107748e4737bdca8a8fb40d15ea7a877ed" dependencies = [ - "parity-scale-codec 2.0.1", -] - -[[package]] -name = "impl-rlp" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" -dependencies = [ - "rlp 0.4.6", + "parity-scale-codec 2.1.0", ] [[package]] @@ -2720,7 +2672,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" dependencies = [ - "rlp 0.5.0", + "rlp", ] [[package]] @@ -2789,7 +2741,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-timer 2.0.2", ] @@ -2808,6 +2760,18 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ee15951c035f79eddbef745611ec962f63f4558f1dadf98ab723cc603487c6f" +[[package]] +name = "ipconfig" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +dependencies = [ + "socket2 0.3.19", + "widestring", + "winapi 0.3.9", + "winreg", +] + [[package]] name = "ipnet" version = "2.3.0" @@ -2823,6 +2787,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.7" @@ -2840,29 +2813,13 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.48" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78" +checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpc-client-transports" -version = "14.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2773fa94a2a1fd51efb89a8f45b8861023dbb415d18d3c9235ae9388d780f9ec" -dependencies = [ - "failure", - "futures 0.1.31", - "jsonrpc-core 14.2.0", - "jsonrpc-pubsub 14.2.0", - "log", - "serde", - "serde_json", - "url 1.7.2", -] - [[package]] name = "jsonrpc-client-transports" version = "15.1.0" @@ -2871,27 +2828,14 @@ checksum = "489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7" dependencies = [ "failure", "futures 0.1.31", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-pubsub", "log", "serde", "serde_json", "url 1.7.2", ] -[[package]] -name = "jsonrpc-core" -version = "14.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62" -dependencies = [ - "futures 0.1.31", - "log", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "jsonrpc-core" version = "15.1.0" @@ -2905,34 +2849,13 @@ dependencies = [ "serde_json", ] -[[package]] -name = "jsonrpc-core-client" -version = "14.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713" -dependencies = [ - "jsonrpc-client-transports 14.2.1", -] - [[package]] name = "jsonrpc-core-client" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f764902d7b891344a0acb65625f32f6f7c6db006952143bd650209fbe7d94db" dependencies = [ - "jsonrpc-client-transports 15.1.0", -] - -[[package]] -name = "jsonrpc-derive" -version = "14.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e77e8812f02155b85a677a96e1d16b60181950c0636199bc4528524fba98dc" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", + "jsonrpc-client-transports", ] [[package]] @@ -2941,7 +2864,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -2954,7 +2877,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7" dependencies = [ "hyper 0.12.36", - "jsonrpc-core 15.1.0", + "jsonrpc-core", "jsonrpc-server-utils", "log", "net2", @@ -2968,7 +2891,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf50e53e4eea8f421a7316c5f63e395f7bc7c4e786a6dc54d76fab6ff7aa7ce7" dependencies = [ - "jsonrpc-core 15.1.0", + "jsonrpc-core", "jsonrpc-server-utils", "log", "parity-tokio-ipc", @@ -2976,26 +2899,13 @@ dependencies = [ "tokio-service", ] -[[package]] -name = "jsonrpc-pubsub" -version = "14.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986" -dependencies = [ - "jsonrpc-core 14.2.0", - "log", - "parking_lot 0.10.2", - "rand 0.7.3", - "serde", -] - [[package]] name = "jsonrpc-pubsub" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "639558e0604013be9787ae52f798506ae42bf4220fe587bdc5625871cc8b9c77" dependencies = [ - "jsonrpc-core 15.1.0", + "jsonrpc-core", "log", "parking_lot 0.10.2", "rand 0.7.3", @@ -3010,7 +2920,7 @@ checksum = "72f1f3990650c033bd8f6bd46deac76d990f9bbfb5f8dc8c4767bf0a00392176" dependencies = [ "bytes 0.4.12", "globset", - "jsonrpc-core 15.1.0", + "jsonrpc-core", "lazy_static", "log", "tokio 0.1.22", @@ -3024,7 +2934,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6596fe75209b73a2a75ebe1dce4e60e03b88a2b25e8807b667597f6315150d22" dependencies = [ - "jsonrpc-core 15.1.0", + "jsonrpc-core", "jsonrpc-server-utils", "log", "parity-ws", @@ -3119,9 +3029,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.88" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a" +checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" [[package]] name = "libloading" @@ -3141,16 +3051,15 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libp2p" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5133112ce42be9482f6a87be92a605dd6bbc9e93c297aee77d172ff06908f3a" +checksum = "fe5759b526f75102829c15e4d8566603b4bf502ed19b5f35920d98113873470d" dependencies = [ "atomic", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "lazy_static", "libp2p-core", - "libp2p-core-derive", "libp2p-deflate", "libp2p-dns", "libp2p-floodsub", @@ -3163,8 +3072,10 @@ dependencies = [ "libp2p-ping", "libp2p-plaintext", "libp2p-pnet", + "libp2p-relay", "libp2p-request-response", "libp2p-swarm", + "libp2p-swarm-derive", "libp2p-tcp", "libp2p-uds", "libp2p-wasm-ext", @@ -3172,23 +3083,23 @@ dependencies = [ "libp2p-yamux", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "smallvec 1.6.1", "wasm-timer", ] [[package]] name = "libp2p-core" -version = "0.27.1" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2d56aadc2c2bf22cd7797f86e56a65b5b3994a0136b65be3106938acae7a26" +checksum = "c1e1797734bbd4c453664fefb029628f77c356ffc5bce98f06b18a7db3ebb0f7" dependencies = [ "asn1_der", "bs58", "ed25519-dalek", "either", "fnv", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", @@ -3197,7 +3108,7 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "prost", "prost-build", "rand 0.7.3", @@ -3211,47 +3122,40 @@ dependencies = [ "zeroize", ] -[[package]] -name = "libp2p-core-derive" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bc40943156e42138d22ed3c57ff0e1a147237742715937622a99b10fbe0156" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "libp2p-deflate" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d42eed63305f0420736fa487f9acef720c4528bd7852a6a760f5ccde4813345" +checksum = "a2181a641cd15f9b6ba71b1335800f309012a0a97a29ffaabbbf40e9d3d58f08" dependencies = [ "flate2", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", ] [[package]] name = "libp2p-dns" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5153b6db68fd4baa3b304e377db744dd8fea8ff4e4504509ee636abcde88d3e3" +checksum = "62e63dab8b5ff35e0c101a3e51e843ba782c07bbb1682f5fd827622e0d02b98b" dependencies = [ - "futures 0.3.13", + "async-std-resolver", + "futures 0.3.14", "libp2p-core", "log", + "smallvec 1.6.1", + "trust-dns-resolver", ] [[package]] name = "libp2p-floodsub" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c63dfa06581b24b1d12bf9815b43689a784424be217d6545c800c7c75a207f" +checksum = "897645f99e9b396df256a6aa8ba8c4bc019ac6b7c62556f624b5feea9acc82bb" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3263,16 +3167,16 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12451ba9493e87c91baf2a6dffce9ddf1fbc807a0861532d7cf477954f8ebbee" +checksum = "794b0c85f5df1acbc1fc38414d37272594811193b6325c76d3931c3e3f5df8c0" dependencies = [ - "asynchronous-codec 0.5.0", + "asynchronous-codec 0.6.0", "base64 0.13.0", "byteorder", "bytes 1.0.1", "fnv", - "futures 0.3.13", + "futures 0.3.14", "hex_fmt", "libp2p-core", "libp2p-swarm", @@ -3283,17 +3187,17 @@ dependencies = [ "regex", "sha2 0.9.3", "smallvec 1.6.1", - "unsigned-varint 0.6.0", + "unsigned-varint 0.7.0", "wasm-timer", ] [[package]] name = "libp2p-identify" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40fb36a059b7a8cce1514bd8b546fa612e006c9937caa7f5950cb20021fe91e" +checksum = "f88ebc841d744979176ab4b8b294a3e655a7ba4ef26a905d073a52b49ed4dff5" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3305,16 +3209,16 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3da6c9acbcc05f93235d201d7d45ef4e8b88a45d8836f98becd8b4d443f066" +checksum = "bbb5b90b6bda749023a85f60b49ea74b387c25f17d8df541ae72a3c75dd52e63" dependencies = [ "arrayvec 0.5.2", "asynchronous-codec 0.6.0", "bytes 1.0.1", "either", "fnv", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3323,7 +3227,7 @@ dependencies = [ "rand 0.7.3", "sha2 0.9.3", "smallvec 1.6.1", - "uint 0.9.0", + "uint", "unsigned-varint 0.7.0", "void", "wasm-timer", @@ -3331,34 +3235,34 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9e6374814d1b118d97ccabdfc975c8910bd16dc38a8bc058eeb08bf2080fe1" +checksum = "be28ca13bb648d249a9baebd750ebc64ce7040ddd5f0ce1035ff1f4549fb596d" dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.13", + "futures 0.3.14", "if-watch", "lazy_static", "libp2p-core", "libp2p-swarm", "log", - "rand 0.7.3", + "rand 0.8.3", "smallvec 1.6.1", - "socket2", + "socket2 0.4.0", "void", ] [[package]] name = "libp2p-mplex" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350ce8b3923594aedabd5d6e3f875d058435052a29c3f32df378bc70d10be464" +checksum = "85e9b544335d1ed30af71daa96edbefadef6f19c7a55f078b9fc92c87163105d" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", "nohash-hasher", @@ -3370,13 +3274,13 @@ dependencies = [ [[package]] name = "libp2p-noise" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aca322b52a0c5136142a7c3971446fb1e9964923a526c9cc6ef3b7c94e57778" +checksum = "36db0f0db3b0433f5b9463f1c0cd9eadc0a3734a9170439ce501ff99733a88bd" dependencies = [ "bytes 1.0.1", "curve25519-dalek 3.0.2", - "futures 0.3.13", + "futures 0.3.14", "lazy_static", "libp2p-core", "log", @@ -3392,11 +3296,11 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3813276d0708c8db0f500d8beda1bda9ad955723b9cb272c41f4727256f73c" +checksum = "dea10fc5209260915ea65b78f612d7ff78a29ab288e7aa3250796866af861c45" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3407,13 +3311,13 @@ dependencies = [ [[package]] name = "libp2p-plaintext" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d58defcadb646ae4b033e130b48d87410bf76394dc3335496cae99dac803e61" +checksum = "0c8c37b4d2a075b4be8442760a5f8c037180f0c8dd5b5734b9978ab868b3aa11" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", "prost", @@ -3428,23 +3332,46 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "log", - "pin-project 1.0.5", + "pin-project 1.0.6", "rand 0.7.3", "salsa20", "sha3 0.9.1", ] +[[package]] +name = "libp2p-relay" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff268be6a9d6f3c6cca3b81bbab597b15217f9ad8787c6c40fc548c1af7cd24" +dependencies = [ + "asynchronous-codec 0.6.0", + "bytes 1.0.1", + "futures 0.3.14", + "futures-timer 3.0.2", + "libp2p-core", + "libp2p-swarm", + "log", + "pin-project 1.0.6", + "prost", + "prost-build", + "rand 0.7.3", + "smallvec 1.6.1", + "unsigned-varint 0.7.0", + "void", + "wasm-timer", +] + [[package]] name = "libp2p-request-response" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10e5552827c33d8326502682da73a0ba4bfa40c1b55b216af3c303f32169dd89" +checksum = "725367dd2318c54c5ab1a6418592e5b01c63b0dedfbbfb8389220b2bcf691899" dependencies = [ "async-trait", "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "libp2p-swarm", "log", @@ -3458,12 +3385,12 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7955b973e1fd2bd61ffd43ce261c1223f61f4aacd5bae362a924993f9a25fd98" +checksum = "75c26980cadd7c25d89071cb23e1f7f5df4863128cc91d83c6ddc72338cecafa" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", "rand 0.7.3", @@ -3472,42 +3399,52 @@ dependencies = [ "wasm-timer", ] +[[package]] +name = "libp2p-swarm-derive" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c564ebaa36a64839f51eaddb0243aaaa29ce64affb56129193cc3248b72af273" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "libp2p-tcp" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a5aef80e519a6cb8e2663605142f97baaaea1a252eecbf8756184765f7471b" +checksum = "2b1a27d21c477951799e99d5c105d78868258502ce092988040a808d5a19bbd9" dependencies = [ "async-io", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "if-watch", "ipnet", "libc", "libp2p-core", "log", - "socket2", + "socket2 0.4.0", ] [[package]] name = "libp2p-uds" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ac51ce419f60be966e02103c17f67ff5dc4422ba83ba54d251d6c62a4ed487" +checksum = "ffd6564bb3b7ff203661ccbb69003c2b551e34cef974f2d6c6a28306a12170b5" dependencies = [ "async-std", - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "log", ] [[package]] name = "libp2p-wasm-ext" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6149c46cb76935c80bc8be6ec6e3ebd5f5e1679765a255fb34331d54610f15dd" +checksum = "cef45d61e43c313531b5e903e4e8415212ff6338e0c54c47da5b9b412b5760de" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3517,12 +3454,12 @@ dependencies = [ [[package]] name = "libp2p-websocket" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b1c6a3431045da8b925ed83384e4c5163e14b990572307fca9c507435d4d22" +checksum = "cace60995ef6f637e4752cccbb2590f6bc358e8741a0d066307636c69a4b3a74" dependencies = [ "either", - "futures 0.3.13", + "futures 0.3.14", "futures-rustls", "libp2p-core", "log", @@ -3535,11 +3472,11 @@ dependencies = [ [[package]] name = "libp2p-yamux" -version = "0.30.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4819358c542a86ff95f6ae691efb4b94ddaf477079b01a686f5705b79bfc232a" +checksum = "96d6144cc94143fb0a8dd1e7c2fbcc32a2808168bcd1d69920635424d5993b7b" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "libp2p-core", "parking_lot 0.11.1", "thiserror", @@ -3602,11 +3539,11 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0ad4b5cc8385a881c561fac3501353d63d2a2b7a357b5064d71815c9a92724" +checksum = "b36162d2e1dcbdeb61223cb788f029f8ac9f2ab19969b89c5a8f4517aad4d940" dependencies = [ - "nalgebra", + "nalgebra 0.25.4", "statrs", ] @@ -3621,9 +3558,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" dependencies = [ "scopeguard", ] @@ -3647,6 +3584,15 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "mach" version = "0.3.2" @@ -3662,6 +3608,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + [[package]] name = "matchers" version = "0.0.1" @@ -3686,6 +3638,15 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "matrixmultiply" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a8a15b776d9dfaecd44b03c5828c2199cddff5247215858aac14624f8d6b741" +dependencies = [ + "rawpointer", +] + [[package]] name = "maybe-uninit" version = "2.0.0" @@ -3700,9 +3661,9 @@ checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "memmap2" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" +checksum = "397d1a6d6d0563c0f5462bbdae662cf6c784edf5e828e40c7257f85d82bf56dd" dependencies = [ "libc", ] @@ -3718,9 +3679,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" +checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d" dependencies = [ "autocfg", ] @@ -3756,9 +3717,9 @@ dependencies = [ [[package]] name = "minicbor" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c2b2c73f9640fccab53947e2b3474d5071fcbc8f82cac51ddf6c8041a30a9ea" +checksum = "ea79ce4ab9f445ec6b71833a2290ac0a29c9dde0fa7cae4c481eecae021d9bd9" dependencies = [ "minicbor-derive", ] @@ -3823,7 +3784,7 @@ checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" dependencies = [ "log", "mio", - "miow 0.3.6", + "miow 0.3.7", "winapi 0.3.9", ] @@ -3852,11 +3813,10 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" dependencies = [ - "socket2", "winapi 0.3.9", ] @@ -3900,7 +3860,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro-error", "proc-macro2", "quote", @@ -3910,9 +3870,9 @@ dependencies = [ [[package]] name = "multimap" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "multistream-select" @@ -3921,27 +3881,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d91ec0a2440aaff5f78ec35631a7027d50386c6163aa975f7caa0d5da4b6ff8" dependencies = [ "bytes 1.0.1", - "futures 0.3.13", + "futures 0.3.14", "log", - "pin-project 1.0.5", + "pin-project 1.0.6", "smallvec 1.6.1", "unsigned-varint 0.7.0", ] [[package]] name = "nalgebra" -version = "0.21.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b6147c3d50b4f3cdabfe2ecc94a0191fd3d6ad58aefd9664cf396285883486" +checksum = "0abb021006c01b126a936a8dd1351e0720d83995f4fc942d0d426c654f990745" dependencies = [ - "approx", + "alga", + "approx 0.3.2", "generic-array 0.13.3", - "matrixmultiply", - "num-complex", - "num-rational", + "matrixmultiply 0.2.4", + "num-complex 0.2.4", + "num-rational 0.2.4", "num-traits", "rand 0.7.3", "rand_distr", + "typenum", +] + +[[package]] +name = "nalgebra" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c70c9e8c5f213c8e93fc8c112ade4edd3ee62062fb897776c23dcebac7932900" +dependencies = [ + "approx 0.4.0", + "generic-array 0.14.4", + "matrixmultiply 0.3.1", + "num-complex 0.3.1", + "num-rational 0.3.2", + "num-traits", + "serde", "simba", "typenum", ] @@ -3957,12 +3934,12 @@ dependencies = [ [[package]] name = "nb-connect" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670361df1bc2399ee1ff50406a0d422587dd3bb0da596e1978fe8e05dabddf4f" +checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d" dependencies = [ "libc", - "socket2", + "socket2 0.4.0", ] [[package]] @@ -3980,23 +3957,14 @@ dependencies = [ name = "node-template" version = "3.0.0" dependencies = [ - "fc-consensus", - "fc-db", - "fc-mapping-sync", - "fc-rpc", - "fc-rpc-core", - "fp-consensus", - "fp-rpc", - "frame-benchmarking 3.1.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "frame-benchmarking-cli", - "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", + "futures 0.3.14", + "jsonrpc-core", + "jsonrpc-pubsub", "log", "node-template-runtime", "pallet-contracts-rpc", - "pallet-ethereum", - "pallet-evm", "pallet-merkle", "pallet-merkle-rpc", "pallet-transaction-payment-rpc", @@ -4016,15 +3984,15 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-transaction-pool", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-finality-grandpa", - "sp-inherents", - "sp-runtime", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", "structopt", "substrate-build-script-utils", @@ -4036,18 +4004,17 @@ name = "node-template-runtime" version = "3.0.0" dependencies = [ "fp-rpc", - "frame-benchmarking 3.1.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "frame-executive", - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex-literal", "orml-currencies", - "orml-tokens", "orml-traits", "pallet-aura", - "pallet-balances", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "pallet-contracts", "pallet-contracts-primitives", "pallet-contracts-rpc-runtime-api", @@ -4060,22 +4027,23 @@ dependencies = [ "pallet-mixer", "pallet-randomness-collective-flip", "pallet-sudo", - "pallet-timestamp", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "pallet-tokens", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-block-builder", "sp-consensus-aura", - "sp-core", - "sp-inherents", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-offchain", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-session", - "sp-std 3.0.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", - "sp-version", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "static_assertions", "substrate-wasm-builder-runner", ] @@ -4123,6 +4091,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-complex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" +dependencies = [ + "num-traits", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -4145,6 +4122,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.14" @@ -4167,20 +4155,14 @@ dependencies = [ [[package]] name = "object" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" dependencies = [ "crc32fast", "indexmap", ] -[[package]] -name = "object" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" - [[package]] name = "once_cell" version = "1.7.2" @@ -4214,31 +4196,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "204fa52ab72cf353879bf57a6cccc64d1fadf3d44246d98007b218cc22fc4d06" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "funty", "orml-traits", "orml-utilities", - "parity-scale-codec 2.0.1", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", -] - -[[package]] -name = "orml-tokens" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0321e56f921689c6c78bf2b68e3deb03172065ca8f306d4d8432d09c3569bb9d" -dependencies = [ - "frame-support", - "frame-system", - "funty", - "orml-traits", - "parity-scale-codec 2.0.1", - "serde", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4247,16 +4213,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18dd4788a7b96709d23081b1a33a5b8477cf25833f20b27b19908d5babdfe7ab" dependencies = [ - "frame-support", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "funty", "impl-trait-for-tuples 0.1.3", "num-traits", "orml-utilities", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4265,13 +4231,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f84d1a0ce4c65a8695cf8c41895c6161d2345214a4a413e674478f6a37968db" dependencies = [ - "frame-support", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "funty", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4286,89 +4252,102 @@ dependencies = [ [[package]] name = "pallet-aura" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "pallet-session", - "pallet-timestamp", - "parity-scale-codec 2.0.1", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "serde", - "sp-application-crypto", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-consensus-aura", - "sp-runtime", - "sp-std 3.0.0", - "sp-timestamp", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sp-authorship", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-balances" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-benchmarking 3.0.0", - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "log", + "parity-scale-codec 2.1.0", + "serde", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "pallet-balances" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "log", + "parity-scale-codec 2.1.0", "serde", - "sp-runtime", - "sp-std 3.0.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-contracts" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0979c1dd82fc56a87b37311006fe56f406de027c24591353058e9e9fc56487c" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "log", "pallet-contracts-primitives", "pallet-contracts-proc-macro", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-wasm", "pwasm-utils 0.16.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-sandbox", - "sp-std 3.0.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi-validation", ] [[package]] name = "pallet-contracts-primitives" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "621d75148763349f72e76e79f62365d28adb51e3f2e0285e4e8b8600ae600978" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "bitflags", - "parity-scale-codec 2.0.1", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-contracts-proc-macro" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90046017aeee3f77752a6c77cdfb1bc93eb728591dc6edad36e2706f7626fd50" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "proc-macro2", "quote", @@ -4378,119 +4357,119 @@ dependencies = [ [[package]] name = "pallet-contracts-rpc" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22491e3c304819f96c83d02e43bd99128e4e42a57da4d6a9d4b5193778da915b" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", "pallet-contracts-primitives", "pallet-contracts-rpc-runtime-api", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-rpc", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-contracts-rpc-runtime-api" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4b410cb148e68256e3827854a67ec34b16157f448e78173219dcd6a8ec7343" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "pallet-contracts-primitives", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-ethereum" -version = "0.1.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.1-dev" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "ethereum", - "ethereum-types 0.11.0", + "ethereum-types", "evm", "fp-consensus", "fp-evm", "fp-rpc", "fp-storage", - "frame-support", - "frame-system", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "libsecp256k1", - "pallet-balances", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "pallet-evm", - "pallet-timestamp", - "parity-scale-codec 2.0.1", - "rlp 0.5.0", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "parity-scale-codec 2.1.0", + "rlp", "rustc-hex", "serde", "sha3 0.8.2", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "pallet-evm" version = "3.0.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "evm", - "evm-gasometer 0.23.0", - "evm-runtime 0.23.0", + "evm-gasometer", + "evm-runtime", "fp-evm", - "frame-support", - "frame-system", - "pallet-balances", - "pallet-timestamp", - "parity-scale-codec 2.0.1", - "primitive-types 0.9.0", - "rlp 0.5.0", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "log", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "parity-scale-codec 2.1.0", + "primitive-types", + "rlp", "serde", "sha3 0.8.2", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "pallet-evm-precompile-simple" -version = "3.0.0" -source = "git+https://github.com/paritytech/frontier#8d54307c84d95bff1300e2803296464bbbe65b64" +version = "1.0.0" +source = "git+https://github.com/paritytech/frontier#15759a8bf6e2251b07ac958fe47981f7a7fe5785" dependencies = [ "evm", "fp-evm", "ripemd160", - "sp-core", - "sp-io", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "pallet-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-benchmarking 3.0.0", - "frame-support", - "frame-system", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "log", "pallet-authorship", "pallet-session", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-application-crypto", - "sp-core", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-finality-grandpa", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-session", - "sp-staking", - "sp-std 3.0.0", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4499,21 +4478,21 @@ version = "3.0.0" dependencies = [ "bulletproofs-gadgets", "curve25519-dalek 3.0.2", - "frame-benchmarking 3.1.0", - "frame-support", - "frame-system", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "lazy_static", "merlin", - "pallet-balances", - "parity-scale-codec 2.0.1", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "rand_core 0.5.1", "serde", "sha2 0.9.3", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "webb-bulletproofs", ] @@ -4521,16 +4500,16 @@ dependencies = [ name = "pallet-merkle-rpc" version = "3.0.0" dependencies = [ - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", "pallet-merkle", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-rpc", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4540,131 +4519,185 @@ dependencies = [ "bencher", "bulletproofs-gadgets", "curve25519-dalek 3.0.2", - "frame-benchmarking 3.1.0", - "frame-support", - "frame-system", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "merlin", "orml-currencies", - "orml-tokens", "orml-traits", - "pallet-balances", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "pallet-merkle", - "parity-scale-codec 2.0.1", + "pallet-tokens", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "webb-bulletproofs", ] [[package]] name = "pallet-randomness-collective-flip" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "safe-mix", - "sp-runtime", - "sp-std 3.0.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "impl-trait-for-tuples 0.2.1", + "pallet-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-session", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "pallet-sudo" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "serde", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "pallet-timestamp" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "frame-support", - "frame-system", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "impl-trait-for-tuples 0.2.1", - "pallet-timestamp", - "parity-scale-codec 2.0.1", + "log", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std 3.0.0", - "sp-trie", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] -name = "pallet-sudo" +name = "pallet-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "impl-trait-for-tuples 0.2.1", + "log", + "parity-scale-codec 2.1.0", "serde", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] -name = "pallet-timestamp" +name = "pallet-tokens" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" dependencies = [ - "frame-benchmarking 3.0.0", - "frame-support", - "frame-system", - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", + "bencher", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "orml-currencies", + "orml-traits", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "pallet-treasury", + "parity-scale-codec 2.1.0", "serde", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", - "sp-timestamp", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-transaction-payment" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec 2.0.1", + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", "serde", "smallvec 1.6.1", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-transaction-payment-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec 2.0.1", - "sp-api", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-rpc", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "pallet-transaction-payment", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-runtime", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "pallet-treasury" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-system 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "impl-trait-for-tuples 0.2.1", + "pallet-balances 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "parity-scale-codec 2.1.0", + "serde", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] @@ -4686,9 +4719,9 @@ dependencies = [ [[package]] name = "parity-multiaddr" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c6805f98667a3828afb2ec2c396a8d610497e8d546f5447188aae47c5a79ec" +checksum = "58341485071825827b7f03cf7efd1cb21e6a709bea778fb50227fd45d2f361b4" dependencies = [ "arrayref", "bs58", @@ -4709,22 +4742,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4b26b16c7687c3075982af47719e481815df30bc544f7a6690763a25ca16e9d" dependencies = [ "arrayvec 0.5.2", - "bitvec 0.17.4", "byte-slice-cast 0.3.5", "parity-scale-codec-derive 1.2.3", - "serde", ] [[package]] name = "parity-scale-codec" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd3dab59b5cf4bc81069ade0fc470341a1ef3ad5fa73e5a8943bed2ec12b2e8" +checksum = "731f4d179ed52b1c7eeb29baf29c604ea9301b889b23ce93660220a5465d5c6f" dependencies = [ - "arrayvec 0.5.2", - "bitvec 0.20.2", + "arrayvec 0.7.0", + "bitvec", "byte-slice-cast 1.0.0", - "parity-scale-codec-derive 2.0.1", + "parity-scale-codec-derive 2.1.0", "serde", ] @@ -4734,7 +4765,7 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41512944b1faff334a5f1b9447611bf4ef40638ccb6328173dacefb338e878c" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -4742,11 +4773,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa04976a81fde04924b40cc4036c4d12841e8bb04325a5cf2ada75731a150a7d" +checksum = "f44c5f94427bd0b5076e8f7e15ca3f60a4d8ac0077e4793884e6fdfd8915344e" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -4769,7 +4800,7 @@ dependencies = [ "libc", "log", "mio-named-pipes", - "miow 0.3.6", + "miow 0.3.7", "rand 0.7.3", "tokio 0.1.22", "tokio-named-pipes", @@ -4788,7 +4819,7 @@ dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-util-mem-derive", "parking_lot 0.11.1", - "primitive-types 0.9.0", + "primitive-types", "smallvec 1.6.1", "winapi 0.3.9", ] @@ -4862,7 +4893,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.2", + "lock_api 0.4.3", "parking_lot_core 0.8.3", ] @@ -4911,28 +4942,9 @@ dependencies = [ [[package]] name = "paste" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880" -dependencies = [ - "paste-impl", - "proc-macro-hack", -] - -[[package]] -name = "paste" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d65c4d95931acda4498f675e332fcbdc9a06705cd07086c510e9b6009cd1c1" - -[[package]] -name = "paste-impl" -version = "0.1.18" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6" -dependencies = [ - "proc-macro-hack", -] +checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58" [[package]] name = "pbkdf2" @@ -5032,27 +5044,27 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" dependencies = [ - "pin-project-internal 0.4.27", + "pin-project-internal 0.4.28", ] [[package]] name = "pin-project" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" +checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" dependencies = [ - "pin-project-internal 1.0.5", + "pin-project-internal 1.0.6", ] [[package]] name = "pin-project-internal" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" dependencies = [ "proc-macro2", "quote", @@ -5061,9 +5073,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" +checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" dependencies = [ "proc-macro2", "quote", @@ -5102,11 +5114,11 @@ checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e" [[package]] name = "polling" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a7bc6b2a29e632e45451c941832803a18cce6781db04de8a04696cdca8bde4" +checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "log", "wepoll-sys", @@ -5140,40 +5152,17 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" -[[package]] -name = "primitive-types" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd39dcacf71411ba488570da7bbc89b717225e46478b30ba99b92db6b149809" -dependencies = [ - "fixed-hash 0.6.1", - "impl-codec 0.4.2", - "impl-rlp 0.2.1", - "uint 0.8.5", -] - -[[package]] -name = "primitive-types" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3824ae2c5e27160113b9e029a10ec9e3f0237bad8029f69c7724393c9fdefd8" -dependencies = [ - "fixed-hash 0.7.0", - "impl-codec 0.4.2", - "uint 0.9.0", -] - [[package]] name = "primitive-types" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2415937401cb030a2a0a4d922483f945fa068f52a7dbb22ce0fe5f2b6f6adace" dependencies = [ - "fixed-hash 0.7.0", - "impl-codec 0.5.0", - "impl-rlp 0.3.0", + "fixed-hash", + "impl-codec", + "impl-rlp", "impl-serde", - "uint 0.9.0", + "uint", ] [[package]] @@ -5185,6 +5174,16 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-crate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92" +dependencies = [ + "thiserror", + "toml", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -5223,9 +5222,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" dependencies = [ "unicode-xid", ] @@ -5262,14 +5261,14 @@ checksum = "32d3ebd75ac2679c2af3a92246639f9fcc8a442ee420719cc4fe195b98dd5fa3" dependencies = [ "bytes 1.0.1", "heck", - "itertools", + "itertools 0.9.0", "log", "multimap", "petgraph", "prost", "prost-types", "tempfile", - "which 4.0.2", + "which 4.1.0", ] [[package]] @@ -5279,7 +5278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "169a15f3008ecb5160cba7d37bcd690a7601b6d30cfb87a117d45e59d52af5d4" dependencies = [ "anyhow", - "itertools", + "itertools 0.9.0", "proc-macro2", "quote", "syn", @@ -5358,12 +5357,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" - [[package]] name = "radium" version = "0.6.2" @@ -5508,17 +5501,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "raw-cpuid" -version = "8.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fdf7d9dbd43f3d81d94a49c1c3df73cc2b3827995147e6cf7f89d4ec5483e73" -dependencies = [ - "bitflags", - "cc", - "rustc_version", -] - [[package]] name = "rawpointer" version = "0.2.1" @@ -5623,14 +5605,15 @@ checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" dependencies = [ "log", "rustc-hash", + "serde", "smallvec 1.6.1", ] [[package]] name = "regex" -version = "1.4.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54fd1046a3107eb58f42de31d656fee6853e5d276c455fd943742dce89fc3dd3" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" dependencies = [ "aho-corasick", "memchr", @@ -5674,6 +5657,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error 1.2.3", +] + [[package]] name = "retain_mut" version = "0.1.2" @@ -5706,15 +5699,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "rlp" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" -dependencies = [ - "rustc-hex", -] - [[package]] name = "rlp" version = "0.5.0" @@ -5833,14 +5817,24 @@ dependencies = [ "security-framework", ] +[[package]] +name = "ruzstd" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00" +dependencies = [ + "byteorder", + "twox-hash", +] + [[package]] name = "rw-stream-sink" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.13", - "pin-project 0.4.27", + "futures 0.3.14", + "pin-project 0.4.28", "static_assertions", ] @@ -5871,22 +5865,22 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-block-builder", "sc-client-api", "sc-proposer-metrics", "sc-telemetry", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", "substrate-prometheus-endpoint", ] @@ -5894,27 +5888,26 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-client-api", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-block-builder", "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-chain-spec-derive", "sc-consensus-babe", "sc-consensus-epochs", @@ -5925,16 +5918,16 @@ dependencies = [ "serde_json", "sp-chain-spec", "sp-consensus-babe", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-chain-spec-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -5943,16 +5936,16 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "chrono", "fdlimit", - "futures 0.3.13", + "futures 0.3.14", "hex", "libp2p", "log", "names", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "rand 0.7.3", "regex", "rpassword", @@ -5965,13 +5958,13 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-keyring", - "sp-keystore", - "sp-panic-handler", - "sp-runtime", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-utils", - "sp-version", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "structopt", "thiserror", "tiny-bip39", @@ -5981,41 +5974,41 @@ dependencies = [ [[package]] name = "sc-client-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "fnv", - "futures 0.3.13", + "futures 0.3.14", "hash-db", "kvdb", "lazy_static", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "sc-executor", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-database", - "sp-externalities", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-std 3.0.0", - "sp-storage", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", - "sp-trie", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-utils", - "sp-version", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "blake2-rfc", "hash-db", @@ -6025,81 +6018,83 @@ dependencies = [ "linked-hash-map", "log", "parity-db", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", "sc-client-api", "sc-executor", "sc-state-db", - "sp-arithmetic", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-database", - "sp-runtime", - "sp-state-machine", - "sp-trie", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-prometheus-endpoint", ] [[package]] name = "sc-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "parking_lot 0.11.1", "sc-client-api", "sp-blockchain", "sp-consensus", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-consensus-aura" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", - "parity-scale-codec 2.0.1", - "parking_lot 0.11.1", + "parity-scale-codec 2.1.0", "sc-block-builder", "sc-client-api", "sc-consensus-slots", "sc-telemetry", - "sp-api", - "sp-application-crypto", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-timestamp", - "sp-version", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-prometheus-endpoint", ] [[package]] name = "sc-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "derive_more", "fork-tree", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "log", "merlin", "num-bigint", - "num-rational", + "num-rational 0.2.4", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "pdqselect", "rand 0.7.3", @@ -6112,119 +6107,122 @@ dependencies = [ "sc-telemetry", "schnorrkel", "serde", - "sp-api", - "sp-application-crypto", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-timestamp", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-utils", - "sp-version", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-prometheus-endpoint", ] [[package]] name = "sc-consensus-epochs" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "fork-tree", - "parity-scale-codec 2.0.1", - "parking_lot 0.11.1", + "parity-scale-codec 2.1.0", "sc-client-api", + "sc-consensus", "sp-blockchain", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "async-trait", + "futures 0.3.14", "futures-timer 3.0.2", "log", - "parity-scale-codec 2.0.1", - "parking_lot 0.11.1", + "parity-scale-codec 2.1.0", "sc-client-api", "sc-telemetry", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-trie", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sc-consensus-uncles" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", "sc-client-api", "sp-authorship", "sp-consensus", - "sp-core", - "sp-inherents", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-executor" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "lazy_static", "libsecp256k1", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-wasm", "parking_lot 0.11.1", "sc-executor-common", "sc-executor-wasmi", "sc-executor-wasmtime", - "sp-api", - "sp-core", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-maybe-compressed-blob", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-serializer", "sp-tasks", - "sp-trie", - "sp-version", - "sp-wasm-interface", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi", ] [[package]] name = "sc-executor-common" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-wasm", + "pwasm-utils 0.14.0", "sp-allocator", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-serializer", - "sp-wasm-interface", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "wasmi", ] @@ -6232,52 +6230,53 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-executor-common", "sp-allocator", - "sp-core", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi", ] [[package]] name = "sc-executor-wasmtime" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-wasm", "pwasm-utils 0.14.0", "sc-executor-common", "scoped-tls", "sp-allocator", - "sp-core", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmtime", ] [[package]] name = "sc-finality-grandpa" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "derive_more", "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "linked-hash-map", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -6287,16 +6286,16 @@ dependencies = [ "sc-network-gossip", "sc-telemetry", "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-finality-grandpa", - "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-utils", "substrate-prometheus-endpoint", ] @@ -6304,40 +6303,40 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", "finality-grandpa", - "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", - "jsonrpc-pubsub 15.1.0", + "futures 0.3.14", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "jsonrpc-pubsub", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-client-api", "sc-finality-grandpa", "sc-rpc", "serde", "serde_json", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-informant" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.13", + "futures 0.3.14", "log", "parity-util-mem", "sc-client-api", "sc-network", "sp-blockchain", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", "sp-utils", "wasm-timer", @@ -6346,46 +6345,46 @@ dependencies = [ [[package]] name = "sc-keystore" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.14", "futures-util", "hex", "merlin", "parking_lot 0.11.1", "rand 0.7.3", "serde_json", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "subtle 2.4.0", ] [[package]] name = "sc-light" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "hash-db", "lazy_static", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "sc-client-api", "sc-executor", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", - "sp-core", - "sp-externalities", - "sp-runtime", - "sp-state-machine", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-network" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-std", "async-trait", @@ -6399,7 +6398,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "hex", "ip_network", @@ -6409,9 +6408,9 @@ dependencies = [ "log", "lru", "nohash-hasher", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "prost", "prost-build", "rand 0.7.3", @@ -6421,11 +6420,11 @@ dependencies = [ "serde", "serde_json", "smallvec 1.6.1", - "sp-arithmetic", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-utils", "substrate-prometheus-endpoint", "thiserror", @@ -6438,42 +6437,44 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "libp2p", "log", "lru", "sc-network", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-prometheus-endpoint", + "tracing", "wasm-timer", ] [[package]] name = "sc-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", + "hex", "hyper 0.13.10", "hyper-rustls", "log", "num_cpus", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "rand 0.7.3", "sc-client-api", "sc-keystore", "sc-network", - "sp-api", - "sp-core", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-offchain", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-utils", "threadpool", ] @@ -6481,9 +6482,9 @@ dependencies = [ [[package]] name = "sc-peerset" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "libp2p", "log", "serde_json", @@ -6494,7 +6495,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -6503,14 +6504,14 @@ dependencies = [ [[package]] name = "sc-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "hash-db", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-pubsub", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "sc-block-builder", "sc-client-api", @@ -6519,82 +6520,83 @@ dependencies = [ "sc-rpc-api", "sc-tracing", "serde_json", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", "sp-chain-spec", - "sp-core", - "sp-keystore", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-offchain", "sp-rpc", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-session", - "sp-state-machine", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", "sp-utils", - "sp-version", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-rpc-api" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", - "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", - "jsonrpc-pubsub 15.1.0", + "futures 0.3.14", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "jsonrpc-pubsub", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "serde", "serde_json", "sp-chain-spec", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-rpc", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", - "sp-version", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sc-rpc-server" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "futures 0.1.31", - "jsonrpc-core 15.1.0", + "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-pubsub", "jsonrpc-ws-server", "log", "serde", "serde_json", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-prometheus-endpoint", ] [[package]] name = "sc-service" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ + "async-trait", "directories", "exit-future", "futures 0.1.31", - "futures 0.3.13", + "futures 0.3.14", "futures-timer 3.0.2", "hash-db", - "jsonrpc-core 15.1.0", - "jsonrpc-pubsub 15.1.0", + "jsonrpc-core", + "jsonrpc-pubsub", "lazy_static", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -6613,24 +6615,24 @@ dependencies = [ "sc-transaction-pool", "serde", "serde_json", - "sp-api", - "sp-application-crypto", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-session", - "sp-state-machine", - "sp-tracing", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", - "sp-trie", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-utils", - "sp-version", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -6642,36 +6644,34 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parity-util-mem-derive", "parking_lot 0.11.1", "sc-client-api", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sc-telemetry" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "chrono", - "futures 0.3.13", + "futures 0.3.14", "libp2p", "log", "parking_lot 0.11.1", - "pin-project 1.0.5", + "pin-project 1.0.6", "rand 0.7.3", "serde", "serde_json", - "sp-utils", "take_mut", - "tracing", - "tracing-subscriber", + "thiserror", "void", "wasm-timer", ] @@ -6679,7 +6679,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "ansi_term 0.12.1", "atty", @@ -6690,11 +6690,10 @@ dependencies = [ "parking_lot 0.11.1", "regex", "rustc-hash", - "sc-telemetry", "sc-tracing-proc-macro", "serde", "serde_json", - "sp-tracing", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "tracing", "tracing-core", @@ -6707,9 +6706,9 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -6718,10 +6717,10 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.14", "linked-hash-map", "log", "parity-util-mem", @@ -6729,8 +6728,8 @@ dependencies = [ "retain_mut", "serde", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", "sp-utils", "thiserror", @@ -6740,22 +6739,22 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-diagnose", "intervalier", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", "sc-client-api", "sc-transaction-graph", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-tracing", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", "sp-utils", "substrate-prometheus-endpoint", @@ -6826,9 +6825,9 @@ dependencies = [ [[package]] name = "sct" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ "ring", "untrusted", @@ -6883,18 +6882,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.124" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd761ff957cb2a45fbb9ab3da6512de9de55872866160b23c25f1a841e99d29f" +checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.124" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b" +checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" dependencies = [ "proc-macro2", "quote", @@ -7004,9 +7003,9 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aa894ef3fade0ee7243422f4fbbd6c2b48e6de767e621d37ef65f2310f53cea" +checksum = "ef33d6d0cd06e0840fba9985aab098c147e67e05cee14d412d3345ed14ff30ac" dependencies = [ "libc", "signal-hook-registry", @@ -7029,14 +7028,14 @@ checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] name = "simba" -version = "0.1.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb931b1367faadea6b1ab1c306a860ec17aaa5fa39f367d0c744e69d971a1fb2" +checksum = "5132a955559188f3d13c9ba831e77c802ddc8782783f050ed0c52f5988b95f4c" dependencies = [ - "approx", - "num-complex", + "approx 0.4.0", + "num-complex 0.3.1", "num-traits", - "paste 0.1.18", + "paste", ] [[package]] @@ -7089,6 +7088,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "socket2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "soketto" version = "0.4.2" @@ -7098,7 +7107,7 @@ dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.13", + "futures 0.3.14", "httparse", "log", "rand 0.7.3", @@ -7108,38 +7117,68 @@ dependencies = [ [[package]] name = "sp-allocator" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "log", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "thiserror", +] + +[[package]] +name = "sp-api" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ + "hash-db", "log", - "sp-core", - "sp-std 3.0.0", - "sp-wasm-interface", + "parity-scale-codec 2.1.0", + "sp-api-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", "thiserror", ] [[package]] name = "sp-api" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "hash-db", - "parity-scale-codec 2.0.1", - "sp-api-proc-macro", - "sp-core", - "sp-runtime", - "sp-state-machine", - "sp-std 3.0.0", - "sp-version", + "log", + "parity-scale-codec 2.1.0", + "sp-api-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sp-api-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "blake2-rfc", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-api-proc-macro" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "blake2-rfc", - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -7148,73 +7187,99 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-application-crypto" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "serde", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-arithmetic" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", + "integer-sqrt", + "num-traits", + "parity-scale-codec 2.1.0", "serde", - "sp-core", - "sp-io", - "sp-std 3.0.0", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-arithmetic" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-debug-derive", - "sp-std 3.0.0", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "static_assertions", ] [[package]] name = "sp-authorship" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-block-builder" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-blockchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "log", "lru", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-consensus", "sp-database", - "sp-runtime", - "sp-state-machine", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sp-chain-spec" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "serde", "serde_json", @@ -7223,24 +7288,25 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "async-trait", + "futures 0.3.14", "futures-timer 3.0.2", "libp2p", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "serde", - "sp-api", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", - "sp-std 3.0.0", - "sp-trie", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-utils", - "sp-version", + "sp-version 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-prometheus-endpoint", "thiserror", "wasm-timer", @@ -7249,71 +7315,117 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-api", - "sp-application-crypto", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-consensus", "sp-consensus-slots", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", - "sp-timestamp", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-consensus-babe" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "merlin", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-application-crypto", + "parity-scale-codec 2.1.0", + "serde", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-consensus", "sp-consensus-slots", "sp-consensus-vrf", - "sp-core", - "sp-inherents", - "sp-keystore", - "sp-runtime", - "sp-std 3.0.0", - "sp-timestamp", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-consensus-slots" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-arithmetic", - "sp-runtime", + "parity-scale-codec 2.1.0", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-consensus-vrf" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "schnorrkel", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-core" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", + "base58", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures 0.3.14", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec 2.1.0", + "parity-util-mem", + "parking_lot 0.11.1", + "primitive-types", + "rand 0.7.3", + "regex", "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std 3.0.0", + "secrecy", + "serde", + "sha2 0.9.3", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "tiny-keccak", + "twox-hash", + "wasmi", + "zeroize", ] [[package]] name = "sp-core" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "base58", "blake2-rfc", "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.13", + "futures 0.3.14", "hash-db", "hash256-std-hasher", "hex", @@ -7323,21 +7435,21 @@ dependencies = [ "log", "merlin", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", "parking_lot 0.11.1", - "primitive-types 0.9.0", + "primitive-types", "rand 0.7.3", "regex", "schnorrkel", "secrecy", "serde", "sha2 0.9.3", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std 3.0.0", - "sp-storage", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "substrate-bip39", "thiserror", "tiny-bip39", @@ -7350,7 +7462,7 @@ dependencies = [ [[package]] name = "sp-database" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -7359,7 +7471,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-debug-derive" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "proc-macro2", "quote", @@ -7369,63 +7491,110 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "environmental", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-externalities" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "environmental", - "parity-scale-codec 2.0.1", - "sp-std 3.0.0", - "sp-storage", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-finality-grandpa" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "finality-grandpa", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std 3.0.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-inherents" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", ] [[package]] name = "sp-inherents" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sp-core", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sp-io" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "futures 0.3.14", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-io" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "hash-db", "libsecp256k1", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std 3.0.0", - "sp-tracing", - "sp-trie", - "sp-wasm-interface", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-keystore 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-state-machine 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "tracing", "tracing-core", ] @@ -7433,45 +7602,78 @@ dependencies = [ [[package]] name = "sp-keyring" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "lazy_static", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "strum", ] [[package]] name = "sp-keystore" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ "async-trait", "derive_more", - "futures 0.3.13", + "futures 0.3.14", "merlin", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "schnorrkel", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-keystore" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "async-trait", + "derive_more", + "futures 0.3.14", + "merlin", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "schnorrkel", "serde", - "sp-core", - "sp-externalities", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-maybe-compressed-blob" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "ruzstd", + "zstd", ] [[package]] name = "sp-offchain" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-panic-handler" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "sp-api", - "sp-core", - "sp-runtime", + "backtrace", ] [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "backtrace", ] @@ -7479,57 +7681,107 @@ dependencies = [ [[package]] name = "sp-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "serde", - "sp-core", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-runtime" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples 0.2.1", + "log", + "parity-scale-codec 2.1.0", + "parity-util-mem", + "paste", + "rand 0.7.3", + "serde", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-runtime" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "either", "hash256-std-hasher", "impl-trait-for-tuples 0.2.1", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parity-util-mem", - "paste 1.0.4", + "paste", "rand 0.7.3", "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std 3.0.0", + "sp-application-crypto 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-arithmetic 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-runtime-interface" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.0", + "primitive-types", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "static_assertions", ] [[package]] name = "sp-runtime-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", - "primitive-types 0.9.0", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std 3.0.0", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "parity-scale-codec 2.1.0", + "primitive-types", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface-proc-macro 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-storage 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-tracing 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "Inflector", + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "Inflector", - "proc-macro-crate", + "proc-macro-crate 1.0.0", "proc-macro2", "quote", "syn", @@ -7538,20 +7790,20 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-core", - "sp-io", - "sp-std 3.0.0", - "sp-wasm-interface", + "parity-scale-codec 2.1.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-wasm-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi", ] [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "serde", "serde_json", @@ -7560,43 +7812,75 @@ dependencies = [ [[package]] name = "sp-session" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-staking 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-staking" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-api", - "sp-core", - "sp-runtime", - "sp-staking", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", ] [[package]] name = "sp-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-state-machine" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "parity-scale-codec 2.0.1", - "sp-runtime", - "sp-std 3.0.0", + "hash-db", + "log", + "num-traits", + "parity-scale-codec 2.1.0", + "parking_lot 0.11.1", + "rand 0.7.3", + "smallvec 1.6.1", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "thiserror", + "trie-db", + "trie-root", ] [[package]] name = "sp-state-machine" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "hash-db", "log", "num-traits", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "parking_lot 0.11.1", "rand 0.7.3", "smallvec 1.6.1", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std 3.0.0", - "sp-trie", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-panic-handler 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", "trie-db", "trie-root", @@ -7611,56 +7895,99 @@ checksum = "2585fb8f5f4fde53c2f9ccebac4517da4dc435373a8fcaf5db7f54b798da66c2" [[package]] name = "sp-std" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" + +[[package]] +name = "sp-std" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[package]] name = "sp-storage" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ "impl-serde", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "ref-cast", "serde", - "sp-debug-derive", - "sp-std 3.0.0", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-storage" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "impl-serde", + "parity-scale-codec 2.1.0", + "ref-cast", + "serde", + "sp-debug-derive 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-tasks" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", - "sp-std 3.0.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-externalities 0.9.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-io 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime-interface 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", ] [[package]] name = "sp-timestamp" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" dependencies = [ - "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", - "sp-api", - "sp-inherents", - "sp-runtime", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasm-timer", +] + +[[package]] +name = "sp-timestamp" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" +dependencies = [ + "parity-scale-codec 2.1.0", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasm-timer", ] [[package]] name = "sp-tracing" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "log", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-tracing" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "log", - "parity-scale-codec 2.0.1", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "tracing", "tracing-core", "tracing-subscriber", @@ -7669,29 +7996,43 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "derive_more", - "futures 0.3.13", + "futures 0.3.14", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-blockchain", - "sp-runtime", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "thiserror", ] [[package]] name = "sp-trie" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec 2.1.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-trie" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "hash-db", "memory-db", - "parity-scale-codec 2.0.1", - "sp-core", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "trie-db", "trie-root", ] @@ -7699,9 +8040,9 @@ dependencies = [ [[package]] name = "sp-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -7711,23 +8052,46 @@ dependencies = [ [[package]] name = "sp-version" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "impl-serde", + "parity-scale-codec 2.1.0", + "serde", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", +] + +[[package]] +name = "sp-version" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-serde", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "serde", - "sp-runtime", - "sp-std 3.0.0", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", +] + +[[package]] +name = "sp-wasm-interface" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=frontier#39b31316815ec6d709e7ad7c1a31c436d14c53e6" +dependencies = [ + "impl-trait-for-tuples 0.2.1", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=frontier)", + "wasmi", ] [[package]] name = "sp-wasm-interface" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "impl-trait-for-tuples 0.2.1", - "parity-scale-codec 2.0.1", - "sp-std 3.0.0", + "parity-scale-codec 2.1.0", + "sp-std 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "wasmi", ] @@ -7751,10 +8115,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "statrs" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce16f6de653e88beca7bd13780d08e09d4489dbca1f9210e041bc4852481382" +checksum = "1e34b58a8f9b7462b6922e0b4e3c83d1b3c2075f7f996a56d6c66afa81590064" dependencies = [ + "nalgebra 0.19.0", "rand 0.7.3", ] @@ -7853,30 +8218,30 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.13", - "jsonrpc-core 15.1.0", - "jsonrpc-core-client 15.1.0", - "jsonrpc-derive 15.1.0", + "futures 0.3.14", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", "log", - "parity-scale-codec 2.0.1", + "parity-scale-codec 2.1.0", "sc-client-api", "sc-rpc-api", "serde", - "sp-api", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-block-builder", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", "sp-transaction-pool", ] [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" dependencies = [ "async-std", "derive_more", @@ -7907,9 +8272,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.63" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd9bc7ccc2688b3344c2f48b9b546648b25ce0b20fc717ee7fa7981a8ca9717" +checksum = "48fe99c6bd8b1cc636890bcc071842de909d902c81ac7dab53ba33c421ab8ffb" dependencies = [ "proc-macro2", "quote", @@ -8056,9 +8421,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" dependencies = [ "tinyvec_macros", ] @@ -8362,9 +8727,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41768be5b9f3489491825f56f01f25290aa1d3e7cc97e182d4d34360493ba6fa" +checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2" dependencies = [ "proc-macro2", "quote", @@ -8386,7 +8751,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.5", + "pin-project 1.0.6", "tracing", ] @@ -8413,9 +8778,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ab8966ac3ca27126141f7999361cc97dd6fb4b71da04c02044fa9045d98bb96" +checksum = "705096c6f83bf68ea5d357a6aa01829ddbdac531b357b45abeca842938085baa" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -8462,7 +8827,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ "hash-db", - "rlp 0.5.0", + "rlp", +] + +[[package]] +name = "trust-dns-proto" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d57e219ba600dd96c2f6d82eb79645068e14edbc5c7e27514af40436b88150c" +dependencies = [ + "async-trait", + "cfg-if 1.0.0", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.2", + "ipnet", + "lazy_static", + "log", + "rand 0.8.3", + "smallvec 1.6.1", + "thiserror", + "tinyvec", + "url 2.2.1", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0437eea3a6da51acc1e946545ff53d5b8fb2611ff1c3bed58522dde100536ae" +dependencies = [ + "cfg-if 1.0.0", + "futures-util", + "ipconfig", + "lazy_static", + "log", + "lru-cache", + "parking_lot 0.11.1", + "resolv-conf", + "smallvec 1.6.1", + "thiserror", + "trust-dns-proto", ] [[package]] @@ -8484,9 +8892,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" [[package]] name = "ucd-trie" @@ -8494,18 +8902,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" -[[package]] -name = "uint" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177" -dependencies = [ - "byteorder", - "crunchy", - "rustc-hex", - "static_assertions", -] - [[package]] name = "uint" version = "0.9.0" @@ -8529,9 +8925,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" dependencies = [ "matches", ] @@ -8649,9 +9045,9 @@ checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" [[package]] name = "vec-arena" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d" +checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1" [[package]] name = "vec_map" @@ -8661,9 +9057,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "void" @@ -8712,9 +9108,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7" +checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -8722,9 +9118,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" +checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" dependencies = [ "bumpalo", "lazy_static", @@ -8737,9 +9133,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.21" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab" +checksum = "81b8b767af23de6ac18bf2168b690bed2902743ddf0fb39252e36f9e2bfc63ea" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -8749,9 +9145,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b" +checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8759,9 +9155,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e" +checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" dependencies = [ "proc-macro2", "quote", @@ -8772,9 +9168,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.71" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1" +checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" [[package]] name = "wasm-timer" @@ -8782,7 +9178,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "js-sys", "parking_lot 0.11.1", "pin-utils", @@ -8799,7 +9195,7 @@ checksum = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" dependencies = [ "libc", "memory_units", - "num-rational", + "num-rational 0.2.4", "num-traits", "parity-wasm", "wasmi-validation", @@ -8816,15 +9212,15 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.71.0" +version = "0.76.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89a30c99437829ede826802bfcf28500cf58df00e66cb9114df98813bc145ff1" +checksum = "755a9a4afe3f6cccbbe6d7e965eef44cf260b001f93e547eba84255c1d0187d8" [[package]] name = "wasmtime" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7426055cb92bd9a1e9469b48154d8d6119cd8c498c8b70284e420342c05dc45d" +checksum = "718cb52a9fdb7ab12471e9b9d051c9adfa6b5c504e0a1fea045e5eabc81eedd9" dependencies = [ "anyhow", "backtrace", @@ -8834,6 +9230,7 @@ dependencies = [ "indexmap", "libc", "log", + "paste", "region", "rustc-demangle", "serde", @@ -8842,6 +9239,7 @@ dependencies = [ "wasmparser", "wasmtime-cache", "wasmtime-environ", + "wasmtime-fiber", "wasmtime-jit", "wasmtime-profiling", "wasmtime-runtime", @@ -8851,9 +9249,9 @@ dependencies = [ [[package]] name = "wasmtime-cache" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c01d9287e36921e46f5887a47007824ae5dbb9b7517a2d565660ab4471478709" +checksum = "1f984df56c4adeba91540f9052db9f7a8b3b00cfaac1a023bee50a972f588b0c" dependencies = [ "anyhow", "base64 0.13.0", @@ -8872,27 +9270,28 @@ dependencies = [ [[package]] name = "wasmtime-cranelift" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4134ed3a4316cd0de0e546c6004850afe472b0fa3fcdc2f2c15f8d449562d962" +checksum = "2a05abbf94e03c2c8ee02254b1949320c4d45093de5d9d6ed4d9351d536075c9" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "cranelift-wasm", + "wasmparser", "wasmtime-environ", ] [[package]] name = "wasmtime-debug" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91fa931df6dd8af2b02606307674d3bad23f55473d5f4c809dddf7e4c4dc411" +checksum = "382eecd6281c6c1d1f3c904c3c143e671fc1a9573820cbfa777fba45ce2eda9c" dependencies = [ "anyhow", "gimli", "more-asserts", - "object 0.22.0", + "object", "target-lexicon", "thiserror", "wasmparser", @@ -8901,9 +9300,9 @@ dependencies = [ [[package]] name = "wasmtime-environ" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1098871dc3120aaf8190d79153e470658bb79f63ee9ca31716711e123c28220" +checksum = "81011b2b833663d7e0ce34639459a0e301e000fc7331e0298b3a27c78d0cec60" dependencies = [ "anyhow", "cfg-if 1.0.0", @@ -8919,11 +9318,22 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "wasmtime-fiber" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92da32e31af2e3d828f485f5f24651ed4d3b7f03a46ea6555eae6940d1402cd" +dependencies = [ + "cc", + "libc", + "winapi 0.3.9", +] + [[package]] name = "wasmtime-jit" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "738bfcd1561ede8bb174215776fd7d9a95d5f0a47ca3deabe0282c55f9a89f68" +checksum = "9b5f649623859a12d361fe4cc4793de44f7c3ff34c322c5714289787e89650bb" dependencies = [ "addr2line", "anyhow", @@ -8936,7 +9346,7 @@ dependencies = [ "gimli", "log", "more-asserts", - "object 0.22.0", + "object", "rayon", "region", "serde", @@ -8954,13 +9364,13 @@ dependencies = [ [[package]] name = "wasmtime-obj" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e96d77f1801131c5e86d93e42a3cf8a35402107332c202c245c83f34888a906" +checksum = "ef2e99cd9858f57fd062e9351e07881cedfc8597928385e02a48d9333b9e15a1" dependencies = [ "anyhow", "more-asserts", - "object 0.22.0", + "object", "target-lexicon", "wasmtime-debug", "wasmtime-environ", @@ -8968,16 +9378,16 @@ dependencies = [ [[package]] name = "wasmtime-profiling" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60bb672c9d894776d7b9250dd9b4fe890f8760201ee4f53e5f2da772b6c4debb" +checksum = "e46c0a590e49278ba7f79ef217af9db4ecc671b50042c185093e22d73524abb2" dependencies = [ "anyhow", "cfg-if 1.0.0", "gimli", "lazy_static", "libc", - "object 0.22.0", + "object", "scroll", "serde", "target-lexicon", @@ -8987,9 +9397,9 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978086740949eeedfefcee667b57a9e98d9a7fc0de382fcfa0da30369e3530d" +checksum = "1438a09185fc7ca067caf1a80d7e5b398eefd4fb7630d94841448ade60feb3d0" dependencies = [ "backtrace", "cc", @@ -8998,7 +9408,7 @@ dependencies = [ "lazy_static", "libc", "log", - "memoffset 0.6.1", + "memoffset 0.6.3", "more-asserts", "psm", "region", @@ -9009,27 +9419,27 @@ dependencies = [ [[package]] name = "wast" -version = "35.0.0" +version = "35.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5ae96da18bb5926341516fd409b5a8ce4e4714da7f0a1063d3b20ac9f9a1e1" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0fa059022c5dabe129f02b429d67086400deb8277f89c975555dacc1dadbcc" +checksum = "8ec280a739b69173e0ffd12c1658507996836ba4e992ed9bc1e5385a0bd72a02" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.48" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b" +checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be" dependencies = [ "js-sys", "wasm-bindgen", @@ -9068,9 +9478,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" dependencies = [ "webpki", ] @@ -9095,14 +9505,20 @@ dependencies = [ [[package]] name = "which" -version = "4.0.2" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" +checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" dependencies = [ + "either", "libc", - "thiserror", ] +[[package]] +name = "widestring" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" + [[package]] name = "winapi" version = "0.2.8" @@ -9146,6 +9562,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -9179,7 +9604,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cc7bd8c983209ed5d527f44b01c41b7dc146fd960c61cf9e1d25399841dc271" dependencies = [ - "futures 0.3.13", + "futures 0.3.14", "log", "nohash-hasher", "parking_lot 0.11.1", @@ -9210,18 +9635,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.5.4+zstd.1.4.7" +version = "0.6.1+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69996ebdb1ba8b1517f61387a883857818a66c8a295f487b1ffd8fd9d2c82910" +checksum = "5de55e77f798f205d8561b8fe2ef57abfb6e0ff2abe7fd3c089e119cdb5631a3" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "2.0.6+zstd.1.4.7" +version = "3.0.1+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98aa931fb69ecee256d44589d19754e61851ae4769bf963b385119b1cc37a49e" +checksum = "1387cabcd938127b30ce78c4bf00b30387dddf704e3f0881dbc4ff62b5566f8c" dependencies = [ "libc", "zstd-sys", @@ -9229,162 +9654,130 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.4.18+zstd.1.4.7" +version = "1.4.20+zstd.1.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6e8778706838f43f771d80d37787cb2fe06dafe89dd3aebaf6721b9eaec81" +checksum = "ebd5b733d7cf2d9447e2c3e76a5589b4f5e5ae065c22a2bc0b023cbc331b6c8e" dependencies = [ "cc", - "glob", - "itertools", "libc", ] [[patch.unused]] name = "pallet-assets" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-collective" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts-primitives" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts-proc-macro" -version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts-rpc" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-contracts-rpc-runtime-api" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-democracy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-elections-phragmen" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-identity" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-im-online" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-indices" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-multisig" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-offences" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-proxy" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-recovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-scheduler" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-staking" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-staking-reward-curve" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" - -[[patch.unused]] -name = "pallet-treasury" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-utility" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "pallet-vesting" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "sc-authority-discovery" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "sp-authority-discovery" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "sp-npos-elections" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "sp-npos-elections-compact" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "substrate-browser-utils" version = "0.9.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "substrate-frame-cli" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" [[patch.unused]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate.git?branch=frontier#ca63242fc848b9bff739c246e07310dd15ec25eb" +source = "git+https://github.com/paritytech/substrate.git?branch=rococo-v1#816ed3d4e77a2463c86e69ec5a26fc307ef452b9" diff --git a/Cargo.toml b/Cargo.toml index 5696b45f..962bab18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ members = [ "pallets/merkle", "pallets/merkle/rpc", "pallets/mixer", + "pallets/tokens", "runtime", ] @@ -56,137 +57,137 @@ yamux = { opt-level = 3 } zeroize = { opt-level = 3 } [patch.crates-io] -fork-tree = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-executive = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-metadata = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-support-procedural = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-support-procedural-tools = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-support-procedural-tools-derive = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-assets = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-aura = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-collective = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-contracts-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-democracy = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-im-online = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-indices = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-multisig = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-offences = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-proxy = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-recovery = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-session = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-sudo = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -pallet-vesting = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-chain-spec-derive = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-client-db = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-consensus-uncles = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-executor-common = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-executor-wasmi = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-executor-wasmtime = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-informant = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-light = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-network-gossip = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-peerset = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-proposer-metrics = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-rpc-server = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-state-db = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-transaction-graph = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-allocator = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-api-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-consensus-vrf = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-database = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-debug-derive = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-externalities = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-npos-elections = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-npos-elections-compact = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-panic-handler = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-runtime-interface-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-sandbox = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-serializer = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-session = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-state-machine = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-storage = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-tasks = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-utils = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -sp-wasm-interface = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-browser-utils = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-frame-cli = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } -substrate-test-client = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" } +fork-tree = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-executive = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-metadata = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-support-procedural = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-support-procedural-tools = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-support-procedural-tools-derive = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-assets = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-aura = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-collective = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-contracts-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-democracy = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-im-online = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-indices = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-multisig = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-offences = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-proxy = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-recovery = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-session = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-staking = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-sudo = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-treasury = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +pallet-vesting = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-chain-spec-derive = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-client-db = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-epochs = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-consensus-uncles = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-executor-common = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-executor-wasmi = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-executor-wasmtime = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-informant = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-light = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-network-gossip = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-peerset = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-proposer-metrics = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-rpc-server = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-state-db = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-transaction-graph = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-allocator = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-api-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-authority-discovery = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus-babe = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus-slots = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-consensus-vrf = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-database = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-debug-derive = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-externalities = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-npos-elections = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-npos-elections-compact = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-panic-handler = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-runtime-interface-proc-macro = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-sandbox = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-serializer = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-session = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-state-machine = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-storage = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-tasks = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-utils = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +sp-wasm-interface = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-browser-utils = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-frame-cli = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } +substrate-test-client = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-v1" } diff --git a/node/Cargo.toml b/node/Cargo.toml index 7cc4e40c..e58ed2b6 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -62,16 +62,16 @@ substrate-frame-rpc-system = { version = "3.0.0" } pallet-contracts-rpc = { version = "3.0.0" } -fc-consensus = { git = "https://github.com/paritytech/frontier" } -fp-consensus = { git = "https://github.com/paritytech/frontier" } -fc-rpc = { git = "https://github.com/paritytech/frontier" } -fp-rpc = { git = "https://github.com/paritytech/frontier" } -fc-rpc-core = { git = "https://github.com/paritytech/frontier" } -fc-db = { git = "https://github.com/paritytech/frontier" } -fc-mapping-sync = { git = "https://github.com/paritytech/frontier" } +# fc-consensus = { git = "https://github.com/paritytech/frontier" } +# fp-consensus = { git = "https://github.com/paritytech/frontier" } +# fc-rpc = { git = "https://github.com/paritytech/frontier" } +# fp-rpc = { git = "https://github.com/paritytech/frontier" } +# fc-rpc-core = { git = "https://github.com/paritytech/frontier" } +# fc-db = { git = "https://github.com/paritytech/frontier" } +# fc-mapping-sync = { git = "https://github.com/paritytech/frontier" } -pallet-evm = { git = "https://github.com/paritytech/frontier" } -pallet-ethereum = { git = "https://github.com/paritytech/frontier" } +# pallet-evm = { git = "https://github.com/paritytech/frontier" } +# pallet-ethereum = { git = "https://github.com/paritytech/frontier" } merkle = { package = "pallet-merkle", version = "3.0.0", path = "../pallets/merkle" } merkle-rpc = { package = "pallet-merkle-rpc", version = "3.0.0", path = "../pallets/merkle/rpc" } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 6c6995d1..b4e65217 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,6 +1,7 @@ use frame_benchmarking::whitelisted_caller; use node_template_runtime::{ - AccountId, AuraConfig, BalancesConfig, EVMConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig, + AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig, + // EVMConfig, SystemConfig, WASM_BINARY, }; use sc_service::ChainType; @@ -134,37 +135,37 @@ fn testnet_genesis( endowed_accounts: Vec, _enable_println: bool, ) -> GenesisConfig { - let alice_evm_account_id = H160::from_str("19e7e376e7c213b7e7e7e46cc70a5dd086daff2a").unwrap(); - let mut evm_accounts = BTreeMap::new(); - evm_accounts.insert(alice_evm_account_id, pallet_evm::GenesisAccount { - nonce: 0.into(), - balance: U256::from(123456_123_000_000_000_000_000u128), - storage: BTreeMap::new(), - code: vec![], - }); + // let alice_evm_account_id = H160::from_str("19e7e376e7c213b7e7e7e46cc70a5dd086daff2a").unwrap(); + // let mut evm_accounts = BTreeMap::new(); + // evm_accounts.insert(alice_evm_account_id, pallet_evm::GenesisAccount { + // nonce: 0.into(), + // balance: U256::from(123456_123_000_000_000_000_000u128), + // storage: BTreeMap::new(), + // code: vec![], + // }); GenesisConfig { - frame_system: Some(SystemConfig { + frame_system: SystemConfig { // Add Wasm runtime to storage. code: wasm_binary.to_vec(), changes_trie_config: Default::default(), - }), - pallet_balances: Some(BalancesConfig { + }, + pallet_balances: BalancesConfig { // Configure endowed accounts with initial balance of 1 << 60. balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), - }), - pallet_contracts: Some(Default::default()), - pallet_aura: Some(AuraConfig { + }, + pallet_contracts: Default::default(), + pallet_aura: AuraConfig { authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), - }), - pallet_grandpa: Some(GrandpaConfig { + }, + pallet_grandpa: GrandpaConfig { authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), - }), - pallet_sudo: Some(SudoConfig { + }, + pallet_sudo: SudoConfig { // Assign network admin rights. key: root_key, - }), - pallet_evm: Some(EVMConfig { accounts: evm_accounts }), - pallet_ethereum: Some(Default::default()), + }, + // pallet_evm: Some(EVMConfig { accounts: evm_accounts }), + // pallet_ethereum: Some(Default::default()), } } diff --git a/node/src/command.rs b/node/src/command.rs index 660ebb3f..38202b60 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -146,7 +146,10 @@ pub fn run() -> sc_cli::Result<()> { runner.run_node_until_exit(|config| async move { match config.role { Role::Light => service::new_light(config), - _ => service::new_full(config, cli.run.enable_dev_signer), + _ => service::new_full( + config, + // cli.run.enable_dev_signer + ), } .map_err(sc_cli::Error::Service) }) diff --git a/node/src/rpc.rs b/node/src/rpc.rs index ffc64661..eabb7035 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -2,12 +2,12 @@ #![warn(missing_docs)] -use fc_rpc::{SchemaV1Override, StorageOverride}; -use fc_rpc_core::types::{FilterPool, PendingTransactions}; +// use fc_rpc::{SchemaV1Override, StorageOverride}; +// use fc_rpc_core::types::{FilterPool, PendingTransactions}; use jsonrpc_pubsub::manager::SubscriptionManager; use merkle_rpc::{MerkleApi, MerkleClient}; use node_template_runtime::{opaque::Block, AccountId, Balance, BlockNumber, Hash, Index}; -use pallet_ethereum::EthereumStorageSchema; +// use pallet_ethereum::EthereumStorageSchema; use sc_client_api::{ backend::{AuxStore, StorageProvider}, client::BlockchainEvents, @@ -63,16 +63,16 @@ pub struct FullDeps { pub select_chain: SC, /// The Node authority flag pub is_authority: bool, - /// Whether to enable dev signer - pub enable_dev_signer: bool, + // /// Whether to enable dev signer + // pub enable_dev_signer: bool, /// Network service pub network: Arc>, - /// Ethereum pending transactions. - pub pending_transactions: PendingTransactions, - /// EthFilterApi pool. - pub filter_pool: Option, - /// Backend. - pub backend: Arc>, + // /// Ethereum pending transactions. + // pub pending_transactions: PendingTransactions, + // /// EthFilterApi pool. + // pub filter_pool: Option, + // /// Backend. + // pub backend: Arc>, /// Whether to deny unsafe calls pub deny_unsafe: DenyUnsafe, /// GRANDPA specific dependencies. @@ -93,7 +93,7 @@ where C::Api: pallet_contracts_rpc::ContractsRuntimeApi, C::Api: BlockBuilder, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, - C::Api: fp_rpc::EthereumRuntimeRPCApi, + // C::Api: fp_rpc::EthereumRuntimeRPCApi, C::Api: BlockBuilder, C::Api: merkle::MerkleApi, P: TransactionPool + 'static, @@ -101,10 +101,10 @@ where B: sc_client_api::Backend + Send + Sync + 'static, B::State: sc_client_api::backend::StateBackend>, { - use fc_rpc::{ - EthApi, EthApiServer, EthDevSigner, EthFilterApi, EthFilterApiServer, EthPubSubApi, EthPubSubApiServer, - EthSigner, HexEncodedIdProvider, NetApi, NetApiServer, Web3Api, Web3ApiServer, - }; + // use fc_rpc::{ + // EthApi, EthApiServer, EthDevSigner, EthFilterApi, EthFilterApiServer, EthPubSubApi, EthPubSubApiServer, + // EthSigner, HexEncodedIdProvider, NetApi, NetApiServer, Web3Api, Web3ApiServer, + // }; use pallet_contracts_rpc::{Contracts, ContractsApi}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; use substrate_frame_rpc_system::{FullSystem, SystemApi}; @@ -114,13 +114,13 @@ where client, pool, select_chain: _, - enable_dev_signer, + // enable_dev_signer, is_authority, network, - pending_transactions, + // pending_transactions, deny_unsafe, - filter_pool, - backend, + // filter_pool, + // backend, grandpa, } = deps; let GrandpaDeps { @@ -144,46 +144,46 @@ where client.clone(), ))); - let mut signers = Vec::new(); - if enable_dev_signer { - signers.push(Box::new(EthDevSigner::new()) as Box); - } - let mut overrides = BTreeMap::new(); - overrides.insert( - EthereumStorageSchema::V1, - Box::new(SchemaV1Override::new(client.clone())) as Box + Send + Sync>, - ); - io.extend_with(EthApiServer::to_delegate(EthApi::new( - client.clone(), - pool.clone(), - node_template_runtime::TransactionConverter, - network.clone(), - pending_transactions.clone(), - signers, - overrides, - backend, - is_authority, - ))); - - if let Some(filter_pool) = filter_pool { - io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new( - client.clone(), - filter_pool.clone(), - 500 as usize, // max stored filters - ))); - } - - io.extend_with(NetApiServer::to_delegate(NetApi::new(client.clone(), network.clone()))); - io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone()))); - io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new( - pool.clone(), - client.clone(), - network, - SubscriptionManager::::with_id_provider( - HexEncodedIdProvider::default(), - Arc::new(subscription_task_executor), - ), - ))); + // let mut signers = Vec::new(); + // if enable_dev_signer { + // signers.push(Box::new(EthDevSigner::new()) as Box); + // } + // let mut overrides = BTreeMap::new(); + // overrides.insert( + // EthereumStorageSchema::V1, + // Box::new(SchemaV1Override::new(client.clone())) as Box + Send + Sync>, + // ); + // io.extend_with(EthApiServer::to_delegate(EthApi::new( + // client.clone(), + // pool.clone(), + // node_template_runtime::TransactionConverter, + // network.clone(), + // pending_transactions.clone(), + // signers, + // overrides, + // backend, + // is_authority, + // ))); + + // if let Some(filter_pool) = filter_pool { + // io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new( + // client.clone(), + // filter_pool.clone(), + // 500 as usize, // max stored filters + // ))); + // } + + // io.extend_with(NetApiServer::to_delegate(NetApi::new(client.clone(), network.clone()))); + // io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone()))); + // io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new( + // pool.clone(), + // client.clone(), + // network, + // SubscriptionManager::::with_id_provider( + // HexEncodedIdProvider::default(), + // Arc::new(subscription_task_executor), + // ), + // ))); io.extend_with(MerkleApi::to_delegate(MerkleClient::new(client.clone()))); diff --git a/node/src/service.rs b/node/src/service.rs index 687bc80f..4cfc4103 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,29 +1,18 @@ -//! Service and ServiceFactory implementation. Specialized wrapper over -//! substrate service. - -use fc_consensus::FrontierBlockImport; -use fc_mapping_sync::MappingSyncWorker; -use fc_rpc::EthTask; -use fc_rpc_core::types::{FilterPool, PendingTransactions}; -use futures::StreamExt; +//! Service and ServiceFactory implementation. Specialized wrapper over substrate service. + +use std::sync::Arc; +use std::time::Duration; +use sc_client_api::{ExecutorProvider, RemoteBackend}; use node_template_runtime::{self, opaque::Block, RuntimeApi}; -use sc_client_api::{BlockchainEvents, ExecutorProvider, RemoteBackend}; +use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; +use sp_inherents::InherentDataProviders; use sc_executor::native_executor_instance; pub use sc_executor::NativeExecutor; -use sc_finality_grandpa::SharedVoterState; -use sc_service::BasePath; -use sc_telemetry::TelemetrySpan; - -use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; -use sp_inherents::InherentDataProviders; - -use sc_cli::SubstrateCli; -use std::{ - collections::{BTreeMap, HashMap}, - sync::{Arc, Mutex}, - time::Duration, -}; +use sc_consensus_aura::{ImportQueueParams, StartAuraParams, SlotProportion}; +use sc_finality_grandpa::SharedVoterState; +use sc_keystore::LocalKeystore; +use sc_telemetry::{Telemetry, TelemetryWorker}; // Our native executor instance. native_executor_instance!( @@ -33,68 +22,53 @@ native_executor_instance!( frame_benchmarking::benchmarking::HostFunctions, ); -pub enum ConsensusResult { - Aura( +type FullClient = sc_service::TFullClient; +type FullBackend = sc_service::TFullBackend; +type FullSelectChain = sc_consensus::LongestChain; + +pub fn new_partial(config: &Configuration) -> Result, + sc_transaction_pool::FullPool, + ( sc_consensus_aura::AuraBlockImport< Block, FullClient, - FrontierBlockImport< - Block, - sc_finality_grandpa::GrandpaBlockImport, - FullClient, - >, - AuraPair, + sc_finality_grandpa::GrandpaBlockImport, + AuraPair >, sc_finality_grandpa::LinkHalf, - ), -} - -type FullClient = sc_service::TFullClient; -type FullBackend = sc_service::TFullBackend; -type FullSelectChain = sc_consensus::LongestChain; - -pub fn open_frontier_backend(config: &Configuration) -> Result>, String> { - let config_dir = config - .base_path - .as_ref() - .map(|base_path| base_path.config_dir(config.chain_spec.id())) - .unwrap_or_else(|| { - BasePath::from_project("", "", &crate::cli::Cli::executable_name()).config_dir(config.chain_spec.id()) - }); - let database_dir = config_dir.join("frontier").join("db"); - - Ok(Arc::new(fc_db::Backend::::new(&fc_db::DatabaseSettings { - source: fc_db::DatabaseSettingsSrc::RocksDb { - path: database_dir, - cache_size: 0, - }, - })?)) -} - -pub fn new_partial( - config: &Configuration, -) -> Result< - sc_service::PartialComponents< - FullClient, - FullBackend, - FullSelectChain, - sp_consensus::import_queue::BasicQueue>, - sc_transaction_pool::FullPool, - ( - ConsensusResult, - PendingTransactions, - Option, - Arc>, - ), - >, - ServiceError, -> { - let inherent_data_providers = sp_inherents::InherentDataProviders::new(); + Option, + ) +>, ServiceError> { + if config.keystore_remote.is_some() { + return Err(ServiceError::Other( + format!("Remote Keystores are not supported."))) + } + let inherent_data_providers = InherentDataProviders::new(); + + let telemetry = config.telemetry_endpoints.clone() + .filter(|x| !x.is_empty()) + .map(|endpoints| -> Result<_, sc_telemetry::Error> { + let worker = TelemetryWorker::new(16)?; + let telemetry = worker.handle().new_telemetry(endpoints); + Ok((worker, telemetry)) + }) + .transpose()?; let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::(&config)?; + sc_service::new_full_parts::( + &config, + telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), + )?; let client = Arc::new(client); + let telemetry = telemetry + .map(|(worker, telemetry)| { + task_manager.spawn_handle().spawn("telemetry", worker.run()); + telemetry + }); + let select_chain = sc_consensus::LongestChain::new(backend.clone()); let transaction_pool = sc_transaction_pool::BasicPool::new_full( @@ -105,30 +79,30 @@ pub fn new_partial( client.clone(), ); - let pending_transactions: PendingTransactions = Some(Arc::new(Mutex::new(HashMap::new()))); - - let filter_pool: Option = Some(Arc::new(Mutex::new(BTreeMap::new()))); - - let frontier_backend = open_frontier_backend(config)?; - - let (grandpa_block_import, grandpa_link) = - sc_finality_grandpa::block_import(client.clone(), &(client.clone() as Arc<_>), select_chain.clone())?; - - let frontier_block_import = - FrontierBlockImport::new(grandpa_block_import.clone(), client.clone(), frontier_backend.clone()); + let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( + client.clone(), + &(client.clone() as Arc<_>), + select_chain.clone(), + telemetry.as_ref().map(|x| x.handle()), + )?; - let aura_block_import = - sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(frontier_block_import, client.clone()); + let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new( + grandpa_block_import.clone(), client.clone(), + ); - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - aura_block_import.clone(), - Some(Box::new(grandpa_block_import.clone())), - client.clone(), - inherent_data_providers.clone(), - &task_manager.spawn_handle(), - config.prometheus_registry(), - sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + let import_queue = sc_consensus_aura::import_queue::( + ImportQueueParams { + block_import: aura_block_import.clone(), + justification_import: Some(Box::new(grandpa_block_import.clone())), + client: client.clone(), + inherent_data_providers: inherent_data_providers.clone(), + spawner: &task_manager.spawn_essential_handle(), + can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + slot_duration: sc_consensus_aura::slot_duration(&*client)?, + registry: config.prometheus_registry(), + check_for_equivocation: Default::default(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, )?; Ok(sc_service::PartialComponents { @@ -140,29 +114,43 @@ pub fn new_partial( select_chain, transaction_pool, inherent_data_providers, - other: ( - ConsensusResult::Aura(aura_block_import, grandpa_link), - pending_transactions, - filter_pool, - frontier_backend, - ), + other: (aura_block_import, grandpa_link, telemetry), }) } -/// Creates a full service from the configuration. -pub fn new_full_base(config: Configuration, enable_dev_signer: bool) -> Result { +fn remote_keystore(_url: &String) -> Result, &'static str> { + // FIXME: here would the concrete keystore be built, + // must return a concrete type (NOT `LocalKeystore`) that + // implements `CryptoStore` and `SyncCryptoStore` + Err("Remote Keystore not supported.") +} + +/// Builds a new service for a full client. +pub fn new_full(mut config: Configuration) -> Result { let sc_service::PartialComponents { client, backend, mut task_manager, import_queue, - keystore_container, + mut keystore_container, select_chain, transaction_pool, inherent_data_providers, - other: (consensus_result, pending_transactions, filter_pool, frontier_backend), + other: (block_import, grandpa_link, mut telemetry), } = new_partial(&config)?; + if let Some(url) = &config.keystore_remote { + match remote_keystore(url) { + Ok(k) => keystore_container.set_remote_keystore(k), + Err(e) => { + return Err(ServiceError::Other( + format!("Error hooking up remote keystore for {}: {}", url, e))) + } + }; + } + + config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config()); + let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, @@ -176,11 +164,7 @@ pub fn new_full_base(config: Configuration, enable_dev_signer: bool) -> Result Result grandpa_link, - }; - let rpc_extensions_builder = { - let justification_stream = g_link.justification_stream(); - let shared_authority_set = g_link.shared_authority_set().clone(); + let justification_stream = grandpa_link.justification_stream(); + let shared_authority_set = grandpa_link.shared_authority_set().clone(); let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty(); let finality_proof_provider = sc_finality_grandpa::FinalityProofProvider::new_for_service( backend.clone(), @@ -209,9 +189,6 @@ pub fn new_full_base(config: Configuration, enable_dev_signer: bool) -> Result Result Result( + StartAuraParams { + slot_duration: sc_consensus_aura::slot_duration(&*client)?, + client: client.clone(), + select_chain: select_chain.clone(), + block_import, + proposer_factory, + inherent_data_providers: inherent_data_providers.clone(), + force_authoring, + backoff_authoring_blocks, + keystore: keystore_container.sync_keystore(), + can_author_with, + sync_oracle: network.clone(), + block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, + )?; + + // the AURA authoring task is considered essential, i.e. if it + // fails we take down the service with it. + task_manager.spawn_essential_handle().spawn_blocking("aura", aura); } - // Spawn Frontier pending transactions maintenance task (as essential, otherwise - // we leak). - if let Some(pending_transactions) = pending_transactions { - const TRANSACTION_RETAIN_THRESHOLD: u64 = 5; - task_manager.spawn_essential_handle().spawn( - "frontier-pending-transactions", - EthTask::pending_transaction_task(Arc::clone(&client), pending_transactions, TRANSACTION_RETAIN_THRESHOLD), - ); - } + // if the node isn't actively participating in consensus then it doesn't + // need a keystore, regardless of which protocol we use below. + let keystore = if role.is_authority() { + Some(keystore_container.sync_keystore()) + } else { + None + }; - match consensus_result { - ConsensusResult::Aura(aura_block_import, grandpa_link) => { - if role.is_authority() { - let proposer = sc_basic_authorship::ProposerFactory::new( - task_manager.spawn_handle(), - client.clone(), - transaction_pool.clone(), - prometheus_registry.as_ref(), - ); - - let can_author_with = sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()); - let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - client.clone(), - select_chain, - aura_block_import, - proposer, - network.clone(), - inherent_data_providers.clone(), - force_authoring, - backoff_authoring_blocks, - keystore_container.sync_keystore(), - can_author_with, - )?; - - // the AURA authoring task is considered essential, i.e. if it - // fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking("aura", aura); - - // if the node isn't actively participating in consensus then it doesn't - // need a keystore, regardless of which protocol we use below. - let keystore = if role.is_authority() { - Some(keystore_container.sync_keystore()) - } else { - None - }; - - let grandpa_config = sc_finality_grandpa::Config { - // FIXME #1578 make this available through chainspec - gossip_duration: Duration::from_millis(333), - justification_period: 512, - name: Some(name), - observer_enabled: false, - keystore, - is_authority: role.is_authority(), - }; - - if enable_grandpa { - // start the full GRANDPA voter - // NOTE: non-authorities could run the GRANDPA observer protocol, but at - // this point the full voter should provide better guarantees of block - // and vote data availability than the observer. The observer has not - // been tested extensively yet and having most nodes in a network run it - // could lead to finality stalls. - let grandpa_config = sc_finality_grandpa::GrandpaParams { - config: grandpa_config, - link: grandpa_link, - network, - telemetry_on_connect: telemetry_connection_notifier.map(|x| x.on_connect_stream()), - voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), - prometheus_registry, - shared_voter_state: SharedVoterState::empty(), - }; - - // the GRANDPA voter task is considered infallible, i.e. - // if it fails we take down the service with it. - task_manager - .spawn_essential_handle() - .spawn_blocking("grandpa-voter", sc_finality_grandpa::run_grandpa_voter(grandpa_config)?); - } - } - } + let grandpa_config = sc_finality_grandpa::Config { + // FIXME #1578 make this available through chainspec + gossip_duration: Duration::from_millis(333), + justification_period: 512, + name: Some(name), + observer_enabled: false, + keystore, + is_authority: role.is_authority(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }; + + if enable_grandpa { + // start the full GRANDPA voter + // NOTE: non-authorities could run the GRANDPA observer protocol, but at + // this point the full voter should provide better guarantees of block + // and vote data availability than the observer. The observer has not + // been tested extensively yet and having most nodes in a network run it + // could lead to finality stalls. + let grandpa_config = sc_finality_grandpa::GrandpaParams { + config: grandpa_config, + link: grandpa_link, + network, + voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), + prometheus_registry, + shared_voter_state: SharedVoterState::empty(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }; + + // the GRANDPA voter task is considered infallible, i.e. + // if it fails we take down the service with it. + task_manager.spawn_essential_handle().spawn_blocking( + "grandpa-voter", + sc_finality_grandpa::run_grandpa_voter(grandpa_config)? + ); } network_starter.start_network(); Ok(task_manager) } -/// Builds a new service for a full client. -pub fn new_full(config: Configuration, enable_dev_signer: bool) -> Result { - new_full_base(config, enable_dev_signer) -} +/// Builds a new service for a light client. +pub fn new_light(mut config: Configuration) -> Result { + let telemetry = config.telemetry_endpoints.clone() + .filter(|x| !x.is_empty()) + .map(|endpoints| -> Result<_, sc_telemetry::Error> { + let worker = TelemetryWorker::new(16)?; + let telemetry = worker.handle().new_telemetry(endpoints); + Ok((worker, telemetry)) + }) + .transpose()?; -pub fn new_light_base(config: Configuration) -> Result { let (client, backend, keystore_container, mut task_manager, on_demand) = - sc_service::new_light_parts::(&config)?; + sc_service::new_light_parts::( + &config, + telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), + )?; - let select_chain = sc_consensus::LongestChain::new(backend.clone()); + let mut telemetry = telemetry + .map(|(worker, telemetry)| { + task_manager.spawn_handle().spawn("telemetry", worker.run()); + telemetry + }); + + config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config()); - let telemetry_span = TelemetrySpan::new(); - let _telemetry_span_entered = telemetry_span.enter(); + let select_chain = sc_consensus::LongestChain::new(backend.clone()); let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( config.transaction_pool.clone(), @@ -389,28 +352,32 @@ pub fn new_light_base(config: Configuration) -> Result), select_chain.clone())?; - - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( - sc_consensus_aura::slot_duration(&*client)?, - grandpa_block_import.clone(), - Some(Box::new(grandpa_block_import)), + let (grandpa_block_import, _) = sc_finality_grandpa::block_import( client.clone(), - InherentDataProviders::new(), - &task_manager.spawn_handle(), - config.prometheus_registry(), - sp_consensus::NeverCanAuthor, + &(client.clone() as Arc<_>), + select_chain.clone(), + telemetry.as_ref().map(|x| x.handle()), )?; - let light_deps = crate::rpc::LightDeps { - remote_blockchain: backend.remote_blockchain(), - fetcher: on_demand.clone(), - client: client.clone(), - pool: transaction_pool.clone(), - }; + let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new( + grandpa_block_import.clone(), + client.clone(), + ); - let rpc_extensions = crate::rpc::create_light(light_deps); + let import_queue = sc_consensus_aura::import_queue::( + ImportQueueParams { + block_import: aura_block_import.clone(), + justification_import: Some(Box::new(grandpa_block_import.clone())), + client: client.clone(), + inherent_data_providers: InherentDataProviders::new(), + spawner: &task_manager.spawn_essential_handle(), + can_author_with: sp_consensus::NeverCanAuthor, + slot_duration: sc_consensus_aura::slot_duration(&*client)?, + registry: config.prometheus_registry(), + check_for_equivocation: Default::default(), + telemetry: telemetry.as_ref().map(|x| x.handle()), + }, + )?; let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { @@ -425,11 +392,7 @@ pub fn new_light_base(config: Configuration) -> Result Result Result Result { - new_light_base(config) -} diff --git a/pallets/merkle/src/mock.rs b/pallets/merkle/src/mock.rs index 8c215406..8fb9c0fa 100644 --- a/pallets/merkle/src/mock.rs +++ b/pallets/merkle/src/mock.rs @@ -22,9 +22,9 @@ construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: system::{Module, Call, Config, Storage, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - MerkleTrees: pallet_merkle::{Module, Call, Storage, Event}, + System: system::{Pallet, Call, Config, Storage, Event}, + Balances: balances::{Pallet, Call, Storage, Config, Event}, + MerkleTrees: pallet_merkle::{Pallet, Call, Storage, Event}, } ); @@ -58,6 +58,7 @@ impl frame_system::Config for Test { type SS58Prefix = Prefix; type SystemWeightInfo = (); type Version = (); + type OnSetCode = (); } parameter_types! { diff --git a/pallets/mixer/Cargo.toml b/pallets/mixer/Cargo.toml index 54a10a3b..d54bf1f2 100644 --- a/pallets/mixer/Cargo.toml +++ b/pallets/mixer/Cargo.toml @@ -16,13 +16,16 @@ frame-support = { default-features = false, version = '3.0.0' } frame-system = { default-features = false, version = '3.0.0' } sp-std = { default-features = false, version = "3.0.0" } sp-runtime = { default-features = false, version = '3.0.0' } + merkle = { package = "pallet-merkle", path = "../merkle", default-features = false } +tokens = { package = "pallet-tokens", path = "../tokens", default-features = false } + + serde = { version = "1.0.101", optional = true, features = ["derive"] } merlin = { version = "2.0.0", default-features = false } frame-benchmarking = { default-features = false, version = "3.0.0", optional = true } orml-traits = { version = "0.4.0", default-features = false } orml-currencies = { version = "0.4.0", default-features = false } -orml-tokens = { version = "0.4.0", default-features = false } [dependencies.bulletproofs] version = "2.0.0" @@ -55,7 +58,7 @@ std = [ "balances/std", "frame-support/std", "frame-system/std", - "orml-tokens/std", + "tokens/std", "frame-benchmarking/std", "merkle/std", ] diff --git a/pallets/mixer/src/lib.rs b/pallets/mixer/src/lib.rs index 4218bc7f..03eccc8b 100644 --- a/pallets/mixer/src/lib.rs +++ b/pallets/mixer/src/lib.rs @@ -57,19 +57,18 @@ pub mod weights; pub mod traits; use codec::{Decode, Encode}; -use frame_support::{debug, dispatch, ensure, traits::Get, weights::Weight}; +use frame_support::{dispatch, ensure, traits::Get, weights::Weight, PalletId}; use frame_system::ensure_signed; use merkle::{ utils::{ keys::{Commitment, ScalarData}, permissions::ensure_admin, }, - Module as MerkleModule, Tree as TreeTrait, + Tree as TreeTrait, Pallet as MerklePallet, }; use orml_traits::MultiCurrency; use sp_runtime::{ traits::{AccountIdConversion, Zero}, - ModuleId, }; use sp_std::prelude::*; use traits::ExtendedMixer; @@ -83,13 +82,13 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - use sp_runtime::DispatchResultWithInfo; + /// The pallet's configuration trait. #[pallet::config] - pub trait Config: frame_system::Config + merkle::Config + orml_tokens::Config + orml_currencies::Config { + pub trait Config: frame_system::Config + merkle::Config + orml_currencies::Config { #[pallet::constant] - type ModuleId: Get; + type PalletId: Get; /// The overarching event type. type Event: IsType<::Event> + From>; /// Currency type for taking deposits @@ -116,7 +115,7 @@ pub mod pallet { #[pallet::getter(fn initialised)] pub type Initialised = StorageValue<_, bool, ValueQuery>; - /// The map of mixer treess to their metadata + /// The map of mixer trees to their metadata #[pallet::storage] #[pallet::getter(fn mixer_trees)] pub type MixerTrees = StorageMap<_, Blake2_128Concat, T::TreeId, MixerInfo, ValueQuery>; @@ -137,10 +136,6 @@ pub mod pallet { #[pallet::getter(fn total_value_locked)] pub type TotalValueLocked = StorageMap<_, Blake2_128Concat, T::TreeId, BalanceOf, ValueQuery>; - // /// Old name generated by `decl_event`. - // #[deprecated(note = "use `Event` instead")] - // pub type RawEvent = Event; - #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] #[pallet::metadata(T::AccountId = "AccountId", T::TreeId = "TreeId", BalanceOf = "Balance")] @@ -211,17 +206,17 @@ pub mod pallet { // this block) if none happened, carry over previous Merkle roots for the cache. let mixer_ids = MixerTreeIds::::get(); for i in 0..mixer_ids.len() { - let cached_roots = >::cached_roots(_n, mixer_ids[i]); + let cached_roots = >::cached_roots(_n, mixer_ids[i]); // if there are no cached roots, carry forward the current root if cached_roots.len() == 0 { - let _ = >::add_root_to_cache(mixer_ids[i], _n); + let _ = >::add_root_to_cache(mixer_ids[i], _n); } } } else { match Self::initialize() { Ok(_) => {} Err(e) => { - debug::native::error!("Error initialising: {:?}", e); + // frame_support::debug::native::error!("Error initialising: {:?}", e); } } } @@ -250,7 +245,7 @@ pub mod pallet { ) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; ensure!(Self::initialised(), Error::::NotInitialised); - ensure!(!>::stopped(mixer_id), Error::::MixerStopped); + ensure!(!>::stopped(mixer_id), Error::::MixerStopped); // get mixer info, should always exist if the module is initialized let mut mixer_info = Self::get_mixer(mixer_id)?; // ensure the sender has enough balance to cover deposit @@ -293,7 +288,7 @@ pub mod pallet { let sender = ensure_signed(origin)?; ensure!(Self::initialised(), Error::::NotInitialised); ensure!( - !>::stopped(withdraw_proof.mixer_id), + !>::stopped(withdraw_proof.mixer_id), Error::::MixerStopped ); let recipient = withdraw_proof.recipient.unwrap_or(sender.clone()); @@ -497,9 +492,9 @@ impl MixerInfo { } } -impl Module { +impl Pallet { pub fn account_id() -> T::AccountId { - T::ModuleId::get().into_account() + T::PalletId::get().into_account() } pub fn get_mixer(mixer_id: T::TreeId) -> Result, dispatch::DispatchError> { @@ -544,7 +539,7 @@ impl Module { impl ExtendedMixer, BalanceOf> for Pallet { fn create_new( - account_id: T::AccountId, + _account_id: T::AccountId, currency_id: CurrencyIdOf, size: BalanceOf, ) -> Result<(), dispatch::DispatchError> { diff --git a/pallets/mixer/src/mock.rs b/pallets/mixer/src/mock.rs index 4646275a..e6bb2fe2 100644 --- a/pallets/mixer/src/mock.rs +++ b/pallets/mixer/src/mock.rs @@ -1,16 +1,16 @@ use super::*; use crate as pallet_mixer; use frame_benchmarking::whitelisted_caller; -use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild, weights::Weight}; +use frame_support::{construct_runtime, parameter_types, weights::Weight, PalletId}; use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; use merkle::weights::Weights as MerkleWeights; use orml_currencies::BasicCurrencyAdapter; -use orml_traits::parameter_type_with_key; + use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, - ModuleId, Perbill, + Perbill, }; use weights::Weights; @@ -30,12 +30,12 @@ construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: frame_system::{Module, Call, Config, Storage, Event}, - Balances: balances::{Module, Call, Storage, Config, Event}, - MerkleTrees: merkle::{Module, Call, Storage, Event}, - Mixer: pallet_mixer::{Module, Call, Storage, Event}, - Currencies: orml_currencies::{Module, Storage, Event}, - Tokens: orml_tokens::{Module, Storage, Event, Config}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: balances::{Pallet, Call, Storage, Config, Event}, + MerkleTrees: merkle::{Pallet, Call, Storage, Event}, + Mixer: pallet_mixer::{Pallet, Call, Storage, Event}, + Currencies: orml_currencies::{Pallet, Storage, Event}, + Tokens: tokens::{Pallet, Storage, Event}, } ); @@ -69,6 +69,7 @@ impl frame_system::Config for Test { type PalletInfo = PalletInfo; type SS58Prefix = Prefix; type SystemWeightInfo = (); + type OnSetCode = (); type Version = (); } @@ -91,26 +92,35 @@ impl balances::Config for Test { type WeightInfo = (); } -parameter_type_with_key! { - pub ExistentialDepositMap: |k: CurrencyId| -> Balance { - match k { - _ => 2, - } - }; +parameter_types! { + pub const NativeCurrencyId: CurrencyId = 0; } parameter_types! { - pub const NativeCurrencyId: CurrencyId = 0; + pub const TokensPalletId: PalletId = PalletId(*b"py/token"); + pub const CurrencyDeposit: u64 = 0; + pub const ApprovalDeposit: u64 = 1; + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 1; + pub const MetadataDepositPerByte: u64 = 1; } -impl orml_tokens::Config for Test { - type Amount = Amount; +impl tokens::Config for Test { + type PalletId = TokensPalletId; + type Event = Event; type Balance = Balance; + type Amount = i128; type CurrencyId = CurrencyId; - type Event = Event; - type ExistentialDeposits = ExistentialDepositMap; + type NativeCurrency = BasicCurrencyAdapter; + type ForceOrigin = frame_system::EnsureRoot; + type CurrencyDeposit = CurrencyDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = StringLimit; type OnDust = (); type WeightInfo = (); + type Extra = (); } impl orml_currencies::Config for Test { @@ -130,7 +140,7 @@ impl merkle::Config for Test { } parameter_types! { - pub const MixerModuleId: ModuleId = ModuleId(*b"py/mixer"); + pub const MixerPalletId: PalletId = PalletId(*b"py/mixer"); pub const DefaultAdmin: u64 = 4; pub MixerSizes: Vec = [1_000, 10_000, 100_000, 1_000_000].to_vec(); } @@ -141,38 +151,39 @@ impl Config for Test { type DepositLength = MinimumDepositLength; type Event = Event; type MixerSizes = MixerSizes; - type ModuleId = MixerModuleId; + type PalletId = MixerPalletId; type NativeCurrencyId = NativeCurrencyId; type Tree = MerkleTrees; type WeightInfo = Weights; } +pub type TokenPallet = tokens::Pallet; pub type MixerCall = pallet_mixer::Call; // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { use balances::GenesisConfig as BalancesConfig; - use orml_tokens::GenesisConfig as TokensConfig; + // use tokens::GenesisConfig as TokensConfig; let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); BalancesConfig:: { // Total issuance will be 200 with treasury account initialized at ED. balances: vec![ - (0, 1_000_000_000), - (1, 1_000_000_000), - (2, 1_000_000_000), + (0, 1_000_000_000_000_000_000), + (1, 1_000_000_000_000_000_000), + (2, 1_000_000_000_000_000_000), (whitelisted_caller(), 1_000_000_000), ], } .assimilate_storage(&mut t) .unwrap(); - let token_currency_id: CurrencyId = 1; - TokensConfig:: { - endowed_accounts: vec![(0, token_currency_id, 1_000_000_000)], - } - .assimilate_storage(&mut t) - .unwrap(); + let _token_currency_id: CurrencyId = 1; + // TokensConfig:: { + // endowed_accounts: vec![(0, token_currency_id, 1_000_000_000)], + // } + // .assimilate_storage(&mut t) + // .unwrap(); t.into() } diff --git a/pallets/mixer/src/tests.rs b/pallets/mixer/src/tests.rs index ae35810b..0b397ba7 100644 --- a/pallets/mixer/src/tests.rs +++ b/pallets/mixer/src/tests.rs @@ -22,6 +22,8 @@ use merkle::{ }; use merlin::Transcript; use sp_runtime::{traits::BadOrigin, DispatchError}; +use crate::mock::TokenPallet; +use tokens::ExtendedTokenSystem; fn default_hasher(num_gens: usize) -> Poseidon { let width = 6; @@ -333,9 +335,17 @@ fn should_not_have_cache_once_cache_length_exceeded() { fn should_make_mixer_with_non_native_token() { new_test_ext().execute_with(|| { let currency_id = 1; + assert_ok!(>::create( + currency_id, + 1, // owner + 1, // admin + 1 // min_balance + )); + + assert_ok!(>::mint(1, 0, 10000000)); assert_ok!(Mixer::initialize()); assert_ok!(>::create_new( - 4, + 1, currency_id, 1_000 )); diff --git a/pallets/tokens/Cargo.toml b/pallets/tokens/Cargo.toml new file mode 100644 index 00000000..4db74a25 --- /dev/null +++ b/pallets/tokens/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "pallet-tokens" +version = "3.0.0" +authors = ["Drew Stone "] +edition = "2018" + +[package.metadata.docs.rs] +targets = ['x86_64-unknown-linux-gnu'] + +[dependencies] +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +pallet-balances = { version = "3.0.0", default-features = false } +pallet-treasury = { version = "3.0.0", default-features = false } +frame-support = { default-features = false, version = '3.0.0' } +frame-system = { default-features = false, version = '3.0.0' } +sp-std = { default-features = false, version = "3.0.0" } +sp-runtime = { default-features = false, version = '3.0.0' } +serde = { version = "1.0.101", optional = true, features = ["derive"] } +frame-benchmarking = { default-features = false, version = "3.0.0", optional = true } +orml-traits = { version = "0.4.0", default-features = false } + +[dependencies.bencher] +version = "0.1.5" + +[dev-dependencies] +sp-core = { default-features = false, version = '3.0.0' } +sp-io = { default-features = false, version = '3.0.0' } +orml-currencies = { version = "0.4.0", default-features = false } + +[features] +default = ['std'] +std = [ + "serde", + "codec/std", + "pallet-balances/std", + "pallet-treasury/std", + "frame-support/std", + "frame-system/std", + "frame-benchmarking/std", + "orml-traits/std", +] +runtime-benchmarks = [ + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", +] diff --git a/pallets/tokens/src/basic_currency.rs b/pallets/tokens/src/basic_currency.rs new file mode 100644 index 00000000..2671e661 --- /dev/null +++ b/pallets/tokens/src/basic_currency.rs @@ -0,0 +1,177 @@ +use super::*; +use sp_std::{ + convert::{TryFrom, TryInto}, + fmt::Debug, + marker, result, +}; +use codec::Codec; +use orml_traits::{ + arithmetic::{Signed, SimpleArithmetic}, + BalanceStatus, BasicCurrency, BasicCurrencyExtended, BasicLockableCurrency, BasicReservableCurrency, + LockIdentifier +}; +use sp_runtime::{ + traits::{CheckedSub, MaybeSerializeDeserialize}, + DispatchError, DispatchResult, +}; +use frame_support::{ + traits::{ + Currency as PalletCurrency, ExistenceRequirement, LockableCurrency as PalletLockableCurrency, + ReservableCurrency as PalletReservableCurrency, WithdrawReasons, + }, +}; + +/// Adapt other currency traits implementation to `BasicCurrency`. +pub struct BasicCurrencyAdapter(marker::PhantomData<(T, Currency, Amount, Moment)>); + +type PalletBalanceOf = >::Balance; + +// Adapt `frame_support::traits::Currency` +impl BasicCurrency + for BasicCurrencyAdapter +where + Currency: PalletCurrency, + T: Config, +{ + type Balance = PalletBalanceOf; + + fn minimum_balance() -> Self::Balance { + Currency::minimum_balance() + } + + fn total_issuance() -> Self::Balance { + Currency::total_issuance() + } + + fn total_balance(who: &AccountId) -> Self::Balance { + Currency::total_balance(who) + } + + fn free_balance(who: &AccountId) -> Self::Balance { + Currency::free_balance(who) + } + + fn ensure_can_withdraw(who: &AccountId, amount: Self::Balance) -> DispatchResult { + let new_balance = Self::free_balance(who) + .checked_sub(&amount) + .ok_or(Error::::BalanceLow)?; + + Currency::ensure_can_withdraw(who, amount, WithdrawReasons::all(), new_balance) + } + + fn transfer(from: &AccountId, to: &AccountId, amount: Self::Balance) -> DispatchResult { + Currency::transfer(from, to, amount, ExistenceRequirement::AllowDeath) + } + + fn deposit(who: &AccountId, amount: Self::Balance) -> DispatchResult { + let _ = Currency::deposit_creating(who, amount); + Ok(()) + } + + fn withdraw(who: &AccountId, amount: Self::Balance) -> DispatchResult { + Currency::withdraw(who, amount, WithdrawReasons::all(), ExistenceRequirement::AllowDeath).map(|_| ()) + } + + fn can_slash(who: &AccountId, amount: Self::Balance) -> bool { + Currency::can_slash(who, amount) + } + + fn slash(who: &AccountId, amount: Self::Balance) -> Self::Balance { + let (_, gap) = Currency::slash(who, amount); + gap + } +} + +// Adapt `frame_support::traits::Currency` +impl BasicCurrencyExtended + for BasicCurrencyAdapter +where + Amount: Signed + + TryInto> + + TryFrom> + + SimpleArithmetic + + Codec + + Copy + + MaybeSerializeDeserialize + + Debug + + Default, + Currency: PalletCurrency, + T: Config, +{ + type Amount = Amount; + + fn update_balance(who: &AccountId, by_amount: Self::Amount) -> DispatchResult { + let by_balance = by_amount + .abs() + .try_into() + .map_err(|_| Error::::AmountIntoBalanceFailed)?; + if by_amount.is_positive() { + Self::deposit(who, by_balance) + } else { + Self::withdraw(who, by_balance) + } + } +} + +// Adapt `frame_support::traits::LockableCurrency` +impl BasicLockableCurrency + for BasicCurrencyAdapter +where + Currency: PalletLockableCurrency, + T: Config, +{ + type Moment = Moment; + + fn set_lock(lock_id: LockIdentifier, who: &AccountId, amount: Self::Balance) -> DispatchResult { + Currency::set_lock(lock_id, who, amount, WithdrawReasons::all()); + Ok(()) + } + + fn extend_lock(lock_id: LockIdentifier, who: &AccountId, amount: Self::Balance) -> DispatchResult { + Currency::extend_lock(lock_id, who, amount, WithdrawReasons::all()); + Ok(()) + } + + fn remove_lock(lock_id: LockIdentifier, who: &AccountId) -> DispatchResult { + Currency::remove_lock(lock_id, who); + Ok(()) + } +} + +// Adapt `frame_support::traits::ReservableCurrency` +impl BasicReservableCurrency + for BasicCurrencyAdapter +where + Currency: PalletReservableCurrency, + T: Config, +{ + fn can_reserve(who: &AccountId, value: Self::Balance) -> bool { + Currency::can_reserve(who, value) + } + + fn slash_reserved(who: &AccountId, value: Self::Balance) -> Self::Balance { + let (_, gap) = Currency::slash_reserved(who, value); + gap + } + + fn reserved_balance(who: &AccountId) -> Self::Balance { + Currency::reserved_balance(who) + } + + fn reserve(who: &AccountId, value: Self::Balance) -> DispatchResult { + Currency::reserve(who, value) + } + + fn unreserve(who: &AccountId, value: Self::Balance) -> Self::Balance { + Currency::unreserve(who, value) + } + + fn repatriate_reserved( + slashed: &AccountId, + beneficiary: &AccountId, + value: Self::Balance, + status: BalanceStatus, + ) -> result::Result { + Currency::repatriate_reserved(slashed, beneficiary, value, status) + } +} diff --git a/pallets/tokens/src/imbalance.rs b/pallets/tokens/src/imbalance.rs new file mode 100644 index 00000000..084a3b9a --- /dev/null +++ b/pallets/tokens/src/imbalance.rs @@ -0,0 +1,174 @@ +// wrapping these imbalances in a private module is necessary to ensure absolute +// privacy of the inner member. +use crate::{Config, TotalIssuance}; +use frame_support::traits::{Get, Imbalance, SameOrOther, TryDrop}; +use sp_runtime::traits::{Saturating, Zero}; +use sp_std::{marker, mem, result}; + +/// Opaque, move-only struct with private fields that serves as a token +/// denoting that funds have been created without any equal and opposite +/// accounting. +#[must_use] +pub struct PositiveImbalance>( + T::Balance, + marker::PhantomData, +); + +impl> PositiveImbalance { + /// Create a new positive imbalance from a balance. + pub fn new(amount: T::Balance) -> Self { + PositiveImbalance(amount, marker::PhantomData::) + } +} + +impl> Default for PositiveImbalance { + fn default() -> Self { + Self::zero() + } +} + +/// Opaque, move-only struct with private fields that serves as a token +/// denoting that funds have been destroyed without any equal and opposite +/// accounting. +#[must_use] +pub struct NegativeImbalance>( + T::Balance, + marker::PhantomData, +); + +impl> NegativeImbalance { + /// Create a new negative imbalance from a balance. + pub fn new(amount: T::Balance) -> Self { + NegativeImbalance(amount, marker::PhantomData::) + } +} + +impl> Default for NegativeImbalance { + fn default() -> Self { + Self::zero() + } +} + +impl> TryDrop for PositiveImbalance { + fn try_drop(self) -> result::Result<(), Self> { + self.drop_zero() + } +} + +impl> Imbalance for PositiveImbalance { + type Opposite = NegativeImbalance; + + fn zero() -> Self { + Self::new(Zero::zero()) + } + fn drop_zero(self) -> result::Result<(), Self> { + if self.0.is_zero() { + Ok(()) + } else { + Err(self) + } + } + fn split(self, amount: T::Balance) -> (Self, Self) { + let first = self.0.min(amount); + let second = self.0 - first; + + mem::forget(self); + (Self::new(first), Self::new(second)) + } + fn merge(mut self, other: Self) -> Self { + self.0 = self.0.saturating_add(other.0); + mem::forget(other); + + self + } + fn subsume(&mut self, other: Self) { + self.0 = self.0.saturating_add(other.0); + mem::forget(other); + } + // allow to make the impl same with `pallet-balances` + #[allow(clippy::comparison_chain)] + fn offset(self, other: Self::Opposite) -> SameOrOther { + let (a, b) = (self.0, other.0); + mem::forget((self, other)); + + if a > b { + SameOrOther::Same(Self::new(a - b)) + } else if b > a { + SameOrOther::Other(NegativeImbalance::new(b - a)) + } else { + SameOrOther::None + } + } + fn peek(&self) -> T::Balance { + self.0 + } +} + +impl> TryDrop for NegativeImbalance { + fn try_drop(self) -> result::Result<(), Self> { + self.drop_zero() + } +} + +impl> Imbalance for NegativeImbalance { + type Opposite = PositiveImbalance; + + fn zero() -> Self { + Self::new(Zero::zero()) + } + fn drop_zero(self) -> result::Result<(), Self> { + if self.0.is_zero() { + Ok(()) + } else { + Err(self) + } + } + fn split(self, amount: T::Balance) -> (Self, Self) { + let first = self.0.min(amount); + let second = self.0 - first; + + mem::forget(self); + (Self::new(first), Self::new(second)) + } + fn merge(mut self, other: Self) -> Self { + self.0 = self.0.saturating_add(other.0); + mem::forget(other); + + self + } + fn subsume(&mut self, other: Self) { + self.0 = self.0.saturating_add(other.0); + mem::forget(other); + } + // allow to make the impl same with `pallet-balances` + #[allow(clippy::comparison_chain)] + fn offset(self, other: Self::Opposite) -> SameOrOther { + let (a, b) = (self.0, other.0); + mem::forget((self, other)); + + if a > b { + SameOrOther::Same(Self::new(a - b)) + } else if b > a { + SameOrOther::Other(PositiveImbalance::new(b - a)) + } else { + SameOrOther::None + } + } + fn peek(&self) -> T::Balance { + self.0 + } +} + +impl> Drop for PositiveImbalance { + /// Basic drop handler will just square up the total issuance. + fn drop(&mut self) { + TotalIssuance::::mutate(GetCurrencyId::get(), |v| *v = v.saturating_add(self.0)); + } +} + +impl> Drop for NegativeImbalance { + /// Basic drop handler will just square up the total issuance. + fn drop(&mut self) { + TotalIssuance::::mutate(GetCurrencyId::get(), |v| *v = v.saturating_sub(self.0)); + } +} diff --git a/pallets/tokens/src/lib.rs b/pallets/tokens/src/lib.rs new file mode 100644 index 00000000..386b21dd --- /dev/null +++ b/pallets/tokens/src/lib.rs @@ -0,0 +1,2093 @@ +// A runtime module Groups with necessary imports + +// Feel free to remove or edit this file as needed. +// If you change the name of this file, make sure to update its references in +// runtime/src/lib.rs If you remove this file, you can remove those references + +// For more guidance on Substrate modules, see the example module +// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod weights; +// #[cfg(feature = "runtime-benchmarks")] +// mod benchmarking; +#[cfg(test)] +pub mod mock; +#[cfg(test)] +mod tests; + +mod basic_currency; +mod traits; +pub use traits::*; +mod types; +pub use types::*; +mod imbalance; +pub use imbalance::*; + +use sp_std::{ + convert::{Infallible, TryFrom, TryInto}, + marker, + prelude::*, + vec::Vec, +}; + +use sp_runtime::{ + traits::{ + AccountIdConversion, AtLeast32BitUnsigned, Bounded, CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, + Saturating, StaticLookup, Zero, + }, + RuntimeDebug, +}; +use codec::{Encode, Decode}; +use frame_support::{ensure, dispatch::{DispatchError, DispatchResult}, PalletId}; +use frame_support::{ + log, + traits::{ + Currency as PalletCurrency, ExistenceRequirement, Get, Imbalance, + LockableCurrency as PalletLockableCurrency, ReservableCurrency as PalletReservableCurrency, SignedImbalance, + WithdrawReasons, + }, + transactional, +}; + + +use orml_traits::{ + account::MergeAccount, + arithmetic::{self, Signed}, + BasicCurrencyExtended, BasicLockableCurrency, BasicReservableCurrency, + BalanceStatus, LockIdentifier, MultiCurrency, MultiCurrencyExtended, MultiLockableCurrency, + MultiReservableCurrency, +}; + +pub use weights::WeightInfo; +pub use pallet::*; + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + #[pallet::config] + /// The module configuration trait. + pub trait Config: frame_system::Config { + #[pallet::constant] + type PalletId: Get; + /// The overarching event type. + type Event: From> + IsType<::Event>; + + /// The balance type + type Balance: Parameter + Member + AtLeast32BitUnsigned + Default + Copy + MaybeSerializeDeserialize; + + /// The amount type, should be signed version of `Balance` + type Amount: Signed + + TryInto + + TryFrom + + Parameter + + Member + + arithmetic::SimpleArithmetic + + Default + + Copy + + MaybeSerializeDeserialize; + + /// The currency ID type + type CurrencyId: Parameter + Member + Copy + MaybeSerializeDeserialize + Ord; + + /// The native currency system + type NativeCurrency: BasicCurrencyExtended + + BasicLockableCurrency + + BasicReservableCurrency; + + /// The origin which may forcibly create or destroy an asset or otherwise alter privileged + /// attributes. + type ForceOrigin: EnsureOrigin; + + /// The basic amount of funds that must be reserved for an asset. + type CurrencyDeposit: Get; + + /// The basic amount of funds that must be reserved when adding metadata to your asset. + type MetadataDepositBase: Get; + + /// The additional funds that must be reserved for the number of bytes you store in your + /// metadata. + type MetadataDepositPerByte: Get; + + /// The amount of funds that must be reserved when creating a new approval. + type ApprovalDeposit: Get; + + /// The maximum length of a name or symbol stored on-chain. + type StringLimit: Get; + + /// Additional data to be stored with an account's asset balance. + type Extra: Member + Parameter + Default; + + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; + + /// The default account to send dust to. + type DustAccount: Get; + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + #[pallet::metadata(T::AccountId = "AccountId", T::Balance = "Balance", T::CurrencyId = "CurrencyId")] + pub enum Event { + /// Some asset class was created. \[asset_id, creator, owner\] + Created(T::CurrencyId, T::AccountId, T::AccountId), + /// Some assets were issued. \[asset_id, owner, total_supply\] + Issued(T::CurrencyId, T::AccountId, T::Balance), + /// Some assets were destroyed. \[asset_id, owner, balance\] + Burned(T::CurrencyId, T::AccountId, T::Balance), + /// Some account `who` was frozen. \[asset_id, who\] + Frozen(T::CurrencyId, T::AccountId), + /// Some account `who` was thawed. \[asset_id, who\] + Thawed(T::CurrencyId, T::AccountId), + /// Some asset `asset_id` was frozen. \[asset_id\] + TokenFrozen(T::CurrencyId), + /// Some asset `asset_id` was thawed. \[asset_id\] + TokenThawed(T::CurrencyId), + /// The management team changed \[asset_id, issuer, admin, freezer\] + TeamChanged(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId), + /// The owner changed \[asset_id, owner\] + OwnerChanged(T::CurrencyId, T::AccountId), + /// An asset class was destroyed. + Destroyed(T::CurrencyId), + /// Some asset class was force-created. \[asset_id, owner\] + ForceCreated(T::CurrencyId, T::AccountId), + /// New metadata has been set for an asset. \[asset_id, name, symbol, decimals, is_frozen\] + MetadataSet(T::CurrencyId, Vec, Vec, u8, bool), + /// Metadata has been cleared for an asset. \[asset_id\] + MetadataCleared(T::CurrencyId), + /// (Additional) funds have been approved for transfer to a destination account. + /// \[asset_id, source, delegate, amount\] + ApprovedTransfer(T::CurrencyId, T::AccountId, T::AccountId, T::Balance), + /// An approval for account `delegate` was cancelled by `owner`. + /// \[id, owner, delegate\] + ApprovalCancelled(T::CurrencyId, T::AccountId, T::AccountId), + /// An `amount` was transferred in its entirety from `owner` to `destination` by + /// the approved `delegate`. + /// \[id, owner, delegate, destination\] + TransferredApproved(T::CurrencyId, T::AccountId, T::AccountId, T::AccountId, T::Balance), + /// An asset has had its attributes changed by the `Force` origin. + /// \[id\] + CurrencyStatusChanged(T::CurrencyId), + /// Token transfer success. \[currency_id, from, to, amount\] + Transferred(T::CurrencyId, T::AccountId, T::AccountId, T::Balance), + /// An account was removed whose balance was non-zero but below + /// ExistentialDeposit, resulting in an outright loss. \[account, + /// currency_id, amount\] + DustLost(T::AccountId, T::CurrencyId, T::Balance), + /// Dust handler change success. \[currency_id, dust_type\] + DustHandlerChange(T::CurrencyId, DustHandlerType), + } + + #[pallet::error] + pub enum Error { + /// The token doesn't exist + TokenDoesntExist, + /// This operation will cause balance to overflow + BalanceOverflow, + /// This operation will cause total issuance to overflow + TotalIssuanceOverflow, + /// Cannot convert Amount into Balance type + AmountIntoBalanceFailed, + /// Failed because liquidity restrictions due to locking + LiquidityRestrictions, + /// Account still has active reserved + StillHasActiveReserved, + /// Account balance must be greater than or equal to the transfer amount. + BalanceLow, + /// Balance should be non-zero. + BalanceZero, + /// Amount to be transferred is below minimum existential deposit + BelowMinimum, + /// The signing account has no permission to do the operation. + NoPermission, + /// The given currency ID is unknown. + Unknown, + /// The origin account is frozen. + Frozen, + /// The token is frozen + TokenIsFrozen, + /// The currency ID is already taken. + InUse, + /// Invalid witness data given. + BadWitness, + /// Minimum balance should be non-zero. + MinBalanceZero, + /// A mint operation lead to an overflow. + Overflow, + /// No provider reference exists to allow a non-zero balance of a non-self-sufficient currency. + NoProvider, + /// Invalid metadata given. + BadMetadata, + /// No approval exists that would allow the transfer. + Unapproved, + /// The source account would not survive the transfer and it needs to stay alive. + WouldDie, + /// Invalid amount, + InvalidAmount + } + + #[pallet::storage] + #[pallet::getter(fn currency)] + /// Details of an asset. + pub(super) type Token = StorageMap< + _, + Blake2_128Concat, + T::CurrencyId, + TokenDetails, + >; + + #[pallet::storage] + #[pallet::getter(fn approvals)] + /// Approved balance transfers. First balance is the amount approved for transfer. Second + /// is the amount of `T::Currency` reserved for storing this. + pub(super) type Approvals = StorageDoubleMap< + _, + Blake2_128Concat, + T::CurrencyId, + Blake2_128Concat, + ApprovalKey, + Approval, + OptionQuery, + >; + + #[pallet::storage] + #[pallet::getter(fn metadata)] + /// Metadata of an currency. + pub(super) type Metadata = StorageMap< + _, + Blake2_128Concat, + T::CurrencyId, + TokenMetadata, + ValueQuery, + >; + + /// The total issuance of a token type. + #[pallet::storage] + #[pallet::getter(fn total_issuance)] + pub type TotalIssuance = StorageMap<_, Twox64Concat, T::CurrencyId, T::Balance, ValueQuery>; + + /// Any liquidity locks of a token type under an account. + /// NOTE: Should only be accessed when setting, changing and freeing a lock. + #[pallet::storage] + #[pallet::getter(fn locks)] + pub type Locks = StorageDoubleMap< + _, + Blake2_128Concat, + T::AccountId, + Twox64Concat, + T::CurrencyId, + Vec>, + ValueQuery, + >; + + /// The balance of an account under a token type. + /// + /// NOTE: If the total is ever zero, decrease account ref account. + /// + /// NOTE: This is only used in the case that this module is used to store + /// balances. + #[pallet::storage] + #[pallet::getter(fn accounts)] + pub type Accounts = StorageDoubleMap< + _, + Blake2_128Concat, + T::CurrencyId, + Twox64Concat, + T::AccountId, + AccountData, + ValueQuery, + >; + + /// The balance of an account under a token type. + /// + /// NOTE: If the total is ever zero, decrease account ref account. + /// + /// NOTE: This is only used in the case that this module is used to store + /// balances. + #[pallet::storage] + #[pallet::getter(fn account_currencies)] + pub type AccountCurrencies = StorageDoubleMap< + _, + Blake2_128Concat, + T::AccountId, + Twox64Concat, + T::CurrencyId, + bool, + ValueQuery, + >; + + #[pallet::hooks] + impl Hooks> for Pallet {} + + #[pallet::call] + impl Pallet { + /// Issue a new class of fungible assets from a public origin. + /// + /// This new asset class has no assets initially and its owner is the origin. + /// + /// The origin must be Signed and the sender must have sufficient funds free. + /// + /// Funds of sender are reserved by `CurrencyDeposit`. + /// + /// Parameters: + /// - `id`: The identifier of the new asset. This must not be currently in use to identify + /// an existing asset. + /// - `admin`: The admin of this class of assets. The admin is the initial address of each + /// member of the asset class's admin team. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// + /// Emits `Created` event when successful. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn create( + origin: OriginFor, + id: T::CurrencyId, + admin: ::Source, + min_balance: T::Balance, + ) -> DispatchResult { + let owner = ensure_signed(origin)?; + let admin = T::Lookup::lookup(admin)?; + + ensure!(!Token::::contains_key(id), Error::::InUse); + ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); + + let deposit = T::CurrencyDeposit::get(); + T::NativeCurrency::reserve(&owner, deposit)?; + + >::create( + id, + owner.clone(), + admin.clone(), + min_balance + )?; + Self::deposit_event(Event::Created(id, owner, admin)); + Ok(()) + } + + /// Issue a new class of fungible assets from a privileged origin. + /// + /// This new asset class has no assets initially. + /// + /// The origin must conform to `ForceOrigin`. + /// + /// Unlike `create`, no funds are reserved. + /// + /// - `id`: The identifier of the new asset. This must not be currently in use to identify + /// an existing asset. + /// - `owner`: The owner of this class of assets. The owner has full superuser permissions + /// over this asset, but may later change and configure the permissions using `transfer_ownership` + /// and `set_team`. + /// - `max_zombies`: The total number of accounts which may hold assets in this class yet + /// have no existential deposit. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// + /// Emits `ForceCreated` event when successful. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_create( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + min_balance: T::Balance, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + let owner = T::Lookup::lookup(owner)?; + + ensure!(!Token::::contains_key(id), Error::::InUse); + ensure!(!min_balance.is_zero(), Error::::MinBalanceZero); + + Token::::insert(id, TokenDetails { + owner: owner.clone(), + issuer: owner.clone(), + admin: owner.clone(), + freezer: owner.clone(), + supply: Zero::zero(), + deposit: Zero::zero(), + min_balance, + approvals: 0, + is_frozen: false, + dust_type: DustHandlerType::Transfer(T::DustAccount::get()), + }); + Self::deposit_event(Event::ForceCreated(id, owner)); + Ok(()) + } + + /// Destroy a class of fungible assets. + /// + /// The origin must conform to `ForceOrigin` or must be Signed and the sender must be the + /// owner of the asset `id`. + /// + /// - `id`: The identifier of the asset to be destroyed. This must identify an existing + /// asset. + /// + /// Emits `Destroyed` event when successful. + /// + /// Weight: `O(c + p + a)` where: + /// - `c = (witness.accounts - witness.sufficients)` + /// - `s = witness.sufficients` + /// - `a = witness.approvals` + #[pallet::weight(5_000_000)] + pub(super) fn destroy( + origin: OriginFor, + id: T::CurrencyId, + ) -> DispatchResult { + let maybe_check_owner = match T::ForceOrigin::try_origin(origin) { + Ok(_) => None, + Err(origin) => Some(ensure_signed(origin)?), + }; + // TODO: Ensure we clean up everything + Token::::try_mutate_exists(id, |maybe_details| { + let details = maybe_details.take().ok_or(Error::::Unknown)?; + if let Some(check_owner) = maybe_check_owner { + ensure!(details.owner == check_owner, Error::::NoPermission); + } + + for (who, _v) in Accounts::::drain_prefix(id) { + Self::dead_account(id, &who); + } + + let metadata = Metadata::::take(&id); + T::NativeCurrency::unreserve( + &details.owner, + details.deposit.saturating_add(metadata.deposit) + ); + + Approvals::::remove_prefix(&id); + Self::deposit_event(Event::Destroyed(id)); + + // NOTE: could use postinfo to reflect the actual number of accounts/sufficient/approvals + Ok(()) + }) + } + + /// Mint assets of a particular class. + /// + /// The origin must be Signed and the sender must be the Issuer of the asset `id`. + /// + /// - `id`: The identifier of the asset to have some amount minted. + /// - `beneficiary`: The account to be credited with the minted assets. + /// - `amount`: The amount of the asset to be minted. + /// + /// Emits `Destroyed` event when successful. + /// + /// Weight: `O(1)` + /// Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. + #[pallet::weight(5_000_000)] + pub(super) fn mint( + origin: OriginFor, + id: T::CurrencyId, + beneficiary: ::Source, + amount: T::Balance + ) -> DispatchResult { + let sender = ensure_signed(origin)?; + let beneficiary = T::Lookup::lookup(beneficiary)?; + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(sender == details.issuer, Error::::NoPermission); + ensure!( + Self::total_balance(id, &beneficiary).saturating_add(amount) >= details.min_balance, + Error::::BelowMinimum + ); + >::mint(id, beneficiary.clone(), amount)?; + Self::deposit_event(Event::Issued(id, beneficiary, amount)); + Ok(()) + } + + /// Reduce the balance of `who` by as much as possible up to `amount` assets of `id`. + /// + /// Origin must be Signed and the sender should be the Manager of the asset `id`. + /// + /// Bails with `BalanceZero` if the `who` is already dead. + /// + /// - `id`: The identifier of the asset to have some amount burned. + /// - `who`: The account to be debited from. + /// - `amount`: The maximum amount by which `who`'s balance should be reduced. + /// + /// Emits `Burned` with the actual amount burned. If this takes the balance to below the + /// minimum for the asset, then the amount burned is increased to take it to zero. + /// + /// Weight: `O(1)` + /// Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. + #[pallet::weight(5_000_000)] + pub(super) fn burn( + origin: OriginFor, + id: T::CurrencyId, + who: ::Source, + amount: T::Balance + ) -> DispatchResult { + let sender = ensure_signed(origin)?; + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(sender == details.admin, Error::::NoPermission); + let who = T::Lookup::lookup(who)?; + >::burn(id, who.clone(), amount)?; + Self::deposit_event(Event::Burned(id, who, amount)); + Ok(()) + } + + /// Disallow further unprivileged transfers from an account. + /// + /// Origin must be Signed and the sender should be the Freezer of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// - `who`: The account to be frozen. + /// + /// Emits `Frozen`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn freeze( + origin: OriginFor, + id: T::CurrencyId, + who: ::Source + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + let d = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.freezer, Error::::NoPermission); + let who = T::Lookup::lookup(who)?; + ensure!(Accounts::::contains_key(id, &who), Error::::BalanceZero); + + Accounts::::mutate(id, &who, |a| a.is_frozen = true); + + Self::deposit_event(Event::::Frozen(id, who)); + Ok(()) + } + + /// Allow unprivileged transfers from an account again. + /// + /// Origin must be Signed and the sender should be the Admin of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// - `who`: The account to be unfrozen. + /// + /// Emits `Thawed`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn thaw( + origin: OriginFor, + id: T::CurrencyId, + who: ::Source + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &details.admin, Error::::NoPermission); + let who = T::Lookup::lookup(who)?; + ensure!(Accounts::::contains_key(id, &who), Error::::BalanceZero); + + Accounts::::mutate(id, &who, |a| a.is_frozen = false); + + Self::deposit_event(Event::::Thawed(id, who)); + Ok(()) + } + + /// Disallow further unprivileged transfers for the asset class. + /// + /// Origin must be Signed and the sender should be the Freezer of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// + /// Emits `Frozen`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn freeze_asset( + origin: OriginFor, + id: T::CurrencyId + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + Token::::try_mutate(id, |maybe_details| { + let d = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &d.freezer, Error::::NoPermission); + + d.is_frozen = true; + + Self::deposit_event(Event::::TokenFrozen(id)); + Ok(()) + }) + } + + /// Allow unprivileged transfers for the asset again. + /// + /// Origin must be Signed and the sender should be the Admin of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// + /// Emits `Thawed`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn thaw_asset( + origin: OriginFor, + id: T::CurrencyId + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + Token::::try_mutate(id, |maybe_details| { + let d = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &d.admin, Error::::NoPermission); + + d.is_frozen = false; + + Self::deposit_event(Event::::TokenThawed(id)); + Ok(()) + }) + } + + /// Change the Owner of an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The new Owner of this asset. + /// + /// Emits `OwnerChanged`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn transfer_ownership( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + let owner = T::Lookup::lookup(owner)?; + + Token::::try_mutate(id, |maybe_details| { + let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &details.owner, Error::::NoPermission); + if details.owner == owner { return Ok(()) } + + let metadata_deposit = Metadata::::get(id).deposit; + let deposit = details.deposit + metadata_deposit; + + // Move the deposit to the new owner. + T::NativeCurrency::repatriate_reserved( + &details.owner, + &owner, + deposit, + BalanceStatus::Reserved + )?; + + details.owner = owner.clone(); + + Self::deposit_event(Event::OwnerChanged(id, owner)); + Ok(()) + }) + } + + /// Change the Issuer, Admin and Freezer of an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// - `id`: The identifier of the asset to be frozen. + /// - `issuer`: The new Issuer of this asset. + /// - `admin`: The new Admin of this asset. + /// - `freezer`: The new Freezer of this asset. + /// + /// Emits `TeamChanged`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn set_team( + origin: OriginFor, + id: T::CurrencyId, + issuer: ::Source, + admin: ::Source, + freezer: ::Source, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + let issuer = T::Lookup::lookup(issuer)?; + let admin = T::Lookup::lookup(admin)?; + let freezer = T::Lookup::lookup(freezer)?; + + Token::::try_mutate(id, |maybe_details| { + let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &details.owner, Error::::NoPermission); + + details.issuer = issuer.clone(); + details.admin = admin.clone(); + details.freezer = freezer.clone(); + + Self::deposit_event(Event::TeamChanged(id, issuer, admin, freezer)); + Ok(()) + }) + } + + /// Set the metadata for an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// Funds of sender are reserved according to the formula: + /// `MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into + /// account any already reserved funds. + /// + /// - `id`: The identifier of the asset to update. + /// - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. + /// - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. + /// - `decimals`: The number of decimals this asset uses to represent one unit. + /// + /// Emits `MetadataSet`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn set_metadata( + origin: OriginFor, + id: T::CurrencyId, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + ensure!(name.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + ensure!(symbol.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + + let d = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.owner, Error::::NoPermission); + + Metadata::::try_mutate_exists(id, |metadata| { + ensure!(metadata.as_ref().map_or(true, |m| !m.is_frozen), Error::::NoPermission); + + let old_deposit = metadata.take().map_or(Zero::zero(), |m| m.deposit); + let new_deposit = T::MetadataDepositPerByte::get() + .saturating_mul(((name.len() + symbol.len()) as u32).into()) + .saturating_add(T::MetadataDepositBase::get()); + + if new_deposit > old_deposit { + T::NativeCurrency::reserve(&origin, new_deposit - old_deposit)?; + } else { + T::NativeCurrency::unreserve(&origin, old_deposit - new_deposit); + } + + *metadata = Some(TokenMetadata { + deposit: new_deposit, + name: name.clone(), + symbol: symbol.clone(), + decimals, + is_frozen: false, + }); + + Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, false)); + Ok(()) + }) + } + + /// Clear the metadata for an asset. + /// + /// Origin must be Signed and the sender should be the Owner of the asset `id`. + /// + /// Any deposit is freed for the asset owner. + /// + /// - `id`: The identifier of the asset to clear. + /// + /// Emits `MetadataCleared`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn clear_metadata( + origin: OriginFor, + id: T::CurrencyId, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + let d = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.owner, Error::::NoPermission); + + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; + T::NativeCurrency::unreserve(&d.owner, deposit); + Self::deposit_event(Event::MetadataCleared(id)); + Ok(()) + }) + } + + /// Force the metadata for an asset to some value. + /// + /// Origin must be ForceOrigin. + /// + /// Any deposit is left alone. + /// + /// - `id`: The identifier of the asset to update. + /// - `name`: The user friendly name of this asset. Limited in length by `StringLimit`. + /// - `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`. + /// - `decimals`: The number of decimals this asset uses to represent one unit. + /// + /// Emits `MetadataSet`. + /// + /// Weight: `O(N + S)` where N and S are the length of the name and symbol respectively. + #[pallet::weight(5_000_000)] + pub(super) fn force_set_metadata( + origin: OriginFor, + id: T::CurrencyId, + name: Vec, + symbol: Vec, + decimals: u8, + is_frozen: bool, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + + ensure!(name.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + ensure!(symbol.len() <= T::StringLimit::get() as usize, Error::::BadMetadata); + + ensure!(Token::::contains_key(id), Error::::Unknown); + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().map_or(Zero::zero(), |m| m.deposit); + *metadata = Some(TokenMetadata { + deposit, + name: name.clone(), + symbol: symbol.clone(), + decimals, + is_frozen, + }); + + Self::deposit_event(Event::MetadataSet(id, name, symbol, decimals, is_frozen)); + Ok(()) + }) + } + + /// Clear the metadata for an asset. + /// + /// Origin must be ForceOrigin. + /// + /// Any deposit is returned. + /// + /// - `id`: The identifier of the asset to clear. + /// + /// Emits `MetadataCleared`. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_clear_metadata( + origin: OriginFor, + id: T::CurrencyId, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + + let d = Token::::get(id).ok_or(Error::::Unknown)?; + Metadata::::try_mutate_exists(id, |metadata| { + let deposit = metadata.take().ok_or(Error::::Unknown)?.deposit; + T::NativeCurrency::unreserve(&d.owner, deposit); + Self::deposit_event(Event::MetadataCleared(id)); + Ok(()) + }) + } + + /// Alter the attributes of a given asset. + /// + /// Origin must be `ForceOrigin`. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The new Owner of this asset. + /// - `issuer`: The new Issuer of this asset. + /// - `admin`: The new Admin of this asset. + /// - `freezer`: The new Freezer of this asset. + /// - `min_balance`: The minimum balance of this new asset that any single account must + /// have. If an account's balance is reduced below this, then it collapses to zero. + /// - `is_frozen`: Whether this asset class is frozen except for permissioned/admin + /// instructions. + /// + /// Emits `CurrencyStatusChanged` with the identity of the asset. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_asset_status( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + issuer: ::Source, + admin: ::Source, + freezer: ::Source, + min_balance: T::Balance, + is_frozen: bool, + ) -> DispatchResult { + T::ForceOrigin::ensure_origin(origin)?; + + Token::::try_mutate(id, |maybe_asset| { + let mut asset = maybe_asset.take().ok_or(Error::::Unknown)?; + asset.owner = T::Lookup::lookup(owner)?; + asset.issuer = T::Lookup::lookup(issuer)?; + asset.admin = T::Lookup::lookup(admin)?; + asset.freezer = T::Lookup::lookup(freezer)?; + asset.min_balance = min_balance; + asset.is_frozen = is_frozen; + *maybe_asset = Some(asset); + + Self::deposit_event(Event::CurrencyStatusChanged(id)); + Ok(()) + }) + } + + /// Approve an amount of asset for transfer by a delegated third-party account. + /// + /// Origin must be Signed. + /// + /// Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account + /// for the purpose of holding the approval. If some non-zero amount of assets is already + /// approved from signing account to `delegate`, then it is topped up or unreserved to + /// meet the right value. + /// + /// NOTE: The signing account does not need to own `amount` of assets at the point of + /// making this call. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account to delegate permission to transfer asset. + /// - `amount`: The amount of asset that may be transferred by `delegate`. If there is + /// already an approval in place, then this acts additively. + /// + /// Emits `ApprovedTransfer` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn approve_transfer( + origin: OriginFor, + id: T::CurrencyId, + delegate: ::Source, + amount: T::Balance, + ) -> DispatchResult { + let owner = ensure_signed(origin)?; + let delegate = T::Lookup::lookup(delegate)?; + + let key = ApprovalKey { owner, delegate }; + Approvals::::try_mutate(id, &key, |maybe_approved| -> DispatchResult { + let mut approved = maybe_approved.take().unwrap_or_default(); + let deposit_required = T::ApprovalDeposit::get(); + if approved.deposit < deposit_required { + T::NativeCurrency::reserve(&key.owner, deposit_required - approved.deposit)?; + approved.deposit = deposit_required; + } + approved.amount = approved.amount.saturating_add(amount); + *maybe_approved = Some(approved); + Ok(()) + })?; + Self::deposit_event(Event::ApprovedTransfer(id, key.owner, key.delegate, amount)); + + Ok(()) + } + + /// Cancel all of some asset approved for delegated transfer by a third-party account. + /// + /// Origin must be Signed and there must be an approval in place between signer and + /// `delegate`. + /// + /// Unreserves any deposit previously reserved by `approve_transfer` for the approval. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account delegated permission to transfer asset. + /// + /// Emits `ApprovalCancelled` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn cancel_approval( + origin: OriginFor, + id: T::CurrencyId, + delegate: ::Source, + ) -> DispatchResult { + let owner = ensure_signed(origin)?; + let delegate = T::Lookup::lookup(delegate)?; + let key = ApprovalKey { owner, delegate }; + let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; + T::NativeCurrency::unreserve(&key.owner, approval.deposit); + + Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); + Ok(()) + } + + /// Cancel all of some asset approved for delegated transfer by a third-party account. + /// + /// Origin must be either ForceOrigin or Signed origin with the signer being the Admin + /// account of the asset `id`. + /// + /// Unreserves any deposit previously reserved by `approve_transfer` for the approval. + /// + /// - `id`: The identifier of the asset. + /// - `delegate`: The account delegated permission to transfer asset. + /// + /// Emits `ApprovalCancelled` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn force_cancel_approval( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + delegate: ::Source, + ) -> DispatchResult { + T::ForceOrigin::try_origin(origin) + .map(|_| ()) + .or_else(|origin| -> DispatchResult { + let origin = ensure_signed(origin)?; + let d = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(&origin == &d.admin, Error::::NoPermission); + Ok(()) + })?; + + let owner = T::Lookup::lookup(owner)?; + let delegate = T::Lookup::lookup(delegate)?; + + let key = ApprovalKey { owner, delegate }; + let approval = Approvals::::take(id, &key).ok_or(Error::::Unknown)?; + T::NativeCurrency::unreserve(&key.owner, approval.deposit); + + Self::deposit_event(Event::ApprovalCancelled(id, key.owner, key.delegate)); + Ok(()) + } + + /// Transfer some asset balance from a previously delegated account to some third-party + /// account. + /// + /// Origin must be Signed and there must be an approval in place by the `owner` to the + /// signer. + /// + /// If the entire amount approved for transfer is transferred, then any deposit previously + /// reserved by `approve_transfer` is unreserved. + /// + /// - `id`: The identifier of the asset. + /// - `owner`: The account which previously approved for a transfer of at least `amount` and + /// from which the asset balance will be withdrawn. + /// - `destination`: The account to which the asset balance of `amount` will be transferred. + /// - `amount`: The amount of assets to transfer. + /// + /// Emits `TransferredApproved` on success. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn transfer_approved( + origin: OriginFor, + id: T::CurrencyId, + owner: ::Source, + destination: ::Source, + amount: T::Balance, + ) -> DispatchResult { + let delegate = ensure_signed(origin)?; + let owner = T::Lookup::lookup(owner)?; + let destination = T::Lookup::lookup(destination)?; + + let key = ApprovalKey { owner, delegate }; + Approvals::::try_mutate_exists(id, &key, |maybe_approved| -> DispatchResult { + let mut approved = maybe_approved.take().ok_or(Error::::Unapproved)?; + let remaining = approved.amount.checked_sub(&amount).ok_or(Error::::Unapproved)?; + + >::transfer(id, &key.owner, &destination, amount)?; + + if remaining.is_zero() { + T::NativeCurrency::unreserve(&key.owner, approved.deposit); + } else { + approved.amount = remaining; + *maybe_approved = Some(approved); + } + Ok(()) + })?; + Ok(()) + } + + /// Transfer some balance to another account. + /// + /// The dispatch origin for this call must be `Signed` by the + /// transactor. + #[pallet::weight(5_000_000)] + pub fn transfer( + origin: OriginFor, + id: T::CurrencyId, + dest: ::Source, + amount: T::Balance, + ) -> DispatchResult { + let from = ensure_signed(origin)?; + let to = T::Lookup::lookup(dest)?; + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(!details.is_frozen, Error::::TokenIsFrozen); + let account_details = Accounts::::get(id, from.clone()); + ensure!(!account_details.is_frozen, Error::::Frozen); + + >::transfer(id, &from, &to, amount)?; + Self::deposit_event(Event::Transferred(id, from, to, amount)); + Ok(().into()) + } + + /// Transfer all remaining balance to the given account. + /// + /// The dispatch origin for this call must be `Signed` by the + /// transactor. + #[pallet::weight(5_000_000)] + pub fn transfer_all( + origin: OriginFor, + id: T::CurrencyId, + dest: ::Source, + ) -> DispatchResult { + let from = ensure_signed(origin)?; + let to = T::Lookup::lookup(dest)?; + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(!details.is_frozen, Error::::TokenIsFrozen); + let account_details = Accounts::::get(id, from.clone()); + ensure!(!account_details.is_frozen, Error::::Frozen); + + let balance = >::free_balance(id, &from); + >::transfer(id, &from, &to, balance)?; + + Self::deposit_event(Event::Transferred(id, from, to, balance)); + Ok(().into()) + } + + /// Move some assets from the sender account to another, keeping the sender account alive. + /// + /// Origin must be Signed. + /// + /// - `id`: The identifier of the asset to have some amount transferred. + /// - `target`: The account to be credited. + /// - `amount`: The amount by which the sender's balance of assets should be reduced and + /// `target`'s balance increased. The amount actually transferred may be slightly greater in + /// the case that the transfer would otherwise take the sender balance above zero but below + /// the minimum balance. Must be greater than zero. + /// + /// Emits `Transferred` with the actual amount transferred. If this takes the source balance + /// to below the minimum for the asset, then the amount transferred is increased to take it + /// to zero. + /// + /// Weight: `O(1)` + /// Modes: Pre-existence of `target`; Post-existence of sender; Prior & post zombie-status + /// of sender; Account pre-existence of `target`. + #[pallet::weight(5_000_000)] + pub(super) fn transfer_keep_alive( + origin: OriginFor, + id: T::CurrencyId, + target: ::Source, + amount: T::Balance + ) -> DispatchResult { + let from = ensure_signed(origin)?; + let to = T::Lookup::lookup(target)?; + let balance = >::free_balance(id, &from); + let details = Token::::get(id).ok_or(Error::::Unknown)?; + ensure!(!details.is_frozen, Error::::TokenIsFrozen); + let account_details = Accounts::::get(id, from.clone()); + ensure!(!account_details.is_frozen, Error::::Frozen); + // Check balance to ensure account is kept alive + ensure!(balance - amount >= details.min_balance, Error::::WouldDie); + >::transfer(id, &from, &to, amount)?; + Self::deposit_event(Event::Transferred(id, from, to, amount)); + + Ok(().into()) + } + + /// Move some assets from one account to another. + /// + /// Origin must be Signed and the sender should be the Admin of the asset `id`. + /// + /// - `id`: The identifier of the asset to have some amount transferred. + /// - `source`: The account to be debited. + /// - `dest`: The account to be credited. + /// - `amount`: The amount by which the `source`'s balance of assets should be reduced and + /// `dest`'s balance increased. The amount actually transferred may be slightly greater in + /// the case that the transfer would otherwise take the `source` balance above zero but + /// below the minimum balance. Must be greater than zero. + /// + /// Emits `Transferred` with the actual amount transferred. If this takes the source balance + /// to below the minimum for the asset, then the amount transferred is increased to take it + /// to zero. + /// + /// Weight: `O(1)` + /// Modes: Pre-existence of `dest`; Post-existence of `source`; Prior & post zombie-status + /// of `source`; Account pre-existence of `dest`. + #[pallet::weight(T::WeightInfo::force_transfer())] + pub(super) fn force_transfer( + origin: OriginFor, + id: T::CurrencyId, + source: ::Source, + dest: ::Source, + amount: T::Balance, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + let from = T::Lookup::lookup(source)?; + let to = T::Lookup::lookup(dest)?; + + let details = Token::::get(id).ok_or(Error::::Unknown)?; + // Check admin rights. + ensure!(&origin == &details.admin, Error::::NoPermission); + >::transfer(id, &from, &to, amount)?; + Self::deposit_event(Event::Transferred(id, from, to, amount)); + Ok(()) + } + + /// Set the dust handler type. + /// + /// Origin must be Signed and the sender should be the Admin of the asset `id`. + /// + /// - `id`: The identifier of the asset to have some amount transferred. + /// - `source`: The account to be debited. + /// - `dest`: The account to be credited. + /// - `amount`: The amount by which the `source`'s balance of assets should be reduced and + /// `dest`'s balance increased. The amount actually transferred may be slightly greater in + /// the case that the transfer would otherwise take the `source` balance above zero but + /// below the minimum balance. Must be greater than zero. + /// + /// Emits `DustHandlerChange` with the currency_id and new handler type. + /// + /// Weight: `O(1)` + #[pallet::weight(5_000_000)] + pub(super) fn set_dust_type( + origin: OriginFor, + id: T::CurrencyId, + dust_type: DustHandlerType, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + Token::::try_mutate(id, |maybe_details| { + let details = maybe_details.as_mut().ok_or(Error::::Unknown)?; + ensure!(&origin == &details.admin, Error::::NoPermission); + + details.dust_type = dust_type.clone(); + Self::deposit_event(Event::DustHandlerChange(id, dust_type)); + Ok(()) + }) + } + } +} + +impl Pallet { + fn total_supply(currency_id: T::CurrencyId) -> T::Balance { + Self::total_issuance(currency_id) + } + + /// Check whether account_id is a module account + pub(crate) fn is_module_account_id(account_id: &T::AccountId) -> bool { + PalletId::try_from_account(account_id).is_some() + } + + pub(crate) fn try_mutate_account( + who: &T::AccountId, + currency_id: T::CurrencyId, + f: impl FnOnce(&mut AccountData, bool) -> sp_std::result::Result, + ) -> sp_std::result::Result { + Accounts::::try_mutate_exists(currency_id, who, |maybe_account| { + let existed = maybe_account.is_some(); + let mut account = maybe_account.take().unwrap_or_default(); + f(&mut account, existed).map(move |result| { + let mut handle_dust: Option = None; + let total = account.total(); + *maybe_account = if total.is_zero() { + None + } else { + // if non_zero total is below existential deposit and the account is not a + // module account, should handle the dust. + match Token::::get(currency_id) { + Some(token_data) => { + if total < token_data.min_balance && !Self::is_module_account_id(who) { + handle_dust = Some(total); + } + Some(account) + }, + None => None, + } + }; + + (existed, maybe_account.is_some(), handle_dust, result) + }) + }) + .map(|(existed, exists, handle_dust, result)| { + if existed && !exists { + // If existed before, decrease account provider. + // Ignore the result, because if it failed means that these’s remain consumers, + // and the account storage in frame_system shouldn't be repeaded. + let _ = frame_system::Pallet::::dec_providers(who); + } else if !existed && exists { + // Add existential currency identifier to this account + AccountCurrencies::::insert(who, currency_id, true); + // if new, increase account provider + frame_system::Pallet::::inc_providers(who); + } + + if let Some(dust_amount) = handle_dust { + // Remove existential currency identifier to this account + AccountCurrencies::::remove(who, currency_id); + // `OnDust` maybe get/set storage `Accounts` of `who`, trigger handler here + // to avoid some unexpected errors. + >::handle_dust(currency_id, who, dust_amount); + Self::deposit_event(Event::DustLost(who.clone(), currency_id, dust_amount)); + } + + result + }) + } + + pub(crate) fn mutate_account( + who: &T::AccountId, + currency_id: T::CurrencyId, + f: impl FnOnce(&mut AccountData, bool) -> R, + ) -> R { + Self::try_mutate_account(who, currency_id, |account, existed| -> Result { + Ok(f(account, existed)) + }) + .expect("Error is infallible; qed") + } + + /// Set free balance of `who` to a new value. + /// + /// Note this will not maintain total issuance, and the caller is + /// expected to do it. + pub(crate) fn set_free_balance(currency_id: T::CurrencyId, who: &T::AccountId, amount: T::Balance) { + Self::mutate_account(who, currency_id, |account, _| { + account.free = amount; + }); + } + + /// Set reserved balance of `who` to a new value. + /// + /// Note this will not maintain total issuance, and the caller is + /// expected to do it. + pub(crate) fn set_reserved_balance(currency_id: T::CurrencyId, who: &T::AccountId, amount: T::Balance) { + Self::mutate_account(who, currency_id, |account, _| { + account.reserved = amount; + }); + } + + /// Update the account entry for `who` under `currency_id`, given the + /// locks. + pub(crate) fn update_locks(currency_id: T::CurrencyId, who: &T::AccountId, locks: &[BalanceLock]) { + // update account data + Self::mutate_account(who, currency_id, |account, _| { + account.frozen = Zero::zero(); + for lock in locks.iter() { + account.frozen = account.frozen.max(lock.amount); + } + }); + + // update locks + let existed = >::contains_key(who, currency_id); + if locks.is_empty() { + >::remove(who, currency_id); + if existed { + // decrease account ref count when destruct lock + frame_system::Pallet::::dec_consumers(who); + } + } else { + >::insert(who, currency_id, locks); + if !existed { + // increase account ref count when initialize lock + if frame_system::Pallet::::inc_consumers(who).is_err() { + // No providers for the locks. This is impossible under normal circumstances + // since the funds that are under the lock will themselves be stored in the + // account and therefore will need a reference. + log::warn!( + "Warning: Attempt to introduce lock consumer reference, yet no providers. \ + This is unexpected but should be safe." + ); + } + } + } + } + + pub(crate) fn dead_account( + id: T::CurrencyId, + who: &T::AccountId, + ) { + frame_system::Pallet::::dec_consumers(who); + AccountCurrencies::::remove(who, id) + } + + pub(crate) fn get_pallet_account() -> T::AccountId { + T::PalletId::get().into_account() + } +} + +impl MultiCurrency for Pallet { + type CurrencyId = T::CurrencyId; + type Balance = T::Balance; + + fn minimum_balance(currency_id: Self::CurrencyId) -> Self::Balance { + match Token::::get(currency_id) { + Some(token_data) => token_data.min_balance, + None => u32::max_value().into(), + } + } + + fn total_issuance(currency_id: Self::CurrencyId) -> Self::Balance { + >::get(currency_id) + } + + fn total_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { + Self::accounts(currency_id, who).total() + } + + fn free_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { + Self::accounts(currency_id, who).free + } + + // Ensure that an account can withdraw from their free balance given any + // existing withdrawal restrictions like locks and vesting balance. + // Is a no-op if amount to be withdrawn is zero. + fn ensure_can_withdraw(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + + let new_balance = Self::free_balance(currency_id, who) + .checked_sub(&amount) + .ok_or(Error::::BalanceLow)?; + ensure!( + new_balance >= Self::accounts(currency_id, who).frozen(), + Error::::LiquidityRestrictions + ); + Ok(()) + } + + /// Transfer some free balance from `from` to `to`. + /// Is a no-op if value to be transferred is zero or the `from` is the + /// same as `to`. + fn transfer( + currency_id: Self::CurrencyId, + from: &T::AccountId, + to: &T::AccountId, + amount: Self::Balance, + ) -> DispatchResult { + if amount.is_zero() || from == to { + return Ok(()); + } + + Self::ensure_can_withdraw(currency_id, from, amount)?; + + let from_balance = Self::free_balance(currency_id, from); + let to_balance = Self::free_balance(currency_id, to) + .checked_add(&amount) + .ok_or(Error::::BalanceOverflow)?; + + let details = Token::::get(currency_id).ok_or(Error::::Unknown)?; + if !Self::is_module_account_id(to) { + ensure!(to_balance >= details.min_balance, Error::::BelowMinimum); + } + + // check if sender goes below min balance and send remaining to recipient + let dust = if from_balance - amount < details.min_balance { + from_balance - amount + } else { + T::Balance::zero() + }; + + // update the sender's balance in the event there is dust being reaped + let new_from_balance = if dust > T::Balance::zero() { + T::Balance::zero() + } else { + from_balance - amount + }; + + // Cannot underflow because ensure_can_withdraw check + Self::set_free_balance(currency_id, from, new_from_balance); + Self::set_free_balance(currency_id, to, to_balance + dust); + + Ok(()) + } + + /// Deposit some `amount` into the free balance of account `who`. + /// + /// Is a no-op if the `amount` to be deposited is zero. + fn deposit(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + + TotalIssuance::::try_mutate(currency_id, |total_issuance| -> DispatchResult { + *total_issuance = total_issuance + .checked_add(&amount) + .ok_or(Error::::TotalIssuanceOverflow)?; + + Self::set_free_balance(currency_id, who, Self::free_balance(currency_id, who) + amount); + + Ok(()) + }) + } + + fn withdraw(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + Self::ensure_can_withdraw(currency_id, who, amount)?; + // Cannot underflow because ensure_can_withdraw check + >::mutate(currency_id, |v| *v -= amount); + Self::set_free_balance(currency_id, who, Self::free_balance(currency_id, who) - amount); + Ok(()) + } + + // Check if `value` amount of free balance can be slashed from `who`. + fn can_slash(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> bool { + if value.is_zero() { + return true; + } + Self::free_balance(currency_id, who) >= value + } + + /// Is a no-op if `value` to be slashed is zero. + /// + /// NOTE: `slash()` prefers free balance, but assumes that reserve + /// balance can be drawn from in extreme circumstances. `can_slash()` + /// should be used prior to `slash()` to avoid having to draw from + /// reserved funds, however we err on the side of punishment if things + /// are inconsistent or `can_slash` wasn't used appropriately. + fn slash(currency_id: Self::CurrencyId, who: &T::AccountId, amount: Self::Balance) -> Self::Balance { + if amount.is_zero() { + return amount; + } + + let account = Self::accounts(currency_id, who); + let free_slashed_amount = account.free.min(amount); + // Cannot underflow becuase free_slashed_amount can never be greater than amount + let mut remaining_slash = amount - free_slashed_amount; + + // slash free balance + if !free_slashed_amount.is_zero() { + // Cannot underflow becuase free_slashed_amount can never be greater than + // account.free + Self::set_free_balance(currency_id, who, account.free - free_slashed_amount); + } + + // slash reserved balance + if !remaining_slash.is_zero() { + let reserved_slashed_amount = account.reserved.min(remaining_slash); + // Cannot underflow due to above line + remaining_slash -= reserved_slashed_amount; + Self::set_reserved_balance(currency_id, who, account.reserved - reserved_slashed_amount); + } + + // Cannot underflow because the slashed value cannot be greater than total + // issuance + >::mutate(currency_id, |v| *v -= amount - remaining_slash); + remaining_slash + } +} + +impl MultiCurrencyExtended for Pallet { + type Amount = T::Amount; + + fn update_balance(currency_id: Self::CurrencyId, who: &T::AccountId, by_amount: Self::Amount) -> DispatchResult { + if by_amount.is_zero() { + return Ok(()); + } + + // Ensure this doesn't overflow. There isn't any traits that exposes + // `saturating_abs` so we need to do it manually. + let by_amount_abs = if by_amount == Self::Amount::min_value() { + Self::Amount::max_value() + } else { + by_amount.abs() + }; + + let by_balance = + TryInto::::try_into(by_amount_abs).map_err(|_| Error::::AmountIntoBalanceFailed)?; + if by_amount.is_positive() { + Self::deposit(currency_id, who, by_balance) + } else { + Self::withdraw(currency_id, who, by_balance).map(|_| ()) + } + } +} + +impl MultiLockableCurrency for Pallet { + type Moment = T::BlockNumber; + + // Set a lock on the balance of `who` under `currency_id`. + // Is a no-op if lock amount is zero. + fn set_lock( + lock_id: LockIdentifier, + currency_id: Self::CurrencyId, + who: &T::AccountId, + amount: Self::Balance, + ) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + let mut new_lock = Some(BalanceLock { id: lock_id, amount }); + let mut locks = Self::locks(who, currency_id) + .into_iter() + .filter_map(|lock| { + if lock.id == lock_id { + new_lock.take() + } else { + Some(lock) + } + }) + .collect::>(); + if let Some(lock) = new_lock { + locks.push(lock) + } + Self::update_locks(currency_id, who, &locks[..]); + Ok(()) + } + + // Extend a lock on the balance of `who` under `currency_id`. + // Is a no-op if lock amount is zero + fn extend_lock( + lock_id: LockIdentifier, + currency_id: Self::CurrencyId, + who: &T::AccountId, + amount: Self::Balance, + ) -> DispatchResult { + if amount.is_zero() { + return Ok(()); + } + let mut new_lock = Some(BalanceLock { id: lock_id, amount }); + let mut locks = Self::locks(who, currency_id) + .into_iter() + .filter_map(|lock| { + if lock.id == lock_id { + new_lock.take().map(|nl| BalanceLock { + id: lock.id, + amount: lock.amount.max(nl.amount), + }) + } else { + Some(lock) + } + }) + .collect::>(); + if let Some(lock) = new_lock { + locks.push(lock) + } + Self::update_locks(currency_id, who, &locks[..]); + Ok(()) + } + + fn remove_lock(lock_id: LockIdentifier, currency_id: Self::CurrencyId, who: &T::AccountId) -> DispatchResult { + let mut locks = Self::locks(who, currency_id); + locks.retain(|lock| lock.id != lock_id); + Self::update_locks(currency_id, who, &locks[..]); + Ok(()) + } +} + +impl MultiReservableCurrency for Pallet { + /// Check if `who` can reserve `value` from their free balance. + /// + /// Always `true` if value to be reserved is zero. + fn can_reserve(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> bool { + if value.is_zero() { + return true; + } + Self::ensure_can_withdraw(currency_id, who, value).is_ok() + } + + /// Slash from reserved balance, returning any amount that was unable to + /// be slashed. + /// + /// Is a no-op if the value to be slashed is zero. + fn slash_reserved(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> Self::Balance { + if value.is_zero() { + return value; + } + + let reserved_balance = Self::reserved_balance(currency_id, who); + let actual = reserved_balance.min(value); + Self::set_reserved_balance(currency_id, who, reserved_balance - actual); + >::mutate(currency_id, |v| *v -= actual); + value - actual + } + + fn reserved_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { + Self::accounts(currency_id, who).reserved + } + + /// Move `value` from the free balance from `who` to their reserved + /// balance. + /// + /// Is a no-op if value to be reserved is zero. + fn reserve(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> DispatchResult { + if value.is_zero() { + return Ok(()); + } + Self::ensure_can_withdraw(currency_id, who, value)?; + + let account = Self::accounts(currency_id, who); + Self::set_free_balance(currency_id, who, account.free - value); + // Cannot overflow becuase total issuance is using the same balance type and + // this doesn't increase total issuance + Self::set_reserved_balance(currency_id, who, account.reserved + value); + Ok(()) + } + + /// Unreserve some funds, returning any amount that was unable to be + /// unreserved. + /// + /// Is a no-op if the value to be unreserved is zero. + fn unreserve(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> Self::Balance { + if value.is_zero() { + return value; + } + + let account = Self::accounts(currency_id, who); + let actual = account.reserved.min(value); + Self::set_reserved_balance(currency_id, who, account.reserved - actual); + Self::set_free_balance(currency_id, who, account.free + actual); + + value - actual + } + + /// Move the reserved balance of one account into the balance of + /// another, according to `status`. + /// + /// Is a no-op if: + /// - the value to be moved is zero; or + /// - the `slashed` id equal to `beneficiary` and the `status` is + /// `Reserved`. + fn repatriate_reserved( + currency_id: Self::CurrencyId, + slashed: &T::AccountId, + beneficiary: &T::AccountId, + value: Self::Balance, + status: BalanceStatus, + ) -> sp_std::result::Result { + if value.is_zero() { + return Ok(value); + } + + if slashed == beneficiary { + return match status { + BalanceStatus::Free => Ok(Self::unreserve(currency_id, slashed, value)), + BalanceStatus::Reserved => Ok(value.saturating_sub(Self::reserved_balance(currency_id, slashed))), + }; + } + + let from_account = Self::accounts(currency_id, slashed); + let to_account = Self::accounts(currency_id, beneficiary); + let actual = from_account.reserved.min(value); + match status { + BalanceStatus::Free => { + Self::set_free_balance(currency_id, beneficiary, to_account.free + actual); + } + BalanceStatus::Reserved => { + Self::set_reserved_balance(currency_id, beneficiary, to_account.reserved + actual); + } + } + Self::set_reserved_balance(currency_id, slashed, from_account.reserved - actual); + Ok(value - actual) + } +} + +pub struct CurrencyAdapter(marker::PhantomData<(T, GetCurrencyId)>); + +impl PalletCurrency for CurrencyAdapter +where + T: Config, + GetCurrencyId: Get, +{ + type Balance = T::Balance; + type PositiveImbalance = PositiveImbalance; + type NegativeImbalance = NegativeImbalance; + + fn total_balance(who: &T::AccountId) -> Self::Balance { + Pallet::::total_balance(GetCurrencyId::get(), who) + } + + fn can_slash(who: &T::AccountId, value: Self::Balance) -> bool { + Pallet::::can_slash(GetCurrencyId::get(), who, value) + } + + fn total_issuance() -> Self::Balance { + Pallet::::total_issuance(GetCurrencyId::get()) + } + + fn minimum_balance() -> Self::Balance { + Pallet::::minimum_balance(GetCurrencyId::get()) + } + + fn burn(mut amount: Self::Balance) -> Self::PositiveImbalance { + if amount.is_zero() { + return PositiveImbalance::zero(); + } + >::mutate(GetCurrencyId::get(), |issued| { + *issued = issued.checked_sub(&amount).unwrap_or_else(|| { + amount = *issued; + Zero::zero() + }); + }); + PositiveImbalance::new(amount) + } + + fn issue(mut amount: Self::Balance) -> Self::NegativeImbalance { + if amount.is_zero() { + return NegativeImbalance::zero(); + } + >::mutate(GetCurrencyId::get(), |issued| { + *issued = issued.checked_add(&amount).unwrap_or_else(|| { + amount = Self::Balance::max_value() - *issued; + Self::Balance::max_value() + }) + }); + NegativeImbalance::new(amount) + } + + fn free_balance(who: &T::AccountId) -> Self::Balance { + Pallet::::free_balance(GetCurrencyId::get(), who) + } + + fn ensure_can_withdraw( + who: &T::AccountId, + amount: Self::Balance, + _reasons: WithdrawReasons, + _new_balance: Self::Balance, + ) -> DispatchResult { + Pallet::::ensure_can_withdraw(GetCurrencyId::get(), who, amount) + } + + fn transfer( + source: &T::AccountId, + dest: &T::AccountId, + value: Self::Balance, + _existence_requirement: ExistenceRequirement, + ) -> DispatchResult { + as MultiCurrency>::transfer(GetCurrencyId::get(), &source, &dest, value) + } + + fn slash(who: &T::AccountId, value: Self::Balance) -> (Self::NegativeImbalance, Self::Balance) { + if value.is_zero() { + return (Self::NegativeImbalance::zero(), value); + } + + let currency_id = GetCurrencyId::get(); + let account = Pallet::::accounts(currency_id, who); + let free_slashed_amount = account.free.min(value); + let mut remaining_slash = value - free_slashed_amount; + + // slash free balance + if !free_slashed_amount.is_zero() { + Pallet::::set_free_balance(currency_id, who, account.free - free_slashed_amount); + } + + // slash reserved balance + if !remaining_slash.is_zero() { + let reserved_slashed_amount = account.reserved.min(remaining_slash); + remaining_slash -= reserved_slashed_amount; + Pallet::::set_reserved_balance(currency_id, who, account.reserved - reserved_slashed_amount); + ( + Self::NegativeImbalance::new(free_slashed_amount + reserved_slashed_amount), + remaining_slash, + ) + } else { + (Self::NegativeImbalance::new(value), remaining_slash) + } + } + + fn deposit_into_existing( + who: &T::AccountId, + value: Self::Balance, + ) -> sp_std::result::Result { + if value.is_zero() { + return Ok(Self::PositiveImbalance::zero()); + } + let currency_id = GetCurrencyId::get(); + let new_total = Pallet::::free_balance(currency_id, who) + .checked_add(&value) + .ok_or(Error::::TotalIssuanceOverflow)?; + Pallet::::set_free_balance(currency_id, who, new_total); + + Ok(Self::PositiveImbalance::new(value)) + } + + fn deposit_creating(who: &T::AccountId, value: Self::Balance) -> Self::PositiveImbalance { + Self::deposit_into_existing(who, value).unwrap_or_else(|_| Self::PositiveImbalance::zero()) + } + + fn withdraw( + who: &T::AccountId, + value: Self::Balance, + _reasons: WithdrawReasons, + _liveness: ExistenceRequirement, + ) -> sp_std::result::Result { + if value.is_zero() { + return Ok(Self::NegativeImbalance::zero()); + } + let currency_id = GetCurrencyId::get(); + Pallet::::ensure_can_withdraw(currency_id, who, value)?; + Pallet::::set_free_balance(currency_id, who, Pallet::::free_balance(currency_id, who) - value); + Ok(Self::NegativeImbalance::new(value)) + } + + fn make_free_balance_be( + who: &T::AccountId, + value: Self::Balance, + ) -> SignedImbalance { + let currency_id = GetCurrencyId::get(); + Pallet::::try_mutate_account( + who, + currency_id, + |account, existed| -> Result, ()> { + // If we're attempting to set an existing account to less than ED, then + // bypass the entire operation. It's a no-op if you follow it through, but + // since this is an instance where we might account for a negative imbalance + // (in the dust cleaner of set_account) before we account for its actual + // equal and opposite cause (returned as an Imbalance), then in the + // instance that there's no other accounts on the system at all, we might + // underflow the issuance and our arithmetic will be off. + match Token::::get(currency_id) { + Some(token_data) => { + let ed = token_data.min_balance; + ensure!(value.saturating_add(account.reserved) >= ed || existed, ()); + + let imbalance = if account.free <= value { + SignedImbalance::Positive(PositiveImbalance::new(value - account.free)) + } else { + SignedImbalance::Negative(NegativeImbalance::new(account.free - value)) + }; + account.free = value; + Ok(imbalance) + }, + None => { Err(()) }, + } + }, + ) + .unwrap_or_else(|_| SignedImbalance::Positive(Self::PositiveImbalance::zero())) + } +} + +impl PalletReservableCurrency for CurrencyAdapter +where + T: Config, + GetCurrencyId: Get, +{ + fn can_reserve(who: &T::AccountId, value: Self::Balance) -> bool { + Pallet::::can_reserve(GetCurrencyId::get(), who, value) + } + + fn slash_reserved(who: &T::AccountId, value: Self::Balance) -> (Self::NegativeImbalance, Self::Balance) { + let actual = Pallet::::slash_reserved(GetCurrencyId::get(), who, value); + (Self::NegativeImbalance::zero(), actual) + } + + fn reserved_balance(who: &T::AccountId) -> Self::Balance { + Pallet::::reserved_balance(GetCurrencyId::get(), who) + } + + fn reserve(who: &T::AccountId, value: Self::Balance) -> DispatchResult { + Pallet::::reserve(GetCurrencyId::get(), who, value) + } + + fn unreserve(who: &T::AccountId, value: Self::Balance) -> Self::Balance { + Pallet::::unreserve(GetCurrencyId::get(), who, value) + } + + fn repatriate_reserved( + slashed: &T::AccountId, + beneficiary: &T::AccountId, + value: Self::Balance, + status: BalanceStatus, + ) -> sp_std::result::Result { + Pallet::::repatriate_reserved(GetCurrencyId::get(), slashed, beneficiary, value, status) + } +} + +impl PalletLockableCurrency for CurrencyAdapter +where + T: Config, + GetCurrencyId: Get, +{ + type Moment = T::BlockNumber; + type MaxLocks = (); + + fn set_lock(id: LockIdentifier, who: &T::AccountId, amount: Self::Balance, _reasons: WithdrawReasons) { + let _ = Pallet::::set_lock(id, GetCurrencyId::get(), who, amount); + } + + fn extend_lock(id: LockIdentifier, who: &T::AccountId, amount: Self::Balance, _reasons: WithdrawReasons) { + let _ = Pallet::::extend_lock(id, GetCurrencyId::get(), who, amount); + } + + fn remove_lock(id: LockIdentifier, who: &T::AccountId) { + let _ = Pallet::::remove_lock(id, GetCurrencyId::get(), who); + } +} + + +impl MergeAccount for Pallet { + #[transactional] + fn merge_account(source: &T::AccountId, dest: &T::AccountId) -> DispatchResult { + AccountCurrencies::::iter_prefix(source).try_for_each(|(currency_id, exists)| -> DispatchResult { + if exists { + let account_data = Accounts::::get(currency_id, source); + // ensure the account has no active reserved of non-native token + ensure!(account_data.reserved.is_zero(), Error::::StillHasActiveReserved); + + // transfer all free to recipient + >::transfer(currency_id, source, dest, account_data.free)?; + } + Ok(()) + }) + } +} + +impl ExtendedTokenSystem for Pallet { + fn create(currency_id: T::CurrencyId, owner: T::AccountId, admin: T::AccountId, min_balance: T::Balance) -> Result<(), DispatchError> { + Token::::insert(currency_id, TokenDetails { + owner: owner.clone(), + issuer: admin.clone(), + admin: admin.clone(), + freezer: admin.clone(), + supply: Zero::zero(), + deposit: T::CurrencyDeposit::get(), + min_balance, + approvals: 0, + is_frozen: false, + dust_type: DustHandlerType::Transfer(T::DustAccount::get()), + }); + + Ok(()) + } + + fn mint(currency_id: T::CurrencyId, account_id: T::AccountId, amount: T::Balance) -> Result<(), DispatchError> { + Self::deposit(currency_id, &account_id, amount)?; + Ok(()) + } + + /// Burns a balance from an account. Will burn into reserved balance as well. + /// Deducts total burned amount from the token supply. Note, the total burned + /// amount might be less than the target burn amount if the user has less balance + /// than what is being burnt. + fn burn(currency_id: T::CurrencyId, account_id: T::AccountId, amount: T::Balance) -> Result<(), DispatchError> { + ensure!(!amount.is_zero(), Error::::InvalidAmount); + + let account = Self::accounts(currency_id, account_id.clone()); + let free_burn_amount = account.free.min(amount); + // Cannot underflow becuase free_burn_amount can never be greater than amount + let mut remaining_burn = amount - free_burn_amount; + + // slash free balance + if !free_burn_amount.is_zero() { + // Cannot underflow becuase free_burn_amount can never be greater than + // account.free + Self::set_free_balance(currency_id, &account_id, account.free - free_burn_amount); + } + + // burn reserved balance + if !remaining_burn.is_zero() { + let reserved_burn_amount = account.reserved.min(remaining_burn); + // Cannot underflow due to above line + remaining_burn -= reserved_burn_amount; + Self::set_reserved_balance(currency_id, &account_id, account.reserved - reserved_burn_amount); + } + + // Cannot underflow because the burn value cannot be greater than total + // issuance + >::mutate(currency_id, |v| *v -= amount - remaining_burn); + Ok(()) + } + + fn handle_dust(currency_id: T::CurrencyId, who: &T::AccountId, amount: T::Balance) { + if let Some(token) = Token::::get(currency_id) { + match token.dust_type { + DustHandlerType::Burn => { + let _ =Pallet::::withdraw(currency_id, who, amount); + }, + DustHandlerType::Transfer(acc) => { + let _ = as MultiCurrency>::transfer(currency_id, who, &acc, amount); + } + } + } + } +} diff --git a/pallets/tokens/src/mock.rs b/pallets/tokens/src/mock.rs new file mode 100644 index 00000000..424627a1 --- /dev/null +++ b/pallets/tokens/src/mock.rs @@ -0,0 +1,182 @@ +use super::*; +use crate as tokens; +use frame_benchmarking::whitelisted_caller; +use frame_support::{construct_runtime, parameter_types, weights::Weight, PalletId}; +use frame_system::mocking::{MockBlock, MockUncheckedExtrinsic}; +use basic_currency::BasicCurrencyAdapter; +use sp_runtime::{Permill}; + +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + Perbill, AccountId32, +}; + +pub(crate) type Balance = u64; +pub type Amount = i128; +pub type CurrencyId = u64; +pub type AccountId = AccountId32; +pub type BlockNumber = u64; + +pub const DOT: CurrencyId = 1; +pub const BTC: CurrencyId = 2; +pub const ETH: CurrencyId = 3; +pub const ALICE: AccountId = AccountId32::new([0u8; 32]); +pub const BOB: AccountId = AccountId32::new([1u8; 32]); +pub const TREASURY_ACCOUNT: AccountId = AccountId32::new([2u8; 32]); +pub const DAVE: AccountId = AccountId::new([4u8; 32]); +pub const ID_1: LockIdentifier = *b"1 "; +pub const ID_2: LockIdentifier = *b"2 "; + +// Configure a mock runtime to test the pallet. +type UncheckedExtrinsic = MockUncheckedExtrinsic; +type Block = MockBlock; + +construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Tokens: tokens::{Pallet, Call, Storage, Event}, + Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, + } +); + +parameter_types! { + pub Prefix: u8 = 100; + 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::Config for Test { + type AccountData = pallet_balances::AccountData; + type AccountId = AccountId; + type BaseCallFilter = (); + type BlockHashCount = BlockHashCount; + type BlockLength = (); + type BlockNumber = BlockNumber; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = Event; + type Hash = H256; + type Hashing = BlakeTwo256; + type Header = Header; + type Index = u64; + type Lookup = IdentityLookup; + type OnKilledAccount = (); + type OnNewAccount = (); + type Origin = Origin; + type PalletInfo = PalletInfo; + type SS58Prefix = Prefix; + type SystemWeightInfo = (); + type OnSetCode = (); + type Version = (); +} + +parameter_types! { + pub const ExistentialDeposit: Balance = 0; + pub const MaxLocks: u32 = 50; + pub const MaxTreeDepth: u8 = 32; + pub const CacheBlockLength: u64 = 5; + // Minimum deposit length is 1 month w/ 6 second blocks + pub const MinimumDepositLength: u64 = 10 * 60 * 24 * 28; +} + +impl pallet_balances::Config for Test { + type AccountStore = System; + type Balance = Balance; + type DustRemoval = (); + type Event = Event; + type ExistentialDeposit = ExistentialDeposit; + type MaxLocks = MaxLocks; + type WeightInfo = (); +} + +parameter_types! { + pub const ProposalBond: Permill = Permill::from_percent(5); + pub const ProposalBondMinimum: u64 = 1; + pub const SpendPeriod: u64 = 2; + pub const Burn: Permill = Permill::from_percent(50); + pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); + pub const GetTokenId: CurrencyId = DOT; +} + +impl pallet_treasury::Config for Test { + type PalletId = TreasuryPalletId; + type Currency = CurrencyAdapter; + type ApproveOrigin = frame_system::EnsureRoot; + type RejectOrigin = frame_system::EnsureRoot; + type Event = Event; + type OnSlash = (); + type ProposalBond = ProposalBond; + type ProposalBondMinimum = ProposalBondMinimum; + type SpendPeriod = SpendPeriod; + type Burn = Burn; + type BurnDestination = (); + type SpendFunds = (); + type WeightInfo = (); +} + +parameter_types! { + pub const NativeCurrencyId: CurrencyId = 0; +} + +parameter_types! { + pub const TokensPalletId: PalletId = PalletId(*b"py/token"); + pub const CurrencyDeposit: u64 = 1; + pub const ApprovalDeposit: u64 = 1; + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 1; + pub const MetadataDepositPerByte: u64 = 1; +} + +parameter_types! { + pub DustAccount: AccountId = PalletId(*b"webb/dst").into_account(); +} + +impl Config for Test { + type PalletId = TokensPalletId; + type Event = Event; + type Balance = Balance; + type Amount = i128; + type CurrencyId = CurrencyId; + type NativeCurrency = BasicCurrencyAdapter; + type ForceOrigin = frame_system::EnsureRoot; + type CurrencyDeposit = CurrencyDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = StringLimit; + type DustAccount = DustAccount; + type WeightInfo = (); + type Extra = (); +} + +pub type TreasuryCurrencyAdapter = ::Currency; + +// Build genesis storage according to the mock runtime. +pub fn new_test_ext() -> sp_io::TestExternalities { + use pallet_balances::GenesisConfig as BalancesConfig; + let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + + BalancesConfig:: { + // Total issuance will be 200 with treasury account initialized at ED. + balances: vec![ + (ALICE, 1_000_000_000_000_000_000), + (BOB, 1_000_000_000_000_000_000), + (TREASURY_ACCOUNT, 1_000_000_000_000_000_000), + (whitelisted_caller(), 1_000_000_000_000_000_000), + ], + } + .assimilate_storage(&mut t) + .unwrap(); + + t.into() +} diff --git a/pallets/tokens/src/tests.rs b/pallets/tokens/src/tests.rs new file mode 100644 index 00000000..ef84187d --- /dev/null +++ b/pallets/tokens/src/tests.rs @@ -0,0 +1,1040 @@ +// This file is part of Substrate. + +// Copyright (C) 2019-2021 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. + +//! Tests for Tokens pallet. + +use super::*; +use crate::{Error, mock::*}; +use frame_support::{assert_ok, assert_noop, traits::Currency}; +use pallet_balances::Error as BalancesError; + +/** + * @brief Assets tests (mostly from pallet-assets) + */ + + +#[test] +fn basic_minting_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, BOB, 100)); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + }); +} + +#[test] +fn approval_lifecycle_works() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Balances::reserved_balance(&ALICE), 1); + assert_ok!(Tokens::transfer_approved(Origin::signed(BOB), DOT, ALICE, TREASURY_ACCOUNT, 40)); + assert_ok!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, BOB)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 60); + assert_eq!(Tokens::free_balance(DOT, &TREASURY_ACCOUNT), 40); + assert_eq!(Balances::reserved_balance(&ALICE), 0); + }); +} + +#[test] +fn approval_deposits_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, AccountId::new([10u8; 32]), 1)); + assert_ok!(Tokens::mint(Origin::signed(AccountId::new([10u8; 32])), DOT, ALICE, 100)); + let e = BalancesError::::InsufficientBalance; + assert_noop!(Tokens::approve_transfer(Origin::signed(AccountId::new([10u8; 32])), DOT, BOB, 50), e); + + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Balances::reserved_balance(&ALICE), 1); + + assert_ok!(Tokens::transfer_approved(Origin::signed(BOB), DOT, ALICE, TREASURY_ACCOUNT, 50)); + assert_eq!(Balances::reserved_balance(&ALICE), 0); + + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_ok!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, BOB)); + assert_eq!(Balances::reserved_balance(&ALICE), 0); + }); +} + +#[test] +fn cannot_transfer_more_than_approved() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + let e = Error::::Unapproved; + assert_noop!(Tokens::transfer_approved(Origin::signed(BOB), DOT, BOB, TREASURY_ACCOUNT, 51), e); + }); +} + +#[test] +fn cannot_transfer_more_than_exists() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 101)); + let e = Error::::BalanceLow; + assert_noop!(Tokens::transfer_approved(Origin::signed(BOB), DOT, ALICE, TREASURY_ACCOUNT, 101), e); + }); +} + +#[test] +fn cancel_approval_works() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_noop!(Tokens::cancel_approval(Origin::signed(ALICE), BTC, BOB), Error::::Unknown); + assert_noop!(Tokens::cancel_approval(Origin::signed(BOB), DOT, BOB), Error::::Unknown); + assert_noop!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, TREASURY_ACCOUNT), Error::::Unknown); + assert_ok!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, BOB)); + assert_noop!(Tokens::cancel_approval(Origin::signed(ALICE), DOT, BOB), Error::::Unknown); + }); +} + +#[test] +fn force_cancel_approval_works() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + Balances::make_free_balance_be(&ALICE, 1); + assert_ok!(Tokens::approve_transfer(Origin::signed(ALICE), DOT, BOB, 50)); + let e = Error::::NoPermission; + assert_noop!(Tokens::force_cancel_approval(Origin::signed(BOB), DOT, ALICE, BOB), e); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(ALICE), BTC, ALICE, BOB), Error::::Unknown); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(ALICE), DOT, BOB, BOB), Error::::Unknown); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(ALICE), DOT, ALICE, TREASURY_ACCOUNT), Error::::Unknown); + assert_ok!(Tokens::force_cancel_approval(Origin::signed(ALICE), DOT, ALICE, BOB)); + assert_noop!(Tokens::force_cancel_approval(Origin::signed(ALICE), DOT, ALICE, BOB), Error::::Unknown); + }); +} + +#[test] +fn lifecycle_should_work() { + new_test_ext().execute_with(|| { + Balances::make_free_balance_be(&ALICE, 100); + assert_ok!(Tokens::create(Origin::signed(ALICE), DOT, ALICE, 1)); + assert_eq!(Balances::reserved_balance(&ALICE), 1); + assert!(Token::::contains_key(DOT)); + + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0], vec![0], 12)); + assert_eq!(Balances::reserved_balance(&ALICE), 4); + assert!(Metadata::::contains_key(DOT)); + + Balances::make_free_balance_be(&AccountId::new([10u8; 32]), 100); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, AccountId::new([10u8; 32]), 100)); + Balances::make_free_balance_be(&AccountId::new([20u8; 32]), 100); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, AccountId::new([20u8; 32]), 100)); + assert_eq!(Accounts::::iter_prefix(DOT).count(), 2); + + assert_ok!(Tokens::destroy(Origin::signed(ALICE), DOT)); + assert_eq!(Balances::reserved_balance(&ALICE), 0); + + assert!(!Token::::contains_key(DOT)); + assert!(!Metadata::::contains_key(DOT)); + assert_eq!(Accounts::::iter_prefix(DOT).count(), 0); + + assert_ok!(Tokens::create(Origin::signed(ALICE), DOT, ALICE, 1)); + assert_eq!(Balances::reserved_balance(&ALICE), 1); + assert!(Token::::contains_key(DOT)); + + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0], vec![0], 12)); + assert_eq!(Balances::reserved_balance(&ALICE), 4); + assert!(Metadata::::contains_key(DOT)); + + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, AccountId::new([10u8; 32]), 100)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, AccountId::new([20u8; 32]), 100)); + assert_eq!(Accounts::::iter_prefix(DOT).count(), 2); + + assert_ok!(Tokens::destroy(Origin::root(), DOT)); + assert_eq!(Balances::reserved_balance(&ALICE), 0); + + assert!(!Token::::contains_key(DOT)); + assert!(!Metadata::::contains_key(DOT)); + assert_eq!(Accounts::::iter_prefix(DOT).count(), 0); + }); +} + +#[test] +fn min_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 10)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Accounts::::iter_prefix_values(DOT).into_iter().map(|e| e).collect::>>().len(), 1); + + // Cannot create a new account with a balance that is below minimum... + assert_noop!(Tokens::mint(Origin::signed(ALICE), DOT, BOB, 9), Error::::BelowMinimum); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 9), Error::::BelowMinimum); + assert_noop!(Tokens::force_transfer(Origin::signed(ALICE), DOT, ALICE, BOB, 9), Error::::BelowMinimum); + + // When deducting from an account to below minimum, it should be reaped. + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 100)); + assert!(Tokens::free_balance(DOT, &ALICE).is_zero()); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_eq!(Tokens::total_issuance(DOT), 100); + assert_eq!(Accounts::::iter_prefix_values(DOT).into_iter().map(|e| e).collect::>>().len(), 1); + + assert_ok!(Tokens::force_transfer(Origin::signed(ALICE), DOT, BOB, ALICE, 100)); + assert!(Tokens::free_balance(DOT, &BOB).is_zero()); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Accounts::::iter_prefix_values(DOT).into_iter().map(|e| e).collect::>>().len(), 1); + + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, ALICE, 100)); + assert!(Tokens::free_balance(DOT, &ALICE).is_zero()); + assert_eq!(Accounts::::iter_prefix_values(DOT).into_iter().map(|e| e).collect::>>().len(), 0); + }); +} + +#[test] +fn querying_total_supply_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_ok!(Tokens::transfer(Origin::signed(BOB), DOT, TREASURY_ACCOUNT, 31)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 19); + assert_eq!(Tokens::free_balance(DOT, &TREASURY_ACCOUNT), 31); + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, TREASURY_ACCOUNT, u64::max_value())); + assert_eq!(Tokens::total_issuance(DOT), 69); + }); +} + +#[test] +fn transferring_amount_below_available_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + }); +} + +#[test] +fn transferring_enough_to_kill_source_when_keep_alive_should_fail() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 10)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_noop!(Tokens::transfer_keep_alive(Origin::signed(ALICE), DOT, BOB, 91), Error::::WouldDie); + assert_ok!(Tokens::transfer_keep_alive(Origin::signed(ALICE), DOT, BOB, 90)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 10); + assert_eq!(Tokens::free_balance(DOT, &BOB), 90); + }); +} + +#[test] +fn transferring_frozen_user_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::freeze(Origin::signed(ALICE), DOT, ALICE)); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50), Error::::Frozen); + assert_ok!(Tokens::thaw(Origin::signed(ALICE), DOT, ALICE)); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + }); +} + +#[test] +fn transferring_frozen_asset_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::freeze_asset(Origin::signed(ALICE), DOT)); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50), Error::::TokenIsFrozen); + assert_ok!(Tokens::thaw_asset(Origin::signed(ALICE), DOT)); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + }); +} + +#[test] +fn origin_guards_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_noop!(Tokens::transfer_ownership(Origin::signed(BOB), DOT, BOB), Error::::NoPermission); + assert_noop!(Tokens::set_team(Origin::signed(BOB), DOT, BOB, BOB, BOB), Error::::NoPermission); + assert_noop!(Tokens::freeze(Origin::signed(BOB), DOT, ALICE), Error::::NoPermission); + assert_noop!(Tokens::thaw(Origin::signed(BOB), DOT, BOB), Error::::NoPermission); + assert_noop!(Tokens::mint(Origin::signed(BOB), DOT, BOB, 100), Error::::NoPermission); + assert_noop!(Tokens::burn(Origin::signed(BOB), DOT, BOB, 100), Error::::NoPermission); + assert_noop!(Tokens::force_transfer(Origin::signed(BOB), DOT, BOB, BOB, 100), Error::::NoPermission); + assert_noop!(Tokens::destroy(Origin::signed(BOB), DOT), Error::::NoPermission); + }); +} + +#[test] +fn transfer_owner_should_work() { + new_test_ext().execute_with(|| { + Balances::make_free_balance_be(&ALICE, 100); + Balances::make_free_balance_be(&BOB, 100); + assert_ok!(Tokens::create(Origin::signed(ALICE), DOT, ALICE, 1)); + + assert_eq!(Balances::reserved_balance(&ALICE), 1); + + assert_ok!(Tokens::transfer_ownership(Origin::signed(ALICE), DOT, BOB)); + assert_eq!(Balances::reserved_balance(&BOB), 1); + assert_eq!(Balances::reserved_balance(&ALICE), 0); + + assert_noop!(Tokens::transfer_ownership(Origin::signed(ALICE), DOT, ALICE), Error::::NoPermission); + + // Set metadata now and make sure that deposit gets transferred back. + assert_ok!(Tokens::set_metadata(Origin::signed(BOB), DOT, vec![0u8; 10], vec![0u8; 10], 12)); + assert_ok!(Tokens::transfer_ownership(Origin::signed(BOB), DOT, ALICE)); + assert_eq!(Balances::reserved_balance(&ALICE), 22); + assert_eq!(Balances::reserved_balance(&BOB), 0); + }); +} + +#[test] +fn set_team_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::set_team(Origin::signed(ALICE), DOT, BOB, TREASURY_ACCOUNT, DAVE)); + + assert_ok!(Tokens::mint(Origin::signed(BOB), DOT, BOB, 100)); + assert_ok!(Tokens::freeze(Origin::signed(DAVE), DOT, BOB)); + assert_ok!(Tokens::thaw(Origin::signed(TREASURY_ACCOUNT), DOT, BOB)); + assert_ok!(Tokens::force_transfer(Origin::signed(TREASURY_ACCOUNT), DOT, BOB, TREASURY_ACCOUNT, 100)); + assert_ok!(Tokens::burn(Origin::signed(TREASURY_ACCOUNT), DOT, TREASURY_ACCOUNT, 100)); + }); +} + +#[test] +fn transferring_to_frozen_account_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, BOB, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_ok!(Tokens::freeze(Origin::signed(ALICE), DOT, BOB)); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &BOB), 150); + }); +} + +#[test] +fn transferring_amount_more_than_available_balance_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, ALICE, u64::max_value())); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 51), Error::::BalanceLow); + }); +} + +#[test] +fn transferring_less_than_one_unit_is_fine() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 0)); + }); +} + +#[test] +fn transferring_more_units_than_total_supply_should_not_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_noop!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 101), Error::::BalanceLow); + }); +} + +#[test] +fn burning_asset_balance_with_positive_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, ALICE, u64::max_value())); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + }); +} + +#[test] +fn burning_asset_balance_with_zero_balance_does_nothing() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(DOT, &BOB), 0); + assert_ok!(Tokens::burn(Origin::signed(ALICE), DOT, BOB, u64::max_value())); + assert_eq!(Tokens::free_balance(DOT, &BOB), 0); + assert_eq!(Tokens::total_supply(DOT), 100); + }); +} + +#[test] +fn set_metadata_should_work() { + new_test_ext().execute_with(|| { + // Cannot add metadata to unknown asset + assert_noop!( + Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 10], 12), + Error::::Unknown, + ); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + // Cannot add metadata to unowned asset + assert_noop!( + Tokens::set_metadata(Origin::signed(BOB), DOT, vec![0u8; 10], vec![0u8; 10], 12), + Error::::NoPermission, + ); + + // Cannot add oversized metadata + assert_noop!( + Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 100], vec![0u8; 10], 12), + Error::::BadMetadata, + ); + assert_noop!( + Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 100], 12), + Error::::BadMetadata, + ); + + // Successfully add metadata and take deposit + Balances::make_free_balance_be(&ALICE, 30); + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 10], 12)); + assert_eq!(Balances::free_balance(&ALICE), 9); + + // Update deposit + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 5], 12)); + assert_eq!(Balances::free_balance(&ALICE), 14); + assert_ok!(Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 10], vec![0u8; 15], 12)); + assert_eq!(Balances::free_balance(&ALICE), 4); + + // Cannot over-reserve + assert_noop!( + Tokens::set_metadata(Origin::signed(ALICE), DOT, vec![0u8; 20], vec![0u8; 20], 12), + BalancesError::::InsufficientBalance, + ); + + // Clear Metadata + assert!(Metadata::::contains_key(DOT)); + assert_noop!(Tokens::clear_metadata(Origin::signed(BOB), DOT), Error::::NoPermission); + assert_noop!(Tokens::clear_metadata(Origin::signed(ALICE), BTC), Error::::Unknown); + assert_ok!(Tokens::clear_metadata(Origin::signed(ALICE), DOT)); + assert!(!Metadata::::contains_key(DOT)); + }); +} + +#[test] +fn force_metadata_should_work() { + new_test_ext().execute_with(|| { + //force set metadata works + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 1)); + assert_ok!(Tokens::force_set_metadata(Origin::root(), DOT, vec![0u8; 10], vec![0u8; 10], 8, false)); + assert!(Metadata::::contains_key(DOT)); + + //overwrites existing metadata + let asset_original_metadata = Metadata::::get(DOT); + assert_ok!(Tokens::force_set_metadata(Origin::root(), DOT, vec![1u8; 10], vec![1u8; 10], 8, false)); + assert_ne!(Metadata::::get(DOT), asset_original_metadata); + + //attempt to set metadata for non-existent asset class + assert_noop!( + Tokens::force_set_metadata(Origin::root(), BTC, vec![0u8; 10], vec![0u8; 10], 8, false), + Error::::Unknown + ); + + //string length limit check + let limit = StringLimit::get() as usize; + assert_noop!( + Tokens::force_set_metadata(Origin::root(), DOT, vec![0u8; limit + 1], vec![0u8; 10], 8, false), + Error::::BadMetadata + ); + assert_noop!( + Tokens::force_set_metadata(Origin::root(), DOT, vec![0u8; 10], vec![0u8; limit + 1], 8, false), + Error::::BadMetadata + ); + + //force clear metadata works + assert!(Metadata::::contains_key(DOT)); + assert_ok!(Tokens::force_clear_metadata(Origin::root(), DOT)); + assert!(!Metadata::::contains_key(DOT)); + + //Error handles clearing non-existent asset class + assert_noop!(Tokens::force_clear_metadata(Origin::root(), BTC), Error::::Unknown); + }); +} + + +#[test] +fn force_asset_status_should_work(){ + new_test_ext().execute_with(|| { + Balances::make_free_balance_be(&ALICE, 10); + Balances::make_free_balance_be(&BOB, 10); + assert_ok!(Tokens::create(Origin::signed(ALICE), DOT, ALICE, 30)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, ALICE, 50)); + assert_ok!(Tokens::mint(Origin::signed(ALICE), DOT, BOB, 150)); + + //force asset status to change min_balance > balance + assert_ok!(Tokens::force_asset_status(Origin::root(), DOT, ALICE, ALICE, ALICE, ALICE, 100, false)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + + //account can NOT receive Tokens for balance < min_balance + assert_noop!(Tokens::transfer(Origin::signed(BOB), DOT, ALICE, 1), Error::::BelowMinimum); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + + //account can send tokens for balance < min_balance + assert_ok!(Tokens::transfer(Origin::signed(ALICE), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::free_balance(DOT, &BOB), 200); + assert_eq!(Tokens::total_supply(DOT), 200); + + //won't create new account with balance below min_balance + assert_noop!(Tokens::transfer(Origin::signed(BOB), DOT, TREASURY_ACCOUNT, 50), Error::::BelowMinimum); + + //force asset status will not execute for non-existent class + assert_noop!( + Tokens::force_asset_status(Origin::root(), BTC, ALICE, ALICE, ALICE, ALICE, 90, false), + Error::::Unknown + ); + + //account drains to completion when funds dip below min_balance + assert_ok!(Tokens::force_asset_status(Origin::root(), DOT, ALICE, ALICE, ALICE, ALICE, 110, false)); + assert_eq!(Tokens::total_supply(DOT), 200); + assert_ok!(Tokens::transfer(Origin::signed(BOB), DOT, ALICE, 110)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 200); + assert_eq!(Tokens::free_balance(DOT, &BOB), 0); + assert_eq!(Tokens::total_supply(DOT), 200); + }); +} + +/** + * @brief Tokens tests (mostly from orml-tokens) + */ + #[test] +fn minimum_balance_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + assert_eq!(Tokens::minimum_balance(BTC), 1); + assert_eq!(Tokens::minimum_balance(DOT), 2); + }); +} + +#[test] +fn remove_dust_work() { + new_test_ext().execute_with(|| { + System::set_block_number(1); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + assert_ok!(Tokens::deposit(DOT, &DAVE, 100)); + assert_eq!(Tokens::total_issuance(DOT), 100); + assert_eq!(Accounts::::contains_key(DOT, DAVE), true); + assert_eq!(Tokens::free_balance(DOT, &DAVE), 100); + assert_eq!(System::providers(&DAVE), 1); + assert_eq!(Accounts::::contains_key(DOT, DustAccount::get()), false); + assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 0); + assert_eq!(System::providers(&DustAccount::get()), 0); + + // total is gte ED, will not handle dust + assert_ok!(Tokens::withdraw(DOT, &DAVE, 98)); + assert_eq!(Tokens::total_issuance(DOT), 2); + assert_eq!(Accounts::::contains_key(DOT, DAVE), true); + assert_eq!(Tokens::free_balance(DOT, &DAVE), 2); + assert_eq!(System::providers(&DAVE), 1); + assert_eq!(Accounts::::contains_key(DOT, DustAccount::get()), false); + assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 0); + assert_eq!(System::providers(&DustAccount::get()), 0); + + assert_eq!(Tokens::total_issuance(DOT), 2); + assert_ok!(Tokens::withdraw(DOT, &DAVE, 1)); + assert_eq!(Tokens::total_issuance(DOT), 1); + assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 1); + // total is lte ED, will handle dust + assert_eq!(Tokens::total_issuance(DOT), 1); + assert_eq!(Accounts::::contains_key(DOT, DAVE), false); + assert_eq!(Tokens::free_balance(DOT, &DAVE), 0); + assert_eq!(System::providers(&DAVE), 0); + + // will not handle dust for module account + assert_eq!(Accounts::::contains_key(DOT, DustAccount::get()), true); + assert_eq!(Tokens::free_balance(DOT, &DustAccount::get()), 1); + assert_eq!(System::providers(&DustAccount::get()), 1); + + let dust_lost_event = mock::Event::tokens(crate::Event::DustLost(DAVE, DOT, 1)); + assert!(System::events().iter().any(|record| record.event == dust_lost_event)); + }); +} + +#[test] +fn set_lock_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 10); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen(), 10); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 50)); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 50); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + assert_ok!(Tokens::set_lock(ID_2, DOT, &ALICE, 60)); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 60); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 2); + }); +} + +#[test] +fn extend_lock_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 10); + assert_ok!(Tokens::extend_lock(ID_1, DOT, &ALICE, 20)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + assert_eq!(Tokens::accounts(DOT, &ALICE).frozen, 20); + assert_ok!(Tokens::extend_lock(ID_2, DOT, &ALICE, 10)); + assert_ok!(Tokens::extend_lock(ID_1, DOT, &ALICE, 20)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 2); + }); +} + +#[test] +fn remove_lock_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); + assert_ok!(Tokens::set_lock(ID_2, DOT, &ALICE, 20)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 2); + assert_ok!(Tokens::remove_lock(ID_2, DOT, &ALICE)); + assert_eq!(Tokens::locks(ALICE, DOT).len(), 1); + }); +} + +#[test] +fn frozen_can_limit_liquidity() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 90)); + assert_noop!( + >::transfer(DOT, &ALICE, &BOB, 11), + Error::::LiquidityRestrictions, + ); + assert_ok!(Tokens::set_lock(ID_1, DOT, &ALICE, 10)); + assert_ok!(>::transfer(DOT, &ALICE, &BOB, 11),); + }); +} + +#[test] +fn can_reserve_is_correct() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::can_reserve(DOT, &ALICE, 0), true); + assert_eq!(Tokens::can_reserve(DOT, &ALICE, 101), false); + assert_eq!(Tokens::can_reserve(DOT, &ALICE, 100), true); + }); +} + +#[test] +fn reserve_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_noop!(Tokens::reserve(DOT, &ALICE, 101), Error::::BalanceLow,); + assert_ok!(Tokens::reserve(DOT, &ALICE, 0)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::total_balance(DOT, &ALICE), 100); + assert_ok!(Tokens::reserve(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_balance(DOT, &ALICE), 100); + }); +} + +#[test] +fn unreserve_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::unreserve(DOT, &ALICE, 0), 0); + assert_eq!(Tokens::unreserve(DOT, &ALICE, 50), 50); + assert_ok!(Tokens::reserve(DOT, &ALICE, 30)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 70); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 30); + assert_eq!(Tokens::unreserve(DOT, &ALICE, 15), 0); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 85); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 15); + assert_eq!(Tokens::unreserve(DOT, &ALICE, 30), 15); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + }); +} + +#[test] +fn slash_reserved_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::reserve(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 200); + assert_eq!(Tokens::slash_reserved(DOT, &ALICE, 0), 0); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 200); + assert_eq!(Tokens::slash_reserved(DOT, &ALICE, 100), 50); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::total_issuance(DOT), 150); + }); +} + +#[test] +fn repatriate_reserved_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!( + Tokens::repatriate_reserved(DOT, &ALICE, &ALICE, 0, BalanceStatus::Free), + Ok(0) + ); + assert_eq!( + Tokens::repatriate_reserved(DOT, &ALICE, &ALICE, 50, BalanceStatus::Free), + Ok(50) + ); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 0); + assert_ok!(Tokens::reserve(DOT, &BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 50); + assert_eq!( + Tokens::repatriate_reserved(DOT, &BOB, &BOB, 60, BalanceStatus::Reserved), + Ok(10) + ); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 50); + + assert_eq!( + Tokens::repatriate_reserved(DOT, &BOB, &ALICE, 30, BalanceStatus::Reserved), + Ok(0) + ); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 30); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 20); + + assert_eq!( + Tokens::repatriate_reserved(DOT, &BOB, &ALICE, 30, BalanceStatus::Free), + Ok(10) + ); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 120); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 30); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::reserved_balance(DOT, &BOB), 0); + }); +} + +#[test] +fn slash_draw_reserved_correct() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::reserve(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 200); + + assert_eq!(Tokens::slash(DOT, &ALICE, 80), 0); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 20); + assert_eq!(Tokens::total_issuance(DOT), 120); + + assert_eq!(Tokens::slash(DOT, &ALICE, 50), 30); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::reserved_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::total_issuance(DOT), 100); + }); +} + +#[test] +fn genesis_issuance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_eq!(Tokens::total_issuance(DOT), 200); + }); +} + +#[test] +fn transfer_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + System::set_block_number(1); + + assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, BOB, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::free_balance(DOT, &BOB), 150); + assert_eq!(Tokens::total_issuance(DOT), 200); + + let transferred_event = mock::Event::tokens(crate::Event::Transferred(DOT, ALICE, BOB, 50)); + assert!(System::events().iter().any(|record| record.event == transferred_event)); + + assert_noop!( + Tokens::transfer(Some(ALICE).into(), DOT, BOB, 60), + Error::::BalanceLow, + ); + }); +} + +#[test] +fn transfer_all_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + System::set_block_number(1); + + assert_ok!(Tokens::transfer_all(Some(ALICE).into(), DOT, BOB)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::free_balance(DOT, &BOB), 200); + + let transferred_event = mock::Event::tokens(crate::Event::Transferred(DOT, ALICE, BOB, 100)); + assert!(System::events().iter().any(|record| record.event == transferred_event)); + }); +} + +#[test] +fn deposit_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 200); + assert_eq!(Tokens::total_issuance(DOT), 300); + + assert_noop!( + Tokens::deposit(DOT, &ALICE, Balance::max_value()), + Error::::TotalIssuanceOverflow, + ); + }); +} + +#[test] +fn withdraw_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::withdraw(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 150); + + assert_noop!(Tokens::withdraw(DOT, &ALICE, 60), Error::::BalanceLow); + }); +} + +#[test] +fn slash_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + // slashed_amount < amount + assert_eq!(Tokens::slash(DOT, &ALICE, 50), 0); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 50); + assert_eq!(Tokens::total_issuance(DOT), 150); + + // slashed_amount == amount + assert_eq!(Tokens::slash(DOT, &ALICE, 51), 1); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::total_issuance(DOT), 100); + }); +} + +#[test] +fn update_balance_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_ok!(Tokens::update_balance(DOT, &ALICE, 50)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 150); + assert_eq!(Tokens::total_issuance(DOT), 250); + + assert_ok!(Tokens::update_balance(DOT, &BOB, -50)); + assert_eq!(Tokens::free_balance(DOT, &BOB), 50); + assert_eq!(Tokens::total_issuance(DOT), 200); + + assert_noop!(Tokens::update_balance(DOT, &BOB, -60), Error::::BalanceLow); + }); +} + +#[test] +fn ensure_can_withdraw_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + assert_ok!(Tokens::deposit(DOT, &BOB, 100)); + + assert_noop!( + Tokens::ensure_can_withdraw(DOT, &ALICE, 101), + Error::::BalanceLow + ); + + assert_ok!(Tokens::ensure_can_withdraw(DOT, &ALICE, 1)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + }); +} + +#[test] +fn no_op_if_amount_is_zero() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + assert_ok!(Tokens::ensure_can_withdraw(DOT, &ALICE, 0)); + assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, BOB, 0)); + assert_ok!(Tokens::transfer(Some(ALICE).into(), DOT, ALICE, 0)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 0)); + assert_ok!(Tokens::withdraw(DOT, &ALICE, 0)); + assert_eq!(Tokens::slash(DOT, &ALICE, 0), 0); + assert_eq!(Tokens::slash(DOT, &ALICE, 1), 1); + assert_ok!(Tokens::update_balance(DOT, &ALICE, 0)); + }); +} + +#[test] +fn merge_account_should_work() { + new_test_ext().execute_with(|| { + assert_ok!(Tokens::force_create(Origin::root(), BTC, ALICE, 1)); + assert_ok!(Tokens::force_create(Origin::root(), DOT, ALICE, 2)); + assert_ok!(Tokens::deposit(BTC, &ALICE, 200)); + assert_ok!(Tokens::deposit(DOT, &ALICE, 100)); + + assert_eq!(Tokens::free_balance(DOT, &ALICE), 100); + assert_eq!(Tokens::free_balance(BTC, &ALICE), 200); + assert_eq!(Tokens::free_balance(DOT, &BOB), 0); + + assert_ok!(Tokens::reserve(DOT, &ALICE, 1)); + assert_noop!( + Tokens::merge_account(&ALICE, &BOB), + Error::::StillHasActiveReserved + ); + Tokens::unreserve(DOT, &ALICE, 1); + + assert_ok!(Tokens::merge_account(&ALICE, &BOB)); + assert_eq!(Tokens::free_balance(DOT, &ALICE), 0); + assert_eq!(Tokens::free_balance(BTC, &ALICE), 0); + assert_eq!(Tokens::free_balance(DOT, &BOB), 100); + assert_eq!(Tokens::free_balance(BTC, &BOB), 200); + }); +} diff --git a/pallets/tokens/src/traits.rs b/pallets/tokens/src/traits.rs new file mode 100644 index 00000000..05999f12 --- /dev/null +++ b/pallets/tokens/src/traits.rs @@ -0,0 +1,11 @@ +use frame_support::dispatch; + +pub trait ExtendedTokenSystem { + fn create(currency: CurrencyId, owner: AccountId, admin: AccountId, min_balance: Balance) + -> Result<(), dispatch::DispatchError>; + fn mint(currency_id: CurrencyId, account_id: AccountId, amount: Balance) + -> Result<(), dispatch::DispatchError>; + fn burn(currency_id: CurrencyId, account_id: AccountId, amount: Balance) + -> Result<(), dispatch::DispatchError>; + fn handle_dust(currency_id: CurrencyId, account_id: &AccountId, amount: Balance); +} diff --git a/pallets/tokens/src/types.rs b/pallets/tokens/src/types.rs new file mode 100644 index 00000000..0261d339 --- /dev/null +++ b/pallets/tokens/src/types.rs @@ -0,0 +1,132 @@ +use super::*; + +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] +pub enum DustHandlerType { + Burn, + Transfer(AccountId), +} + +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] +pub struct TokenDetails< + Balance, + AccountId, +> { + /// Can change `owner`, `issuer`, `freezer` and `admin` accounts. + pub(super) owner: AccountId, + /// Can mint tokens. + pub(super) issuer: AccountId, + /// Can thaw tokens, force transfers and burn tokens from any account. + pub(super) admin: AccountId, + /// Can freeze tokens. + pub(super) freezer: AccountId, + /// The total supply across all accounts. + pub(super) supply: Balance, + /// The balance deposited for this currency. This pays for the data stored here. + pub(super) deposit: Balance, + /// The ED for virtual accounts. + pub(super) min_balance: Balance, + /// The total number of approvals. + pub(super) approvals: u32, + /// Whether the currency is frozen for non-admin transfers. + pub(super) is_frozen: bool, + /// The type of handler used to clean up dust + pub(super) dust_type: DustHandlerType, +} + +/// A pair to act as a key for the approval storage map. +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] +pub struct ApprovalKey { + /// The owner of the funds that are being approved. + pub(super) owner: AccountId, + /// The party to whom transfer of the funds is being delegated. + pub(super) delegate: AccountId, +} + +/// Data concerning an approval. +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default)] +pub struct Approval { + /// The amount of funds approved for the balance transfer from the owner to some delegated + /// target. + pub(super) amount: Balance, + /// The amount reserved on the owner's account to hold this item in storage. + pub(super) deposit: Balance, +} + +#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default)] +pub struct TokenMetadata { + /// The balance deposited for this metadata. + /// + /// This pays for the data stored in this struct. + pub(super) deposit: Balance, + /// The user friendly name of this asset. Limited in length by `StringLimit`. + pub(super) name: Vec, + /// The ticker symbol for this asset. Limited in length by `StringLimit`. + pub(super) symbol: Vec, + /// The number of decimals this asset uses to represent one unit. + pub(super) decimals: u8, + /// Whether the asset metadata may be changed by a non Force origin. + pub(super) is_frozen: bool, +} + +/// Witness data for the destroy transactions. +#[derive(Copy, Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug)] +pub struct DestroyWitness { + /// The number of accounts holding the asset. + #[codec(compact)] + pub(super) accounts: u32, + /// The number of accounts holding the asset with a self-sufficient reference. + #[codec(compact)] + pub(super) sufficients: u32, + /// The number of transfer-approvals of the asset. + #[codec(compact)] + pub(super) approvals: u32, +} + +/// A single lock on a balance. There can be many of these on an account and +/// they "overlap", so the same balance is frozen by multiple locks. +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)] +pub struct BalanceLock { + /// An identifier for this lock. Only one lock may be in existence for + /// each identifier. + pub id: LockIdentifier, + /// The amount which the free balance may not drop below when this lock + /// is in effect. + pub amount: Balance, +} + +/// balance information for an account. +#[derive(Encode, Decode, Clone, PartialEq, Eq, Default, RuntimeDebug)] +pub struct AccountData { + /// Non-reserved part of the balance. There may still be restrictions on + /// this, but it is the total pool what may in principle be transferred, + /// reserved. + /// + /// This is the only balance that matters in terms of most operations on + /// tokens. + pub free: Balance, + /// Balance which is reserved and may not be used at all. + /// + /// This can still get slashed, but gets slashed last of all. + /// + /// This balance is a 'reserve' balance that other subsystems use in + /// order to set aside tokens that are still 'owned' by the account + /// holder, but which are suspendable. + pub reserved: Balance, + /// The amount that `free` may not drop below when withdrawing. + pub frozen: Balance, + /// The flag representing if the entire account is frozen + pub is_frozen: bool, +} + +impl AccountData { + /// The amount that this account's free balance may not be reduced + /// beyond. + pub(crate) fn frozen(&self) -> Balance { + self.frozen + } + /// The total balance in this account including any that is reserved and + /// ignoring any frozen. + pub fn total(&self) -> Balance { + self.free.saturating_add(self.reserved) + } +} diff --git a/pallets/tokens/src/weights.rs b/pallets/tokens/src/weights.rs new file mode 100644 index 00000000..e258309a --- /dev/null +++ b/pallets/tokens/src/weights.rs @@ -0,0 +1,295 @@ +// This file is part of Substrate. + +// Copyright (C) 2021 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. + +//! Autogenerated weights for pallet_assets +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 +//! DATE: 2021-03-08, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// target/release/substrate +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_assets +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./frame/assets/src/weights.rs +// --template=./.maintain/frame-weight-template.hbs + + +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for pallet_assets. +pub trait WeightInfo { + fn create() -> Weight; + fn force_create() -> Weight; + fn destroy(c: u32, s: u32, a: u32, ) -> Weight; + fn mint() -> Weight; + fn burn() -> Weight; + fn transfer() -> Weight; + fn transfer_keep_alive() -> Weight; + fn force_transfer() -> Weight; + fn transfer_ownership() -> Weight; + fn set_team() -> Weight; + fn set_metadata(n: u32, s: u32, ) -> Weight; + fn clear_metadata() -> Weight; + fn force_set_metadata(n: u32, s: u32, ) -> Weight; + fn force_clear_metadata() -> Weight; + fn force_asset_status() -> Weight; + fn approve_transfer() -> Weight; + fn transfer_approved() -> Weight; + fn cancel_approval() -> Weight; + fn force_cancel_approval() -> Weight; +} + +/// Weights for pallet_assets using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + fn create() -> Weight { + (48_305_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_create() -> Weight { + (23_827_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn destroy(c: u32, s: u32, a: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 38_000 + .saturating_add((24_232_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 38_000 + .saturating_add((30_467_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 383_000 + .saturating_add((2_343_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + } + fn mint() -> Weight { + (46_433_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn burn() -> Weight { + (46_000_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + fn transfer() -> Weight { + (70_793_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn transfer_keep_alive() -> Weight { + (57_453_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn force_transfer() -> Weight { + (70_968_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + fn transfer_ownership() -> Weight { + (28_566_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn set_team() -> Weight { + (25_297_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn set_metadata(_n: u32, s: u32, ) -> Weight { + (53_367_000 as Weight) + // Standard Error: 0 + .saturating_add((8_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn clear_metadata() -> Weight { + (51_721_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_set_metadata(_n: u32, s: u32, ) -> Weight { + (27_117_000 as Weight) + // Standard Error: 0 + .saturating_add((5_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_clear_metadata() -> Weight { + (51_598_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_asset_status() -> Weight { + (23_366_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn approve_transfer() -> Weight { + (47_906_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn transfer_approved() -> Weight { + (90_338_000 as Weight) + .saturating_add(T::DbWeight::get().reads(5 as Weight)) + .saturating_add(T::DbWeight::get().writes(5 as Weight)) + } + fn cancel_approval() -> Weight { + (48_591_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + fn force_cancel_approval() -> Weight { + (54_879_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn create() -> Weight { + (48_305_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_create() -> Weight { + (23_827_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn destroy(c: u32, s: u32, a: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 38_000 + .saturating_add((24_232_000 as Weight).saturating_mul(c as Weight)) + // Standard Error: 38_000 + .saturating_add((30_467_000 as Weight).saturating_mul(s as Weight)) + // Standard Error: 383_000 + .saturating_add((2_343_000 as Weight).saturating_mul(a as Weight)) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(c as Weight))) + .saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight))) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(a as Weight))) + } + fn mint() -> Weight { + (46_433_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + fn burn() -> Weight { + (46_000_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(2 as Weight)) + } + fn transfer() -> Weight { + (70_793_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn transfer_keep_alive() -> Weight { + (57_453_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn force_transfer() -> Weight { + (70_968_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + fn transfer_ownership() -> Weight { + (28_566_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn set_team() -> Weight { + (25_297_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn set_metadata(_n: u32, s: u32, ) -> Weight { + (53_367_000 as Weight) + // Standard Error: 0 + .saturating_add((8_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn clear_metadata() -> Weight { + (51_721_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_set_metadata(_n: u32, s: u32, ) -> Weight { + (27_117_000 as Weight) + // Standard Error: 0 + .saturating_add((5_000 as Weight).saturating_mul(s as Weight)) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_clear_metadata() -> Weight { + (51_598_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_asset_status() -> Weight { + (23_366_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn approve_transfer() -> Weight { + (47_906_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn transfer_approved() -> Weight { + (90_338_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(5 as Weight)) + .saturating_add(RocksDbWeight::get().writes(5 as Weight)) + } + fn cancel_approval() -> Weight { + (48_591_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(1 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + fn force_cancel_approval() -> Weight { + (54_879_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } +} diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 6159e8ce..eaf7eb3d 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -27,6 +27,7 @@ static_assertions = "1.1.0" merkle = { package = "pallet-merkle", version = "3.0.0", default-features = false, path = "../pallets/merkle" } mixer = { package = "pallet-mixer", version = "3.0.0", default-features = false, path = "../pallets/mixer" } +tokens = { package = "pallet-tokens", version = "3.0.0", default-features = false, path = "../pallets/tokens" } merkle-rpc = { package = "pallet-merkle-rpc", version = "3.0.0", path = "../pallets/merkle/rpc", optional = true } # Substrate dependencies @@ -42,10 +43,10 @@ pallet-contracts = { default-features = false, version = "3.0.0" } pallet-contracts-primitives = { default-features = false, version = "3.0.0" } pallet-contracts-rpc-runtime-api = { default-features = false, version = "3.0.0" } -pallet-evm = { git = "https://github.com/paritytech/frontier", default-features = false } -pallet-ethereum = { default-features = false, git = "https://github.com/paritytech/frontier" } -fp-rpc = { default-features = false, git = "https://github.com/paritytech/frontier" } -pallet-evm-precompile-simple = { version = "3.0", git = "https://github.com/paritytech/frontier", default-features = false } +pallet-evm = { git = "https://github.com/paritytech/frontier", default-features = false, optional = true } +pallet-ethereum = { default-features = false, git = "https://github.com/paritytech/frontier", optional = true} +fp-rpc = { default-features = false, git = "https://github.com/paritytech/frontier", optional = true} +pallet-evm-precompile-simple = { version = "1.0.0", git = "https://github.com/paritytech/frontier", default-features = false, optional = true} pallet-grandpa = { default-features = false, version = "3.0.0" } pallet-randomness-collective-flip = { default-features = false, version = "3.0.0" } @@ -65,7 +66,6 @@ sp-std = { default-features = false, version = "3.0.0" } sp-transaction-pool = { default-features = false, version = "3.0.0" } sp-version = { default-features = false, version = "3.0.0" } -orml-tokens = { version = "0.4.0", default-features = false } orml-currencies = { version = "0.4.0", default-features = false } orml-traits = { version = "0.4.0", default-features = false } @@ -83,6 +83,14 @@ runtime-benchmarks = [ "mixer/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] + +frontier = [ + "fp-rpc/std", + "pallet-ethereum/std", + "pallet-evm/std", + "pallet-evm-precompile-simple/std", +] + std = [ "codec/std", "serde", @@ -90,15 +98,11 @@ std = [ "frame-support/std", "frame-system/std", "frame-system-rpc-runtime-api/std", - "fp-rpc/std", "pallet-aura/std", "pallet-balances/std", "pallet-contracts/std", "pallet-contracts-primitives/std", "pallet-contracts-rpc-runtime-api/std", - "pallet-ethereum/std", - "pallet-evm/std", - "pallet-evm-precompile-simple/std", "pallet-grandpa/std", "pallet-randomness-collective-flip/std", "pallet-sudo/std", @@ -119,4 +123,5 @@ std = [ "merkle/std", "merkle-rpc", "mixer/std", + "tokens/std", ] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index cf0cbde4..e32abef4 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -17,11 +17,12 @@ use sp_core::{ crypto::{AccountId32, KeyTypeId}, OpaqueMetadata, H160, H256, U256, }; +use sp_inherents::{InherentData, CheckInherentsResult}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, NumberFor, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedPointNumber, ModuleId, MultiSignature, Perbill, Perquintill, + ApplyExtrinsicResult, FixedPointNumber, MultiSignature, Perbill, Perquintill, }; use sp_std::prelude::*; #[cfg(feature = "std")] @@ -31,9 +32,7 @@ use static_assertions::const_assert; // A few exports that help ease life for downstream crates. pub use frame_support::{ - construct_runtime, - pallet_prelude::PhantomData, - parameter_types, + construct_runtime, parameter_types, pallet_prelude::PhantomData, PalletId, traits::{Currency, Imbalance, KeyOwnerProofSystem, LockIdentifier, OnUnbalanced, Randomness, U128CurrencyToVote}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, @@ -45,17 +44,26 @@ pub use frame_system::limits::{BlockLength, BlockWeights}; pub use pallet_balances::Call as BalancesCall; use pallet_contracts::weights::WeightInfo; pub use pallet_timestamp::Call as TimestampCall; +use sp_consensus_aura::SlotDuration; use frame_support::traits::FindAuthor; use merkle::utils::keys::ScalarData; use orml_currencies::BasicCurrencyAdapter; use orml_traits::parameter_type_with_key; -use pallet_ethereum::TransactionStatus; -use pallet_evm::{Account as EVMAccount, EnsureAddressTruncated, FeeCalculator, HashedAddressMapping, Runner}; + +// use pallet_ethereum::TransactionStatus; +// use pallet_evm::{Account as EVMAccount, EnsureAddressTruncated, FeeCalculator, HashedAddressMapping, Runner}; use sp_core::crypto::Public; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -use sp_runtime::ConsensusEngineId; +// use pallet_ethereum::TransactionStatus +// use pallet_evm::{ +// Account as EVMAccount, FeeCalculator, Runner, +// } +// use pallet_evm::HashedAddressMapping +// use pallet_evm::EnsureAddressTruncated; +// use sp_runtime::ConsensusEngineId; + pub mod currency { use super::Balance; @@ -137,8 +145,8 @@ pub mod opaque { } pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("node-template"), - impl_name: create_runtime_str!("node-template"), + spec_name: create_runtime_str!("webb-node"), + impl_name: create_runtime_str!("webb-node"), authoring_version: 1, spec_version: 1, impl_version: 1, @@ -225,6 +233,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = Prefix; type SystemWeightInfo = frame_system::weights::SubstrateWeight; type Version = Version; + type OnSetCode = (); } impl pallet_aura::Config for Runtime { @@ -272,14 +281,14 @@ impl pallet_balances::Config for Runtime { } parameter_types! { - pub const TombstoneDeposit: Balance = deposit( + pub TombstoneDeposit: Balance = deposit( 1, - sp_std::mem::size_of::>() as u32 + >::contract_info_size(), ); - pub const DepositPerContract: Balance = TombstoneDeposit::get(); + pub DepositPerContract: Balance = TombstoneDeposit::get(); pub const DepositPerStorageByte: Balance = deposit(0, 1); pub const DepositPerStorageItem: Balance = deposit(1, 0); - pub RentFraction: Perbill = Perbill::from_rational_approximation(1u32, 30 * DAYS); + pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS); pub const SurchargeReward: Balance = 150 * MILLICENTS; pub const SignedClaimHandicap: u32 = 2; pub const MaxDepth: u32 = 32; @@ -297,26 +306,26 @@ parameter_types! { } impl pallet_contracts::Config for Runtime { - type ChainExtension = (); + type Time = Timestamp; + type Randomness = RandomnessCollectiveFlip; type Currency = Balances; - type DeletionQueueDepth = DeletionQueueDepth; - type DeletionWeightLimit = DeletionWeightLimit; + type Event = Event; + type RentPayment = (); + type SignedClaimHandicap = SignedClaimHandicap; + type TombstoneDeposit = TombstoneDeposit; type DepositPerContract = DepositPerContract; type DepositPerStorageByte = DepositPerStorageByte; type DepositPerStorageItem = DepositPerStorageItem; - type Event = Event; - type MaxCodeSize = MaxCodeSize; - type MaxDepth = MaxDepth; - type MaxValueSize = MaxValueSize; - type Randomness = RandomnessCollectiveFlip; type RentFraction = RentFraction; - type RentPayment = (); - type SignedClaimHandicap = SignedClaimHandicap; type SurchargeReward = SurchargeReward; - type Time = Timestamp; - type TombstoneDeposit = TombstoneDeposit; - type WeightInfo = pallet_contracts::weights::SubstrateWeight; + type MaxDepth = MaxDepth; + type MaxValueSize = MaxValueSize; type WeightPrice = pallet_transaction_payment::Module; + type WeightInfo = pallet_contracts::weights::SubstrateWeight; + type ChainExtension = (); + type DeletionQueueDepth = DeletionQueueDepth; + type DeletionWeightLimit = DeletionWeightLimit; + type MaxCodeSize = MaxCodeSize; } parameter_types! { @@ -351,26 +360,33 @@ impl merkle::Config for Runtime { type WeightInfo = MerkleWeights; } -parameter_type_with_key! { - pub ExistentialDepositMap: |k: CurrencyId| -> Balance { - match k { - _ => 2, - } - }; -} - parameter_types! { + pub const TokensPalletId: PalletId = PalletId(*b"py/token"); pub const NativeCurrencyId: CurrencyId = 0; + pub const CurrencyDeposit: u64 = 1; + pub const ApprovalDeposit: u64 = 1; + pub const StringLimit: u32 = 50; + pub const MetadataDepositBase: u64 = 1; + pub const MetadataDepositPerByte: u64 = 1; } -impl orml_tokens::Config for Runtime { + +impl tokens::Config for Runtime { + type PalletId = TokensPalletId; type Amount = Amount; type Balance = Balance; type CurrencyId = CurrencyId; + type NativeCurrency = BasicCurrencyAdapter; type Event = Event; - type ExistentialDeposits = ExistentialDepositMap; - type OnDust = (); + type ForceOrigin = frame_system::EnsureRoot; + type CurrencyDeposit = CurrencyDeposit; + type MetadataDepositBase = MetadataDepositBase; + type MetadataDepositPerByte = MetadataDepositPerByte; + type ApprovalDeposit = ApprovalDeposit; + type StringLimit = StringLimit; + type DustAccount = (); type WeightInfo = (); + type Extra = (); } impl orml_currencies::Config for Runtime { @@ -382,7 +398,7 @@ impl orml_currencies::Config for Runtime { } parameter_types! { - pub const MixerModuleId: ModuleId = ModuleId(*b"py/mixer"); + pub const MixerPalletId: PalletId = PalletId(*b"py/mixer"); pub const MinimumDepositLength: BlockNumber = 10 * 60 * 24 * 28; pub const DefaultAdminKey: AccountId32 = AccountId32::new([0; 32]); pub MixerSizes: Vec = [ @@ -399,84 +415,89 @@ impl mixer::Config for Runtime { type DepositLength = MinimumDepositLength; type Event = Event; type MixerSizes = MixerSizes; - type ModuleId = MixerModuleId; + type PalletId = MixerPalletId; type NativeCurrencyId = NativeCurrencyId; type Tree = Merkle; type WeightInfo = MixerWeights; } -/// Current approximation of the gas/s consumption considering -/// EVM execution over compiled WASM (on 4.4Ghz CPU). -/// Given the 500ms Weight, from which 75% only are used for transactions, -/// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= -/// 15_000_000. -pub const GAS_PER_SECOND: u64 = 40_000_000; - -/// Approximate ratio of the amount of Weight per Gas. -/// u64 works for approximations because Weight is a very small unit compared to -/// gas. -pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND; - -pub struct AnonGasWeightMapping; - -impl pallet_evm::GasWeightMapping for AnonGasWeightMapping { - fn gas_to_weight(gas: u64) -> Weight { - gas.saturating_mul(WEIGHT_PER_GAS) - } - - fn weight_to_gas(weight: Weight) -> u64 { - u64::try_from(weight.wrapping_div(WEIGHT_PER_GAS)).unwrap_or(u32::MAX as u64) - } -} - -parameter_types! { - pub const ChainId: u64 = 42; -} - -impl pallet_evm::Config for Runtime { - type AddressMapping = HashedAddressMapping; - type CallOrigin = EnsureAddressTruncated; - type ChainId = ChainId; - type Currency = Balances; - type Event = Event; - type FeeCalculator = (); - type GasWeightMapping = AnonGasWeightMapping; - type OnChargeTransaction = (); - type Precompiles = ( - pallet_evm_precompile_simple::ECRecover, - pallet_evm_precompile_simple::Sha256, - pallet_evm_precompile_simple::Ripemd160, - pallet_evm_precompile_simple::Identity, - ); - type Runner = pallet_evm::runner::stack::Runner; - type WithdrawOrigin = EnsureAddressTruncated; -} - -pub struct EthereumFindAuthor(PhantomData); -impl> FindAuthor for EthereumFindAuthor { - fn find_author<'a, I>(digests: I) -> Option - where - I: 'a + IntoIterator, - { - if let Some(author_index) = F::find_author(digests) { - let authority_id = Aura::authorities()[author_index as usize].clone(); - return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); - } - None - } -} - -parameter_types! { - pub BlockGasLimit: U256 - = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT / WEIGHT_PER_GAS); -} - -impl pallet_ethereum::Config for Runtime { - type BlockGasLimit = BlockGasLimit; - type Event = Event; - type FindAuthor = EthereumFindAuthor; - type StateRoot = pallet_ethereum::IntermediateStateRoot; -} +// /// Current approximation of the gas/s consumption considering +// /// EVM execution over compiled WASM (on 4.4Ghz CPU). +// /// Given the 500ms Weight, from which 75% only are used for transactions, +// /// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= 15_000_000 +// pub const GAS_PER_SECOND: u64 = 40_000_000; + +// /// Approximate ratio of the amount of Weight per Gas. +// /// u64 works for approximations because Weight is a very small unit compared to gas +// pub const WEIGHT_PER_GAS: u64 = WEIGHT_PER_SECOND / GAS_PER_SECOND; +// pub struct AnonGasWeightMapping; +// impl pallet_evm::GasWeightMapping for AnonGasWeightMapping { +// fn gas_to_weight(gas: u64) -> Weight { +// gas.saturating_mul(WEIGHT_PER_GAS) +// } + +// fn weight_to_gas(weight: Weight) -> u64 { +// u64::try_from(weight.wrapping_div(WEIGHT_PER_GAS)).unwrap_or(u32::MAX as u64) +// } +// } +// /// Fixed gas price of `1`. +// pub struct FixedGasPrice; +// impl FeeCalculator for FixedGasPrice { +// fn min_gas_price() -> U256 { +// // Gas price is always one token per gas. +// 1.into() +// } +// } +// parameter_types! { +// pub const ChainId: u64 = 42; +// pub BlockGasLimit: U256 = U256::from(u32::max_value()); +// } +// impl pallet_evm::Config for Runtime { +// type FeeCalculator = FixedGasPrice; +// type GasWeightMapping = AnonGasWeightMapping; +// type CallOrigin = EnsureAddressTruncated; +// type WithdrawOrigin = EnsureAddressTruncated; +// type AddressMapping = HashedAddressMapping; +// type CallOrigin = EnsureAddressTruncated; +// type ChainId = ChainId; +// type Currency = Balances; +// type Event = Event; +// type FeeCalculator = (); +// type GasWeightMapping = AnonGasWeightMapping; +// type OnChargeTransaction = (); +// type Precompiles = ( +// pallet_evm_precompile_simple::ECRecover, +// pallet_evm_precompile_simple::Sha256, +// pallet_evm_precompile_simple::Ripemd160, +// pallet_evm_precompile_simple::Identity, +// pallet_evm_precompile_simple::ECRecoverPublicKey, +// // pallet_evm_precompile_sha3fips::Sha3FIPS256, +// // pallet_evm_precompile_sha3fips::Sha3FIPS512, +// ); +// type ChainId = ChainId; +// type BlockGasLimit = BlockGasLimit; +// type OnChargeTransaction = (); +// type Runner = pallet_evm::runner::stack::Runner; +// } +// pub struct EthereumFindAuthor(PhantomData); +// impl> FindAuthor for EthereumFindAuthor { +// fn find_author<'a, I>(digests: I) -> Option +// where +// I: 'a + IntoIterator, +// { +// if let Some(author_index) = F::find_author(digests) { +// let authority_id = Aura::authorities()[author_index as usize].clone(); +// return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); +// } +// None +// } +// } +// impl pallet_ethereum::Config for Runtime { +// type BlockGasLimit = BlockGasLimit; +// type Event = Event; +// type FindAuthor = EthereumFindAuthor; +// type StateRoot = pallet_ethereum::IntermediateStateRoot; +// } // Create the runtime by composing the FRAME pallets that were previously // configured. @@ -486,42 +507,41 @@ construct_runtime!( NodeBlock = opaque::Block, UncheckedExtrinsic = UncheckedExtrinsic { - System: frame_system::{Module, Call, Config, Storage, Event}, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage}, - Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent}, - Aura: pallet_aura::{Module, Config}, - Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event}, - Balances: pallet_balances::{Module, Call, Storage, Config, Event}, - Contracts: pallet_contracts::{Module, Call, Config, Storage, Event}, - EVM: pallet_evm::{Module, Config, Call, Storage, Event}, - Ethereum: pallet_ethereum::{Module, Call, Storage, Event, Config, ValidateUnsigned}, - - TransactionPayment: pallet_transaction_payment::{Module, Storage}, - Sudo: pallet_sudo::{Module, Call, Config, Storage, Event}, - - Currencies: orml_currencies::{Module, Storage, Event}, - Tokens: orml_tokens::{Module, Storage, Event}, - Mixer: mixer::{Module, Call, Storage, Event}, - Merkle: merkle::{Module, Call, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, + RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage}, + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, + Aura: pallet_aura::{Pallet, Config}, + Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event}, + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + Contracts: pallet_contracts::{Pallet, Call, Config, Storage, Event}, + + // EVM: pallet_evm::{Pallet, Config, Call, Storage, Event}, + // Ethereum: pallet_ethereum::{Pallet, Call, Storage, Event, Config, ValidateUnsigned}, + + TransactionPayment: pallet_transaction_payment::{Pallet, Storage}, + Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event}, + + Currencies: orml_currencies::{Pallet, Storage, Event}, + Tokens: tokens::{Pallet, Storage, Event}, + Mixer: mixer::{Pallet, Call, Storage, Event}, + Merkle: merkle::{Pallet, Call, Storage, Event}, } ); -pub struct TransactionConverter; - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { - UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()) - } -} - -impl fp_rpc::ConvertTransaction for TransactionConverter { - fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic { - let extrinsic = - UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()); - let encoded = extrinsic.encode(); - opaque::UncheckedExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid") - } -} +// pub struct TransactionConverter; +// impl fp_rpc::ConvertTransaction for TransactionConverter { +// fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { +// UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()) +// } +// } +// impl fp_rpc::ConvertTransaction for TransactionConverter { +// fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> opaque::UncheckedExtrinsic { +// let extrinsic = +// UncheckedExtrinsic::new_unsigned(pallet_ethereum::Call::::transact(transaction).into()); +// let encoded = extrinsic.encode(); +// opaque::UncheckedExtrinsic::decode(&mut &encoded[..]).expect("Encoded extrinsic is always valid") +// } +// } /// The address format for describing accounts. pub type Address = AccountId; @@ -558,7 +578,7 @@ impl_runtime_apis! { } fn execute_block(block: Block) { - Executive::execute_block(block) + Executive::execute_block(block); } fn initialize_block(header: &::Header) { @@ -581,19 +601,16 @@ impl_runtime_apis! { Executive::finalize_block() } - fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { + fn inherent_extrinsics(data: InherentData) -> Vec<::Extrinsic> { data.create_extrinsics() } - fn check_inherents( - block: Block, - data: sp_inherents::InherentData, - ) -> sp_inherents::CheckInherentsResult { + fn check_inherents(block: Block, data: InherentData) -> CheckInherentsResult { data.check_extrinsics(&block) } fn random_seed() -> ::Hash { - RandomnessCollectiveFlip::random_seed() + RandomnessCollectiveFlip::random_seed().0 } } @@ -613,8 +630,8 @@ impl_runtime_apis! { } impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> u64 { - Aura::slot_duration() + fn slot_duration() -> SlotDuration { + sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) } fn authorities() -> Vec { @@ -693,115 +710,115 @@ impl_runtime_apis! { } } - impl fp_rpc::EthereumRuntimeRPCApi for Runtime { - fn chain_id() -> u64 { - ::ChainId::get() - } - - fn account_basic(address: H160) -> EVMAccount { - EVM::account_basic(&address) - } - - fn gas_price() -> U256 { - ::FeeCalculator::min_gas_price() - } - - fn account_code_at(address: H160) -> Vec { - EVM::account_codes(address) - } - - fn author() -> H160 { - >::find_author() - } - - fn storage_at(address: H160, index: U256) -> H256 { - let mut tmp = [0u8; 32]; - index.to_big_endian(&mut tmp); - EVM::account_storages(address, H256::from_slice(&tmp[..])) - } - - fn call( - from: H160, - to: H160, - data: Vec, - value: U256, - gas_limit: U256, - gas_price: Option, - nonce: Option, - estimate: bool, - ) -> Result { - let config = if estimate { - let mut config = ::config().clone(); - config.estimate = true; - Some(config) - } else { - None - }; - - ::Runner::call( - from, - to, - data, - value, - gas_limit.low_u64(), - gas_price, - nonce, - config.as_ref().unwrap_or(::config()), - ).map_err(|err| err.into()) - } - - fn create( - from: H160, - data: Vec, - value: U256, - gas_limit: U256, - gas_price: Option, - nonce: Option, - estimate: bool, - ) -> Result { - let config = if estimate { - let mut config = ::config().clone(); - config.estimate = true; - Some(config) - } else { - None - }; - - ::Runner::create( - from, - data, - value, - gas_limit.low_u64(), - gas_price, - nonce, - config.as_ref().unwrap_or(::config()), - ).map_err(|err| err.into()) - } - - fn current_transaction_statuses() -> Option> { - Ethereum::current_transaction_statuses() - } - - fn current_block() -> Option { - Ethereum::current_block() - } - - fn current_receipts() -> Option> { - Ethereum::current_receipts() - } - - fn current_all() -> ( - Option, - Option>, - Option> - ) { - ( - Ethereum::current_block(), - Ethereum::current_receipts(), - Ethereum::current_transaction_statuses() - ) - } - } + // impl fp_rpc::EthereumRuntimeRPCApi for Runtime { + // fn chain_id() -> u64 { + // ::ChainId::get() + // } + + // fn account_basic(address: H160) -> EVMAccount { + // EVM::account_basic(&address) + // } + + // fn gas_price() -> U256 { + // ::FeeCalculator::min_gas_price() + // } + + // fn account_code_at(address: H160) -> Vec { + // EVM::account_codes(address) + // } + + // fn author() -> H160 { + // >::find_author() + // } + + // fn storage_at(address: H160, index: U256) -> H256 { + // let mut tmp = [0u8; 32]; + // index.to_big_endian(&mut tmp); + // EVM::account_storages(address, H256::from_slice(&tmp[..])) + // } + + // fn call( + // from: H160, + // to: H160, + // data: Vec, + // value: U256, + // gas_limit: U256, + // gas_price: Option, + // nonce: Option, + // estimate: bool, + // ) -> Result { + // let config = if estimate { + // let mut config = ::config().clone(); + // config.estimate = true; + // Some(config) + // } else { + // None + // }; + + // ::Runner::call( + // from, + // to, + // data, + // value, + // gas_limit.low_u64(), + // gas_price, + // nonce, + // config.as_ref().unwrap_or(::config()), + // ).map_err(|err| err.into()) + // } + + // fn create( + // from: H160, + // data: Vec, + // value: U256, + // gas_limit: U256, + // gas_price: Option, + // nonce: Option, + // estimate: bool, + // ) -> Result { + // let config = if estimate { + // let mut config = ::config().clone(); + // config.estimate = true; + // Some(config) + // } else { + // None + // }; + + // ::Runner::create( + // from, + // data, + // value, + // gas_limit.low_u64(), + // gas_price, + // nonce, + // config.as_ref().unwrap_or(::config()), + // ).map_err(|err| err.into()) + // } + + // fn current_transaction_statuses() -> Option> { + // Ethereum::current_transaction_statuses() + // } + + // fn current_block() -> Option { + // Ethereum::current_block() + // } + + // fn current_receipts() -> Option> { + // Ethereum::current_receipts() + // } + + // fn current_all() -> ( + // Option, + // Option>, + // Option> + // ) { + // ( + // Ethereum::current_block(), + // Ethereum::current_receipts(), + // Ethereum::current_transaction_statuses() + // ) + // } + // } impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, @@ -833,7 +850,7 @@ impl_runtime_apis! { ) -> Result, sp_runtime::RuntimeString> { use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; - use frame_system_benchmarking::Module as SystemBench; + use frame_system_benchmarking::Pallet as SystemBench; impl frame_system_benchmarking::Config for Runtime {} let whitelist: Vec = vec![