diff --git a/Cargo.lock b/Cargo.lock index 9887bd521..ba7959cd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -724,7 +724,7 @@ dependencies = [ "parachains-runtimes-test-utils", "parity-scale-codec", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-parachain-info", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -749,7 +749,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -1326,7 +1326,7 @@ dependencies = [ "serde", "sp-consensus-grandpa", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -1361,7 +1361,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -1394,7 +1394,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -1413,7 +1413,7 @@ dependencies = [ "pallet-utility", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -1434,7 +1434,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-state-machine 0.43.0", "sp-std", "sp-trie 37.0.0", @@ -1457,7 +1457,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-consensus-grandpa", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-trie 37.0.0", ] @@ -1489,7 +1489,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", ] @@ -1506,7 +1506,7 @@ dependencies = [ "scale-info", "snowbridge-core", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", ] @@ -1548,7 +1548,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keyring", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -1580,7 +1580,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-trie 37.0.0", "staging-xcm 14.2.0", @@ -1607,9 +1607,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" +checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" dependencies = [ "memchr", "regex-automata 0.4.9", @@ -1703,7 +1703,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "thiserror 1.0.69", @@ -1717,7 +1717,7 @@ checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "thiserror 2.0.6", @@ -1735,9 +1735,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.3" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" dependencies = [ "jobserver", "libc", @@ -2021,7 +2021,7 @@ dependencies = [ "parity-scale-codec", "regex", "rustc_version 0.4.1", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "strum 0.26.3", @@ -2080,7 +2080,7 @@ source = "git+https://github.com/use-ink/cargo-contract?branch=peter/chore-make- dependencies = [ "anyhow", "impl-serde 0.5.0", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "url", @@ -2406,7 +2406,7 @@ dependencies = [ "scale-info", "sp-application-crypto 38.0.0", "sp-consensus-aura", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2423,7 +2423,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", ] @@ -2454,7 +2454,7 @@ dependencies = [ "sp-externalities 0.29.0", "sp-inherents", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-state-machine 0.43.0", "sp-std", "sp-trie 37.0.0", @@ -2487,7 +2487,7 @@ dependencies = [ "frame-system", "pallet-session", "parity-scale-codec", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2503,7 +2503,7 @@ dependencies = [ "parity-scale-codec", "polkadot-primitives 16.0.0", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2518,7 +2518,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", ] @@ -2542,7 +2542,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -2560,7 +2560,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", ] @@ -2575,7 +2575,7 @@ dependencies = [ "polkadot-primitives 15.0.0", "sp-api", "sp-consensus-aura", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2590,7 +2590,7 @@ dependencies = [ "polkadot-primitives 16.0.0", "scale-info", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-trie 37.0.0", "staging-xcm 14.2.0", ] @@ -2635,7 +2635,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -2661,7 +2661,7 @@ dependencies = [ "pallet-asset-conversion", "parity-scale-codec", "polkadot-runtime-common", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -2676,7 +2676,7 @@ dependencies = [ "cumulus-primitives-core", "parity-scale-codec", "polkadot-primitives 16.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-state-machine 0.43.0", "sp-trie 37.0.0", ] @@ -2723,9 +2723,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e1ec88093d2abd9cf1b09ffd979136b8e922bf31cad966a8fe0d73233112ef" +checksum = "a5a32d755fe20281b46118ee4b507233311fb7a48a0cfd42f554b93640521a2f" dependencies = [ "cc", "cxxbridge-cmd", @@ -2737,9 +2737,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afa390d956ee7ccb41aeed7ed7856ab3ffb4fc587e7216be7e0f83e949b4e6c" +checksum = "11645536ada5d1c8804312cbffc9ab950f2216154de431de930da47ca6955199" dependencies = [ "cc", "codespan-reporting", @@ -2751,9 +2751,9 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c23bfff654d6227cbc83de8e059d2f8678ede5fc3a6c5a35d5c379983cc61e6" +checksum = "ebcc9c78e3c7289665aab921a2b394eaffe8bdb369aa18d81ffc0f534fd49385" dependencies = [ "clap", "codespan-reporting", @@ -2764,15 +2764,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c01b36e22051bc6928a78583f1621abaaf7621561c2ada1b00f7878fbe2caa" +checksum = "3a22a87bd9e78d7204d793261470a4c9d585154fddd251828d8aefbb5f74c3bf" [[package]] name = "cxxbridge-macro" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e14013136fac689345d17b9a6df55977251f11d333c0a571e8d963b55e1f95" +checksum = "1dfdb020ff8787c5daf6e0dca743005cc8782868faeadfbabb8824ede5cb1c72" dependencies = [ "proc-macro2", "quote", @@ -3611,7 +3611,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "sp-storage 21.0.0", "static_assertions", @@ -3629,7 +3629,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -3672,7 +3672,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -3690,7 +3690,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", ] @@ -3731,7 +3731,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -3766,7 +3766,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-metadata-ir", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", "sp-state-machine 0.43.0", "sp-std", @@ -3835,7 +3835,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-version", "sp-weights", @@ -3853,7 +3853,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -3876,7 +3876,7 @@ dependencies = [ "frame-support", "parity-scale-codec", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -4506,7 +4506,7 @@ dependencies = [ "http 1.2.0", "hyper 1.5.1", "hyper-util", - "rustls 0.23.19", + "rustls 0.23.20", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", @@ -5174,7 +5174,7 @@ dependencies = [ "http 1.2.0", "jsonrpsee-core", "pin-project", - "rustls 0.23.19", + "rustls 0.23.20", "rustls-pki-types", "rustls-platform-verifier", "soketto", @@ -6301,7 +6301,7 @@ dependencies = [ "sp-core 34.0.0", "sp-crypto-hashing", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6320,7 +6320,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6339,7 +6339,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6354,7 +6354,7 @@ dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6369,7 +6369,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6387,7 +6387,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6404,7 +6404,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6420,7 +6420,7 @@ dependencies = [ "pallet-assets", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6435,7 +6435,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6452,7 +6452,7 @@ dependencies = [ "scale-info", "sp-application-crypto 38.0.0", "sp-consensus-aura", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6468,7 +6468,7 @@ dependencies = [ "scale-info", "sp-application-crypto 38.0.0", "sp-authority-discovery", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6482,7 +6482,7 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6504,7 +6504,7 @@ dependencies = [ "sp-consensus-babe", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", ] @@ -6527,7 +6527,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", ] @@ -6544,7 +6544,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6562,7 +6562,7 @@ dependencies = [ "scale-info", "serde", "sp-consensus-beefy", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", ] @@ -6589,7 +6589,7 @@ dependencies = [ "sp-consensus-beefy", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-state-machine 0.43.0", ] @@ -6608,7 +6608,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6627,7 +6627,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-consensus-grandpa", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -6646,7 +6646,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-trie 37.0.0", ] @@ -6668,7 +6668,7 @@ dependencies = [ "pallet-bridge-grandpa", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -6693,7 +6693,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-arithmetic", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -6713,7 +6713,7 @@ dependencies = [ "sp-api", "sp-arithmetic", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6732,7 +6732,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6751,7 +6751,7 @@ dependencies = [ "parity-scale-codec", "rand", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -6769,7 +6769,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6784,7 +6784,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6812,7 +6812,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -6848,7 +6848,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -6918,7 +6918,7 @@ dependencies = [ "scale-info", "serde", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6937,7 +6937,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6952,7 +6952,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -6971,7 +6971,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -6987,7 +6987,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7009,7 +7009,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "strum 0.26.3", ] @@ -7024,7 +7024,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7042,7 +7042,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7061,7 +7061,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7081,7 +7081,7 @@ dependencies = [ "sp-core 34.0.0", "sp-inherents", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7102,7 +7102,7 @@ dependencies = [ "sp-consensus-grandpa", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", ] @@ -7121,7 +7121,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7140,7 +7140,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7158,7 +7158,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keyring", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7172,7 +7172,7 @@ dependencies = [ "parity-scale-codec", "safe-mix", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7186,7 +7186,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7203,7 +7203,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7222,7 +7222,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", ] @@ -7241,7 +7241,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7261,7 +7261,7 @@ dependencies = [ "sp-arithmetic", "sp-io 38.0.0", "sp-mixnet", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7279,7 +7279,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-mmr-primitives", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7295,7 +7295,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7312,7 +7312,7 @@ dependencies = [ "pallet-nfts", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7330,7 +7330,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7357,7 +7357,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7373,7 +7373,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7390,7 +7390,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", "sp-tracing 17.0.1", ] @@ -7411,7 +7411,7 @@ dependencies = [ "pallet-staking", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "sp-staking 36.0.0", ] @@ -7440,7 +7440,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7464,7 +7464,7 @@ dependencies = [ "pallet-staking", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7483,7 +7483,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-metadata-ir", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7501,7 +7501,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7518,7 +7518,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7533,7 +7533,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7552,7 +7552,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7567,7 +7567,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7585,7 +7585,7 @@ dependencies = [ "serde", "sp-arithmetic", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7602,7 +7602,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7630,7 +7630,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -7646,7 +7646,7 @@ dependencies = [ "frame-system", "parity-wasm", "polkavm-linker 0.10.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "tempfile", "toml 0.8.19", ] @@ -7678,7 +7678,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -7722,7 +7722,7 @@ dependencies = [ "pallet-staking", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7738,7 +7738,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7757,7 +7757,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-arithmetic", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7776,7 +7776,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7793,7 +7793,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", ] @@ -7808,7 +7808,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7826,7 +7826,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", "sp-state-machine 0.43.0", @@ -7846,7 +7846,7 @@ dependencies = [ "pallet-staking", "parity-scale-codec", "rand", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", ] @@ -7860,7 +7860,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7878,7 +7878,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7899,7 +7899,7 @@ dependencies = [ "serde", "sp-application-crypto 38.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -7938,7 +7938,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7955,7 +7955,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-statement-store", ] @@ -7972,7 +7972,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -7990,7 +7990,7 @@ dependencies = [ "scale-info", "sp-inherents", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-storage 21.0.0", "sp-timestamp", ] @@ -8011,7 +8011,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8027,7 +8027,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8039,7 +8039,7 @@ dependencies = [ "pallet-transaction-payment", "parity-scale-codec", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", ] @@ -8059,7 +8059,7 @@ dependencies = [ "serde", "sp-inherents", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-transaction-storage-proof", ] @@ -8079,7 +8079,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8097,7 +8097,7 @@ dependencies = [ "pallet-utility", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8112,7 +8112,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8128,7 +8128,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8143,7 +8143,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8158,7 +8158,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8178,7 +8178,7 @@ dependencies = [ "serde", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -8199,7 +8199,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "staging-xcm-builder", "staging-xcm-executor", @@ -8221,7 +8221,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -8242,7 +8242,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -8272,7 +8272,7 @@ dependencies = [ "sp-consensus-aura", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-parachain-info", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -8302,7 +8302,7 @@ dependencies = [ "sp-consensus-aura", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-tracing 17.0.1", "staging-parachain-info", "staging-xcm 14.2.0", @@ -8587,7 +8587,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -8603,7 +8603,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", ] @@ -8630,7 +8630,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 34.0.0", ] @@ -8657,7 +8657,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -8702,7 +8702,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-npos-elections", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", "staging-xcm 14.2.0", @@ -8765,7 +8765,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-staking 36.0.0", "sp-std", @@ -8980,7 +8980,7 @@ dependencies = [ "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "sp-session", "sp-staking 36.0.0", @@ -9031,7 +9031,7 @@ dependencies = [ "sp-inherents", "sp-io 38.0.0", "sp-offchain", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-session", "sp-storage 21.0.0", "sp-transaction-pool", @@ -9416,7 +9416,6 @@ dependencies = [ "duct", "flate2", "glob", - "hex", "indexmap 2.7.0", "mockito", "pop-common", @@ -9424,6 +9423,7 @@ dependencies = [ "scale-info", "scale-value", "serde_json", + "sp-core 32.0.0", "strum 0.26.3", "strum_macros 0.26.4", "subxt", @@ -9780,9 +9780,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -10060,7 +10060,7 @@ dependencies = [ "polkadot-runtime-common", "smallvec", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -10160,7 +10160,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.24", ] [[package]] @@ -10204,9 +10204,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "log", "once_cell", @@ -10262,9 +10262,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-platform-verifier" @@ -10277,7 +10277,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.19", + "rustls 0.23.20", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -10912,9 +10912,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] @@ -11265,7 +11265,7 @@ dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11414,7 +11414,7 @@ dependencies = [ "snowbridge-milagro-bls", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "ssz_rs", "ssz_rs_derive", @@ -11438,7 +11438,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -11461,7 +11461,7 @@ dependencies = [ "serde", "serde-big-array", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -11489,7 +11489,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11526,7 +11526,7 @@ dependencies = [ "snowbridge-pallet-ethereum-client-fixtures", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "static_assertions", ] @@ -11566,7 +11566,7 @@ dependencies = [ "snowbridge-router-primitives", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -11604,7 +11604,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", ] @@ -11623,7 +11623,7 @@ dependencies = [ "snowbridge-core", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -11643,7 +11643,7 @@ dependencies = [ "snowbridge-core", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -11692,7 +11692,7 @@ dependencies = [ "sp-core 34.0.0", "sp-io 38.0.0", "sp-keyring", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-parachain-info", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -11751,7 +11751,7 @@ dependencies = [ "sp-core 34.0.0", "sp-externalities 0.29.0", "sp-metadata-ir", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "sp-state-machine 0.43.0", "sp-trie 37.0.0", @@ -11827,7 +11827,7 @@ dependencies = [ "scale-info", "sp-api", "sp-application-crypto 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11838,7 +11838,7 @@ checksum = "74738809461e3d4bd707b5b94e0e0c064a623a74a6a8fe5c98514417a02858dd" dependencies = [ "sp-api", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11854,7 +11854,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-consensus-slots", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-timestamp", ] @@ -11873,7 +11873,7 @@ dependencies = [ "sp-consensus-slots", "sp-core 34.0.0", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-timestamp", ] @@ -11894,7 +11894,7 @@ dependencies = [ "sp-io 38.0.0", "sp-keystore 0.40.0", "sp-mmr-primitives", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "strum 0.26.3", ] @@ -11914,7 +11914,7 @@ dependencies = [ "sp-application-crypto 38.0.0", "sp-core 34.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -11926,7 +11926,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12192,7 +12192,7 @@ dependencies = [ "scale-info", "serde_json", "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12205,7 +12205,7 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "thiserror 1.0.69", ] @@ -12270,7 +12270,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c0e20624277f578b27f44ecfbe2ebc2e908488511ee2c900c5281599f700ab3" dependencies = [ "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "strum 0.26.3", ] @@ -12345,7 +12345,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-debug-derive", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "thiserror 1.0.69", ] @@ -12360,7 +12360,7 @@ dependencies = [ "serde", "sp-arithmetic", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12371,7 +12371,7 @@ checksum = "2d9de237d72ecffd07f90826eef18360208b16d8de939d54e61591fac0fcbf99" dependencies = [ "sp-api", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12412,9 +12412,9 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "39.0.2" +version = "39.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658f23be7c79a85581029676a73265c107c5469157e3444c8c640fdbaa8bfed0" +checksum = "ef567865c042b9002dfa44b8fc850fe611038acdf1e382e539495015f60f692f" dependencies = [ "docify", "either", @@ -12522,7 +12522,7 @@ dependencies = [ "sp-api", "sp-core 34.0.0", "sp-keystore 0.40.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-staking 36.0.0", ] @@ -12537,7 +12537,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12551,7 +12551,7 @@ dependencies = [ "scale-info", "serde", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12615,7 +12615,7 @@ dependencies = [ "sp-core 34.0.0", "sp-crypto-hashing", "sp-externalities 0.29.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-runtime-interface 28.0.0", "thiserror 1.0.69", "x25519-dalek", @@ -12663,7 +12663,7 @@ dependencies = [ "async-trait", "parity-scale-codec", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "thiserror 1.0.69", ] @@ -12699,7 +12699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc4bf251059485a7dd38fe4afeda8792983511cc47f342ff4695e2dcae6b5247" dependencies = [ "sp-api", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12713,7 +12713,7 @@ dependencies = [ "scale-info", "sp-core 34.0.0", "sp-inherents", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-trie 37.0.0", ] @@ -12777,7 +12777,7 @@ dependencies = [ "scale-info", "serde", "sp-crypto-hashing-proc-macro", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "sp-version-proc-macro", "thiserror 1.0.69", @@ -12908,7 +12908,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", ] [[package]] @@ -12945,7 +12945,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "xcm-procedural 10.1.0", ] @@ -12967,7 +12967,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "staging-xcm 14.2.0", "staging-xcm-executor", @@ -12988,7 +12988,7 @@ dependencies = [ "sp-arithmetic", "sp-core 34.0.0", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "staging-xcm 14.2.0", "tracing", @@ -13477,7 +13477,7 @@ dependencies = [ "polkadot-core-primitives", "rococo-runtime-constants", "smallvec", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "staging-xcm 14.2.0", "westend-runtime-constants", ] @@ -13673,7 +13673,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.19", + "rustls 0.23.20", "tokio", ] @@ -14520,7 +14520,7 @@ dependencies = [ "bitflags 2.6.0", "hashbrown 0.14.5", "indexmap 2.7.0", - "semver 1.0.23", + "semver 1.0.24", "serde", ] @@ -14768,7 +14768,7 @@ dependencies = [ "polkadot-runtime-common", "smallvec", "sp-core 34.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-weights", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -15213,7 +15213,7 @@ dependencies = [ "polkadot-runtime-parachains", "scale-info", "sp-io 38.0.0", - "sp-runtime 39.0.2", + "sp-runtime 39.0.3", "sp-std", "staging-xcm 14.2.0", "staging-xcm-builder", @@ -15357,9 +15357,9 @@ dependencies = [ [[package]] name = "zombienet-configuration" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22860eef7e651d6e0aa7e37fc3bcba3c2c8b7bd1c140d7ea929caacf2b7fc726" +checksum = "d716b3ff8112d98ced15f53b0c72454f8cde533fe2b68bb04379228961efbd80" dependencies = [ "anyhow", "lazy_static", @@ -15377,9 +15377,9 @@ dependencies = [ [[package]] name = "zombienet-orchestrator" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19b1b2fd2db3153155f21cb84cdd8e5d6faefc3043353b8c90661c44f4660da" +checksum = "4098a7d33b729b59e32c41a87aa4d484bd1b8771a059bbd4edfb4d430b3b2d74" dependencies = [ "anyhow", "async-trait", @@ -15410,9 +15410,9 @@ dependencies = [ [[package]] name = "zombienet-prom-metrics-parser" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61ce9c6b2d43be864ad34328d05794079381807f5d77c737a062486966347f" +checksum = "961e30be45b34f6ebeabf29ee2f47b0cd191ea62e40c064752572207509a6f5c" dependencies = [ "pest", "pest_derive", @@ -15421,9 +15421,9 @@ dependencies = [ [[package]] name = "zombienet-provider" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99cc7c143f1145bda2b2f5a945b8040a898a85fc029dba51f220395a7188d9d" +checksum = "ab0f7f01780b7c99a6c40539d195d979f234305f32808d547438b50829d44262" dependencies = [ "anyhow", "async-trait", @@ -15452,9 +15452,9 @@ dependencies = [ [[package]] name = "zombienet-sdk" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e5abdad4ad32c1c06cb8fdc4507db026f65987cb5c46ae4224118cc496097b" +checksum = "99a3c5f2d657235b3ab7dc384677e63cde21983029e99106766ecd49e9f8d7f3" dependencies = [ "async-trait", "futures", @@ -15470,9 +15470,9 @@ dependencies = [ [[package]] name = "zombienet-support" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e3310631948f8bb4d394c160c4b063889a4e0c6beadd6b95f9b62d1616ab93c" +checksum = "296f887ea88e07edd771f8e1d0dec5297a58b422f4b884a6292a21ebe03277cb" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 3effb7c2e..c96a1bfe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,7 +59,6 @@ contract-extrinsics = { git = "https://github.com/use-ink/cargo-contract", branc #contract-transcode = "5.0.0" contract-transcode = { git = "https://github.com/use-ink/cargo-contract", branch = "peter/chore-make-types-pub" } heck = "0.5.0" -hex = { version = "0.4.3", default-features = false } # parachains askama = "0.12" diff --git a/crates/pop-cli/Cargo.toml b/crates/pop-cli/Cargo.toml index 6d2d6ef42..2d511c77b 100644 --- a/crates/pop-cli/Cargo.toml +++ b/crates/pop-cli/Cargo.toml @@ -28,12 +28,12 @@ url.workspace = true clap.workspace = true cliclack.workspace = true console.workspace = true +sp-core.workspace = true strum.workspace = true strum_macros.workspace = true # contracts pop-contracts = { path = "../pop-contracts", version = "0.5.0", optional = true } -sp-core = { workspace = true, optional = true } sp-weights = { workspace = true, optional = true } # parachains @@ -59,6 +59,6 @@ subxt-signer.workspace = true [features] default = ["contract", "parachain", "telemetry"] -contract = ["dep:pop-contracts", "dep:sp-core", "dep:sp-weights", "dep:dirs"] +contract = ["dep:pop-contracts", "dep:sp-weights", "dep:dirs"] parachain = ["dep:pop-parachains", "dep:dirs"] telemetry = ["dep:pop-telemetry"] diff --git a/crates/pop-cli/src/cli.rs b/crates/pop-cli/src/cli.rs index 6c6bb3bce..f98c934e9 100644 --- a/crates/pop-cli/src/cli.rs +++ b/crates/pop-cli/src/cli.rs @@ -150,7 +150,6 @@ impl traits::Confirm for Confirm { /// A input prompt using cliclack. struct Input(cliclack::Input); - impl traits::Input for Input { /// Sets the default value for the input. fn default_input(mut self, value: &str) -> Self { diff --git a/crates/pop-cli/src/commands/call/chain.rs b/crates/pop-cli/src/commands/call/chain.rs index 9751b7dd9..9f769af5e 100644 --- a/crates/pop-cli/src/commands/call/chain.rs +++ b/crates/pop-cli/src/commands/call/chain.rs @@ -2,14 +2,17 @@ use std::path::Path; -use crate::cli::{self, traits::*}; +use crate::{ + cli::{self, traits::*}, + common::wallet::wait_for_signature, +}; use anyhow::{anyhow, Result}; use clap::Args; use pop_parachains::{ construct_extrinsic, construct_sudo_extrinsic, decode_call_data, encode_call_data, find_dispatchable_by_name, find_pallet_by_name, parse_chain_metadata, set_up_client, - sign_and_submit_extrinsic, supported_actions, Action, CallData, DynamicPayload, Function, - OnlineClient, Pallet, Param, SubstrateConfig, + sign_and_submit_extrinsic, submit_signed_extrinsic, supported_actions, Action, CallData, + DynamicPayload, Function, OnlineClient, Pallet, Param, Payload, SubstrateConfig, }; use url::Url; @@ -40,6 +43,9 @@ pub struct CallChainCommand { /// - with a password "//Alice///SECRET_PASSWORD" #[arg(short, long)] suri: Option, + /// Use your browser wallet to sign the extrinsic. + #[arg(name = "use-wallet", short('w'), long, default_value = "false", conflicts_with = "suri")] + use_wallet: bool, /// SCALE encoded bytes representing the call data of the extrinsic. #[arg(name = "call", short, long, conflicts_with_all = ["pallet", "function", "args"])] call_data: Option, @@ -95,7 +101,14 @@ impl CallChainCommand { }; // Sign and submit the extrinsic. - if let Err(e) = call.submit_extrinsic(&chain.client, &chain.url, xt, &mut cli).await { + let result = if self.use_wallet { + let call_data = xt.encode_call_data(&chain.client.metadata())?; + submit_extrinsic_with_wallet(&chain.client, &chain.url, call_data, &mut cli).await + } else { + call.submit_extrinsic(&chain.client, &chain.url, xt, &mut cli).await + }; + + if let Err(e) = result { display_message(&e.to_string(), false, &mut cli)?; break; } @@ -197,11 +210,25 @@ impl CallChainCommand { // sudo. self.configure_sudo(chain, cli)?; - // Resolve who is signing the extrinsic. + // Resolve who is signing the extrinsic. If a `suri` was provided via the command line, + // skip the prompt. let suri = match self.suri.as_ref() { Some(suri) => suri.clone(), - None => - cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()?, + None => { + if !self.use_wallet { + if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") + .initial_value(true) + .interact()? { + self.use_wallet = true; + DEFAULT_URI.to_string() // Default value because the user is using the browser wallet. + } + else { + cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()? + } + } else { + DEFAULT_URI.to_string() // Default value because the user is using the browser wallet. + } + }, }; return Ok(Call { @@ -210,6 +237,7 @@ impl CallChainCommand { suri, skip_confirm: self.skip_confirm, sudo: self.sudo, + use_wallet: self.use_wallet, }); } } @@ -222,11 +250,36 @@ impl CallChainCommand { call_data: &str, cli: &mut impl Cli, ) -> Result<()> { - // Resolve who is signing the extrinsic. + // Resolve who is signing the extrinsic. If a `suri` was provided via the command line, + // skip the prompt. + let mut use_wallet = self.use_wallet; let suri = match self.suri.as_ref() { - Some(suri) => suri, - None => &cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()?, + Some(suri) => suri.clone(), + None => + if !self.use_wallet { + if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") + .initial_value(true) + .interact()? { + use_wallet = true; + DEFAULT_URI.to_string() + } + else { + cli.input("Signer of the extrinsic:").default_input(DEFAULT_URI).interact()? + } + } else { + DEFAULT_URI.to_string() + }, }; + // Perform signing steps with wallet integration and return early. + if use_wallet { + let call_data_bytes = + decode_call_data(call_data).map_err(|err| anyhow!("{}", format!("{err:?}")))?; + submit_extrinsic_with_wallet(client, &url, call_data_bytes, cli) + .await + .map_err(|err| anyhow!("{}", format!("{err:?}")))?; + display_message("Call complete.", true, cli)?; + return Ok(()); + } cli.info(format!("Encoded call data: {}", call_data))?; if !self.skip_confirm && !cli.confirm("Do you want to submit the extrinsic?") @@ -244,7 +297,7 @@ impl CallChainCommand { spinner.start("Signing and submitting the extrinsic and then waiting for finalization, please be patient..."); let call_data_bytes = decode_call_data(call_data).map_err(|err| anyhow!("{}", format!("{err:?}")))?; - let result = sign_and_submit_extrinsic(client, url, CallData::new(call_data_bytes), suri) + let result = sign_and_submit_extrinsic(client, url, CallData::new(call_data_bytes), &suri) .await .map_err(|err| anyhow!("{}", format!("{err:?}")))?; @@ -283,6 +336,7 @@ impl CallChainCommand { self.function = None; self.args.clear(); self.sudo = false; + self.use_wallet = false; } // Function to check if all required fields are specified. @@ -334,6 +388,8 @@ struct Call { /// - for a dev account "//Alice" /// - with a password "//Alice///SECRET_PASSWORD" suri: String, + /// Whether to use your browser wallet to sign the extrinsic. + use_wallet: bool, /// Whether to automatically sign and submit the extrinsic without prompting for confirmation. skip_confirm: bool, /// Whether to dispatch the function call with `Root` origin. @@ -411,7 +467,12 @@ impl Call { .collect(); full_message.push_str(&format!(" --args {}", args.join(" "))); } - full_message.push_str(&format!(" --url {} --suri {}", chain.url, self.suri)); + full_message.push_str(&format!(" --url {}", chain.url)); + if self.use_wallet { + full_message.push_str(" --use-wallet"); + } else { + full_message.push_str(&format!(" --suri {}", self.suri)); + } if self.sudo { full_message.push_str(" --sudo"); } @@ -419,6 +480,32 @@ impl Call { } } +// Sign and submit an extrinsic using wallet integration. +async fn submit_extrinsic_with_wallet( + client: &OnlineClient, + url: &Url, + call_data: Vec, + cli: &mut impl Cli, +) -> Result<()> { + let maybe_payload = wait_for_signature(call_data, url.to_string()).await?; + if let Some(payload) = maybe_payload { + cli.success("Signed payload received.")?; + let spinner = cliclack::spinner(); + spinner.start( + "Submitting the extrinsic and then waiting for finalization, please be patient...", + ); + + let result = submit_signed_extrinsic(client.clone(), payload) + .await + .map_err(|err| anyhow!("{}", format!("{err:?}")))?; + + spinner.stop(format!("Extrinsic submitted with hash: {:?}", result)); + } else { + display_message("No signed payload received.", false, cli)?; + } + Ok(()) +} + // Displays a message to the user, with formatting based on the success status. fn display_message(message: &str, success: bool, cli: &mut impl Cli) -> Result<()> { if success { @@ -642,7 +729,7 @@ mod tests { ) .expect_input("The value for `remark` might be too large to enter. You may enter the path to a file instead.", "0x11".into()) .expect_confirm("Would you like to dispatch this function call with `Root` origin?", true) - .expect_input("Signer of the extrinsic:", "//Bob".into()); + .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", true); let chain = call_config.configure_chain(&mut cli).await?; assert_eq!(chain.url, Url::parse(POP_NETWORK_TESTNET_URL)?); @@ -651,9 +738,10 @@ mod tests { assert_eq!(call_chain.function.pallet, "System"); assert_eq!(call_chain.function.name, "remark"); assert_eq!(call_chain.args, ["0x11".to_string()].to_vec()); - assert_eq!(call_chain.suri, "//Bob"); + assert_eq!(call_chain.suri, "//Alice"); // Default value + assert!(call_chain.use_wallet); assert!(call_chain.sudo); - assert_eq!(call_chain.display(&chain), "pop call chain --pallet System --function remark --args \"0x11\" --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Bob --sudo"); + assert_eq!(call_chain.display(&chain), "pop call chain --pallet System --function remark --args \"0x11\" --url wss://rpc1.paseo.popnetwork.xyz/ --use-wallet --sudo"); cli.verify() } @@ -714,6 +802,7 @@ mod tests { }, args: vec!["0x11".to_string()].to_vec(), suri: DEFAULT_URI.to_string(), + use_wallet: false, skip_confirm: false, sudo: false, }; @@ -753,6 +842,7 @@ mod tests { function: find_dispatchable_by_name(&pallets, "System", "remark")?.clone(), args: vec!["0x11".to_string()].to_vec(), suri: DEFAULT_URI.to_string(), + use_wallet: false, skip_confirm: false, sudo: false, }; @@ -776,11 +866,13 @@ mod tests { args: vec![].to_vec(), url: Some(Url::parse(POP_NETWORK_TESTNET_URL)?), suri: None, + use_wallet: false, skip_confirm: false, call_data: Some("0x00000411".to_string()), sudo: false, }; let mut cli = MockCli::new() + .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", false) .expect_input("Signer of the extrinsic:", "//Bob".into()) .expect_confirm("Do you want to submit the extrinsic?", false) .expect_outro_cancel("Extrinsic with call data 0x00000411 was not submitted."); @@ -803,8 +895,9 @@ mod tests { pallet: None, function: None, args: vec![].to_vec(), - url: Some(Url::parse("wss://polkadot-rpc.publicnode.com")?), + url: Some(Url::parse(POLKADOT_NETWORK_URL)?), suri: Some("//Alice".to_string()), + use_wallet: false, skip_confirm: false, call_data: Some("0x00000411".to_string()), sudo: true, @@ -836,6 +929,7 @@ mod tests { function: Some("remark".to_string()), args: vec!["0x11".to_string()].to_vec(), url: Some(Url::parse(POP_NETWORK_TESTNET_URL)?), + use_wallet: true, suri: Some(DEFAULT_URI.to_string()), skip_confirm: false, call_data: None, @@ -846,6 +940,7 @@ mod tests { assert_eq!(call_config.function, None); assert_eq!(call_config.args.len(), 0); assert!(!call_config.sudo); + assert!(!call_config.use_wallet); Ok(()) } @@ -857,6 +952,7 @@ mod tests { args: vec!["0x11".to_string()].to_vec(), url: Some(Url::parse(POP_NETWORK_TESTNET_URL)?), suri: Some(DEFAULT_URI.to_string()), + use_wallet: false, skip_confirm: false, call_data: None, sudo: false, @@ -875,6 +971,7 @@ mod tests { args: vec!["2000".to_string(), "0x1".to_string(), "0x12".to_string()].to_vec(), url: Some(Url::parse(POP_NETWORK_TESTNET_URL)?), suri: Some(DEFAULT_URI.to_string()), + use_wallet: false, call_data: None, skip_confirm: false, sudo: false, diff --git a/crates/pop-cli/src/commands/call/contract.rs b/crates/pop-cli/src/commands/call/contract.rs index 0b2815a85..c81c86c2d 100644 --- a/crates/pop-cli/src/commands/call/contract.rs +++ b/crates/pop-cli/src/commands/call/contract.rs @@ -2,17 +2,19 @@ use crate::{ cli::{self, traits::*}, - common::contracts::has_contract_been_built, + common::{contracts::has_contract_been_built, wallet::wait_for_signature}, }; use anyhow::{anyhow, Result}; use clap::Args; use cliclack::spinner; +use pop_common::{DefaultConfig, Keypair}; use pop_contracts::{ - build_smart_contract, call_smart_contract, dry_run_call, dry_run_gas_estimate_call, - get_messages, parse_account, set_up_call, CallOpts, Verbosity, + build_smart_contract, call_smart_contract, call_smart_contract_from_signed_payload, + dry_run_call, dry_run_gas_estimate_call, get_call_payload, get_message, get_messages, + parse_account, set_up_call, CallExec, CallOpts, DefaultEnvironment, Verbosity, }; use sp_weights::Weight; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; const DEFAULT_URL: &str = "ws://localhost:9944/"; const DEFAULT_URI: &str = "//Alice"; @@ -54,6 +56,9 @@ pub struct CallContractCommand { /// - with a password "//Alice///SECRET_PASSWORD" #[arg(name = "suri", long, short, default_value = DEFAULT_URI)] suri: String, + /// Use your browser wallet to sign a transaction. + #[arg(name = "use-wallet", long, short('w'), default_value = "false", conflicts_with = "suri")] + use_wallet: bool, /// Submit an extrinsic for on-chain execution. #[arg(short('x'), long)] execute: bool, @@ -115,14 +120,19 @@ impl CallContractCommand { full_message.push_str(&format!(" --gas {}", gas_limit)); } if let Some(proof_size) = self.proof_size { - full_message.push_str(&format!(" --proof_size {}", proof_size)); + full_message.push_str(&format!(" --proof-size {}", proof_size)); + } + full_message.push_str(&format!(" --url {}", self.url)); + if self.use_wallet { + full_message.push_str(" --use-wallet"); + } else { + full_message.push_str(&format!(" --suri {}", self.suri)); } - full_message.push_str(&format!(" --url {} --suri {}", self.url, self.suri)); if self.execute { full_message.push_str(" --execute"); } if self.dry_run { - full_message.push_str(" --dry_run"); + full_message.push_str(" --dry-run"); } full_message } @@ -165,7 +175,7 @@ impl CallContractCommand { fn is_contract_build_required(&self) -> bool { self.path .as_ref() - .map(|p| p.is_dir() && !has_contract_been_built(Some(&p))) + .map(|p| p.is_dir() && !has_contract_been_built(Some(p))) .unwrap_or_default() } @@ -303,18 +313,25 @@ impl CallContractCommand { self.proof_size = proof_size_input.parse::().ok(); // If blank or bad input, estimate it. } - // Resolve who is calling the contract. - if self.suri == DEFAULT_URI { - // Prompt for uri. - self.suri = cli - .input("Signer calling the contract:") - .placeholder("//Alice") - .default_input("//Alice") - .interact()?; - }; + // Resolve who is calling the contract. If a `suri` was provided via the command line, skip + // the prompt. + if self.suri == DEFAULT_URI && !self.use_wallet && message.mutates { + if cli.confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')") + .initial_value(true) + .interact()? { + self.use_wallet = true; + } + else{ + self.suri = cli + .input("Signer calling the contract:") + .placeholder("//Alice") + .default_input("//Alice") + .interact()?; + }; + } // Finally prompt for confirmation. - let is_call_confirmed = if message.mutates && !self.dev_mode { + let is_call_confirmed = if message.mutates && !self.dev_mode && !self.use_wallet { cli.confirm("Do you want to execute the call? (Selecting 'No' will perform a dry run)") .initial_value(true) .interact()? @@ -340,6 +357,14 @@ impl CallContractCommand { return Err(anyhow!("Please specify the message to call.")); }, }; + // Disable wallet signing and display warning if the call is read-only. + let message_metadata = + get_message(self.path.as_deref().unwrap_or_else(|| Path::new("./")), &message)?; + if !message_metadata.mutates && self.use_wallet { + cli.warning("NOTE: Signing is not required for this read-only call. The '--use-wallet' flag will be ignored.")?; + self.use_wallet = false; + } + let contract = match &self.contract { Some(contract) => contract.to_string(), None => { @@ -366,6 +391,12 @@ impl CallContractCommand { }, }; + // Perform signing steps with wallet integration, skipping secure signing for query-only + // operations. + if self.use_wallet { + self.execute_with_secure_signing(call_exec, cli).await?; + return self.finalize_execute_call(cli, prompt_to_repeat_call).await; + } if self.dry_run { let spinner = spinner(); spinner.start("Doing a dry run to estimate the gas..."); @@ -414,7 +445,15 @@ impl CallContractCommand { cli.info(call_result)?; } + self.finalize_execute_call(cli, prompt_to_repeat_call).await + } + /// Finalize the current call, prompting the user to repeat or conclude the process. + async fn finalize_execute_call( + &mut self, + cli: &mut impl Cli, + prompt_to_repeat_call: bool, + ) -> Result<()> { // Prompt for any additional calls. if !prompt_to_repeat_call { display_message("Call completed successfully!", true, cli)?; @@ -435,12 +474,55 @@ impl CallContractCommand { } } + /// Execute the smart contract call using wallet integration. + async fn execute_with_secure_signing( + &self, + call_exec: CallExec, + cli: &mut impl Cli, + ) -> Result<()> { + let call_data = self.get_contract_data(&call_exec).map_err(|err| { + anyhow!("An error occurred getting the call data: {}", err.to_string()) + })?; + + let maybe_payload = wait_for_signature(call_data, self.url.to_string()).await?; + if let Some(payload) = maybe_payload { + cli.success("Signed payload received.")?; + let spinner = spinner(); + spinner.start("Calling the contract..."); + + let call_result = + call_smart_contract_from_signed_payload(call_exec, payload, &self.url) + .await + .map_err(|err| anyhow!("{} {}", "ERROR:", format!("{err:?}")))?; + + cli.info(call_result)?; + } else { + display_message("No signed payload received.", false, cli)?; + } + Ok(()) + } + + // Get the call data. + fn get_contract_data( + &self, + call_exec: &CallExec, + ) -> anyhow::Result> { + let weight_limit = if self.gas_limit.is_some() && self.proof_size.is_some() { + Weight::from_parts(self.gas_limit.unwrap(), self.proof_size.unwrap()) + } else { + Weight::from_parts(0, 0) + }; + let call_data = get_call_payload(call_exec, weight_limit)?; + Ok(call_data) + } + /// Resets message specific fields to default values for a new call. fn reset_for_new_call(&mut self) { self.message = None; self.value = DEFAULT_PAYABLE_VALUE.to_string(); self.gas_limit = None; self.proof_size = None; + self.use_wallet = false; } } @@ -482,6 +564,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -517,13 +600,14 @@ mod tests { proof_size: Some(10), url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: true, execute: false, dev_mode: false, }; call_config.configure(&mut cli, false).await?; assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof_size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry_run", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof-size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry-run", temp_dir.path().join("testing").display().to_string(), )); // Contract deployed on Pop Network testnet, test dry-run @@ -553,13 +637,14 @@ mod tests { proof_size: Some(10), url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: true, execute: false, dev_mode: false, }; call_config.configure(&mut cli, false).await?; assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof_size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry_run", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof-size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry-run", current_dir.join("pop-contracts/tests/files/testing.contract").display().to_string(), )); // Contract deployed on Pop Network testnet, test dry-run @@ -569,7 +654,7 @@ mod tests { call_config.path = Some(current_dir.join("pop-contracts/tests/files/testing.json")); call_config.configure(&mut cli, false).await?; assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof_size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry_run", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof-size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry-run", current_dir.join("pop-contracts/tests/files/testing.json").display().to_string(), )); @@ -577,7 +662,7 @@ mod tests { call_config.path = Some(current_dir.join("pop-contracts/tests/files/testing.wasm")); call_config.configure(&mut cli, false).await?; assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof_size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry_run", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message flip --gas 100 --proof-size 10 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --dry-run", current_dir.join("pop-contracts/tests/files/testing.wasm").display().to_string(), )); // Contract deployed on Pop Network testnet, test dry-run @@ -608,10 +693,6 @@ mod tests { "Do you want to perform another call using the existing smart contract?", true, ) - .expect_confirm( - "Do you want to perform another call using the existing smart contract?", - false, - ) .expect_select( "Select the message to call:", Some(false), @@ -619,12 +700,16 @@ mod tests { Some(items), 1, // "get" message ) - .expect_input("Signer calling the contract:", "//Alice".into()) .expect_info(format!( "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message get --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice", temp_dir.path().join("testing").display().to_string(), )) + .expect_warning("NOTE: Signing is not required for this read-only call. The '--use-wallet' flag will be ignored.") .expect_warning("Your call has not been executed.") + .expect_confirm( + "Do you want to perform another call using the existing smart contract?", + false, + ) .expect_outro("Contract calling complete."); // Contract deployed on Pop Network testnet, test get @@ -638,6 +723,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: true, dry_run: false, execute: false, dev_mode: false, @@ -688,7 +774,6 @@ mod tests { "Provide the on-chain contract address:", "15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm".into(), ) - .expect_input("Signer calling the contract:", "//Alice".into()) .expect_info(format!( "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message get --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice", temp_dir.path().join("testing").display().to_string(), @@ -704,6 +789,7 @@ mod tests { proof_size: None, url: Url::parse(DEFAULT_URL)?, suri: DEFAULT_URI.to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -750,14 +836,6 @@ mod tests { ]; // The inputs are processed in reverse order. let mut cli = MockCli::new() - .expect_confirm("Do you want to execute the call? (Selecting 'No' will perform a dry run)", true) - .expect_select( - "Select the message to call:", - Some(false), - true, - Some(items), - 2, // "specific_flip" message - ) .expect_input( "Where is your project or contract artifact located?", temp_dir.path().join("testing").display().to_string(), @@ -770,14 +848,21 @@ mod tests { "Provide the on-chain contract address:", "15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm".into(), ) + .expect_select( + "Select the message to call:", + Some(false), + true, + Some(items), + 2, // "specific_flip" message + ) .expect_input("Enter the value for the parameter: new_value", "true".into()) // Args for specific_flip .expect_input("Enter the value for the parameter: number", "2".into()) // Args for specific_flip .expect_input("Value to transfer to the call:", "50".into()) // Only if payable .expect_input("Enter the gas limit:", "".into()) // Only if call .expect_input("Enter the proof size limit:", "".into()) // Only if call - .expect_input("Signer calling the contract:", "//Alice".into()) + .expect_confirm("Do you want to use your browser wallet to sign the transaction? (Selecting 'No' will prompt you to manually enter the secret key URI for signing, e.g., '//Alice')", true) .expect_info(format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --execute", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --use-wallet --execute", temp_dir.path().join("testing").display().to_string(), )); @@ -791,6 +876,7 @@ mod tests { proof_size: None, url: Url::parse(DEFAULT_URL)?, suri: DEFAULT_URI.to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -809,10 +895,11 @@ mod tests { assert_eq!(call_config.proof_size, None); assert_eq!(call_config.url.to_string(), "wss://rpc1.paseo.popnetwork.xyz/"); assert_eq!(call_config.suri, "//Alice"); + assert!(call_config.use_wallet); assert!(call_config.execute); assert!(!call_config.dry_run); assert_eq!(call_config.display(), format!( - "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --suri //Alice --execute", + "pop call contract --path {} --contract 15XausWjFLBBFLDXUSBRfSfZk25warm4wZRV4ZxhZbfvjrJm --message specific_flip --args \"true\", \"2\" --value 50 --url wss://rpc1.paseo.popnetwork.xyz/ --use-wallet --execute", temp_dir.path().join("testing").display().to_string(), )); @@ -877,6 +964,7 @@ mod tests { proof_size: None, url: Url::parse(DEFAULT_URL)?, suri: DEFAULT_URI.to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: true, @@ -935,6 +1023,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -984,6 +1073,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -1002,6 +1092,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -1025,6 +1116,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, @@ -1055,6 +1147,7 @@ mod tests { proof_size: None, url: Url::parse("wss://rpc1.paseo.popnetwork.xyz")?, suri: "//Alice".to_string(), + use_wallet: false, dry_run: false, execute: false, dev_mode: false, diff --git a/crates/pop-cli/src/commands/up/contract.rs b/crates/pop-cli/src/commands/up/contract.rs index dfb95380e..f2c26076f 100644 --- a/crates/pop-cli/src/commands/up/contract.rs +++ b/crates/pop-cli/src/commands/up/contract.rs @@ -2,9 +2,11 @@ use crate::{ cli::{traits::Cli as _, Cli}, - common::contracts::{check_contracts_node_and_prompt, has_contract_been_built}, + common::{ + contracts::{check_contracts_node_and_prompt, has_contract_been_built, terminate_node}, + wallet::wait_for_signature, + }, style::style, - wallet_integration::{FrontendFromString, TransactionData, WalletIntegrationManager}, }; use clap::Args; use cliclack::{confirm, log, log::error, spinner, ProgressBar}; @@ -18,10 +20,7 @@ use pop_contracts::{ }; use sp_core::Bytes; use sp_weights::Weight; -use std::{ - path::PathBuf, - process::{Child, Command}, -}; +use std::path::PathBuf; use tempfile::NamedTempFile; use url::Url; @@ -182,13 +181,13 @@ impl UpContractCommand { Ok(data) => data, Err(e) => { error(format!("An error occurred getting the call data: {e}"))?; - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, }; - let maybe_payload = self.wait_for_signature(call_data).await?; + let maybe_payload = wait_for_signature(call_data, self.url.to_string()).await?; if let Some(payload) = maybe_payload { log::success("Signed payload received.")?; let spinner = spinner(); @@ -196,10 +195,9 @@ impl UpContractCommand { if self.upload_only { let result = upload_contract_signed(self.url.as_str(), payload).await; - // TODO: dry (see else below) if let Err(e) = result { spinner.error(format!("An error occurred uploading your contract: {e}")); - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); } @@ -218,7 +216,7 @@ impl UpContractCommand { let result = instantiate_contract_signed(self.url.as_str(), payload).await; if let Err(e) = result { spinner.error(format!("An error occurred uploading your contract: {e}")); - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); } @@ -237,19 +235,19 @@ impl UpContractCommand { } } else { Cli.outro_cancel("Signed payload doesn't exist.")?; - Self::terminate_node(process)?; + terminate_node(process)?; return Ok(()); } - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro(COMPLETE)?; - return Ok(()) + return Ok(()); } // Check for upload only. if self.upload_only { let result = self.upload_contract().await; - Self::terminate_node(process)?; + terminate_node(process)?; match result { Ok(_) => { Cli.outro(COMPLETE)?; @@ -266,7 +264,7 @@ impl UpContractCommand { Ok(i) => i, Err(e) => { error(format!("An error occurred instantiating the contract: {e}"))?; - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -284,7 +282,7 @@ impl UpContractCommand { }, Err(e) => { spinner.error(format!("{e}")); - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro_cancel(FAILED)?; return Ok(()); }, @@ -302,7 +300,7 @@ impl UpContractCommand { contract_info.code_hash, ); - Self::terminate_node(process)?; + terminate_node(process)?; Cli.outro(COMPLETE)?; } @@ -344,29 +342,6 @@ impl UpContractCommand { Ok(()) } - /// Handles the optional termination of a local running node. - fn terminate_node(process: Option<(Child, NamedTempFile)>) -> anyhow::Result<()> { - // Prompt to close any launched node - let Some((process, log)) = process else { - return Ok(()); - }; - if confirm("Would you like to terminate the local node?") - .initial_value(true) - .interact()? - { - // Stop the process contracts-node - Command::new("kill") - .args(["-s", "TERM", &process.id().to_string()]) - .spawn()? - .wait()?; - } else { - log.keep()?; - log::warning(format!("NOTE: The node is running in the background with process ID {}. Please terminate it manually when done.", process.id()))?; - } - - Ok(()) - } - // get the call data and contract code hash async fn get_contract_data(&self) -> anyhow::Result<(Vec, [u8; 32])> { let contract_code = get_contract_code(self.path.as_ref()).await?; @@ -380,40 +355,12 @@ impl UpContractCommand { let weight_limit = if self.gas_limit.is_some() && self.proof_size.is_some() { Weight::from_parts(self.gas_limit.unwrap(), self.proof_size.unwrap()) } else { - // Frontend will do dry run and update call data. Weight::from_parts(0, 0) }; let call_data = get_instantiate_payload(instantiate_exec, weight_limit).await?; Ok((call_data, hash)) } } - - async fn wait_for_signature(&self, call_data: Vec) -> anyhow::Result> { - let ui = FrontendFromString::new(include_str!("../../assets/index.html").to_string()); - - let transaction_data = TransactionData::new(self.url.to_string(), call_data); - // starts server - let mut wallet = WalletIntegrationManager::new(ui, transaction_data); - log::step(format!("Wallet signing portal started at http://{}", wallet.rpc_url))?; - - log::step("Waiting for signature... Press Ctrl+C to terminate early.")?; - loop { - // Display error, if any. - if let Some(error) = wallet.take_error().await { - log::error(format!("Signing portal error: {error}"))?; - } - - let state = wallet.state.lock().await; - // If the payload is submitted we terminate the frontend. - if !wallet.is_running() || state.signed_payload.is_some() { - wallet.task_handle.await??; - break; - } - } - - let signed_payload = wallet.state.lock().await.signed_payload.clone(); - Ok(signed_payload) - } } impl From for UpOpts { @@ -456,9 +403,6 @@ fn display_contract_info(spinner: &ProgressBar, address: String, code_hash: Opti #[cfg(test)] mod tests { use super::*; - use duct::cmd; - use std::fs::{self, File}; - use subxt::{client::OfflineClientT, utils::to_hex}; use url::Url; fn default_up_contract_command() -> UpContractCommand { @@ -500,82 +444,6 @@ mod tests { Ok(()) } - #[test] - fn has_contract_been_built_works() -> anyhow::Result<()> { - let temp_dir = tempfile::tempdir()?; - let path = temp_dir.path(); - - // Standard rust project - let name = "hello_world"; - cmd("cargo", ["new", name]).dir(&path).run()?; - let contract_path = path.join(name); - assert!(!has_contract_been_built(Some(&contract_path))); - - cmd("cargo", ["build"]).dir(&contract_path).run()?; - // Mock build directory - fs::create_dir(&contract_path.join("target/ink"))?; - assert!(!has_contract_been_built(Some(&path.join(name)))); - // Create a mocked .contract file inside the target directory - File::create(contract_path.join(format!("target/ink/{}.contract", name)))?; - assert!(has_contract_been_built(Some(&path.join(name)))); - Ok(()) - } - - // TODO: delete this test. - // This is a helper test for an actual running pop CLI. - // It can serve as the "frontend" to query the payload, sign it - // and submit back to the CLI. - #[tokio::test] - async fn sign_call_data() -> anyhow::Result<()> { - use subxt::{config::DefaultExtrinsicParamsBuilder as Params, tx::Payload}; - // This struct implements the [`Payload`] trait and is used to submit - // pre-encoded SCALE call data directly, without the dynamic construction of transactions. - struct CallData(Vec); - - impl Payload for CallData { - fn encode_call_data_to( - &self, - _: &subxt::Metadata, - out: &mut Vec, - ) -> Result<(), subxt::ext::subxt_core::Error> { - out.extend_from_slice(&self.0); - Ok(()) - } - } - - use subxt_signer::sr25519::dev; - let payload = reqwest::get(&format!("{}/payload", "http://127.0.0.1:9090")) - .await - .expect("Failed to get payload") - .json::() - .await - .expect("Failed to parse payload"); - - let url = "ws://localhost:9944"; - let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; - let client = - subxt::OnlineClient::::from_rpc_client(rpc_client).await?; - - let signer = dev::alice(); - - let payload = CallData(payload.call_data()); - let ext_params = Params::new().build(); - let signed = client.tx().create_signed(&payload, &signer, ext_params).await?; - - let response = reqwest::Client::new() - .post(&format!("{}/submit", "http://localhost:9090")) - .json(&to_hex(signed.encoded())) - .send() - .await - .expect("Failed to submit payload") - .text() - .await - .expect("Failed to parse JSON response"); - - Ok(()) - } - - #[tokio::test] async fn get_upload_call_data_works() -> anyhow::Result<()> { todo!() } diff --git a/crates/pop-cli/src/common/contracts.rs b/crates/pop-cli/src/common/contracts.rs index 3d0be11f6..c353d196e 100644 --- a/crates/pop-cli/src/common/contracts.rs +++ b/crates/pop-cli/src/common/contracts.rs @@ -3,7 +3,11 @@ use cliclack::{confirm, log::warning, spinner}; use pop_common::{manifest::from_path, sourcing::set_executable_permission}; use pop_contracts::contracts_node_generator; -use std::path::{Path, PathBuf}; +use std::{ + path::{Path, PathBuf}, + process::{Child, Command}, +}; +use tempfile::NamedTempFile; /// Checks the status of the `substrate-contracts-node` binary, sources it if necessary, and /// prompts the user to update it if the existing binary is not the latest version. @@ -68,6 +72,29 @@ pub async fn check_contracts_node_and_prompt(skip_confirm: bool) -> anyhow::Resu Ok(node_path) } +/// Handles the optional termination of a local running node. +pub fn terminate_node(process: Option<(Child, NamedTempFile)>) -> anyhow::Result<()> { + // Prompt to close any launched node + let Some((process, log)) = process else { + return Ok(()); + }; + if confirm("Would you like to terminate the local node?") + .initial_value(true) + .interact()? + { + // Stop the process contracts-node + Command::new("kill") + .args(["-s", "TERM", &process.id().to_string()]) + .spawn()? + .wait()?; + } else { + log.keep()?; + warning(format!("NOTE: The node is running in the background with process ID {}. Please terminate it manually when done.", process.id()))?; + } + + Ok(()) +} + /// Checks if a contract has been built by verifying the existence of the build directory and the /// .contract file. /// diff --git a/crates/pop-cli/src/common/mod.rs b/crates/pop-cli/src/common/mod.rs index 1cb3ee579..4a89036e5 100644 --- a/crates/pop-cli/src/common/mod.rs +++ b/crates/pop-cli/src/common/mod.rs @@ -3,3 +3,4 @@ #[cfg(feature = "contract")] pub mod contracts; pub mod helpers; +pub mod wallet; diff --git a/crates/pop-cli/src/common/wallet.rs b/crates/pop-cli/src/common/wallet.rs new file mode 100644 index 000000000..4bfffa6dc --- /dev/null +++ b/crates/pop-cli/src/common/wallet.rs @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-3.0 + +use crate::wallet_integration::{FrontendFromString, TransactionData, WalletIntegrationManager}; +use cliclack::log; + +pub async fn wait_for_signature(call_data: Vec, url: String) -> anyhow::Result> { + let ui = FrontendFromString::new(include_str!("../assets/index.html").to_string()); + + let transaction_data = TransactionData::new(url, call_data); + // starts server + let mut wallet = WalletIntegrationManager::new(ui, transaction_data); + log::step(format!("Wallet signing portal started at http://{}", wallet.rpc_url))?; + + log::step("Waiting for signature... Press Ctrl+C to terminate early.")?; + loop { + // Display error, if any. + if let Some(error) = wallet.take_error().await { + log::error(format!("Signing portal error: {error}"))?; + } + + let state = wallet.state.lock().await; + // If the payload is submitted we terminate the frontend. + if !wallet.is_running() || state.signed_payload.is_some() { + wallet.task_handle.await??; + break; + } + } + + let signed_payload = wallet.state.lock().await.signed_payload.clone(); + Ok(signed_payload) +} + +#[cfg(test)] +mod tests { + use super::*; + use subxt::utils::to_hex; + + // TODO: delete this test. + // This is a helper test for an actual running pop CLI. + // It can serve as the "frontend" to query the payload, sign it + // and submit back to the CLI. + #[tokio::test] + async fn sign_call_data() -> anyhow::Result<()> { + use subxt::{config::DefaultExtrinsicParamsBuilder as Params, tx::Payload}; + // This struct implements the [`Payload`] trait and is used to submit + // pre-encoded SCALE call data directly, without the dynamic construction of transactions. + struct CallData(Vec); + + impl Payload for CallData { + fn encode_call_data_to( + &self, + _: &subxt::Metadata, + out: &mut Vec, + ) -> Result<(), subxt::ext::subxt_core::Error> { + out.extend_from_slice(&self.0); + Ok(()) + } + } + + use subxt_signer::sr25519::dev; + let payload = reqwest::get(&format!("{}/payload", "http://127.0.0.1:9090")) + .await + .expect("Failed to get payload") + .json::() + .await + .expect("Failed to parse payload"); + + let url = "ws://localhost:9944"; + let rpc_client = subxt::backend::rpc::RpcClient::from_url(url).await?; + let client = + subxt::OnlineClient::::from_rpc_client(rpc_client).await?; + + let signer = dev::alice(); + + let payload = CallData(payload.call_data()); + let ext_params = Params::new().build(); + let signed = client.tx().create_signed(&payload, &signer, ext_params).await?; + + let _response = reqwest::Client::new() + .post(&format!("{}/submit", "http://localhost:9090")) + .json(&to_hex(signed.encoded())) + .send() + .await + .expect("Failed to submit payload") + .text() + .await + .expect("Failed to parse JSON response"); + + Ok(()) + } +} diff --git a/crates/pop-contracts/src/call.rs b/crates/pop-contracts/src/call.rs index 03effcb0a..ed948c38b 100644 --- a/crates/pop-contracts/src/call.rs +++ b/crates/pop-contracts/src/call.rs @@ -2,6 +2,7 @@ use crate::{ errors::Error, + submit_signed_payload, utils::{ get_manifest_path, metadata::{process_function_args, FunctionType}, @@ -11,16 +12,18 @@ use crate::{ use anyhow::Context; use contract_build::Verbosity; use contract_extrinsics::{ - BalanceVariant, CallCommandBuilder, CallExec, ContractArtifacts, DisplayEvents, ErrorVariant, - ExtrinsicOptsBuilder, TokenMetadata, + extrinsic_calls::Call, BalanceVariant, CallCommandBuilder, CallExec, ContractArtifacts, + DisplayEvents, ErrorVariant, ExtrinsicOptsBuilder, TokenMetadata, }; use ink_env::{DefaultEnvironment, Environment}; use pop_common::{create_signer, Config, DefaultConfig, Keypair}; use sp_weights::Weight; use std::path::PathBuf; +use subxt::{tx::Payload, SubstrateConfig}; use url::Url; /// Attributes for the `call` command. +#[derive(Clone, Debug, PartialEq)] pub struct CallOpts { /// Path to the contract build directory. pub path: Option, @@ -173,6 +176,53 @@ pub async fn call_smart_contract( Ok(output) } +/// Executes a smart contract call using a signed payload. +/// +/// # Arguments +/// +/// * `call_exec` - A struct containing the details of the contract call. +/// * `payload` - The signed payload string to be submitted for executing the call. +/// * `url` - The endpoint of the node where the call is executed. +pub async fn call_smart_contract_from_signed_payload( + call_exec: CallExec, + payload: String, + url: &Url, +) -> anyhow::Result { + let token_metadata = TokenMetadata::query::(url).await?; + let metadata = call_exec.client().metadata(); + let events = submit_signed_payload(url.as_str(), payload).await?; + let display_events = DisplayEvents::from_events::( + &events, None, &metadata, + )?; + + let output = + display_events.display_events::(Verbosity::Default, &token_metadata)?; + Ok(output) +} + +/// Generates the payload for executing a smart contract call. +/// +/// # Arguments +/// * `call_exec` - A struct containing the details of the contract call. +/// * `gas_limit` - The maximum amount of gas allocated for executing the contract call. +pub fn get_call_payload( + call_exec: &CallExec, + gas_limit: Weight, +) -> anyhow::Result> { + let storage_deposit_limit: Option = call_exec.opts().storage_deposit_limit(); + let mut encoded_data = Vec::::new(); + Call::new( + call_exec.contract().into(), + call_exec.value(), + gas_limit, + storage_deposit_limit.as_ref(), + call_exec.call_data().clone(), + ) + .build() + .encode_call_data_to(&call_exec.client().metadata(), &mut encoded_data)?; + Ok(encoded_data) +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/pop-contracts/src/lib.rs b/crates/pop-contracts/src/lib.rs index 69897be33..6dded2fe0 100644 --- a/crates/pop-contracts/src/lib.rs +++ b/crates/pop-contracts/src/lib.rs @@ -14,7 +14,8 @@ mod utils; pub use build::{build_smart_contract, is_supported, Verbosity}; pub use call::{ - call_smart_contract, dry_run_call, dry_run_gas_estimate_call, set_up_call, CallOpts, + call_smart_contract, call_smart_contract_from_signed_payload, dry_run_call, + dry_run_gas_estimate_call, get_call_payload, set_up_call, CallOpts, }; pub use new::{create_smart_contract, is_valid_contract_name}; pub use node::{contracts_node_generator, is_chain_alive, run_contracts_node}; @@ -28,6 +29,9 @@ pub use up::{ upload_contract_signed, upload_smart_contract, ContractInfo, UpOpts, }; pub use utils::{ - metadata::{get_messages, ContractFunction}, + metadata::{get_message, get_messages, ContractFunction}, parse_account, parse_hex_bytes, }; +// External exports +pub use contract_extrinsics::CallExec; +pub use ink_env::DefaultEnvironment; diff --git a/crates/pop-contracts/src/up.rs b/crates/pop-contracts/src/up.rs index 8ae38e405..d31d0c7f1 100644 --- a/crates/pop-contracts/src/up.rs +++ b/crates/pop-contracts/src/up.rs @@ -126,7 +126,6 @@ pub async fn get_upload_payload(code: WasmCode, url: &str) -> anyhow::Result::from_rpc_client(rpc_client).await?; diff --git a/crates/pop-contracts/src/utils/metadata.rs b/crates/pop-contracts/src/utils/metadata.rs index 111468f0e..0c2d26d6d 100644 --- a/crates/pop-contracts/src/utils/metadata.rs +++ b/crates/pop-contracts/src/utils/metadata.rs @@ -117,7 +117,7 @@ fn get_contract_functions( /// # Arguments /// * `path` - Location path of the project or contract artifact. /// * `message` - The label of the contract message. -fn get_message

(path: P, message: &str) -> Result +pub fn get_message

(path: P, message: &str) -> Result where P: AsRef, { diff --git a/crates/pop-parachains/Cargo.toml b/crates/pop-parachains/Cargo.toml index 64bef2d67..6380fbd10 100644 --- a/crates/pop-parachains/Cargo.toml +++ b/crates/pop-parachains/Cargo.toml @@ -24,11 +24,11 @@ tokio.workspace = true url.workspace = true askama.workspace = true -hex.workspace = true indexmap.workspace = true reqwest.workspace = true scale-info.workspace = true scale-value.workspace = true +sp-core.workspace = true subxt.workspace = true symlink.workspace = true toml_edit.workspace = true diff --git a/crates/pop-parachains/src/call/metadata/mod.rs b/crates/pop-parachains/src/call/metadata/mod.rs index 1f53f523c..5a9a9a2cb 100644 --- a/crates/pop-parachains/src/call/metadata/mod.rs +++ b/crates/pop-parachains/src/call/metadata/mod.rs @@ -4,7 +4,7 @@ use crate::errors::Error; use params::Param; use scale_value::stringify::custom_parsers; use std::fmt::{Display, Formatter}; -use subxt::{dynamic::Value, Metadata, OnlineClient, SubstrateConfig}; +use subxt::{dynamic::Value, utils::to_hex, Metadata, OnlineClient, SubstrateConfig}; pub mod action; pub mod params; @@ -179,7 +179,7 @@ pub fn parse_dispatchable_arguments( .map(|(param, raw_param)| { // Convert sequence parameters to hex if is_sequence let processed_param = if param.is_sequence && !raw_param.starts_with("0x") { - format!("0x{}", hex::encode(raw_param)) + to_hex(&raw_param) } else { raw_param }; @@ -199,6 +199,7 @@ mod tests { use crate::{call::tests::POP_NETWORK_TESTNET_URL, set_up_client}; use anyhow::Result; + use sp_core::bytes::from_hex; use subxt::ext::scale_bits; #[tokio::test] @@ -283,7 +284,7 @@ mod tests { ] .to_vec(); let addr: Vec<_> = - hex::decode("8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48") + from_hex("8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48") .unwrap() .into_iter() .map(|b| Value::u128(b as u128)) diff --git a/crates/pop-parachains/src/call/mod.rs b/crates/pop-parachains/src/call/mod.rs index 1f7e61b22..f5bb05b71 100644 --- a/crates/pop-parachains/src/call/mod.rs +++ b/crates/pop-parachains/src/call/mod.rs @@ -5,12 +5,12 @@ use pop_common::{ call::{DefaultEnvironment, DisplayEvents, TokenMetadata, Verbosity}, create_signer, }; +use sp_core::bytes::{from_hex, to_hex}; use subxt::{ dynamic::Value, - tx::{DynamicPayload, Payload}, + tx::{DynamicPayload, Payload, SubmittableExtrinsic}, OnlineClient, SubstrateConfig, }; - pub mod metadata; /// Sets up an [OnlineClient] instance for connecting to a blockchain. @@ -82,6 +82,28 @@ pub async fn sign_and_submit_extrinsic( Ok(format!("Extrinsic Submitted with hash: {:?}\n\n{}", result.extrinsic_hash(), events)) } +/// Submits a signed extrinsic. +/// +/// # Arguments +/// * `client` - The client used to interact with the chain. +/// * `payload` - The signed payload string to be submitted. +pub async fn submit_signed_extrinsic( + client: OnlineClient, + payload: String, +) -> Result { + let hex_encoded = + from_hex(&payload).map_err(|e| Error::CallDataDecodingError(e.to_string()))?; + let extrinsic = SubmittableExtrinsic::from_bytes(client, hex_encoded); + let result = extrinsic + .submit_and_watch() + .await + .map_err(|e| Error::ExtrinsicSubmissionError(format!("{:?}", e)))? + .wait_for_finalized_success() + .await + .map_err(|e| Error::ExtrinsicSubmissionError(format!("{:?}", e)))?; + Ok(format!("{:?}", result.extrinsic_hash())) +} + /// Encodes the call data for a given extrinsic into a hexadecimal string. /// /// # Arguments @@ -94,7 +116,7 @@ pub fn encode_call_data( let call_data = xt .encode_call_data(&client.metadata()) .map_err(|e| Error::CallDataEncodingError(e.to_string()))?; - Ok(format!("0x{}", hex::encode(call_data))) + Ok(to_hex(&call_data, false)) } /// Decodes a hex-encoded string into a vector of bytes representing the call data. @@ -102,8 +124,7 @@ pub fn encode_call_data( /// # Arguments /// * `call_data` - The hex-encoded string representing call data. pub fn decode_call_data(call_data: &str) -> Result, Error> { - hex::decode(call_data.trim_start_matches("0x")) - .map_err(|e| Error::CallDataDecodingError(e.to_string())) + from_hex(call_data).map_err(|e| Error::CallDataDecodingError(e.to_string())) } /// This struct implements the [`Payload`] trait and is used to submit diff --git a/crates/pop-parachains/src/lib.rs b/crates/pop-parachains/src/lib.rs index 5bba81542..7e70c2149 100644 --- a/crates/pop-parachains/src/lib.rs +++ b/crates/pop-parachains/src/lib.rs @@ -24,14 +24,17 @@ pub use call::{ params::Param, parse_chain_metadata, Function, Pallet, }, - set_up_client, sign_and_submit_extrinsic, CallData, + set_up_client, sign_and_submit_extrinsic, submit_signed_extrinsic, CallData, }; pub use errors::Error; pub use indexmap::IndexSet; pub use new_pallet::{create_pallet_template, new_pallet_options::*, TemplatePalletConfig}; pub use new_parachain::instantiate_template_dir; // External export from subxt. -pub use subxt::{tx::DynamicPayload, OnlineClient, SubstrateConfig}; +pub use subxt::{ + tx::{DynamicPayload, Payload}, + OnlineClient, SubstrateConfig, +}; pub use templates::{Config, Parachain, Provider}; pub use up::Zombienet; pub use utils::helpers::is_initial_endowment_valid;