diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8affb0d66..6e034f9e7 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install rust toolchain run: rustup show diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a814b4d88..c8fe30515 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -58,7 +58,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh @@ -84,7 +84,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh @@ -106,7 +106,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh @@ -132,7 +132,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh @@ -158,7 +158,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh diff --git a/Cargo.lock b/Cargo.lock index 1b3fccf00..432acaf5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -508,7 +508,7 @@ checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" dependencies = [ "concurrent-queue", "event-listener 5.3.0", - "event-listener-strategy 0.5.1", + "event-listener-strategy 0.5.2", "futures-core", "pin-project-lite 0.2.14", ] @@ -521,7 +521,7 @@ checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-lite 2.3.0", "slab", ] @@ -570,8 +570,8 @@ dependencies = [ "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.6.0", - "rustix 0.38.32", + "polling 3.7.0", + "rustix 0.38.34", "slab", "tracing", "windows-sys 0.52.0", @@ -621,15 +621,15 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.32", + "rustix 0.38.34", "windows-sys 0.48.0", ] [[package]] name = "async-recursion" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", @@ -638,27 +638,27 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" dependencies = [ "async-io 2.3.2", - "async-lock 2.8.0", + "async-lock 3.3.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.32", + "rustix 0.38.34", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "async-task" -version = "4.7.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" @@ -1082,18 +1082,16 @@ dependencies = [ [[package]] name = "blocking" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" dependencies = [ "async-channel 2.2.1", "async-lock 3.3.0", "async-task", - "fastrand 2.0.2", "futures-io", "futures-lite 2.3.0", "piper", - "tracing", ] [[package]] @@ -1232,12 +1230,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.94" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -1490,9 +1489,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -1832,7 +1831,7 @@ dependencies = [ "cumulus-primitives-core", "futures 0.3.30", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -1884,7 +1883,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", "futures 0.3.30", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-consensus", "sp-api", "sp-block-builder", @@ -1907,7 +1906,7 @@ dependencies = [ "futures 0.3.30", "futures-timer", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", "polkadot-parachain-primitives", "polkadot-primitives", @@ -2387,15 +2386,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "data-encoding-macro" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2403,9 +2402,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" dependencies = [ "data-encoding", "syn 1.0.109", @@ -2739,7 +2738,7 @@ checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek 4.1.2", "ed25519", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "rand_core 0.6.4", "sha2 0.10.8", @@ -2919,9 +2918,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ "event-listener 5.3.0", "pin-project-lite 0.2.14", @@ -2997,9 +2996,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fatality" @@ -3060,9 +3059,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" +checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" [[package]] name = "file-per-thread-logger" @@ -3098,7 +3097,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "scale-info", ] @@ -3135,9 +3134,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "libz-sys", @@ -3495,7 +3494,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.32", + "rustix 0.38.34", "windows-sys 0.48.0", ] @@ -3581,7 +3580,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-core", "futures-io", "parking", @@ -3848,9 +3847,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", @@ -4043,7 +4042,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.14", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -4060,7 +4059,7 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-native-certs", "tokio", "tokio-rustls", @@ -4206,7 +4205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -4284,7 +4283,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.6", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -4342,9 +4341,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] @@ -4411,7 +4410,7 @@ dependencies = [ "globset", "hyper", "jsonrpsee-types", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "rustc-hash", "serde", @@ -4554,7 +4553,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" dependencies = [ "kvdb", - "parking_lot 0.12.1", + "parking_lot 0.12.2", ] [[package]] @@ -4565,7 +4564,7 @@ checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "regex", "rocksdb", "smallvec", @@ -4596,9 +4595,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libfuzzer-sys" @@ -4701,7 +4700,7 @@ dependencies = [ "multihash", "multistream-select", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "quick-protobuf", "rand 0.8.5", @@ -4721,7 +4720,7 @@ dependencies = [ "futures 0.3.30", "libp2p-core", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "smallvec", "trust-dns-resolver", ] @@ -4883,7 +4882,7 @@ dependencies = [ "libp2p-identity", "libp2p-tls", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "quinn-proto", "rand 0.8.5", "rustls 0.20.9", @@ -4999,7 +4998,7 @@ dependencies = [ "futures-rustls", "libp2p-core", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "quicksink", "rw-stream-sink", "soketto", @@ -5157,9 +5156,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -5321,7 +5320,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.32", + "rustix 0.38.34", ] [[package]] @@ -5689,7 +5688,7 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#370090929c24a65fb90d4ff622086d953be8222a" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "async-trait", "cumulus-client-consensus-common", @@ -5699,7 +5698,7 @@ dependencies = [ "log", "nimbus-primitives", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-consensus", "sc-consensus-manual-seal", @@ -5719,7 +5718,7 @@ dependencies = [ [[package]] name = "nimbus-primitives" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#370090929c24a65fb90d4ff622086d953be8222a" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "async-trait", "frame-benchmarking", @@ -6171,7 +6170,7 @@ dependencies = [ [[package]] name = "pallet-author-inherent" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#370090929c24a65fb90d4ff622086d953be8222a" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "frame-benchmarking", "frame-support", @@ -6190,7 +6189,7 @@ dependencies = [ [[package]] name = "pallet-author-mapping" version = "2.0.5" -source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#370090929c24a65fb90d4ff622086d953be8222a" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "frame-benchmarking", "frame-support", @@ -6208,7 +6207,7 @@ dependencies = [ [[package]] name = "pallet-author-slot-filter" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#370090929c24a65fb90d4ff622086d953be8222a" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "frame-benchmarking", "frame-support", @@ -7372,7 +7371,7 @@ dependencies = [ "log", "lz4", "memmap2", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "siphasher", "snap", @@ -7437,12 +7436,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.10", ] [[package]] @@ -7461,15 +7460,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -7632,7 +7631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" dependencies = [ "atomic-waker", - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-io", ] @@ -7868,7 +7867,7 @@ dependencies = [ "fatality", "futures 0.3.30", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -8220,7 +8219,7 @@ dependencies = [ "log", "mick-jaeger", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", "polkadot-primitives", "sc-network", @@ -8370,7 +8369,7 @@ dependencies = [ "futures 0.3.30", "futures-timer", "orchestra", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8976,15 +8975,15 @@ dependencies = [ [[package]] name = "polling" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.3.9", "pin-project-lite 0.2.14", - "rustix 0.38.32", + "rustix 0.38.34", "tracing", "windows-sys 0.52.0", ] @@ -9193,7 +9192,7 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "thiserror", ] @@ -9205,7 +9204,7 @@ checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "prometheus-client-derive-encode", ] @@ -9491,6 +9490,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" version = "0.4.5" @@ -9879,9 +9887,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", @@ -9904,9 +9912,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -10161,7 +10169,7 @@ dependencies = [ "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -10191,7 +10199,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-state-db", "schnellru", @@ -10215,7 +10223,7 @@ dependencies = [ "libp2p-identity", "log", "mockall", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-utils", "serde", @@ -10271,7 +10279,7 @@ dependencies = [ "num-rational", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-consensus", "sc-consensus-epochs", @@ -10328,7 +10336,7 @@ dependencies = [ "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-consensus", "sc-network", @@ -10359,7 +10367,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-consensus-beefy", "sc-rpc", "serde", @@ -10397,7 +10405,7 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "sc-block-builder", "sc-chain-spec", @@ -10507,7 +10515,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-executor-common", "sc-executor-wasmtime", "schnellru", @@ -10574,7 +10582,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "array-bytes", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "serde_json", "sp-application-crypto", "sp-core", @@ -10602,7 +10610,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "partial_sort", "pin-project", "rand 0.8.5", @@ -10786,7 +10794,7 @@ dependencies = [ "num_cpus", "once_cell", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "sc-client-api", "sc-network", @@ -10821,7 +10829,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -10889,7 +10897,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-chain-spec", "sc-client-api", "sc-transaction-pool-api", @@ -10918,7 +10926,7 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand 0.8.5", "sc-block-builder", @@ -10976,7 +10984,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sp-core", ] @@ -11041,7 +11049,7 @@ dependencies = [ "futures 0.3.30", "libp2p", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand 0.8.5", "sc-utils", @@ -11062,7 +11070,7 @@ dependencies = [ "lazy_static", "libc", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "regex", "rustc-hash", "sc-client-api", @@ -11102,7 +11110,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -11143,7 +11151,7 @@ dependencies = [ "futures-timer", "lazy_static", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "prometheus", "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] @@ -11366,18 +11374,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" dependencies = [ "proc-macro2", "quote", @@ -11407,7 +11415,7 @@ dependencies = [ [[package]] name = "session-keys-primitives" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#370090929c24a65fb90d4ff622086d953be8222a" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "async-trait", "frame-support", @@ -11500,9 +11508,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -11617,7 +11625,7 @@ dependencies = [ "fnv", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "hmac 0.12.1", "itertools 0.11.0", @@ -11666,13 +11674,13 @@ dependencies = [ "futures-channel", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "itertools 0.11.0", "log", "lru 0.11.1", "no-std-net", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand 0.8.5", "rand_chacha 0.3.1", @@ -11720,9 +11728,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -11852,7 +11860,7 @@ dependencies = [ "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "schnellru", "sp-api", "sp-consensus", @@ -11985,7 +11993,7 @@ dependencies = [ "log", "merlin 2.0.1", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "paste", "primitive-types", "rand 0.8.5", @@ -12038,7 +12046,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "kvdb", - "parking_lot 0.12.1", + "parking_lot 0.12.2", ] [[package]] @@ -12128,7 +12136,7 @@ version = "0.27.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sp-core", "sp-externalities", "thiserror", @@ -12305,7 +12313,7 @@ dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "smallvec", "sp-core", @@ -12426,7 +12434,7 @@ dependencies = [ "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "scale-info", "schnellru", "sp-core", @@ -13023,8 +13031,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.2", - "rustix 0.38.32", + "fastrand 2.1.0", + "rustix 0.38.34", "windows-sys 0.52.0", ] @@ -13092,9 +13100,9 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] @@ -13121,9 +13129,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", @@ -13274,10 +13282,10 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project-lite 0.2.14", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] @@ -13310,7 +13318,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.12", "tokio", ] @@ -13620,7 +13628,7 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "resolv-conf", "smallvec", "thiserror", @@ -13736,9 +13744,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" @@ -14049,9 +14057,9 @@ dependencies = [ [[package]] name = "wasmparser-nostd" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] @@ -14408,14 +14416,14 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.32", + "rustix 0.38.34", ] [[package]] name = "wide" -version = "0.7.16" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a1851a719f11d1d2fea40e15c72f6c00de8c142d7ac47c1441cc7e4d0d5bc6" +checksum = "0f0e39d2c603fdc0504b12b458cf1f34e0b937ed2f4f2dc20796e3e86f34e11f" dependencies = [ "bytemuck", "safe_arch", @@ -14445,11 +14453,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -14812,7 +14820,7 @@ dependencies = [ "futures 0.3.30", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "static_assertions", ] @@ -15449,7 +15457,7 @@ dependencies = [ "env_logger 0.10.2", "frame-support", "frame-system", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "pallet-balances", "pallet-timestamp", "parity-scale-codec", diff --git a/node/src/cli.rs b/node/src/cli.rs index 13bf908f4..299e80c21 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -108,6 +108,7 @@ pub fn load_spec(id: &str) -> Result, String> { } #[derive(Debug, clap::Subcommand)] +#[allow(clippy::large_enum_variant)] pub enum Subcommand { /// The custom benchmark subcommmand benchmarking runtime pallets. #[clap(subcommand)] @@ -202,6 +203,7 @@ pub struct Cli { #[cfg(feature = "parachain")] impl Cli { + #[allow(clippy::borrowed_box)] pub(crate) fn runtime_version(spec: &Box) -> sc_cli::RuntimeVersion { match spec { #[cfg(feature = "with-zeitgeist-runtime")] diff --git a/node/src/command.rs b/node/src/command.rs index bf365d4be..4c4143c49 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -82,9 +82,9 @@ pub fn run() -> sc_cli::Result<()> { _ => panic!("{}", crate::BATTERY_STATION_RUNTIME_NOT_AVAILABLE), } } else { - return Err("Runtime benchmarking wasn't enabled when building the node. \ - You can enable it with `--features runtime-benchmarks`." - .into()); + Err("Runtime benchmarking wasn't enabled when building the node. \ + You can enable it with `--features runtime-benchmarks`." + .into()) } } BenchmarkCmd::Block(cmd) => match chain_spec { diff --git a/primitives/src/math/fixed.rs b/primitives/src/math/fixed.rs index fe262980e..930a26b43 100644 --- a/primitives/src/math/fixed.rs +++ b/primitives/src/math/fixed.rs @@ -330,6 +330,9 @@ where #[cfg(test)] mod tests { + // TODO(#1328): Remove after rustc nightly-2024-04-22 + #![allow(clippy::duplicated_attributes)] + use super::*; use crate::assert_approx; use fixed::{traits::ToFixed, FixedU128}; diff --git a/primitives/src/math/root.rs b/primitives/src/math/root.rs index 2479e1ab4..22de3a7f5 100644 --- a/primitives/src/math/root.rs +++ b/primitives/src/math/root.rs @@ -156,6 +156,9 @@ fn dist(x: T, y: T) -> T { #[cfg(test)] mod tests { + // TODO(#1328): Remove after rustc nightly-2024-04-22 + #![allow(clippy::duplicated_attributes)] + use super::*; use crate::{constants::BASE, math::fixed::FixedMul}; use test_case::test_case; diff --git a/runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.rs b/runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.rs index 79ede9c15..139765e7d 100644 --- a/runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.rs +++ b/runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.rs @@ -60,8 +60,8 @@ pub(crate) fn genesis(parachain_id: u32) -> Storage { tokens: crate::TokensConfig { balances: accounts::init_balances() .iter() - .chain(vec![(ZeitgeistTreasuryAccount::get())].iter()) - .map(|k| { + .chain([(ZeitgeistTreasuryAccount::get())].iter()) + .flat_map(|k| { vec![ (k.clone(), Asset::from(FOREIGN_PARENT_ID).try_into().unwrap(), ENDOWMENT), (k.clone(), Asset::from(FOREIGN_SIBLING_ID).try_into().unwrap(), ENDOWMENT), @@ -69,7 +69,6 @@ pub(crate) fn genesis(parachain_id: u32) -> Storage { (k.clone(), Asset::from(BTC_ID).try_into().unwrap(), ENDOWMENT), ] }) - .flatten() .collect::>(), }, ..Default::default() diff --git a/runtime/battery-station/src/integration_tests/xcm/genesis/rococo.rs b/runtime/battery-station/src/integration_tests/xcm/genesis/rococo.rs index 6d37c8450..5c7330213 100644 --- a/runtime/battery-station/src/integration_tests/xcm/genesis/rococo.rs +++ b/runtime/battery-station/src/integration_tests/xcm/genesis/rococo.rs @@ -74,6 +74,7 @@ fn get_host_config() -> HostConfiguration { mod validators { use super::*; + #[allow(clippy::type_complexity)] pub fn initial_authorities() -> Vec<( AccountId, AccountId, diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs index e22df751f..825bbdbc1 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs @@ -26,7 +26,7 @@ use crate::{ }, test_net::{BatteryStation, Rococo, Sibling}, }, - xcm_config::{config::battery_station, fees::default_per_second}, + xcm_config::fees::default_per_second, AssetManager, Balance, Balances, RuntimeOrigin, XTokens, ZeitgeistTreasuryAccount, }; @@ -54,7 +54,7 @@ fn transfer_ztg_to_sibling() { }); BatteryStation::execute_with(|| { - alice_initial_balance = Balances::free_balance(&alice()); + alice_initial_balance = Balances::free_balance(alice()); assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(alice()), @@ -74,7 +74,7 @@ fn transfer_ztg_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&alice()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); @@ -114,7 +114,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { }); BatteryStation::execute_with(|| { - let alice_initial_balance = Balances::free_balance(&alice()); + let alice_initial_balance = Balances::free_balance(alice()); assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(alice()), @@ -133,7 +133,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { WeightLimit::Limited(4_000_000_000.into()), )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&alice()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); @@ -163,7 +163,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { BatteryStation::execute_with(|| { treasury_initial_balance = Balances::free_balance(ZeitgeistTreasuryAccount::get()); - alice_initial_balance = Balances::free_balance(&alice()); + alice_initial_balance = Balances::free_balance(alice()); assert_eq!( Balances::set_balance(&sibling_parachain_account(), sibling_initial_balance), sibling_initial_balance @@ -200,7 +200,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { BatteryStation::execute_with(|| { // Verify that alice() now has initial balance + amount transferred - fee assert_eq!( - Balances::free_balance(&alice()), + Balances::free_balance(alice()), alice_initial_balance + transfer_amount - ztg_fee(), ); // Verify that the reserve has been adjusted properly @@ -230,7 +230,7 @@ fn transfer_btc_sibling_to_zeitgeist() { }); Sibling::execute_with(|| { - let alice_initial_balance = Balances::free_balance(&alice()); + let alice_initial_balance = Balances::free_balance(alice()); let initial_sovereign_balance = transfer_amount; // Set the sovereign balance such that it is not subject to dust collection @@ -256,7 +256,7 @@ fn transfer_btc_sibling_to_zeitgeist() { WeightLimit::Limited(4_000_000_000.into()), )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&alice()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the zeitgeist account here assert_eq!( Balances::free_balance(zeitgeist_parachain_account()), @@ -290,7 +290,7 @@ fn transfer_btc_zeitgeist_to_sibling() { let mut bob_initial_balance = 0; Sibling::execute_with(|| { - bob_initial_balance = Balances::free_balance(&bob()); + bob_initial_balance = Balances::free_balance(bob()); // Set the sovereign balance such that it is not subject to dust collection assert_eq!( Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), @@ -330,7 +330,7 @@ fn transfer_btc_zeitgeist_to_sibling() { let expected_sovereign = initial_sovereign_balance - transfer_amount; // Verify that Bob now has initial balance + amount transferred - fee - assert_eq!(Balances::free_balance(&bob()), expected); + assert_eq!(Balances::free_balance(bob()), expected); // Verify that the amount transferred is now subtracted from the zeitgeist account at sibling assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), expected_sovereign); }); @@ -350,7 +350,7 @@ fn transfer_roc_from_relay_chain() { }); Rococo::execute_with(|| { - let initial_balance = rococo_runtime::Balances::free_balance(&alice()); + let initial_balance = rococo_runtime::Balances::free_balance(alice()); assert!(initial_balance >= transfer_amount); assert_ok!(rococo_runtime::XcmPallet::reserve_transfer_assets( @@ -383,7 +383,7 @@ fn transfer_roc_to_relay_chain() { let mut initial_balance_bob = 0; Rococo::execute_with(|| { - initial_balance_bob = rococo_runtime::Balances::free_balance(&bob()); + initial_balance_bob = rococo_runtime::Balances::free_balance(bob()); let bs_acc = Rococo::sovereign_account_id_of_child_para(PARA_ID_BATTERY_STATION.into()); assert_eq!( rococo_runtime::Balances::set_balance(&bs_acc, transfer_amount), diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index e72672438..9b06c07b8 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -111,6 +111,8 @@ parameter_types! { // Balance pub const ExistentialDeposit: u128 = 5 * MILLI; + pub const MaxHolds: u32 = 1; + pub const MaxFreezes: u32 = 1; pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; @@ -130,7 +132,7 @@ parameter_types! { // Contracts pub const ContractsCodeHashLockupDepositPercent: Perbill = Perbill::from_percent(10); - pub const ContractsDefaultDepositLimit: Balance = deposit(16, 16 * 1024); + pub const ContractsDefaultDepositLimit: Balance = deposit(16, 16 * 1024 * 1024); pub const ContractsDepositPerByte: Balance = deposit(0,1); pub const ContractsDepositPerItem: Balance = deposit(1,0); pub const ContractsMaxCodeLen: u32 = 123 * 1024; @@ -427,7 +429,7 @@ parameter_types! { /// The maximum number of approvals that can wait in the spending queue. pub const MaxApprovals: u32 = 100; /// Maximum amount a verified origin can spend - pub const MaxTreasurySpend: Balance = Balance::max_value(); + pub const MaxTreasurySpend: Balance = Balance::MAX; /// Fraction of a proposal's value that should be bonded in order to place the proposal. /// An accepted proposal gets these back. A rejected proposal does not. pub const ProposalBond: Permill = Permill::from_percent(5); diff --git a/runtime/battery-station/src/xcm_config/config.rs b/runtime/battery-station/src/xcm_config/config.rs index 7dffe666f..f9008fea9 100644 --- a/runtime/battery-station/src/xcm_config/config.rs +++ b/runtime/battery-station/src/xcm_config/config.rs @@ -425,7 +425,7 @@ impl MaybeEquivalence for AssetConvert { impl MaybeEquivalence for AssetConvert { fn convert(location: &MultiLocation) -> Option { - >::convert(&location) + >::convert(location) .and_then(|asset| asset.try_into().ok()) } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 4e6bb2477..3ed97a8c7 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -62,10 +62,7 @@ macro_rules! decl_common_types { type Address = sp_runtime::MultiAddress; - type Migrations = ( - MigrateScoringRuleAmmCdaHybridAndMarketId, - MigratePoolReservesToBoundedBTreeMap, - ); + type Migrations = (pallet_contracts::Migration,); pub type Executive = frame_executive::Executive< Runtime, @@ -777,8 +774,8 @@ macro_rules! impl_config_traits { type DustRemoval = DustIntoTreasury; type ExistentialDeposit = ExistentialDeposit; type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; - type MaxHolds = ConstU32<0>; + type MaxFreezes = MaxFreezes; + type MaxHolds = MaxHolds; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; @@ -843,7 +840,14 @@ macro_rules! impl_config_traits { type MaxDelegateDependencies = ContractsMaxDelegateDependencies; type MaxStorageKeyLen = ContractsMaxStorageKeyLen; #[cfg(not(feature = "runtime-benchmarks"))] - type Migrations = (); + type Migrations = ( + pallet_contracts::migration::v10::Migration, + pallet_contracts::migration::v11::Migration, + pallet_contracts::migration::v12::Migration, + pallet_contracts::migration::v13::Migration, + pallet_contracts::migration::v14::Migration, + pallet_contracts::migration::v15::Migration, + ); #[cfg(feature = "runtime-benchmarks")] type Migrations = pallet_contracts::migration::codegen::BenchMigrations; type Randomness = RandomnessCollectiveFlip; diff --git a/runtime/zeitgeist/src/integration_tests/xcm/genesis/polkadot.rs b/runtime/zeitgeist/src/integration_tests/xcm/genesis/polkadot.rs index 2ef8a7349..99e61bc08 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/genesis/polkadot.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/genesis/polkadot.rs @@ -69,6 +69,7 @@ fn get_host_config() -> HostConfiguration { mod validators { use super::*; + #[allow(clippy::type_complexity)] pub fn initial_authorities() -> Vec<( AccountId, AccountId, diff --git a/runtime/zeitgeist/src/integration_tests/xcm/genesis/zeitgeist.rs b/runtime/zeitgeist/src/integration_tests/xcm/genesis/zeitgeist.rs index 22e3fc162..39cf5a6f9 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/genesis/zeitgeist.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/genesis/zeitgeist.rs @@ -63,8 +63,8 @@ pub(crate) fn genesis(parachain_id: u32) -> Storage { tokens: crate::TokensConfig { balances: accounts::init_balances() .iter() - .chain(vec![(ZeitgeistTreasuryAccount::get())].iter()) - .map(|k| { + .chain([(ZeitgeistTreasuryAccount::get())].iter()) + .flat_map(|k| { vec![ (k.clone(), Asset::from(FOREIGN_PARENT_ID).try_into().unwrap(), ENDOWMENT), (k.clone(), Asset::from(FOREIGN_SIBLING_ID).try_into().unwrap(), ENDOWMENT), @@ -73,7 +73,6 @@ pub(crate) fn genesis(parachain_id: u32) -> Storage { (k.clone(), Asset::from(ETH_ID).try_into().unwrap(), ENDOWMENT), ] }) - .flatten() .collect::>(), }, ..Default::default() diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs index 72f5a6dac..834120424 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs @@ -54,7 +54,7 @@ fn transfer_ztg_to_sibling() { }); Zeitgeist::execute_with(|| { - alice_initial_balance = Balances::free_balance(&alice()); + alice_initial_balance = Balances::free_balance(alice()); assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(alice()), @@ -74,7 +74,7 @@ fn transfer_ztg_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&alice()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); @@ -114,7 +114,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { }); Zeitgeist::execute_with(|| { - let alice_initial_balance = Balances::free_balance(&alice()); + let alice_initial_balance = Balances::free_balance(alice()); assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(alice()), @@ -133,7 +133,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { WeightLimit::Limited(4_000_000_000.into()), )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&alice()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); @@ -163,7 +163,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { treasury_initial_balance = Balances::free_balance(ZeitgeistTreasuryAccount::get()); - alice_initial_balance = Balances::free_balance(&alice()); + alice_initial_balance = Balances::free_balance(alice()); assert_eq!( Balances::set_balance(&sibling_parachain_account(), sibling_initial_balance), sibling_initial_balance @@ -200,7 +200,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { // Verify that alice() now has initial balance + amount transferred - fee assert_eq!( - Balances::free_balance(&alice()), + Balances::free_balance(alice()), alice_initial_balance + transfer_amount - ztg_fee(), ); // Verify that the reserve has been adjusted properly @@ -230,7 +230,7 @@ fn transfer_btc_sibling_to_zeitgeist() { }); Sibling::execute_with(|| { - let alice_initial_balance = Balances::free_balance(&alice()); + let alice_initial_balance = Balances::free_balance(alice()); let initial_sovereign_balance = transfer_amount; // Set the sovereign balance such that it is not subject to dust collection @@ -256,7 +256,7 @@ fn transfer_btc_sibling_to_zeitgeist() { WeightLimit::Limited(4_000_000_000.into()), )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&alice()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the zeitgeist account here assert_eq!( Balances::free_balance(zeitgeist_parachain_account()), @@ -290,7 +290,7 @@ fn transfer_btc_zeitgeist_to_sibling() { let mut bob_initial_balance = 0; Sibling::execute_with(|| { - bob_initial_balance = Balances::free_balance(&bob()); + bob_initial_balance = Balances::free_balance(bob()); // Set the sovereign balance such that it is not subject to dust collection assert_eq!( Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), @@ -330,7 +330,7 @@ fn transfer_btc_zeitgeist_to_sibling() { let expected_sovereign = initial_sovereign_balance - transfer_amount; // Verify that Bob now has initial balance + amount transferred - fee - assert_eq!(Balances::free_balance(&bob()), expected); + assert_eq!(Balances::free_balance(bob()), expected); // Verify that the amount transferred is now subtracted from the zeitgeist account at sibling assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), expected_sovereign); }); @@ -350,7 +350,7 @@ fn transfer_eth_sibling_to_zeitgeist() { }); Sibling::execute_with(|| { - let alice_initial_balance = Balances::free_balance(&alice()); + let alice_initial_balance = Balances::free_balance(alice()); let initial_sovereign_balance = transfer_amount; // Set the sovereign balance such that it is not subject to dust collection @@ -376,7 +376,7 @@ fn transfer_eth_sibling_to_zeitgeist() { WeightLimit::Limited(4_000_000_000.into()), )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&alice()), alice_initial_balance - transfer_amount); + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the zeitgeist account here assert_eq!( Balances::free_balance(zeitgeist_parachain_account()), @@ -410,7 +410,7 @@ fn transfer_eth_zeitgeist_to_sibling() { let mut bob_initial_balance = 0; Sibling::execute_with(|| { - bob_initial_balance = Balances::free_balance(&bob()); + bob_initial_balance = Balances::free_balance(bob()); // Set the sovereign balance such that it is not subject to dust collection assert_eq!( Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), @@ -450,7 +450,7 @@ fn transfer_eth_zeitgeist_to_sibling() { let expected_sovereign = initial_sovereign_balance - transfer_amount; // Verify that Bob now has initial balance + amount transferred - fee - assert_eq!(Balances::free_balance(&bob()), expected); + assert_eq!(Balances::free_balance(bob()), expected); // Verify that the amount transferred is now subtracted from the zeitgeist account at sibling assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), expected_sovereign); }); @@ -470,7 +470,7 @@ fn transfer_dot_from_relay_chain() { }); Polkadot::execute_with(|| { - let initial_balance = polkadot_runtime::Balances::free_balance(&alice()); + let initial_balance = polkadot_runtime::Balances::free_balance(alice()); assert!(initial_balance >= transfer_amount); assert_ok!(polkadot_runtime::XcmPallet::reserve_transfer_assets( @@ -503,7 +503,7 @@ fn transfer_dot_to_relay_chain() { let mut initial_balance_bob = 0; Polkadot::execute_with(|| { - initial_balance_bob = polkadot_runtime::Balances::free_balance(&bob()); + initial_balance_bob = polkadot_runtime::Balances::free_balance(bob()); let bs_acc = Polkadot::sovereign_account_id_of_child_para(PARA_ID_ZEITGEIST.into()); assert_eq!( polkadot_runtime::Balances::set_balance(&bs_acc, transfer_amount), diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 4124e4bf5..5c8fade66 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -109,6 +109,8 @@ parameter_types! { // Balance pub const ExistentialDeposit: u128 = 5 * MILLI; + pub const MaxHolds: u32 = 1; + pub const MaxFreezes: u32 = 1; pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; @@ -128,7 +130,7 @@ parameter_types! { // Contracts pub const ContractsCodeHashLockupDepositPercent: Perbill = Perbill::from_percent(10); - pub const ContractsDefaultDepositLimit: Balance = deposit(16, 16 * 1024); + pub const ContractsDefaultDepositLimit: Balance = deposit(16, 16 * 1024 * 1024); pub const ContractsDepositPerByte: Balance = deposit(0,1); pub const ContractsDepositPerItem: Balance = deposit(1,0); pub const ContractsMaxCodeLen: u32 = 123 * 1024; @@ -429,7 +431,7 @@ parameter_types! { /// The maximum number of approvals that can wait in the spending queue. pub const MaxApprovals: u32 = 100; /// Maximum amount a verified origin can spend - pub const MaxTreasurySpend: Balance = Balance::max_value(); + pub const MaxTreasurySpend: Balance = Balance::MAX; /// Fraction of a proposal's value that should be bonded in order to place the proposal. /// An accepted proposal gets these back. A rejected proposal does not. pub const ProposalBond: Permill = Permill::from_percent(5); diff --git a/runtime/zeitgeist/src/xcm_config/config.rs b/runtime/zeitgeist/src/xcm_config/config.rs index fe1b0b03f..c86c0feba 100644 --- a/runtime/zeitgeist/src/xcm_config/config.rs +++ b/runtime/zeitgeist/src/xcm_config/config.rs @@ -427,7 +427,7 @@ impl MaybeEquivalence for AssetConvert { impl MaybeEquivalence for AssetConvert { fn convert(location: &MultiLocation) -> Option { - >::convert(&location) + >::convert(location) .and_then(|asset| asset.try_into().ok()) } diff --git a/zrml/asset-router/src/pallet_impl/multi_currency.rs b/zrml/asset-router/src/pallet_impl/multi_currency.rs index 63518a7fb..6d812aca9 100644 --- a/zrml/asset-router/src/pallet_impl/multi_currency.rs +++ b/zrml/asset-router/src/pallet_impl/multi_currency.rs @@ -263,9 +263,9 @@ impl MultiCurrency for Pallet { } else { Self::withdraw(currency_id, who, amount).map(|_| Zero::zero()).unwrap_or(amount) } - } else if let Ok(_) = T::CampaignAssetType::try_from(currency_id) { + } else if T::CampaignAssetType::try_from(currency_id).is_ok() { Self::withdraw(currency_id, who, amount).map(|_| Zero::zero()).unwrap_or(amount) - } else if let Ok(_) = T::CustomAssetType::try_from(currency_id) { + } else if T::CustomAssetType::try_from(currency_id).is_ok() { Self::withdraw(currency_id, who, amount).map(|_| Zero::zero()).unwrap_or(amount) } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { T::Currencies::slash(currency, who, amount) diff --git a/zrml/asset-router/src/pallet_impl/unbalanced.rs b/zrml/asset-router/src/pallet_impl/unbalanced.rs index 0dcb7bf5b..ecffc76c2 100644 --- a/zrml/asset-router/src/pallet_impl/unbalanced.rs +++ b/zrml/asset-router/src/pallet_impl/unbalanced.rs @@ -30,12 +30,10 @@ impl Unbalanced for Pallet { // Route "pre new asset system" market assets to `CurrencyType` if T::MarketAssets::asset_exists(asset) { T::MarketAssets::handle_dust(Dust(asset, amount)); + } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { + T::Currencies::handle_dust(Dust(currency, amount)); } else { - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::handle_dust(Dust(currency, amount)); - } else { - T::MarketAssets::handle_dust(Dust(asset, amount)); - } + T::MarketAssets::handle_dust(Dust(asset, amount)); } } else if let Ok(asset) = T::CampaignAssetType::try_from(currency_id) { T::CampaignAssets::handle_dust(Dust(asset, amount)); diff --git a/zrml/asset-router/src/tests/multi_currency.rs b/zrml/asset-router/src/tests/multi_currency.rs index 0e6802305..ddc0f7233 100644 --- a/zrml/asset-router/src/tests/multi_currency.rs +++ b/zrml/asset-router/src/tests/multi_currency.rs @@ -120,15 +120,15 @@ fn routes_currencies_correctly() { } #[test_case(0, Some(0); "zero")] -#[test_case(Amount::max_value(), Some(Amount::max_value().unsigned_abs() as Balance); "max")] -#[test_case(Amount::min_value(), None; "min")] -#[test_case(Amount::min_value() + 1, Some((Amount::min_value() + 1).unsigned_abs() as Balance); "min_plus_one")] +#[test_case(Amount::MAX, Some(Amount::MAX.unsigned_abs() as Balance); "max")] +#[test_case(Amount::MIN, None; "min")] +#[test_case(Amount::MIN + 1, Some((Amount::MIN + 1).unsigned_abs() as Balance); "min_plus_one")] fn update_balance_handles_overflows_correctly(update: Amount, expected: Option) { ExtBuilder::default().build().execute_with(|| { assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); if update.is_negative() { - assert_ok!(AssetRouter::update_balance(CAMPAIGN_ASSET, &ALICE, Amount::max_value())); + assert_ok!(AssetRouter::update_balance(CAMPAIGN_ASSET, &ALICE, Amount::MAX)); } if let Some(expected_inner) = expected { @@ -137,7 +137,7 @@ fn update_balance_handles_overflows_correctly(update: Amount, expected: Option(asset_count: u16) -> Vec> { amounts } -fn create_market( +fn create_market( caller: T::AccountId, base_asset: BaseAssetClass, asset_count: u16, -) -> MarketIdOf -where - T: Config, -{ +) -> MarketIdOf { let market = Market { market_id: 0u8.into(), base_asset, @@ -105,10 +102,7 @@ fn create_market_and_deploy_pool( base_asset: BaseAssetClass, asset_count: u16, amount: BalanceOf, -) -> MarketIdOf -where - T: Config, -{ +) -> MarketIdOf { let market_id = create_market::(caller.clone(), base_asset, asset_count); let total_cost = amount + T::AssetManager::minimum_balance(base_asset.into()); assert_ok!(T::AssetManager::deposit(base_asset.into(), &caller, total_cost)); diff --git a/zrml/liquidity-mining/src/lib.rs b/zrml/liquidity-mining/src/lib.rs index 549b30764..ad96e8317 100644 --- a/zrml/liquidity-mining/src/lib.rs +++ b/zrml/liquidity-mining/src/lib.rs @@ -67,7 +67,6 @@ mod pallet { ensure_root, pallet_prelude::{BlockNumberFor, OriginFor}, }; - use log; use sp_runtime::{ traits::{AccountIdConversion, Saturating}, TransactionOutcome, diff --git a/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs b/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs index 24410c66d..208189b20 100644 --- a/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs +++ b/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs @@ -71,7 +71,7 @@ where } } - let _ = >::clear(u32::max_value(), None); + let _ = >::clear(u32::MAX, None); Some(market_incentives_len) } diff --git a/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs b/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs index 1efbacf0d..a9b49a7ed 100644 --- a/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs +++ b/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs @@ -58,7 +58,7 @@ where }); counter = counter.saturating_add(1); } - let _ = >::clear(u32::max_value(), None); + let _ = >::clear(u32::MAX, None); counter } } diff --git a/zrml/neo-swaps/src/benchmarking.rs b/zrml/neo-swaps/src/benchmarking.rs index 075fc85db..89d896f36 100644 --- a/zrml/neo-swaps/src/benchmarking.rs +++ b/zrml/neo-swaps/src/benchmarking.rs @@ -56,10 +56,7 @@ macro_rules! assert_ok_with_transaction { }}; } -trait LiquidityTreeBenchmarkHelper -where - T: Config, -{ +trait LiquidityTreeBenchmarkHelper { fn calculate_min_pool_shares_amount(&self) -> BalanceOf; } @@ -83,10 +80,7 @@ struct BenchmarkHelper { _marker: PhantomData, } -impl BenchmarkHelper -where - T: Config, -{ +impl BenchmarkHelper { fn new() -> Self { BenchmarkHelper { current_id: Cell::new(0), _marker: PhantomData } } @@ -175,14 +169,11 @@ where } } -fn create_market( +fn create_market( caller: T::AccountId, base_asset: AssetOf, asset_count: AssetIndexType, -) -> MarketIdOf -where - T: Config, -{ +) -> MarketIdOf { let market = Market { market_id: 0u8.into(), base_asset: base_asset.try_into().unwrap(), @@ -219,10 +210,7 @@ fn create_market_and_deploy_pool( base_asset: AssetOf, asset_count: AssetIndexType, amount: BalanceOf, -) -> MarketIdOf -where - T: Config, -{ +) -> MarketIdOf { let market_id = create_market::(caller.clone(), base_asset, asset_count); let total_cost = amount + T::MultiCurrency::minimum_balance(base_asset); assert_ok!(T::MultiCurrency::deposit(base_asset, &caller, total_cost)); @@ -241,10 +229,7 @@ where market_id } -fn deposit_fees(market_id: MarketIdOf, amount: BalanceOf) -where - T: Config, -{ +fn deposit_fees(market_id: MarketIdOf, amount: BalanceOf) { let mut pool = Pools::::get(market_id).unwrap(); assert_ok!(T::MultiCurrency::deposit(pool.collateral, &pool.account_id, amount)); assert_ok!(pool.liquidity_shares_manager.deposit_fees(amount)); @@ -252,10 +237,7 @@ where } // Let `caller` join the pool of `market_id` after adding the required funds to their account. -fn add_liquidity_provider_to_market(market_id: MarketIdOf, caller: AccountIdOf) -where - T: Config, -{ +fn add_liquidity_provider_to_market(market_id: MarketIdOf, caller: AccountIdOf) { let pool = Pools::::get(market_id).unwrap(); // Buy a little more to account for rounding. let pool_shares_amount = diff --git a/zrml/neo-swaps/src/math.rs b/zrml/neo-swaps/src/math.rs index 92aa104be..401dfb8be 100644 --- a/zrml/neo-swaps/src/math.rs +++ b/zrml/neo-swaps/src/math.rs @@ -423,6 +423,7 @@ mod transcendental { #[cfg(test)] mod tests { + use super::*; use alloc::str::FromStr; use fixed::types::U64F64; @@ -504,6 +505,9 @@ mod transcendental { #[cfg(test)] mod tests { + // TODO(#1328): Remove after rustc nightly-2024-04-22 + #![allow(clippy::duplicated_attributes)] + use super::*; use crate::{mock::Runtime as MockRuntime, MAX_SPOT_PRICE, MIN_SPOT_PRICE}; use alloc::str::FromStr; diff --git a/zrml/parimutuel/src/lib.rs b/zrml/parimutuel/src/lib.rs index c90d2af65..824a92f35 100644 --- a/zrml/parimutuel/src/lib.rs +++ b/zrml/parimutuel/src/lib.rs @@ -47,7 +47,6 @@ mod pallet { ensure_signed, pallet_prelude::{BlockNumberFor, OriginFor}, }; - use log; use orml_traits::MultiCurrency; use pallet_assets::ManagedDestroy; use sp_runtime::{ diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index b4233568b..0e825cc06 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -63,7 +63,6 @@ mod pallet { }; use frame_system::pallet_prelude::BlockNumberFor; - use log; use orml_traits::{MultiCurrency, NamedMultiReservableCurrency}; use sp_arithmetic::per_things::{Perbill, Percent}; use sp_runtime::{ diff --git a/zrml/swaps/src/tests.rs b/zrml/swaps/src/tests.rs index b5e3e264e..ef05cb25f 100644 --- a/zrml/swaps/src/tests.rs +++ b/zrml/swaps/src/tests.rs @@ -24,6 +24,8 @@ #![cfg(all(feature = "mock", test))] #![allow(clippy::too_many_arguments)] +// TODO(#1328): Remove after rustc nightly-2024-04-22 +#![allow(clippy::duplicated_attributes)] use crate::{ events::{CommonPoolEventParams, PoolAssetEvent, PoolAssetsEvent, SwapEvent},