From c7ffd86a78133e8e21b1818ba5a9efb445df5c79 Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Tue, 17 Jan 2023 14:00:21 +0300 Subject: [PATCH] fix: subxt fixed clippy warnings (#1545) * fix: subxt fixed clippy warnings * default branch * update Cargo.lock --- .github/workflows/rust-clippy.yml | 2 +- rust/Cargo.lock | 496 ++++++------------------------ rust/parser/Cargo.toml | 2 +- rust/parser/src/tests.rs | 22 +- 4 files changed, 100 insertions(+), 422 deletions(-) diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml index 563d275a64..860b5d3e35 100644 --- a/.github/workflows/rust-clippy.yml +++ b/.github/workflows/rust-clippy.yml @@ -50,4 +50,4 @@ jobs: - name: cargo clippy run: | cd rust - cargo clippy --all-targets --all-features -- -A clippy::enum_variant_names -A clippy::too_many_arguments -D warnings + cargo clippy --all-targets --all-features -- -D warnings diff --git a/rust/Cargo.lock b/rust/Cargo.lock index ad01f56631..88e497b72c 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -814,8 +814,8 @@ dependencies = [ "pretty_assertions", "regex", "sled", - "sp-core 6.0.0", - "sp-runtime 6.0.0", + "sp-core", + "sp-runtime", "thiserror", "time", "tiny-bip39 1.0.0", @@ -829,8 +829,8 @@ dependencies = [ "definitions", "lazy_static", "regex", - "sp-core 6.0.0", - "sp-runtime 6.0.0", + "sp-core", + "sp-runtime", "thiserror", ] @@ -849,11 +849,11 @@ dependencies = [ "sc-executor-common", "sc-executor-wasmi", "sled", - "sp-core 6.0.0", - "sp-io 6.0.0", - "sp-runtime 6.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-version", - "sp-wasm-interface 6.0.0", + "sp-wasm-interface", "thiserror", "variant_count", ] @@ -1303,9 +1303,9 @@ dependencies = [ "regex", "serde_json", "sled", - "sp-core 6.0.0", + "sp-core", "sp-keyring", - "sp-runtime 6.0.0", + "sp-runtime", "tempfile", "thiserror", "tokio", @@ -1998,15 +1998,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "lru" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" -dependencies = [ - "hashbrown", -] - [[package]] name = "maplit" version = "1.0.2" @@ -2142,8 +2133,8 @@ dependencies = [ "pretty_assertions", "qrcode_rtx", "regex", - "sp-core 6.0.0", - "sp-runtime 6.0.0", + "sp-core", + "sp-runtime", "tempfile", "thiserror", "transaction_parsing", @@ -2492,9 +2483,9 @@ dependencies = [ "printing_balance", "regex", "scale-info", - "sp-arithmetic 5.0.0", - "sp-core 6.0.0", - "sp-runtime 6.0.0", + "sp-arithmetic", + "sp-core", + "sp-runtime", "subxt", "thiserror", ] @@ -3126,8 +3117,8 @@ version = "4.1.0-dev" source = "git+https://github.com/paritytech/substrate#49734dd1d72a00b9d3b87ba397661a63e0e17af3" dependencies = [ "log", - "sp-core 6.0.0", - "sp-wasm-interface 6.0.0", + "sp-core", + "sp-wasm-interface", "thiserror", ] @@ -3141,7 +3132,7 @@ dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", "sp-sandbox", - "sp-wasm-interface 6.0.0", + "sp-wasm-interface", "thiserror", "wasm-instrument", "wasmi", @@ -3156,9 +3147,9 @@ dependencies = [ "parity-scale-codec", "sc-allocator", "sc-executor-common", - "sp-runtime-interface 6.0.0", + "sp-runtime-interface", "sp-sandbox", - "sp-wasm-interface 6.0.0", + "sp-wasm-interface", "wasmi", ] @@ -3501,8 +3492,8 @@ dependencies = [ "oslog", "qr_reader_phone", "qrcode_static", - "sp-core 6.0.0", - "sp-runtime 6.0.0", + "sp-core", + "sp-runtime", "uniffi", "uniffi_build", ] @@ -3574,25 +3565,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 6.0.0", - "sp-io 6.0.0", + "sp-core", + "sp-io", "sp-std 4.0.0", ] -[[package]] -name = "sp-application-crypto" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a70f8245ad75c773c43e46d16e81adb62290d37cd07efcde6cef06d93235e5" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-std 5.0.0", -] - [[package]] name = "sp-arithmetic" version = "5.0.0" @@ -3603,27 +3580,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-debug-derive 4.0.0", + "sp-debug-derive", "sp-std 4.0.0", "static_assertions", ] -[[package]] -name = "sp-arithmetic" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3856b3e912f0a7a1332f1642b5fd3c2e76476e894c656538d32c004698690157" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-debug-derive 5.0.0", - "sp-std 5.0.0", - "static_assertions", -] - [[package]] name = "sp-core" version = "6.0.0" @@ -3657,57 +3618,11 @@ dependencies = [ "secrecy", "serde", "sp-core-hashing 4.0.0", - "sp-debug-derive 4.0.0", - "sp-externalities 0.12.0", - "sp-runtime-interface 6.0.0", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", "sp-std 4.0.0", - "sp-storage 6.0.0", - "ss58-registry", - "substrate-bip39", - "thiserror", - "tiny-bip39 0.8.2", - "wasmi", - "zeroize", -] - -[[package]] -name = "sp-core" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c78530907dbf7949af928d0ce88b485067389201b6d9b468074b1924f209f0" -dependencies = [ - "array-bytes", - "base58", - "bitflags", - "blake2", - "byteorder", - "dyn-clonable", - "ed25519-zebra", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "lazy_static", - "libsecp256k1", - "log", - "merlin", - "num-traits", - "parity-scale-codec", - "parking_lot 0.12.1", - "primitive-types", - "rand 0.7.3", - "regex", - "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", - "serde", - "sp-core-hashing 5.0.0", - "sp-debug-derive 5.0.0", - "sp-externalities 0.13.0", - "sp-runtime-interface 7.0.0", - "sp-std 5.0.0", - "sp-storage 7.0.0", + "sp-storage", "ss58-registry", "substrate-bip39", "thiserror", @@ -3732,16 +3647,16 @@ dependencies = [ [[package]] name = "sp-core-hashing" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b9d1daa6aebfc144729b630885e91df92ff00560490ec065a56cb538e8895a" +checksum = "cbc2d1947252b7a4e403b0a260f596920443742791765ec111daa2bbf98eff25" dependencies = [ "blake2", "byteorder", "digest 0.10.3", "sha2 0.10.2", "sha3", - "sp-std 5.0.0", + "sp-std 6.0.0", "twox-hash", ] @@ -3766,17 +3681,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sp-debug-derive" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9ba7352773b96a4aa57e903447f841c6bc26e8c798377db6e7eb332346454" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sp-externalities" version = "0.12.0" @@ -3785,19 +3689,7 @@ dependencies = [ "environmental", "parity-scale-codec", "sp-std 4.0.0", - "sp-storage 6.0.0", -] - -[[package]] -name = "sp-externalities" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef739442230f49d88ece41259e5d886d6b8bc0f4197ef7f1585c39c762ce7ef2" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std 5.0.0", - "sp-storage 7.0.0", + "sp-storage", ] [[package]] @@ -3813,42 +3705,15 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "secp256k1", - "sp-core 6.0.0", - "sp-externalities 0.12.0", - "sp-keystore 0.12.0", - "sp-runtime-interface 6.0.0", - "sp-state-machine 0.12.0", + "sp-core", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", "sp-std 4.0.0", - "sp-tracing 5.0.0", - "sp-trie 6.0.0", - "sp-wasm-interface 6.0.0", - "tracing", - "tracing-core", -] - -[[package]] -name = "sp-io" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6280bd3643354f7ff0b2abd36c687745455779231a7a86d90945608f0d4924c4" -dependencies = [ - "bytes", - "futures", - "hash-db", - "libsecp256k1", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "secp256k1", - "sp-core 7.0.0", - "sp-externalities 0.13.0", - "sp-keystore 0.13.0", - "sp-runtime-interface 7.0.0", - "sp-state-machine 0.13.0", - "sp-std 5.0.0", - "sp-tracing 6.0.0", - "sp-trie 7.0.0", - "sp-wasm-interface 7.0.0", + "sp-tracing", + "sp-trie", + "sp-wasm-interface", "tracing", "tracing-core", ] @@ -3859,8 +3724,8 @@ version = "6.0.0" source = "git+https://github.com/paritytech/substrate#49734dd1d72a00b9d3b87ba397661a63e0e17af3" dependencies = [ "lazy_static", - "sp-core 6.0.0", - "sp-runtime 6.0.0", + "sp-core", + "sp-runtime", "strum", ] @@ -3875,25 +3740,8 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "schnorrkel", - "sp-core 6.0.0", - "sp-externalities 0.12.0", - "thiserror", -] - -[[package]] -name = "sp-keystore" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44bec4f0d036b6993c14bbee4216781f21275e5c201e43e45fed4a434bf0e5a" -dependencies = [ - "async-trait", - "futures", - "merlin", - "parity-scale-codec", - "parking_lot 0.12.1", - "schnorrkel", - "sp-core 7.0.0", - "sp-externalities 0.13.0", + "sp-core", + "sp-externalities", "thiserror", ] @@ -3916,17 +3764,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-panic-handler" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97549ec99cb289db2a9f5c656b6880f7c90097135e1ca6c6ae4fe5694232e526" -dependencies = [ - "backtrace", - "lazy_static", - "regex", -] - [[package]] name = "sp-runtime" version = "6.0.0" @@ -3942,36 +3779,12 @@ dependencies = [ "rand 0.7.3", "scale-info", "serde", - "sp-application-crypto 6.0.0", - "sp-arithmetic 5.0.0", - "sp-core 6.0.0", - "sp-io 6.0.0", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-std 4.0.0", - "sp-weights 4.0.0 (git+https://github.com/paritytech/substrate)", -] - -[[package]] -name = "sp-runtime" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfc5c54c2b31d2f0cf904d472a0bff7125c0c2a2e2330507842e56f9a27444" -dependencies = [ - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "parity-util-mem", - "paste", - "rand 0.7.3", - "scale-info", - "serde", - "sp-application-crypto 7.0.0", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", - "sp-io 7.0.0", - "sp-std 5.0.0", - "sp-weights 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-weights", ] [[package]] @@ -3983,31 +3796,12 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities 0.12.0", - "sp-runtime-interface-proc-macro 5.0.0", + "sp-externalities", + "sp-runtime-interface-proc-macro", "sp-std 4.0.0", - "sp-storage 6.0.0", - "sp-tracing 5.0.0", - "sp-wasm-interface 6.0.0", - "static_assertions", -] - -[[package]] -name = "sp-runtime-interface" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b886a5d34400b0e0c12d389e3bb48b7a93d651cddf7e248124b81fe64c339251" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities 0.13.0", - "sp-runtime-interface-proc-macro 6.0.0", - "sp-std 5.0.0", - "sp-storage 7.0.0", - "sp-tracing 6.0.0", - "sp-wasm-interface 7.0.0", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", "static_assertions", ] @@ -4023,19 +3817,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a157f1ce0108b9b87f87e826726049d9b6253318b74410c814be7fc2af416b51" -dependencies = [ - "Inflector", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sp-sandbox" version = "0.10.0-dev" @@ -4043,10 +3824,10 @@ source = "git+https://github.com/paritytech/substrate#49734dd1d72a00b9d3b87ba397 dependencies = [ "log", "parity-scale-codec", - "sp-core 6.0.0", - "sp-io 6.0.0", + "sp-core", + "sp-io", "sp-std 4.0.0", - "sp-wasm-interface 6.0.0", + "sp-wasm-interface", "wasmi", ] @@ -4062,34 +3843,11 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.7.3", "smallvec", - "sp-core 6.0.0", - "sp-externalities 0.12.0", - "sp-panic-handler 4.0.0", + "sp-core", + "sp-externalities", + "sp-panic-handler", "sp-std 4.0.0", - "sp-trie 6.0.0", - "thiserror", - "tracing", - "trie-root", -] - -[[package]] -name = "sp-state-machine" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5c2d97ad69011d34ca257f0383532b80096d53f889f5894ae2b24a211bec66f" -dependencies = [ - "hash-db", - "log", - "num-traits", - "parity-scale-codec", - "parking_lot 0.12.1", - "rand 0.7.3", - "smallvec", - "sp-core 7.0.0", - "sp-externalities 0.13.0", - "sp-panic-handler 5.0.0", - "sp-std 5.0.0", - "sp-trie 7.0.0", + "sp-trie", "thiserror", "tracing", "trie-root", @@ -4102,9 +3860,9 @@ source = "git+https://github.com/paritytech/substrate#49734dd1d72a00b9d3b87ba397 [[package]] name = "sp-std" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3fd4c1d304be101e6ebbafd3d4be9a37b320c970ef4e8df188b16873981c93" +checksum = "af0ee286f98455272f64ac5bb1384ff21ac029fbb669afbaf48477faff12760e" [[package]] name = "sp-storage" @@ -4115,24 +3873,10 @@ dependencies = [ "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 4.0.0", + "sp-debug-derive", "sp-std 4.0.0", ] -[[package]] -name = "sp-storage" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb987ed2e4d7d870170a225083ea962f2a359d75cdf76935d5ed8d91bee912d9" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 5.0.0", - "sp-std 5.0.0", -] - [[package]] name = "sp-tracing" version = "5.0.0" @@ -4145,19 +3889,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "sp-tracing" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e761df87dc940d87720939de8f976d1fc0657e523886ae0d7bf3f7e2e2f0abb6" -dependencies = [ - "parity-scale-codec", - "sp-std 5.0.0", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "sp-trie" version = "6.0.0" @@ -4167,13 +3898,13 @@ dependencies = [ "hash-db", "hashbrown", "lazy_static", - "lru 0.7.8", + "lru", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", "scale-info", - "sp-core 6.0.0", + "sp-core", "sp-std 4.0.0", "thiserror", "tracing", @@ -4181,30 +3912,6 @@ dependencies = [ "trie-root", ] -[[package]] -name = "sp-trie" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4f48c887e90050537e399d2d8b6ee82787ebec0fe46e4880b42cab0c2d5ba6" -dependencies = [ - "ahash", - "hash-db", - "hashbrown", - "lazy_static", - "lru 0.8.1", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot 0.12.1", - "scale-info", - "sp-core 7.0.0", - "sp-std 5.0.0", - "thiserror", - "tracing", - "trie-db", - "trie-root", -] - [[package]] name = "sp-version" version = "5.0.0" @@ -4216,7 +3923,7 @@ dependencies = [ "scale-info", "serde", "sp-core-hashing-proc-macro", - "sp-runtime 6.0.0", + "sp-runtime", "sp-std 4.0.0", "sp-version-proc-macro", "thiserror", @@ -4245,36 +3952,6 @@ dependencies = [ "wasmi", ] -[[package]] -name = "sp-wasm-interface" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f43c40afab6ecac20505907631c929957ed636b7af8795984649bbaa6ff38c3" -dependencies = [ - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-std 5.0.0", - "wasmi", -] - -[[package]] -name = "sp-weights" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c671673133b30e6ab6d88139b06adcdaec5aa06548abe0e155a0c830b592793b" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic 6.0.0", - "sp-core 7.0.0", - "sp-debug-derive 5.0.0", - "sp-std 5.0.0", -] - [[package]] name = "sp-weights" version = "4.0.0" @@ -4285,9 +3962,9 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 5.0.0", - "sp-core 6.0.0", - "sp-debug-derive 4.0.0", + "sp-arithmetic", + "sp-core", + "sp-debug-derive", "sp-std 4.0.0", ] @@ -4377,24 +4054,26 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "subxt" version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3cbc78fd36035a24883eada29e0205b9b1416172530a7d00a60c07d0337db0c" +source = "git+https://github.com/paritytech/subxt#c9f414f4ed7e9f6891eded667a6181dd5345590c" dependencies = [ - "bitvec", + "base58", + "blake2", "derivative", "frame-metadata", "futures", "getrandom 0.2.6", "hex", + "impl-serde", "parity-scale-codec", "parking_lot 0.12.1", + "primitive-types", + "scale-bits", "scale-decode", "scale-info", "scale-value", "serde", "serde_json", - "sp-core 7.0.0", - "sp-runtime 7.0.0", + "sp-core-hashing 6.0.0", "subxt-macro", "subxt-metadata", "thiserror", @@ -4404,8 +4083,7 @@ dependencies = [ [[package]] name = "subxt-codegen" version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7722c31febf55eb300c73d977da5d65cfd6fb443419b1185b9abcdd9925fd7be" +source = "git+https://github.com/paritytech/subxt#c9f414f4ed7e9f6891eded667a6181dd5345590c" dependencies = [ "darling", "frame-metadata", @@ -4425,8 +4103,7 @@ dependencies = [ [[package]] name = "subxt-macro" version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f64826f2c4ba20e3b2a86ec81a6ae8655ca6b6a4c2a6ccc888b6615efc2df14" +source = "git+https://github.com/paritytech/subxt#c9f414f4ed7e9f6891eded667a6181dd5345590c" dependencies = [ "darling", "proc-macro-error", @@ -4437,13 +4114,12 @@ dependencies = [ [[package]] name = "subxt-metadata" version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869af75e23513538ad0af046af4a97b8d684e8d202e35ff4127ee061c1110813" +source = "git+https://github.com/paritytech/subxt#c9f414f4ed7e9f6891eded667a6181dd5345590c" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-core 7.0.0", + "sp-core-hashing 6.0.0", ] [[package]] @@ -4811,8 +4487,8 @@ dependencies = [ "parser", "pretty_assertions", "sled", - "sp-core 6.0.0", - "sp-runtime 6.0.0", + "sp-core", + "sp-runtime", "thiserror", ] @@ -4828,8 +4504,8 @@ dependencies = [ "parity-scale-codec", "pretty_assertions", "sled", - "sp-core 6.0.0", - "sp-runtime 6.0.0", + "sp-core", + "sp-runtime", "tempfile", "thiserror", "transaction_parsing", diff --git a/rust/parser/Cargo.toml b/rust/parser/Cargo.toml index a13395bb87..adc26f898b 100644 --- a/rust/parser/Cargo.toml +++ b/rust/parser/Cargo.toml @@ -25,7 +25,7 @@ thiserror = "1.0.38" pretty_assertions = { version = "1.3.0", optional = true } [dev-dependencies] -subxt = { version = "0.25.0", default-features = false } +subxt = { git = "https://github.com/paritytech/subxt", default-features = false } [features] default = ["test"] diff --git a/rust/parser/src/tests.rs b/rust/parser/src/tests.rs index 64f2eba0b9..b4abfb8b8f 100644 --- a/rust/parser/src/tests.rs +++ b/rust/parser/src/tests.rs @@ -10,9 +10,12 @@ use pretty_assertions::assert_eq; use sp_core::H256; use subxt::{ - config::PolkadotConfig, - ext::{sp_core::crypto::Ss58Codec, sp_runtime::AccountId32}, - tx::{BaseExtrinsicParams, BaseExtrinsicParamsBuilder, Era, ExtrinsicParams, PlainTip}, + config::{ + extrinsic_params::{BaseExtrinsicParams, BaseExtrinsicParamsBuilder, Era, ExtrinsicParams}, + polkadot::PlainTip, + PolkadotConfig, + }, + utils::AccountId32, }; fn metadata(filename: &str) -> RuntimeMetadata { @@ -44,7 +47,6 @@ mod westend9122 {} #[subxt::subxt(runtime_metadata_path = "for_tests/acala2012.scale")] mod acala2012 {} -#[allow(clippy::*)] #[subxt::subxt(runtime_metadata_path = "for_tests/moonbase1802.scale")] mod moonbase1802 {} @@ -96,7 +98,7 @@ fn tr_1() { let mut calls = Vec::new(); let staking_call_bond = StakingCall::bond { - controller: AccountId32::from_ss58check("5DfhGyQdFobKM8NsWvEeAKk5EQQgYe9AydgJ7rMB6E1EqRzV") + controller: AccountId32::from_str("5DfhGyQdFobKM8NsWvEeAKk5EQQgYe9AydgJ7rMB6E1EqRzV") .unwrap() .into(), value: 1061900000000, @@ -111,7 +113,7 @@ fn tr_1() { "5FZoQhgUCmqBxnkHX7jCqThScS2xQWiwiF61msg63CFL3Y8f", ] .iter() - .map(|addr| AccountId32::from_ss58check(addr).unwrap().into()) + .map(|addr| AccountId32::from_str(addr).unwrap().into()) .collect(), }; @@ -182,7 +184,7 @@ fn tr_2() { let mut calls = Vec::new(); let staking_call_bond = StakingCall::bond { - controller: AccountId32::from_ss58check("5DfhGyQdFobKM8NsWvEeAKk5EQQgYe9AydgJ7rMB6E1EqRzV") + controller: AccountId32::from_str("5DfhGyQdFobKM8NsWvEeAKk5EQQgYe9AydgJ7rMB6E1EqRzV") .unwrap() .into(), value: 1061900000000, @@ -197,7 +199,7 @@ fn tr_2() { "5FZoQhgUCmqBxnkHX7jCqThScS2xQWiwiF61msg63CFL3Y8f", ] .iter() - .map(|addr| AccountId32::from_ss58check(addr).unwrap().into()) + .map(|addr| AccountId32::from_str(addr).unwrap().into()) .collect(), }; @@ -275,7 +277,7 @@ fn tr_4() { pallet_balances::pallet::Call as BalancesCall, westend_runtime::Call, }; - let dest = AccountId32::from_ss58check("5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty") + let dest = AccountId32::from_str("5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty") .unwrap() .into(); let genesis_hash = westend_genesis(); @@ -376,7 +378,7 @@ fn tr_6() { acala_runtime::Call, pallet_balances::pallet::Call as BalancesCall, }; - let dest = AccountId32::from_ss58check("25rZGFcFEWz1d81xB98PJN8LQu5cCwjyazAerGkng5NDuk9C") + let dest = AccountId32::from_str("25rZGFcFEWz1d81xB98PJN8LQu5cCwjyazAerGkng5NDuk9C") .unwrap() .into();