From f72543926b36ae98e7c3e5a946bf39762b268a5e Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Thu, 20 Nov 2025 06:01:08 +0800 Subject: [PATCH 1/5] fix: Treasury - address format --- Cargo.lock | 820 +++++++++++++++++++++++++++++++++++++++++--- Cargo.toml | 1 + src/cli/treasury.rs | 20 +- 3 files changed, 777 insertions(+), 64 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee03d0c..978a630 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,6 +155,20 @@ version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" +[[package]] +name = "aquamarine" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "argon2" version = "0.5.3" @@ -862,6 +876,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", +] + [[package]] name = "cfg-if" version = "1.0.3" @@ -989,6 +1012,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.16", + "once_cell", + "tiny-keccak", +] + [[package]] name = "const_format" version = "0.2.34" @@ -1361,6 +1404,27 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "dyn-clonable" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a36efbb9bfd58e1723780aa04b61aba95ace6a05d9ffabfdb0b43672552f0805" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "dyn-clone" version = "1.0.20" @@ -1615,7 +1679,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e56c0e51972d7b26ff76966c4d0f2307030df9daa5ce0885149ece1ab7ca5ad" dependencies = [ - "frame-metadata", + "frame-metadata 23.0.0", "parity-scale-codec", "scale-decode", "scale-info", @@ -1623,6 +1687,18 @@ dependencies = [ "sp-crypto-hashing", ] +[[package]] +name = "frame-metadata" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + [[package]] name = "frame-metadata" version = "23.0.0" @@ -1635,6 +1711,93 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-support" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c7c272704856cc88a86aef689a778050e59f89d7ec1e4ffb3a9e8e04e6b10" +dependencies = [ + "aquamarine", + "array-bytes", + "binary-merkle-tree", + "bitflags 1.3.2", + "docify", + "environmental", + "frame-metadata 20.0.0", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "macro_magic", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "serde_json", + "sp-api", + "sp-arithmetic 26.1.0", + "sp-core 36.1.0", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder", + "sp-inherents", + "sp-io 40.0.1", + "sp-metadata-ir", + "sp-runtime 41.1.0", + "sp-staking", + "sp-state-machine 0.45.0", + "sp-std", + "sp-tracing", + "sp-trie 39.1.0", + "sp-weights 31.1.0", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "33.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcb3c16c8fe1b4edc6df122212b50f776dfce31a94fa63305100841ba4eb7c93" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse", + "docify", + "expander", + "frame-support-procedural-tools", + "itertools 0.11.0", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "sp-crypto-hashing", + "syn 2.0.106", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "13.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "fs-err" version = "2.11.0" @@ -2289,6 +2452,25 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "include_dir" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "2.11.1" @@ -2680,6 +2862,54 @@ dependencies = [ "hashbrown 0.15.5", ] +[[package]] +name = "macro_magic" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "macro_magic_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "macro_magic_macros" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.106", +] + [[package]] name = "matchers" version = "0.2.0" @@ -2695,6 +2925,15 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +[[package]] +name = "memory-db" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" +dependencies = [ + "hash-db", +] + [[package]] name = "memory-db" version = "0.34.0" @@ -3055,6 +3294,12 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "parity-wasm" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" + [[package]] name = "parking" version = "2.2.1" @@ -3179,19 +3424,46 @@ dependencies = [ "spki", ] +[[package]] +name = "polkavm-common" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" + [[package]] name = "polkavm-common" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed9e5af472f729fcf3b3c1cf17508ddbb3505259dd6e2ee0fb5a29e105d22" +[[package]] +name = "polkavm-derive" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" +dependencies = [ + "polkavm-derive-impl-macro 0.18.0", +] + [[package]] name = "polkavm-derive" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "176144f8661117ea95fa7cf868c9a62d6b143e8a2ebcb7582464c3faade8669a" dependencies = [ - "polkavm-derive-impl-macro", + "polkavm-derive-impl-macro 0.24.0", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" +dependencies = [ + "polkavm-common 0.18.0", + "proc-macro2", + "quote", + "syn 2.0.106", ] [[package]] @@ -3200,19 +3472,29 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5a21844afdfcc10c92b9ef288ccb926211af27478d1730fcd55e4aec710179d" dependencies = [ - "polkavm-common", + "polkavm-common 0.24.0", "proc-macro2", "quote", "syn 2.0.106", ] +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" +dependencies = [ + "polkavm-derive-impl 0.18.1", + "syn 2.0.106", +] + [[package]] name = "polkavm-derive-impl-macro" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba0ef0f17ad81413ea1ca5b1b67553aedf5650c88269b673d3ba015c83bc2651" dependencies = [ - "polkavm-derive-impl", + "polkavm-derive-impl 0.24.0", "syn 2.0.106", ] @@ -3310,6 +3592,30 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -3332,6 +3638,17 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "proc-macro-warning" +version = "1.84.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75eea531cfcd120e0851a3f8aed42c4841f78c889eefafd96339c72677ae42c3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "proc-macro2" version = "1.0.101" @@ -3367,9 +3684,9 @@ dependencies = [ "qp-rusty-crystals-dilithium", "qp-rusty-crystals-hdwallet", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 37.0.0", + "sp-io 41.0.1", + "sp-runtime 42.0.0", "thiserror 1.0.69", ] @@ -3386,10 +3703,10 @@ dependencies = [ "qp-poseidon-core 0.9.5", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 37.0.0", + "sp-runtime 42.0.0", "sp-storage", - "sp-trie", + "sp-trie 40.0.0", ] [[package]] @@ -3405,10 +3722,10 @@ dependencies = [ "qp-poseidon-core 1.0.1", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 37.0.0", + "sp-runtime 42.0.0", "sp-storage", - "sp-trie", + "sp-trie 40.0.0", ] [[package]] @@ -3493,6 +3810,7 @@ dependencies = [ "clap", "colored", "dirs", + "frame-support", "hex", "jsonrpsee", "parity-scale-codec", @@ -3505,8 +3823,8 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.9", - "sp-core", - "sp-runtime", + "sp-core 37.0.0", + "sp-runtime 42.0.0", "subxt", "subxt-metadata", "tempfile", @@ -4412,38 +4730,152 @@ dependencies = [ ] [[package]] -name = "sp-application-crypto" -version = "41.0.0" +name = "sp-api" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c668f1ce424bc131f40ade33fa4c0bd4dcd2428479e1e291aad66d4b00c74f" +checksum = "541da427f47dfb97f3dd0556fa3272bdc5dfa0d4c1ad53a22670a9bae4db63d7" dependencies = [ + "docify", + "hash-db", + "log", "parity-scale-codec", "scale-info", - "serde", - "sp-core", - "sp-io", + "sp-api-proc-macro", + "sp-core 36.1.0", + "sp-externalities", + "sp-metadata-ir", + "sp-runtime 41.1.0", + "sp-runtime-interface 29.0.1", + "sp-state-machine 0.45.0", + "sp-trie 39.1.0", + "sp-version", + "thiserror 1.0.69", ] [[package]] -name = "sp-arithmetic" -version = "27.0.0" +name = "sp-api-proc-macro" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2929fd12ac6ca3cfac7f62885866810ba4e9464814dbaa87592b5b5681b29aee" +checksum = "cedafdeaf15c774433ad8f5b00883bdf7d86e7c8b8e050e3439d4ae422114096" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "sp-application-crypto" +version = "40.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba375ab65a76f7413d1bfe48122fd347ce7bd2047e36ecbbd78f12f5adaed121" dependencies = [ - "docify", - "integer-sqrt", - "num-traits", "parity-scale-codec", "scale-info", "serde", - "static_assertions", + "sp-core 36.1.0", + "sp-io 40.0.1", ] [[package]] -name = "sp-core" -version = "37.0.0" +name = "sp-application-crypto" +version = "41.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1a46a6b2323401e4489184846a7fb7d89091b42602a2391cd3ef652ede2850" +checksum = "28c668f1ce424bc131f40ade33fa4c0bd4dcd2428479e1e291aad66d4b00c74f" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 37.0.0", + "sp-io 41.0.1", +] + +[[package]] +name = "sp-arithmetic" +version = "26.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9971b30935cea3858664965039dabd80f67aca74cc6cc6dd42ff1ab14547bc53" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "static_assertions", +] + +[[package]] +name = "sp-arithmetic" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2929fd12ac6ca3cfac7f62885866810ba4e9464814dbaa87592b5b5681b29aee" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "static_assertions", +] + +[[package]] +name = "sp-core" +version = "36.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" +dependencies = [ + "ark-vrf", + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.11.0", + "k256", + "libsecp256k1", + "log", + "merlin", + "parity-bip39", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types", + "rand 0.8.5", + "scale-info", + "schnorrkel", + "secp256k1", + "secrecy", + "serde", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface 29.0.1", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror 1.0.69", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e1a46a6b2323401e4489184846a7fb7d89091b42602a2391cd3ef652ede2850" dependencies = [ "ark-vrf", "array-bytes", @@ -4477,7 +4909,7 @@ dependencies = [ "sp-crypto-hashing", "sp-debug-derive", "sp-externalities", - "sp-runtime-interface", + "sp-runtime-interface 30.0.0", "sp-std", "sp-storage", "ss58-registry", @@ -4502,6 +4934,17 @@ dependencies = [ "twox-hash 1.6.3", ] +[[package]] +name = "sp-crypto-hashing-proc-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" +dependencies = [ + "quote", + "sp-crypto-hashing", + "syn 2.0.106", +] + [[package]] name = "sp-debug-derive" version = "14.0.0" @@ -4524,6 +4967,60 @@ dependencies = [ "sp-storage", ] +[[package]] +name = "sp-genesis-builder" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb0d996dfce9afb8879bdfbba9cb9a7d06f29fda38168b91e90419b3b92c42e" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde_json", + "sp-api", + "sp-runtime 41.1.0", +] + +[[package]] +name = "sp-inherents" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb09ff07946f3e1ecdd4bfb40b2cceba60188215ceb941b5b07230294d7aee1" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime 41.1.0", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-io" +version = "40.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e41d010bcc515d119901ff7ac83150c335d543c7f6c03be5c8fe08430b8a03b" +dependencies = [ + "bytes", + "docify", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "polkavm-derive 0.18.0", + "rustversion", + "secp256k1", + "sp-core 36.1.0", + "sp-crypto-hashing", + "sp-externalities", + "sp-keystore 0.42.0", + "sp-runtime-interface 29.0.1", + "sp-state-machine 0.45.0", + "sp-tracing", + "sp-trie 39.1.0", + "tracing", + "tracing-core", +] + [[package]] name = "sp-io" version = "41.0.1" @@ -4536,21 +5033,33 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "polkavm-derive", + "polkavm-derive 0.24.0", "rustversion", "secp256k1", - "sp-core", + "sp-core 37.0.0", "sp-crypto-hashing", "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", + "sp-keystore 0.43.0", + "sp-runtime-interface 30.0.0", + "sp-state-machine 0.46.0", "sp-tracing", - "sp-trie", + "sp-trie 40.0.0", "tracing", "tracing-core", ] +[[package]] +name = "sp-keystore" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45f893398a5330e28f219662c7a0afa174fb068d8f82d2a9990016c4b0bc4369" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core 36.1.0", + "sp-externalities", +] + [[package]] name = "sp-keystore" version = "0.43.0" @@ -4559,10 +5068,21 @@ checksum = "269d0ee360f6d072f9203485afea35583ac151521a525cc48b2a107fc576c2d9" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core", + "sp-core 37.0.0", "sp-externalities", ] +[[package]] +name = "sp-metadata-ir" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d1db25e362edbf5531b427d4bdfc2562bec6a031c3eb2a9145c0a0a01a572d" +dependencies = [ + "frame-metadata 20.0.0", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "sp-panic-handler" version = "13.0.2" @@ -4573,6 +5093,36 @@ dependencies = [ "regex", ] +[[package]] +name = "sp-runtime" +version = "41.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3864101a28faba3d8eca026e3f56ea20dd1d979ce1bcc20152e86c9d82be52bf" +dependencies = [ + "binary-merkle-tree", + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "num-traits", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto 40.1.0", + "sp-arithmetic 26.1.0", + "sp-core 36.1.0", + "sp-io 40.0.1", + "sp-std", + "sp-trie 39.1.0", + "sp-weights 31.1.0", + "tracing", + "tuplex", +] + [[package]] name = "sp-runtime" version = "42.0.0" @@ -4592,17 +5142,37 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", + "sp-application-crypto 41.0.0", + "sp-arithmetic 27.0.0", + "sp-core 37.0.0", + "sp-io 41.0.1", "sp-std", - "sp-trie", - "sp-weights", + "sp-trie 40.0.0", + "sp-weights 32.0.0", "tracing", "tuplex", ] +[[package]] +name = "sp-runtime-interface" +version = "29.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive 0.18.0", + "primitive-types", + "sp-externalities", + "sp-runtime-interface-proc-macro 18.0.0", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface 21.0.1", + "static_assertions", +] + [[package]] name = "sp-runtime-interface" version = "30.0.0" @@ -4612,17 +5182,31 @@ dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive", + "polkavm-derive 0.24.0", "primitive-types", "sp-externalities", - "sp-runtime-interface-proc-macro", + "sp-runtime-interface-proc-macro 19.0.0", "sp-std", "sp-storage", "sp-tracing", - "sp-wasm-interface", + "sp-wasm-interface 22.0.0", "static_assertions", ] +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "sp-runtime-interface-proc-macro" version = "19.0.0" @@ -4637,6 +5221,41 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "sp-staking" +version = "38.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8f9c0a32836e3c8842b0aec0813077654885d45d83b618210fbb730ea63545" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 36.1.0", + "sp-runtime 41.1.0", +] + +[[package]] +name = "sp-state-machine" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "smallvec", + "sp-core 36.1.0", + "sp-externalities", + "sp-panic-handler", + "sp-trie 39.1.0", + "thiserror 1.0.69", + "tracing", + "trie-db", +] + [[package]] name = "sp-state-machine" version = "0.46.0" @@ -4649,10 +5268,10 @@ dependencies = [ "parking_lot", "rand 0.8.5", "smallvec", - "sp-core", + "sp-core 37.0.0", "sp-externalities", "sp-panic-handler", - "sp-trie", + "sp-trie 40.0.0", "thiserror 1.0.69", "tracing", "trie-db", @@ -4689,6 +5308,29 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "sp-trie" +version = "39.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" +dependencies = [ + "ahash", + "hash-db", + "memory-db 0.32.0", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand 0.8.5", + "scale-info", + "schnellru", + "sp-core 36.1.0", + "sp-externalities", + "thiserror 1.0.69", + "tracing", + "trie-db", + "trie-root", +] + [[package]] name = "sp-trie" version = "40.0.0" @@ -4699,14 +5341,14 @@ dependencies = [ "foldhash", "hash-db", "hashbrown 0.15.5", - "memory-db", + "memory-db 0.34.0", "nohash-hasher", "parity-scale-codec", "parking_lot", "rand 0.8.5", "scale-info", "schnellru", - "sp-core", + "sp-core 37.0.0", "sp-externalities", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -4715,6 +5357,49 @@ dependencies = [ "trie-root", ] +[[package]] +name = "sp-version" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd736a15ff2ea0a67c5a3bbdfd842d88f11f0774d7701a8d8a316f8deba276c5" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-crypto-hashing-proc-macro", + "sp-runtime 41.1.0", + "sp-std", + "sp-version-proc-macro", + "thiserror 1.0.69", +] + +[[package]] +name = "sp-version-proc-macro" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cabc8279e835cd9c608d70cb00e693bddec94fe8478e9f3104dad1da5f93ca" +dependencies = [ + "parity-scale-codec", + "proc-macro-warning", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "sp-wasm-interface" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + [[package]] name = "sp-wasm-interface" version = "22.0.0" @@ -4727,6 +5412,21 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "sp-weights" +version = "31.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" +dependencies = [ + "bounded-collections", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 26.1.0", + "sp-debug-derive", +] + [[package]] name = "sp-weights" version = "32.0.0" @@ -4738,7 +5438,7 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic", + "sp-arithmetic 27.0.0", "sp-debug-derive", ] @@ -4840,7 +5540,7 @@ dependencies = [ "async-trait", "derive-where", "either", - "frame-metadata", + "frame-metadata 23.0.0", "futures", "hex", "jsonrpsee", @@ -4895,7 +5595,7 @@ dependencies = [ "blake2", "derive-where", "frame-decode", - "frame-metadata", + "frame-metadata 23.0.0", "hashbrown 0.14.5", "hex", "impl-serde", @@ -4956,7 +5656,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c134068711c0c46906abc0e6e4911204420331530738e18ca903a5469364d9f" dependencies = [ "frame-decode", - "frame-metadata", + "frame-metadata 23.0.0", "hashbrown 0.14.5", "parity-scale-codec", "scale-info", @@ -4971,7 +5671,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25de7727144780d780a6a7d78bbfd28414b8adbab68b05e87329c367d7705be4" dependencies = [ "derive-where", - "frame-metadata", + "frame-metadata 23.0.0", "futures", "hex", "impl-serde", @@ -5446,6 +6146,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tt-call" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" + [[package]] name = "tuplex" version = "0.1.2" diff --git a/Cargo.toml b/Cargo.toml index bcd74ba..4bc54e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,7 @@ codec = { package = "parity-scale-codec", version = "3.7", features = [ ] } sp-core = { version = "37.0.0" } sp-runtime = { version = "42.0.0" } +frame-support = { version = "40.0.0" } subxt = "0.43.0" jsonrpsee = { version = "0.24", features = ["client"] } diff --git a/src/cli/treasury.rs b/src/cli/treasury.rs index 4577025..14a43b8 100644 --- a/src/cli/treasury.rs +++ b/src/cli/treasury.rs @@ -2,6 +2,7 @@ use crate::{chain::quantus_subxt, cli::common::submit_transaction, log_print, log_success}; use clap::Subcommand; use colored::Colorize; +use frame_support::sp_runtime::traits::AccountIdConversion; /// Treasury management commands #[derive(Subcommand, Debug)] @@ -158,12 +159,13 @@ async fn get_treasury_balance( log_print!("💰 Treasury Balance"); log_print!(""); - // Get Treasury account ID - // PalletId("py/trsry") converts to account using "modl" prefix - let mut full_data = [0u8; 32]; - full_data[0..4].copy_from_slice(b"modl"); - full_data[4..12].copy_from_slice(b"py/trsry"); - let treasury_account = subxt::utils::AccountId32(full_data); + // Get Treasury account ID using the same method as runtime + let treasury_pallet_id = frame_support::PalletId(*b"py/trsry"); + let treasury_account_raw: sp_runtime::AccountId32 = + treasury_pallet_id.into_account_truncating(); + + // Convert to subxt's AccountId32 + let treasury_account = subxt::utils::AccountId32(*treasury_account_raw.as_ref()); // Query balance let addr = quantus_subxt::api::storage().system().account(treasury_account.clone()); @@ -185,7 +187,11 @@ async fn get_treasury_balance( log_print!("💰 Free Balance: {}", formatted_free_balance); log_print!("💰 Reserved: {}", formatted_reserved_balance); - log_print!("📍 Treasury Account: {}", treasury_account.to_string().bright_yellow()); + + // Display address in Quantus format (uses default SS58 version 189 set in main.rs) + use crate::cli::address_format::QuantusSS58; + let treasury_address = treasury_account_raw.to_quantus_ss58(); + log_print!("📍 Treasury Account: {}", treasury_address.bright_yellow()); Ok(()) } From 86a235bdbcf66d5f3d19461deae3b820d24c2d43 Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Thu, 20 Nov 2025 06:38:29 +0800 Subject: [PATCH 2/5] fix: frame-support version consistent with the chain --- Cargo.lock | 489 +++++++++-------------------------------------------- Cargo.toml | 2 +- 2 files changed, 81 insertions(+), 410 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 978a630..75debb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1404,27 +1404,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" -[[package]] -name = "dyn-clonable" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36efbb9bfd58e1723780aa04b61aba95ace6a05d9ffabfdb0b43672552f0805" -dependencies = [ - "dyn-clonable-impl", - "dyn-clone", -] - -[[package]] -name = "dyn-clonable-impl" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - [[package]] name = "dyn-clone" version = "1.0.20" @@ -1679,7 +1658,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e56c0e51972d7b26ff76966c4d0f2307030df9daa5ce0885149ece1ab7ca5ad" dependencies = [ - "frame-metadata 23.0.0", + "frame-metadata", "parity-scale-codec", "scale-decode", "scale-info", @@ -1687,18 +1666,6 @@ dependencies = [ "sp-crypto-hashing", ] -[[package]] -name = "frame-metadata" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26de808fa6461f2485dc51811aefed108850064994fb4a62b3ac21ffa62ac8df" -dependencies = [ - "cfg-if", - "parity-scale-codec", - "scale-info", - "serde", -] - [[package]] name = "frame-metadata" version = "23.0.0" @@ -1713,9 +1680,9 @@ dependencies = [ [[package]] name = "frame-support" -version = "40.1.0" +version = "41.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c7c272704856cc88a86aef689a778050e59f89d7ec1e4ffb3a9e8e04e6b10" +checksum = "00861648586bca196780b311ca1f345752ee5d971fa1a027f3213955bc493434" dependencies = [ "aquamarine", "array-bytes", @@ -1723,7 +1690,7 @@ dependencies = [ "bitflags 1.3.2", "docify", "environmental", - "frame-metadata 20.0.0", + "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -1735,29 +1702,29 @@ dependencies = [ "serde", "serde_json", "sp-api", - "sp-arithmetic 26.1.0", - "sp-core 36.1.0", + "sp-arithmetic", + "sp-core", "sp-crypto-hashing-proc-macro", "sp-debug-derive", "sp-genesis-builder", "sp-inherents", - "sp-io 40.0.1", + "sp-io", "sp-metadata-ir", - "sp-runtime 41.1.0", + "sp-runtime", "sp-staking", - "sp-state-machine 0.45.0", + "sp-state-machine", "sp-std", "sp-tracing", - "sp-trie 39.1.0", - "sp-weights 31.1.0", + "sp-trie", + "sp-weights", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "33.0.1" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcb3c16c8fe1b4edc6df122212b50f776dfce31a94fa63305100841ba4eb7c93" +checksum = "aeeec31716c2eeecf21535814faf293dfc7120351c249d1f6f4dea0e520c155b" dependencies = [ "Inflector", "cfg-expr", @@ -2925,15 +2892,6 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" -[[package]] -name = "memory-db" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" -dependencies = [ - "hash-db", -] - [[package]] name = "memory-db" version = "0.34.0" @@ -3424,46 +3382,19 @@ dependencies = [ "spki", ] -[[package]] -name = "polkavm-common" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31ff33982a807d8567645d4784b9b5d7ab87bcb494f534a57cadd9012688e102" - [[package]] name = "polkavm-common" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed9e5af472f729fcf3b3c1cf17508ddbb3505259dd6e2ee0fb5a29e105d22" -[[package]] -name = "polkavm-derive" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2eb703f3b6404c13228402e98a5eae063fd16b8f58afe334073ec105ee4117e" -dependencies = [ - "polkavm-derive-impl-macro 0.18.0", -] - [[package]] name = "polkavm-derive" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "176144f8661117ea95fa7cf868c9a62d6b143e8a2ebcb7582464c3faade8669a" dependencies = [ - "polkavm-derive-impl-macro 0.24.0", -] - -[[package]] -name = "polkavm-derive-impl" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2116a92e6e96220a398930f4c8a6cda1264206f3e2034fc9982bfd93f261f7" -dependencies = [ - "polkavm-common 0.18.0", - "proc-macro2", - "quote", - "syn 2.0.106", + "polkavm-derive-impl-macro", ] [[package]] @@ -3472,29 +3403,19 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5a21844afdfcc10c92b9ef288ccb926211af27478d1730fcd55e4aec710179d" dependencies = [ - "polkavm-common 0.24.0", + "polkavm-common", "proc-macro2", "quote", "syn 2.0.106", ] -[[package]] -name = "polkavm-derive-impl-macro" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" -dependencies = [ - "polkavm-derive-impl 0.18.1", - "syn 2.0.106", -] - [[package]] name = "polkavm-derive-impl-macro" version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba0ef0f17ad81413ea1ca5b1b67553aedf5650c88269b673d3ba015c83bc2651" dependencies = [ - "polkavm-derive-impl 0.24.0", + "polkavm-derive-impl", "syn 2.0.106", ] @@ -3684,9 +3605,9 @@ dependencies = [ "qp-rusty-crystals-dilithium", "qp-rusty-crystals-hdwallet", "scale-info", - "sp-core 37.0.0", - "sp-io 41.0.1", - "sp-runtime 42.0.0", + "sp-core", + "sp-io", + "sp-runtime", "thiserror 1.0.69", ] @@ -3703,10 +3624,10 @@ dependencies = [ "qp-poseidon-core 0.9.5", "scale-info", "serde", - "sp-core 37.0.0", - "sp-runtime 42.0.0", + "sp-core", + "sp-runtime", "sp-storage", - "sp-trie 40.0.0", + "sp-trie", ] [[package]] @@ -3722,10 +3643,10 @@ dependencies = [ "qp-poseidon-core 1.0.1", "scale-info", "serde", - "sp-core 37.0.0", - "sp-runtime 42.0.0", + "sp-core", + "sp-runtime", "sp-storage", - "sp-trie 40.0.0", + "sp-trie", ] [[package]] @@ -3823,8 +3744,8 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.9", - "sp-core 37.0.0", - "sp-runtime 42.0.0", + "sp-core", + "sp-runtime", "subxt", "subxt-metadata", "tempfile", @@ -4731,9 +4652,9 @@ dependencies = [ [[package]] name = "sp-api" -version = "36.0.1" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "541da427f47dfb97f3dd0556fa3272bdc5dfa0d4c1ad53a22670a9bae4db63d7" +checksum = "1ee297c1304c6b069784dda4147ef5f478f7aef75b94e0838a38c29de792f1df" dependencies = [ "docify", "hash-db", @@ -4741,22 +4662,22 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api-proc-macro", - "sp-core 36.1.0", + "sp-core", "sp-externalities", "sp-metadata-ir", - "sp-runtime 41.1.0", - "sp-runtime-interface 29.0.1", - "sp-state-machine 0.45.0", - "sp-trie 39.1.0", + "sp-runtime", + "sp-runtime-interface", + "sp-state-machine", + "sp-trie", "sp-version", "thiserror 1.0.69", ] [[package]] name = "sp-api-proc-macro" -version = "22.0.1" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cedafdeaf15c774433ad8f5b00883bdf7d86e7c8b8e050e3439d4ae422114096" +checksum = "74a14a276fde5d6e5a0668494e3dd42739b346a7ac7b6348c74f9c9142f4474a" dependencies = [ "Inflector", "blake2", @@ -4767,19 +4688,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "sp-application-crypto" -version = "40.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba375ab65a76f7413d1bfe48122fd347ce7bd2047e36ecbbd78f12f5adaed121" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 36.1.0", - "sp-io 40.0.1", -] - [[package]] name = "sp-application-crypto" version = "41.0.0" @@ -4789,23 +4697,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 37.0.0", - "sp-io 41.0.1", -] - -[[package]] -name = "sp-arithmetic" -version = "26.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9971b30935cea3858664965039dabd80f67aca74cc6cc6dd42ff1ab14547bc53" -dependencies = [ - "docify", - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "static_assertions", + "sp-core", + "sp-io", ] [[package]] @@ -4823,54 +4716,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-core" -version = "36.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdbb58c21e6b27f2aadf3ff0c8b20a8ead13b9dfe63f46717fd59334517f3b4" -dependencies = [ - "ark-vrf", - "array-bytes", - "bitflags 1.3.2", - "blake2", - "bounded-collections", - "bs58", - "dyn-clonable", - "ed25519-zebra", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "itertools 0.11.0", - "k256", - "libsecp256k1", - "log", - "merlin", - "parity-bip39", - "parity-scale-codec", - "parking_lot", - "paste", - "primitive-types", - "rand 0.8.5", - "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", - "serde", - "sp-crypto-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface 29.0.1", - "sp-std", - "sp-storage", - "ss58-registry", - "substrate-bip39", - "thiserror 1.0.69", - "tracing", - "w3f-bls", - "zeroize", -] - [[package]] name = "sp-core" version = "37.0.0" @@ -4909,7 +4754,7 @@ dependencies = [ "sp-crypto-hashing", "sp-debug-derive", "sp-externalities", - "sp-runtime-interface 30.0.0", + "sp-runtime-interface", "sp-std", "sp-storage", "ss58-registry", @@ -4969,58 +4814,31 @@ dependencies = [ [[package]] name = "sp-genesis-builder" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb0d996dfce9afb8879bdfbba9cb9a7d06f29fda38168b91e90419b3b92c42e" +checksum = "d731c7b601124756432cd9f5b5da55f6bc55b52c7a334b6df340b769d7103383" dependencies = [ "parity-scale-codec", "scale-info", "serde_json", "sp-api", - "sp-runtime 41.1.0", + "sp-runtime", ] [[package]] name = "sp-inherents" -version = "36.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb09ff07946f3e1ecdd4bfb40b2cceba60188215ceb941b5b07230294d7aee1" +checksum = "f1371275d805f905c407a9eef8447bc0a3d383dbd9277adba2a6264c6fe7daac" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 41.1.0", + "sp-runtime", "thiserror 1.0.69", ] -[[package]] -name = "sp-io" -version = "40.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e41d010bcc515d119901ff7ac83150c335d543c7f6c03be5c8fe08430b8a03b" -dependencies = [ - "bytes", - "docify", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "polkavm-derive 0.18.0", - "rustversion", - "secp256k1", - "sp-core 36.1.0", - "sp-crypto-hashing", - "sp-externalities", - "sp-keystore 0.42.0", - "sp-runtime-interface 29.0.1", - "sp-state-machine 0.45.0", - "sp-tracing", - "sp-trie 39.1.0", - "tracing", - "tracing-core", -] - [[package]] name = "sp-io" version = "41.0.1" @@ -5033,33 +4851,21 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", - "polkavm-derive 0.24.0", + "polkavm-derive", "rustversion", "secp256k1", - "sp-core 37.0.0", + "sp-core", "sp-crypto-hashing", "sp-externalities", - "sp-keystore 0.43.0", - "sp-runtime-interface 30.0.0", - "sp-state-machine 0.46.0", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", "sp-tracing", - "sp-trie 40.0.0", + "sp-trie", "tracing", "tracing-core", ] -[[package]] -name = "sp-keystore" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45f893398a5330e28f219662c7a0afa174fb068d8f82d2a9990016c4b0bc4369" -dependencies = [ - "parity-scale-codec", - "parking_lot", - "sp-core 36.1.0", - "sp-externalities", -] - [[package]] name = "sp-keystore" version = "0.43.0" @@ -5068,17 +4874,17 @@ checksum = "269d0ee360f6d072f9203485afea35583ac151521a525cc48b2a107fc576c2d9" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core 37.0.0", + "sp-core", "sp-externalities", ] [[package]] name = "sp-metadata-ir" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d1db25e362edbf5531b427d4bdfc2562bec6a031c3eb2a9145c0a0a01a572d" +checksum = "2319040b39b9614c35c7faaf548172f4d9a3b44b6992bbae534b096d5cdb4f79" dependencies = [ - "frame-metadata 20.0.0", + "frame-metadata", "parity-scale-codec", "scale-info", ] @@ -5093,36 +4899,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-runtime" -version = "41.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3864101a28faba3d8eca026e3f56ea20dd1d979ce1bcc20152e86c9d82be52bf" -dependencies = [ - "binary-merkle-tree", - "docify", - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "num-traits", - "parity-scale-codec", - "paste", - "rand 0.8.5", - "scale-info", - "serde", - "simple-mermaid", - "sp-application-crypto 40.1.0", - "sp-arithmetic 26.1.0", - "sp-core 36.1.0", - "sp-io 40.0.1", - "sp-std", - "sp-trie 39.1.0", - "sp-weights 31.1.0", - "tracing", - "tuplex", -] - [[package]] name = "sp-runtime" version = "42.0.0" @@ -5142,37 +4918,17 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto 41.0.0", - "sp-arithmetic 27.0.0", - "sp-core 37.0.0", - "sp-io 41.0.1", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-std", - "sp-trie 40.0.0", - "sp-weights 32.0.0", + "sp-trie", + "sp-weights", "tracing", "tuplex", ] -[[package]] -name = "sp-runtime-interface" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e99db36a7aff44c335f5d5b36c182a3e0cac61de2fefbe2eeac6af5fb13f63bf" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "polkavm-derive 0.18.0", - "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro 18.0.0", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface 21.0.1", - "static_assertions", -] - [[package]] name = "sp-runtime-interface" version = "30.0.0" @@ -5182,31 +4938,17 @@ dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive 0.24.0", + "polkavm-derive", "primitive-types", "sp-externalities", - "sp-runtime-interface-proc-macro 19.0.0", + "sp-runtime-interface-proc-macro", "sp-std", "sp-storage", "sp-tracing", - "sp-wasm-interface 22.0.0", + "sp-wasm-interface", "static_assertions", ] -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" -dependencies = [ - "Inflector", - "expander", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.106", -] - [[package]] name = "sp-runtime-interface-proc-macro" version = "19.0.0" @@ -5223,37 +4965,16 @@ dependencies = [ [[package]] name = "sp-staking" -version = "38.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8f9c0a32836e3c8842b0aec0813077654885d45d83b618210fbb730ea63545" +checksum = "bca7ccd7d7e478e9f8e933850f025a1c7f409a2b70157d30e5f51675427af022" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", - "sp-core 36.1.0", - "sp-runtime 41.1.0", -] - -[[package]] -name = "sp-state-machine" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206508475c01ae2e14f171d35d7fc3eaa7278140d7940416591d49a784792ed6" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot", - "rand 0.8.5", - "smallvec", - "sp-core 36.1.0", - "sp-externalities", - "sp-panic-handler", - "sp-trie 39.1.0", - "thiserror 1.0.69", - "tracing", - "trie-db", + "sp-core", + "sp-runtime", ] [[package]] @@ -5268,10 +4989,10 @@ dependencies = [ "parking_lot", "rand 0.8.5", "smallvec", - "sp-core 37.0.0", + "sp-core", "sp-externalities", "sp-panic-handler", - "sp-trie 40.0.0", + "sp-trie", "thiserror 1.0.69", "tracing", "trie-db", @@ -5308,29 +5029,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "sp-trie" -version = "39.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a555bf4c42ca89e2e7bf2f11308806dad13cdbd7f8fd60cf2649f12b6ee809bf" -dependencies = [ - "ahash", - "hash-db", - "memory-db 0.32.0", - "nohash-hasher", - "parity-scale-codec", - "parking_lot", - "rand 0.8.5", - "scale-info", - "schnellru", - "sp-core 36.1.0", - "sp-externalities", - "thiserror 1.0.69", - "tracing", - "trie-db", - "trie-root", -] - [[package]] name = "sp-trie" version = "40.0.0" @@ -5341,14 +5039,14 @@ dependencies = [ "foldhash", "hash-db", "hashbrown 0.15.5", - "memory-db 0.34.0", + "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot", "rand 0.8.5", "scale-info", "schnellru", - "sp-core 37.0.0", + "sp-core", "sp-externalities", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -5359,9 +5057,9 @@ dependencies = [ [[package]] name = "sp-version" -version = "39.0.0" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd736a15ff2ea0a67c5a3bbdfd842d88f11f0774d7701a8d8a316f8deba276c5" +checksum = "98fd599db91c11c32e4df4c85b22b6396f28284889a583db9151ff59599dd1cb" dependencies = [ "impl-serde", "parity-scale-codec", @@ -5369,7 +5067,7 @@ dependencies = [ "scale-info", "serde", "sp-crypto-hashing-proc-macro", - "sp-runtime 41.1.0", + "sp-runtime", "sp-std", "sp-version-proc-macro", "thiserror 1.0.69", @@ -5388,18 +5086,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "sp-wasm-interface" -version = "21.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", -] - [[package]] name = "sp-wasm-interface" version = "22.0.0" @@ -5412,21 +5098,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "sp-weights" -version = "31.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "515aa194eabac059041df2dbee75b059b99981213ec680e9de85b45b6988346a" -dependencies = [ - "bounded-collections", - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic 26.1.0", - "sp-debug-derive", -] - [[package]] name = "sp-weights" version = "32.0.0" @@ -5438,7 +5109,7 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 27.0.0", + "sp-arithmetic", "sp-debug-derive", ] @@ -5540,7 +5211,7 @@ dependencies = [ "async-trait", "derive-where", "either", - "frame-metadata 23.0.0", + "frame-metadata", "futures", "hex", "jsonrpsee", @@ -5595,7 +5266,7 @@ dependencies = [ "blake2", "derive-where", "frame-decode", - "frame-metadata 23.0.0", + "frame-metadata", "hashbrown 0.14.5", "hex", "impl-serde", @@ -5656,7 +5327,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c134068711c0c46906abc0e6e4911204420331530738e18ca903a5469364d9f" dependencies = [ "frame-decode", - "frame-metadata 23.0.0", + "frame-metadata", "hashbrown 0.14.5", "parity-scale-codec", "scale-info", @@ -5671,7 +5342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25de7727144780d780a6a7d78bbfd28414b8adbab68b05e87329c367d7705be4" dependencies = [ "derive-where", - "frame-metadata 23.0.0", + "frame-metadata", "futures", "hex", "impl-serde", diff --git a/Cargo.toml b/Cargo.toml index 4bc54e8..64dd71d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ codec = { package = "parity-scale-codec", version = "3.7", features = [ ] } sp-core = { version = "37.0.0" } sp-runtime = { version = "42.0.0" } -frame-support = { version = "40.0.0" } +frame-support = { version = "41.0.0" } subxt = "0.43.0" jsonrpsee = { version = "0.24", features = ["client"] } From 0b4e9b71a2f25fc7b145a406cce235ed2f6463dc Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Fri, 12 Dec 2025 11:41:25 +0800 Subject: [PATCH 3/5] fix: address formatting fixes --- src/cli/address_format.rs | 16 +++++++++---- src/cli/treasury.rs | 9 +++---- src/wallet/keystore.rs | 50 ++++++++++++++++++++++++++++++--------- src/wallet/mod.rs | 8 ++++++- 4 files changed, 62 insertions(+), 21 deletions(-) diff --git a/src/cli/address_format.rs b/src/cli/address_format.rs index adaab9b..08ee1e2 100644 --- a/src/cli/address_format.rs +++ b/src/cli/address_format.rs @@ -1,9 +1,15 @@ /// Address formatting utilities for consistent SS58 encoding /// /// This module provides unified functions for formatting addresses in the Quantus -/// SS58 format (version 189). Since the default SS58 version is set to 189 in main.rs, -/// most conversions can use the simpler to_ss58check() method. -use sp_core::crypto::Ss58Codec; +/// SS58 format (version 189). +use sp_core::crypto::{Ss58AddressFormat, Ss58Codec}; + +/// Returns the Quantus SS58 address format (version 189) +/// This is the standard address format for Quantus Network, producing addresses with 'qz' prefix +#[inline] +pub fn quantus_ss58_format() -> Ss58AddressFormat { + Ss58AddressFormat::custom(189) +} /// Trait for converting AccountId32 to Quantus SS58 format pub trait QuantusSS58 { @@ -12,7 +18,7 @@ pub trait QuantusSS58 { impl QuantusSS58 for sp_core::crypto::AccountId32 { fn to_quantus_ss58(&self) -> String { - self.to_ss58check() + self.to_ss58check_with_version(quantus_ss58_format()) } } @@ -20,6 +26,6 @@ impl QuantusSS58 for subxt::ext::subxt_core::utils::AccountId32 { fn to_quantus_ss58(&self) -> String { let bytes: [u8; 32] = *self.as_ref(); let sp_account_id = sp_core::crypto::AccountId32::from(bytes); - sp_account_id.to_ss58check() + sp_account_id.to_ss58check_with_version(quantus_ss58_format()) } } diff --git a/src/cli/treasury.rs b/src/cli/treasury.rs index 14a43b8..bde75a9 100644 --- a/src/cli/treasury.rs +++ b/src/cli/treasury.rs @@ -481,10 +481,11 @@ async fn list_spends( if let Some(spend_status) = storage_at.fetch(&spend_addr).await? { log_print!("💰 Spend #{}", spend_index.to_string().bright_yellow().bold()); log_print!(" Amount: {} (raw)", spend_status.amount.to_string().bright_green()); - log_print!( - " Beneficiary: {}", - format!("{:?}", spend_status.beneficiary).bright_cyan() - ); + + // Format beneficiary address in Quantus SS58 format + use crate::cli::address_format::QuantusSS58; + let beneficiary_str = spend_status.beneficiary.to_quantus_ss58(); + log_print!(" Beneficiary: {}", beneficiary_str.bright_cyan()); log_print!(" Valid From: Block #{}", spend_status.valid_from); log_print!(" Expires At: Block #{}", spend_status.expire_at); log_print!( diff --git a/src/wallet/keystore.rs b/src/wallet/keystore.rs index 16af6d3..49d85cb 100644 --- a/src/wallet/keystore.rs +++ b/src/wallet/keystore.rs @@ -78,8 +78,9 @@ impl QuantumKeyPair { } pub fn to_account_id_ss58check(&self) -> String { + use crate::cli::address_format::quantus_ss58_format; let account = self.to_account_id_32(); - account.to_ss58check_with_version(Ss58AddressFormat::custom(189)) + account.to_ss58check_with_version(quantus_ss58_format()) } /// Convert to subxt Signer for use @@ -354,14 +355,18 @@ mod tests { ); // Verify consistency between methods + use crate::cli::address_format::quantus_ss58_format; assert_eq!( - account_id.to_ss58check(), + account_id.to_ss58check_with_version(quantus_ss58_format()), ss58_address, "Address methods should be consistent for {name}" ); // Verify it matches the direct DilithiumPair method - let expected_address = resonance_pair.public().into_account().to_ss58check(); + let expected_address = resonance_pair + .public() + .into_account() + .to_ss58check_with_version(quantus_ss58_format()); assert_eq!( ss58_address, expected_address, "Address should match DilithiumPair method for {name}" @@ -373,10 +378,20 @@ mod tests { fn test_ss58_to_account_id_conversion() { sp_core::crypto::set_default_ss58_version(sp_core::crypto::Ss58AddressFormat::custom(189)); // Test with known addresses + use crate::cli::address_format::quantus_ss58_format; let test_cases = vec![ - crystal_alice().public().into_account().to_ss58check(), - dilithium_bob().public().into_account().to_ss58check(), - crystal_charlie().public().into_account().to_ss58check(), + crystal_alice() + .public() + .into_account() + .to_ss58check_with_version(quantus_ss58_format()), + dilithium_bob() + .public() + .into_account() + .to_ss58check_with_version(quantus_ss58_format()), + crystal_charlie() + .public() + .into_account() + .to_ss58check_with_version(quantus_ss58_format()), ]; for ss58_address in test_cases { @@ -389,7 +404,8 @@ mod tests { // Convert back to SS58 and verify round-trip let account_id = AccountId32::from_slice(&account_bytes).expect("Should create valid AccountId32"); - let round_trip_address = account_id.to_ss58check(); + let round_trip_address = + account_id.to_ss58check_with_version(Ss58AddressFormat::custom(189)); assert_eq!( ss58_address, round_trip_address, "Round-trip conversion should preserve address" @@ -414,7 +430,10 @@ mod tests { // All should generate the same address let addr1 = quantum_from_dilithium.to_account_id_ss58check(); let addr2 = quantum_from_resonance.to_account_id_ss58check(); - let addr3 = resonance_from_quantum.public().into_account().to_ss58check(); + let addr3 = resonance_from_quantum + .public() + .into_account() + .to_ss58check_with_version(Ss58AddressFormat::custom(189)); assert_eq!(addr1, addr2, "Addresses should be consistent across conversion paths"); assert_eq!(addr2, addr3, "Address should match direct DilithiumPair calculation"); @@ -501,7 +520,10 @@ mod tests { Ok(address) => { println!("✅ Address generation successful: {address}"); // Verify it matches the expected address - let expected = alice_pair.public().into_account().to_ss58check(); + let expected = alice_pair + .public() + .into_account() + .to_ss58check_with_version(Ss58AddressFormat::custom(189)); assert_eq!(address, expected, "Stored wallet should generate correct address"); }, Err(_) => { @@ -559,7 +581,10 @@ mod tests { Ok(address) => { println!("✅ Encrypted wallet address generation successful: {address}"); // Verify it matches the expected address - let expected = alice_pair.public().into_account().to_ss58check(); + let expected = alice_pair + .public() + .into_account() + .to_ss58check_with_version(Ss58AddressFormat::custom(189)); assert_eq!(address, expected, "Decrypted wallet should generate correct address"); }, Err(_) => { @@ -617,7 +642,10 @@ mod tests { Ok(address) => { println!("✅ Send command flow works: {address}"); // If this passes, the bug is fixed - let expected = alice_pair.public().into_account().to_ss58check(); + let expected = alice_pair + .public() + .into_account() + .to_ss58check_with_version(Ss58AddressFormat::custom(189)); assert_eq!(address, expected, "Loaded wallet should generate correct address"); }, Err(_) => { diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index f421314..f7f0ec3 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -124,7 +124,13 @@ impl WalletManager { let quantum_keypair = QuantumKeyPair::from_resonance_pair(&resonance_pair); - println!("🔑 Resonance pair: {:?}", resonance_pair.public().into_account().to_ss58check()); + // Format addresses with SS58 version 189 (Quantus format) + use sp_core::crypto::Ss58Codec; + let resonance_addr = resonance_pair + .public() + .into_account() + .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + println!("🔑 Resonance pair: {:?}", resonance_addr); println!("🔑 Quantum keypair: {:?}", quantum_keypair.to_account_id_ss58check()); // Create wallet data From 476ece84d1819eaad1d22b0b9e8f6c13be5e27d3 Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Fri, 12 Dec 2025 11:57:02 +0800 Subject: [PATCH 4/5] fix: Clippy --- src/wallet/keystore.rs | 2 +- src/wallet/mod.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wallet/keystore.rs b/src/wallet/keystore.rs index 49d85cb..b043951 100644 --- a/src/wallet/keystore.rs +++ b/src/wallet/keystore.rs @@ -8,7 +8,7 @@ use crate::error::{Result, WalletError}; use qp_rusty_crystals_dilithium::ml_dsa_87::{Keypair, PublicKey, SecretKey}; use serde::{Deserialize, Serialize}; use sp_core::{ - crypto::{AccountId32, Ss58AddressFormat, Ss58Codec}, + crypto::{AccountId32, Ss58Codec}, ByteArray, }; // Quantum-safe encryption imports diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs index f7f0ec3..f92ec96 100644 --- a/src/wallet/mod.rs +++ b/src/wallet/mod.rs @@ -13,7 +13,6 @@ pub use keystore::{Keystore, QuantumKeyPair, WalletData}; use qp_rusty_crystals_hdwallet::{generate_mnemonic, HDLattice}; use rand::{rng, RngCore}; use serde::{Deserialize, Serialize}; -use sp_core::crypto::Ss58Codec; use sp_runtime::traits::IdentifyAccount; /// Default derivation path for Quantus wallets: m/44'/189189'/0'/0/0 From 446ca17f561c50a4d86fd6b62cae7e0606d6de08 Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Fri, 12 Dec 2025 12:07:36 +0800 Subject: [PATCH 5/5] fix: Clippy --all-targets --- src/wallet/keystore.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wallet/keystore.rs b/src/wallet/keystore.rs index b043951..aeed76b 100644 --- a/src/wallet/keystore.rs +++ b/src/wallet/keystore.rs @@ -7,6 +7,8 @@ use crate::error::{Result, WalletError}; use qp_rusty_crystals_dilithium::ml_dsa_87::{Keypair, PublicKey, SecretKey}; use serde::{Deserialize, Serialize}; +#[cfg(test)] +use sp_core::crypto::Ss58AddressFormat; use sp_core::{ crypto::{AccountId32, Ss58Codec}, ByteArray,