From 9eee9a34a135f04bf75c3a34a94cfaab060a831c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Andr=C3=A9s=20Dorado=20Su=C3=A1rez?= Date: Tue, 7 Jan 2025 11:49:02 -0500 Subject: [PATCH] feat: Configure Gas Tank for Memberships (#437) * chore(kreivo-runtime): bump version * chore: bump patch * chore: update dependencies * feat(pallet-communities-manager): add `set_gas_tank` and `maybe_tank_config` for memberships being created * feat(kreivo-runtime): `NonFungiblesGasBurner` -> `NonFungiblesGasTank` / Add `MakeTank` to `pallet_communities_manager` * feat(kreivo-runtime): Relax `BlockHashChallenger` to accept challenges for blocks up to `P` back in the past. * fix(kreivo-runtime): missing `set_gas_tank` on `WeightInfo` for `pallet_communities_manager` * feat(kreivo-runtime): handle transfeerring of memberships base attributes from items in `MembershipsManagementCollection` to items in communities' collections. * fix: fmt * fix(kreivo-runtime): resolve non-conflicting errors * fix(kreivo-runtime): add selector to filter out tanks for memberships that are not expired * chore(Cargo): update dependencies * fix(pallet-communities-manager/pallet-communities): replace memberships manager pallet reference with `NonFungiblesMemberships` support structure. * fix(Cargo): update dependencies (again) * chore(kreivo-runtime): improve documentation for `BlockHashChallenger` * feat(kreivo-runtime): configure hooks on `CommunitiesMemberships` to copy certain fields (such as gas and expirations) when a membership is assigned. * feat(kreivo-runtime): make clippy happy * fix(Cargo): update dependencies * fix(kreivo-runtime): make ci happy * fix(kreivo-runtime): bump version * fix(pallet-communities-manager): address review changes suggested by @olanod * make ci happy --- Cargo.lock | 405 +++++++++--------- chain-spec-generator/Cargo.toml | 2 +- pallets/communities-manager/Cargo.toml | 4 + .../communities-manager/src/benchmarking.rs | 66 ++- pallets/communities-manager/src/lib.rs | 58 ++- pallets/communities-manager/src/mock/mod.rs | 34 +- pallets/communities-manager/src/tests.rs | 24 ++ pallets/communities-manager/src/weights.rs | 15 + pallets/communities/src/mock.rs | 5 +- pallets/communities/src/tests/governance.rs | 2 +- runtime/kreivo/Cargo.toml | 2 +- .../src/communities/kreivo_memberships.rs | 19 + runtime/kreivo/src/communities/mod.rs | 15 +- runtime/kreivo/src/configuration/mod.rs | 4 +- .../src/configuration/monetary_stuff.rs | 22 +- .../src/configuration/system_support.rs | 11 +- runtime/kreivo/src/lib.rs | 4 +- .../src/weights/pallet_communities_manager.rs | 8 + 18 files changed, 463 insertions(+), 237 deletions(-) create mode 100644 runtime/kreivo/src/communities/kreivo_memberships.rs diff --git a/Cargo.lock b/Cargo.lock index 4f24890a..aab22a02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "approx" @@ -189,7 +189,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -391,7 +391,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", "synstructure 0.13.1", ] @@ -414,7 +414,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -470,7 +470,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix 0.38.41", + "rustix 0.38.42", "slab", "tracing", "windows-sys 0.59.0", @@ -489,13 +489,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "1b1244b10dcd56c92219da4e14caa97e312079e185f04ba3eea25061561dc0a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -544,7 +544,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.36.5", + "object 0.36.7", "rustc-demangle", "windows-targets 0.52.6", ] @@ -759,9 +759,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -801,7 +801,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "thiserror", @@ -809,9 +809,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.3" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "jobserver", "libc", @@ -859,7 +859,7 @@ dependencies = [ [[package]] name = "chain-spec-generator" -version = "0.14.2" +version = "0.15.0" dependencies = [ "clap", "cumulus-primitives-core", @@ -876,9 +876,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -956,7 +956,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -972,7 +972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ "termcolor", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -1008,15 +1008,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.8" +version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "unicode-width", - "windows-sys 0.52.0", + "once_cell", + "unicode-width 0.2.0", + "windows-sys 0.59.0", ] [[package]] @@ -1230,9 +1230,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1249,9 +1249,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -1362,7 +1362,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -1518,14 +1518,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] name = "cxx" -version = "1.0.133" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e1ec88093d2abd9cf1b09ffd979136b8e922bf31cad966a8fe0d73233112ef" +checksum = "ad7c7515609502d316ab9a24f67dc045132d93bfd3f00713389e90d9898bf30d" dependencies = [ "cc", "cxxbridge-cmd", @@ -1537,47 +1537,47 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.133" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afa390d956ee7ccb41aeed7ed7856ab3ffb4fc587e7216be7e0f83e949b4e6c" +checksum = "8bfd16fca6fd420aebbd80d643c201ee4692114a0de208b790b9cd02ceae65fb" dependencies = [ "cc", "codespan-reporting", "proc-macro2", "quote", "scratch", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] name = "cxxbridge-cmd" -version = "1.0.133" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c23bfff654d6227cbc83de8e059d2f8678ede5fc3a6c5a35d5c379983cc61e6" +checksum = "6c33fd49f5d956a1b7ee5f7a9768d58580c6752838d92e39d0d56439efdedc35" dependencies = [ "clap", "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] name = "cxxbridge-flags" -version = "1.0.133" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c01b36e22051bc6928a78583f1621abaaf7621561c2ada1b00f7878fbe2caa" +checksum = "be0f1077278fac36299cce8446effd19fe93a95eedb10d39265f3bf67b3036c9" [[package]] name = "cxxbridge-macro" -version = "1.0.133" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e14013136fac689345d17b9a6df55977251f11d333c0a571e8d963b55e1f95" +checksum = "3da7e4d6e74af6b79031d264b2f13c3ea70af1978083741c41ffce9308f1f24f" dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -1672,7 +1672,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -1685,7 +1685,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -1705,7 +1705,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -1764,7 +1764,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -1788,7 +1788,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.90", + "syn 2.0.95", "termcolor", "toml 0.8.19", "walkdir", @@ -1922,9 +1922,9 @@ dependencies = [ [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "enum-as-inner" @@ -1947,7 +1947,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -1967,7 +1967,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -1978,7 +1978,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -2052,10 +2052,10 @@ dependencies = [ "blake2", "file-guard", "fs-err", - "prettyplease 0.2.25", + "prettyplease 0.2.27", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -2072,14 +2072,14 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fc-pallet-gas-transaction-payment" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#a2fd3d73ce6a6d3ca510b73cfad96c4384b84307" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" dependencies = [ "fc-traits-gas-tank", "frame-support", @@ -2092,7 +2092,7 @@ dependencies = [ [[package]] name = "fc-pallet-pass" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#a2fd3d73ce6a6d3ca510b73cfad96c4384b84307" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" dependencies = [ "fc-traits-authn", "frame-benchmarking", @@ -2110,7 +2110,7 @@ dependencies = [ [[package]] name = "fc-pallet-referenda-tracks" version = "1.0.0" -source = "git+https://github.com/virto-network/frame-contrib#a2fd3d73ce6a6d3ca510b73cfad96c4384b84307" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" dependencies = [ "fc-traits-tracks", "frame-benchmarking", @@ -2129,7 +2129,7 @@ dependencies = [ [[package]] name = "fc-traits-authn" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#a2fd3d73ce6a6d3ca510b73cfad96c4384b84307" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" dependencies = [ "fc-traits-authn-proc", "frame-support", @@ -2141,17 +2141,18 @@ dependencies = [ [[package]] name = "fc-traits-authn-proc" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#a2fd3d73ce6a6d3ca510b73cfad96c4384b84307" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" dependencies = [ "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] name = "fc-traits-gas-tank" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#a2fd3d73ce6a6d3ca510b73cfad96c4384b84307" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" dependencies = [ + "fc-traits-nonfungibles-helpers", "frame-support", "frame-system", "parity-scale-codec", @@ -2161,17 +2162,22 @@ dependencies = [ [[package]] name = "fc-traits-memberships" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#a2fd3d73ce6a6d3ca510b73cfad96c4384b84307" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" dependencies = [ "frame-support", "parity-scale-codec", "scale-info", ] +[[package]] +name = "fc-traits-nonfungibles-helpers" +version = "0.1.0" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" + [[package]] name = "fc-traits-tracks" version = "0.1.0" -source = "git+https://github.com/virto-network/frame-contrib#a2fd3d73ce6a6d3ca510b73cfad96c4384b84307" +source = "git+https://github.com/virto-network/frame-contrib#42e047c1934e642f83658c1e6fe159cb41d9fd6f" dependencies = [ "frame-support", "pallet-referenda", @@ -2278,9 +2284,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[package]] name = "foreign-types" @@ -2309,7 +2315,7 @@ dependencies = [ [[package]] name = "form_urlencoded" version = "1.2.1" -source = "git+https://github.com/servo/rust-url#7492360d4230b67fa0e62794b6fde276525e5f84" +source = "git+https://github.com/servo/rust-url#84cf467095210f5d808e5153cd0550294ffff0b0" dependencies = [ "percent-encoding 2.3.1 (git+https://github.com/servo/rust-url)", ] @@ -2352,7 +2358,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -2459,7 +2465,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -2471,7 +2477,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -2481,7 +2487,7 @@ source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -2631,7 +2637,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -2941,11 +2947,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3035,9 +3041,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.31" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -3059,9 +3065,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -3087,7 +3093,7 @@ dependencies = [ "futures-util", "http 1.2.0", "http-body 1.0.1", - "hyper 1.5.1", + "hyper 1.5.2", "pin-project-lite", "tokio", ] @@ -3230,7 +3236,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -3268,7 +3274,7 @@ dependencies = [ [[package]] name = "idna" version = "1.0.3" -source = "git+https://github.com/servo/rust-url#7492360d4230b67fa0e62794b6fde276525e5f84" +source = "git+https://github.com/servo/rust-url#84cf467095210f5d808e5153cd0550294ffff0b0" dependencies = [ "idna_adapter", "smallvec", @@ -3329,7 +3335,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "log", "rand", "tokio", @@ -3363,7 +3369,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -3568,7 +3574,7 @@ dependencies = [ [[package]] name = "kreivo-runtime" -version = "0.14.2" +version = "0.15.0" dependencies = [ "assets-common", "cumulus-pallet-aura-ext", @@ -3674,9 +3680,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libm" @@ -4015,7 +4021,7 @@ dependencies = [ "proc-macro-warning 0.4.2", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -4126,7 +4132,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.8", ] [[package]] @@ -4194,9 +4200,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linked_hash_set" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +checksum = "bae85b5be22d9843c80e5fc80e9b64c8a3b1f98f867c709956eca3efff4e92e2" dependencies = [ "linked-hash-map", ] @@ -4335,7 +4341,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -4349,7 +4355,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -4360,7 +4366,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -4371,7 +4377,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -4417,7 +4423,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.41", + "rustix 0.38.42", ] [[package]] @@ -4467,9 +4473,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] @@ -4511,7 +4517,7 @@ dependencies = [ "fragile", "lazy_static", "mockall_derive 0.12.1", - "predicates 3.1.2", + "predicates 3.1.3", "predicates-tree", ] @@ -4536,7 +4542,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -4747,9 +4753,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" dependencies = [ "bytes", "futures", @@ -4846,7 +4852,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -4921,9 +4927,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -4981,7 +4987,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -5261,6 +5267,8 @@ name = "pallet-communities-manager" version = "0.1.0" dependencies = [ "fc-pallet-referenda-tracks", + "fc-traits-gas-tank", + "fc-traits-memberships", "fc-traits-tracks", "frame-benchmarking", "frame-support", @@ -5323,7 +5331,7 @@ source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -5920,7 +5928,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.8", "smallvec", "windows-targets 0.52.6", ] @@ -5991,7 +5999,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "percent-encoding" version = "2.3.1" -source = "git+https://github.com/servo/rust-url#7492360d4230b67fa0e62794b6fde276525e5f84" +source = "git+https://github.com/servo/rust-url#84cf467095210f5d808e5153cd0550294ffff0b0" [[package]] name = "petgraph" @@ -6020,7 +6028,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -6274,7 +6282,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -6284,7 +6292,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -6318,7 +6326,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.41", + "rustix 0.38.42", "tracing", "windows-sys 0.59.0", ] @@ -6377,9 +6385,9 @@ dependencies = [ [[package]] name = "predicates" -version = "3.1.2" +version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" +checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" dependencies = [ "anstyle", "predicates-core", @@ -6387,15 +6395,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" +checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" [[package]] name = "predicates-tree" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" +checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" dependencies = [ "predicates-core", "termtree", @@ -6413,12 +6421,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.25" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" dependencies = [ "proc-macro2", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -6494,7 +6502,7 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -6505,7 +6513,7 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -6551,7 +6559,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -6609,11 +6617,11 @@ dependencies = [ "multimap 0.10.0", "once_cell", "petgraph", - "prettyplease 0.2.25", + "prettyplease 0.2.27", "prost 0.12.6", "prost-types 0.12.6", "regex", - "syn 2.0.90", + "syn 2.0.95", "tempfile", ] @@ -6640,7 +6648,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -6797,9 +6805,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -6898,9 +6906,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", ] @@ -6933,7 +6941,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -7170,7 +7178,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]] @@ -7198,15 +7206,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7265,9 +7273,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "rw-stream-sink" @@ -7288,9 +7296,9 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe_arch" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" dependencies = [ "bytemuck", ] @@ -7350,7 +7358,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -7629,7 +7637,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -7643,9 +7651,9 @@ dependencies = [ [[package]] name = "schnellru" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ "ahash", "cfg-if", @@ -7765,9 +7773,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" dependencies = [ "core-foundation-sys", "libc", @@ -7784,9 +7792,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", ] @@ -7805,9 +7813,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -7823,20 +7831,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -8105,7 +8113,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -8318,7 +8326,7 @@ source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -8337,7 +8345,7 @@ source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -8536,7 +8544,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -8707,7 +8715,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -8934,7 +8942,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -8955,7 +8963,7 @@ version = "0.17.0" source = "git+https://github.com/virto-network/polkadot-sdk?branch=release-virto-stable2409#d13cf291bef64b5ab713ed864df18ce763a799fc" dependencies = [ "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "log", "prometheus", @@ -9002,9 +9010,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -9031,7 +9039,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -9069,14 +9077,15 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell", - "rustix 0.38.41", + "rustix 0.38.42", "windows-sys 0.59.0", ] @@ -9091,9 +9100,9 @@ dependencies = [ [[package]] name = "termtree" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "thiserror" @@ -9112,7 +9121,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -9177,9 +9186,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -9215,7 +9224,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -9337,7 +9346,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -9537,9 +9546,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" @@ -9562,6 +9571,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "unicode-xid" version = "0.2.6" @@ -9626,7 +9641,7 @@ dependencies = [ [[package]] name = "url" version = "2.5.4" -source = "git+https://github.com/servo/rust-url#7492360d4230b67fa0e62794b6fde276525e5f84" +source = "git+https://github.com/servo/rust-url#84cf467095210f5d808e5153cd0550294ffff0b0" dependencies = [ "form_urlencoded 1.2.1 (git+https://github.com/servo/rust-url)", "idna 1.0.3 (git+https://github.com/servo/rust-url)", @@ -9777,7 +9792,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", "wasm-bindgen-shared", ] @@ -9812,7 +9827,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10176,14 +10191,14 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.41", + "rustix 0.38.42", ] [[package]] name = "wide" -version = "0.7.30" +version = "0.7.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e6db2670d2be78525979e9a5f9c69d296fd7d670549fe9ebf70f8708cb5019" +checksum = "cc0ca27312d1e9218687a4e804cd4b7410bf54125d54d13e5170efbf09066d24" dependencies = [ "bytemuck", "safe_arch", @@ -10495,9 +10510,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" dependencies = [ "memchr", ] @@ -10587,7 +10602,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -10663,7 +10678,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", "synstructure 0.13.1", ] @@ -10685,7 +10700,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -10705,7 +10720,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", "synstructure 0.13.1", ] @@ -10726,7 +10741,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] @@ -10748,7 +10763,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.95", ] [[package]] diff --git a/chain-spec-generator/Cargo.toml b/chain-spec-generator/Cargo.toml index e88fa0ee..372520a2 100644 --- a/chain-spec-generator/Cargo.toml +++ b/chain-spec-generator/Cargo.toml @@ -6,7 +6,7 @@ homepage.workspace = true license.workspace = true name = "chain-spec-generator" repository.workspace = true -version = "0.14.2" +version = "0.15.0" [dependencies] clap = { workspace = true, features = ["derive"] } diff --git a/pallets/communities-manager/Cargo.toml b/pallets/communities-manager/Cargo.toml index 169ca170..4200ae40 100644 --- a/pallets/communities-manager/Cargo.toml +++ b/pallets/communities-manager/Cargo.toml @@ -12,6 +12,7 @@ version = "0.1.0" targets = ["x86_64-unknown-linux-gnu"] [dependencies] +fc-traits-gas-tank.workspace = true fc-traits-tracks.workspace = true frame-benchmarking = { workspace = true, optional = true } @@ -31,6 +32,7 @@ sp-runtime.workspace = true sp-std.workspace = true [dev-dependencies] +fc-traits-memberships.workspace = true sp-core.workspace = true sp-io.workspace = true @@ -47,6 +49,8 @@ virto-common = { workspace = true, default-features = false, features = [ [features] default = ["std"] std = [ + "fc-traits-gas-tank/std", + "fc-traits-memberships/std", "fc-traits-tracks/std", "frame-benchmarking?/std", "frame-support/std", diff --git a/pallets/communities-manager/src/benchmarking.rs b/pallets/communities-manager/src/benchmarking.rs index 043a2823..48e50565 100644 --- a/pallets/communities-manager/src/benchmarking.rs +++ b/pallets/communities-manager/src/benchmarking.rs @@ -9,6 +9,14 @@ use sp_runtime::SaturatedConversion; type RuntimeEventFor = ::RuntimeEvent; +// Since `periodicity` is arbitrary, we assume `DAYS` is a nominal day for 6s +// block. +const DAYS: u32 = 14_400; + +fn block_weight() -> Weight { + ::BlockWeights::get().max_block +} + fn assert_has_event(generic_event: RuntimeEventFor) { frame_system::Pallet::::assert_has_event(generic_event.into()); } @@ -22,6 +30,21 @@ where Ok(()) } +fn setup_collection() -> Result<(), BenchmarkError> { + T::CreateCollection::create_collection_with_id( + T::MembershipsManagerCollectionId::get(), + &T::MembershipsManagerOwner::get(), + &T::MembershipsManagerOwner::get(), + &pallet_nfts::CollectionConfig { + settings: Default::default(), + max_supply: None, + mint_settings: Default::default(), + }, + )?; + + Ok(()) +} + #[benchmarks( where RuntimeEventFor: From>, @@ -60,16 +83,7 @@ mod benchmarks { #[benchmark] fn create_memberships(q: Linear<1, 1024>) -> Result<(), BenchmarkError> { // setup code - T::CreateCollection::create_collection_with_id( - T::MembershipsManagerCollectionId::get(), - &T::MembershipsManagerOwner::get(), - &T::MembershipsManagerOwner::get(), - &pallet_nfts::CollectionConfig { - settings: Default::default(), - max_supply: None, - mint_settings: Default::default(), - }, - )?; + setup_collection::()?; #[extrinsic_call] _( @@ -77,6 +91,11 @@ mod benchmarks { q.saturated_into(), 100u32.into(), 300_000_000_000u64.into(), + TankConfig { + capacity: Some(block_weight::()), + periodicity: Some((7 * DAYS).into()), + }, + Some(u32::MAX.into()), ); // verification code @@ -90,6 +109,33 @@ mod benchmarks { Ok(()) } + #[benchmark] + fn set_gas_tank() -> Result<(), BenchmarkError> { + // Setup code + setup_collection::()?; + Pallet::::create_memberships( + RawOrigin::Root.into(), + 1, + 1u32.into(), + 0u64.into(), + TankConfig::default(), + None, + )?; + + #[extrinsic_call] + _( + RawOrigin::Root, + T::MembershipsManagerCollectionId::get(), + 1u32.into(), + TankConfig { + capacity: Some(block_weight::()), + periodicity: Some((7 * DAYS).into()), + }, + ); + + Ok(()) + } + impl_benchmark_test_suite!( Pallet, sp_io::TestExternalities::new(Default::default()), diff --git a/pallets/communities-manager/src/lib.rs b/pallets/communities-manager/src/lib.rs index 7f6e3944..aaf56a0f 100644 --- a/pallets/communities-manager/src/lib.rs +++ b/pallets/communities-manager/src/lib.rs @@ -13,6 +13,7 @@ mod tests; pub mod weights; pub use weights::*; +use fc_traits_gas_tank::MakeTank; use fc_traits_tracks::MutateTracks; use frame_support::{ pallet_prelude::*, @@ -37,11 +38,16 @@ use sp_runtime::{ type TrackInfoOf = TrackInfo, BlockNumberFor>; +#[derive(Default, Encode, Decode, Clone, PartialEq, Eq, Debug, TypeInfo)] +pub struct TankConfig { + capacity: Option, + periodicity: Option, +} + #[frame_support::pallet] pub mod pallet { - use parity_scale_codec::HasCompact; - use super::*; + use parity_scale_codec::HasCompact; type CommunityName = BoundedVec>; @@ -59,6 +65,12 @@ pub mod pallet { CollectionId = CommunityIdOf, >; + type MakeTank: fc_traits_gas_tank::MakeTank< + Gas = Weight, + TankId = (CommunityIdOf, ::MembershipId), + BlockNumber = BlockNumberFor, + >; + type Tracks: TracksInfo, BlockNumberFor> + MutateTracks< NativeBalanceOf, @@ -106,7 +118,7 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - /// The community with [`CommmunityId`](pallet_communities::CommunityId) + /// The community with [`CommunityId`](pallet_communities::CommunityId) /// has been created. CommunityRegistered { id: T::CommunityId }, /// The @@ -196,21 +208,35 @@ pub mod pallet { amount: u16, starting_at: ::MembershipId, #[pallet::compact] price: NativeBalanceOf, + tank_config: TankConfig>, + maybe_expiration: Option>, ) -> DispatchResult { ensure!(amount <= 1024u16, Error::::CreatingTooManyMemberships); - T::CreateMembershipsOrigin::ensure_origin(origin)?; + T::CreateMembershipsOrigin::ensure_origin(origin.clone())?; + let collection_id = &T::MembershipsManagerCollectionId::get(); let mut id = starting_at.clone(); let mut minted = 0u32; for _ in 0..amount { T::CreateMemberships::mint_into( - &T::MembershipsManagerCollectionId::get(), + collection_id, &id, &T::MembershipsManagerOwner::get(), &Default::default(), true, )?; + Self::do_set_gas_tank(&(*collection_id, id.clone()), &tank_config)?; + + if let Some(expiration) = maybe_expiration { + T::CreateMemberships::set_typed_attribute( + collection_id, + &id, + &b"membership_expiration", + &expiration, + )?; + } + T::CreateMemberships::set_price( &T::MembershipsManagerCollectionId::get(), &id, @@ -232,9 +258,31 @@ pub mod pallet { }); Ok(()) } + + #[pallet::call_index(2)] + pub fn set_gas_tank( + origin: OriginFor, + community_id: CommunityIdOf, + membership_id: ::MembershipId, + config: TankConfig>, + ) -> DispatchResult { + T::CreateMembershipsOrigin::ensure_origin(origin)?; + Self::do_set_gas_tank(&(community_id, membership_id), &config) + } } impl Pallet { + #[inline] + pub(crate) fn do_set_gas_tank( + tank_id: &(CommunityIdOf, ::MembershipId), + config: &TankConfig>, + ) -> DispatchResult { + let TankConfig { capacity, periodicity } = config; + T::MakeTank::make_tank(tank_id, *capacity, *periodicity)?; + + Ok(()) + } + fn default_tack(name: &str) -> TrackInfoOf { use sp_runtime::Perbill; TrackInfo { diff --git a/pallets/communities-manager/src/mock/mod.rs b/pallets/communities-manager/src/mock/mod.rs index 38ed2e4a..374cc20c 100644 --- a/pallets/communities-manager/src/mock/mod.rs +++ b/pallets/communities-manager/src/mock/mod.rs @@ -1,7 +1,8 @@ use super::*; - +use fc_traits_gas_tank::NonFungibleGasTank; +use fc_traits_memberships::NonFungiblesMemberships; use frame_support::{ - derive_impl, parameter_types, + assert_ok, derive_impl, parameter_types, traits::{AsEnsureOriginWithArg, ConstU16, ConstU32, ConstU64, EitherOf, EqualPrivilegeOnly, VariantCountOf}, PalletId, }; @@ -26,6 +27,7 @@ mod runtime_benchmarks; use runtime_benchmarks::*; type Block = frame_system::mocking::MockBlock; +pub type BlockNumber = BlockNumberFor; type WeightInfo = (); pub type AccountPublic = ::Signer; @@ -89,7 +91,8 @@ impl frame_system::Config for Test { type RuntimeEvent = RuntimeEvent; } -#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig +)] impl pallet_balances::Config for Test { type AccountStore = System; type FreezeIdentifier = RuntimeFreezeReason; @@ -192,7 +195,7 @@ impl pallet_nfts::Config for Test { type OffchainSignature = MultiSignature; type RuntimeEvent = RuntimeEvent; type StringLimit = (); - type ValueLimit = ConstU32<10>; + type ValueLimit = ConstU32<40>; type WeightInfo = (); #[cfg(feature = "runtime-benchmarks")] type Helper = (); @@ -206,7 +209,7 @@ impl pallet_communities::Config for Test { type AssetsFreezer = AssetsFreezer; type Balances = Balances; type ItemConfig = pallet_nfts::ItemConfig; - type MemberMgmt = Memberships; + type MemberMgmt = NonFungiblesMemberships; type Polls = Referenda; type CreateOrigin = EnsureNever; type AdminOrigin = EnsureCommunity; @@ -234,11 +237,26 @@ impl Config for Test { type MembershipsManagerCollectionId = MembershipsManagerCollectionId; type MembershipsManagerOwner = RootAccount; type CreateMemberships = Memberships; + type MakeTank = NonFungibleGasTank; type WeightInfo = WeightInfo; } -#[allow(dead_code)] -fn new_test_ext() -> TestExternalities { - TestExternalities::new(Default::default()) +pub fn new_test_ext() -> TestExternalities { + let mut t = TestExternalities::new(Default::default()); + + t.execute_with(|| { + assert_ok!(Memberships::create_collection_with_id( + MembershipsManagerCollectionId::get(), + &RootAccount::get(), + &RootAccount::get(), + &pallet_nfts::CollectionConfig { + settings: Default::default(), + max_supply: None, + mint_settings: Default::default(), + }, + )); + }); + + t } diff --git a/pallets/communities-manager/src/tests.rs b/pallets/communities-manager/src/tests.rs index faf8e0ed..a3bbcecc 100644 --- a/pallets/communities-manager/src/tests.rs +++ b/pallets/communities-manager/src/tests.rs @@ -1,9 +1,32 @@ +use crate::mock::new_test_ext; use crate::{ mock::*, weights::{SubstrateWeight, WeightInfo}, + TankConfig, }; +use frame_support::assert_ok; use frame_support::weights::Weight; +#[test] +fn create_membership_works() { + new_test_ext().execute_with(|| { + const DAYS: u64 = 14_400; + let config = TankConfig { + capacity: Some(Weight::MAX), + periodicity: Some(7 * DAYS), + }; + + assert_ok!(CommunitiesManager::create_memberships( + RuntimeOrigin::root(), + 1, + 1, + 1, + config, + Some(BlockNumber::MAX), + )); + }) +} + #[test] fn weights() { let max_total_extrinsics = MAX_BLOCK_WEIGHT * NORMAL_DISPATCH_RATIO; @@ -25,6 +48,7 @@ fn weights() { "create_memberships(1024)", SubstrateWeight::::create_memberships(1024), ), + ("set_gas_tank", SubstrateWeight::::set_gas_tank()), ]; for (function, weight) in calls { diff --git a/pallets/communities-manager/src/weights.rs b/pallets/communities-manager/src/weights.rs index 0ea54cfd..a6621c2e 100644 --- a/pallets/communities-manager/src/weights.rs +++ b/pallets/communities-manager/src/weights.rs @@ -9,6 +9,7 @@ use core::marker::PhantomData; pub trait WeightInfo { fn register() -> Weight; fn create_memberships(q: u32, ) -> Weight; + fn set_gas_tank() -> Weight; } /// Weights for pallet_communities using the Substrate node and recommended hardware. @@ -80,6 +81,13 @@ impl WeightInfo for SubstrateWeight { .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(q.into()))) .saturating_add(Weight::from_parts(0, 3334).saturating_mul(q.into())) } + + fn set_gas_tank() -> Weight { + Weight::from_parts(10_000_000, 0) + .saturating_add(Weight::from_parts(0, 102400)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } } impl WeightInfo for () { @@ -149,4 +157,11 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().writes((4_u64).saturating_mul(q.into()))) .saturating_add(Weight::from_parts(0, 3334).saturating_mul(q.into())) } + + fn set_gas_tank() -> Weight { + Weight::from_parts(10_000_000, 0) + .saturating_add(Weight::from_parts(0, 102400)) + .saturating_add(RocksDbWeight::get().reads(2)) + .saturating_add(RocksDbWeight::get().writes(1)) + } } \ No newline at end of file diff --git a/pallets/communities/src/mock.rs b/pallets/communities/src/mock.rs index 5610345b..446f2cea 100644 --- a/pallets/communities/src/mock.rs +++ b/pallets/communities/src/mock.rs @@ -1,3 +1,4 @@ +use fc_traits_memberships::NonFungiblesMemberships; use frame_support::{ derive_impl, dispatch::DispatchResult, @@ -414,6 +415,8 @@ parameter_types! { type RootCreatesCommunitiesForFree = EnsureRootWithSuccess; type AnyoneElsePays = EnsureSignedPays, RootAccount>; +pub type MembershipsManager = NonFungiblesMemberships; + impl Config for Test { type PalletId = CommunitiesPalletId; type CommunityId = CommunityId; @@ -423,7 +426,7 @@ impl Config for Test { type AssetsFreezer = AssetsFreezer; type Balances = Balances; type ItemConfig = pallet_nfts::ItemConfig; - type MemberMgmt = Nfts; + type MemberMgmt = MembershipsManager; type Polls = Referenda; type CreateOrigin = EitherOf; diff --git a/pallets/communities/src/tests/governance.rs b/pallets/communities/src/tests/governance.rs index 79b253b3..fdba36fb 100644 --- a/pallets/communities/src/tests/governance.rs +++ b/pallets/communities/src/tests/governance.rs @@ -366,7 +366,7 @@ mod vote { ); let community_account = Communities::community_account(&COMMUNITY_A); - let (_, membership_id) = Nfts::user_memberships(&community_account, None) + let (_, membership_id) = MembershipsManager::user_memberships(&community_account, None) .next() .expect("CommunityA should still have memberships"); diff --git a/runtime/kreivo/Cargo.toml b/runtime/kreivo/Cargo.toml index afdf5b0f..bbcd0a09 100644 --- a/runtime/kreivo/Cargo.toml +++ b/runtime/kreivo/Cargo.toml @@ -6,7 +6,7 @@ homepage.workspace = true license.workspace = true name = "kreivo-runtime" repository.workspace = true -version = "0.14.2" +version = "0.15.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/kreivo/src/communities/kreivo_memberships.rs b/runtime/kreivo/src/communities/kreivo_memberships.rs new file mode 100644 index 00000000..91697f00 --- /dev/null +++ b/runtime/kreivo/src/communities/kreivo_memberships.rs @@ -0,0 +1,19 @@ +use super::*; + +use fc_traits_memberships::OnMembershipAssigned; +use frame_support::traits::nonfungibles_v2::{Inspect as NonFunsInspect, Mutate}; + +const WELL_KNOWN_ATTR_KEYS: [&[u8]; 3] = [b"membership_member_rank", b"membership_gas", b"membership_expiration"]; + +parameter_types! { + pub CopySystemAttributesOnAssign: Box> = + Box::new(|_, group, m| { + for key in WELL_KNOWN_ATTR_KEYS.into_iter() { + if let Some(value) = CommunityMemberships::system_attribute(&group, Some(&m), key) { + >::set_attribute(&group, &m, key, &value)?; + } + } + + Ok(()) + }); +} diff --git a/runtime/kreivo/src/communities/mod.rs b/runtime/kreivo/src/communities/mod.rs index e393790c..b6b57c09 100644 --- a/runtime/kreivo/src/communities/mod.rs +++ b/runtime/kreivo/src/communities/mod.rs @@ -8,7 +8,10 @@ use pallet_communities::origin::{EnsureCommunity, EnsureSignedPays}; use sp_runtime::{morph_types, traits::AccountIdConversion}; use virto_common::{CommunityId, MembershipId}; +use fc_traits_memberships::{NonFungiblesMemberships, WithHooks}; + pub mod governance; +mod kreivo_memberships; pub mod memberships; #[cfg(feature = "runtime-benchmarks")] @@ -62,7 +65,8 @@ impl pallet_communities::Config for Runtime { type CreateOrigin = RootCreatesCommunitiesForFree; type AdminOrigin = EitherOf, EnsureCommunityAccount>; type MemberMgmtOrigin = EitherOf, EnsureCommunityAccount>; - type MemberMgmt = CommunityMemberships; + type MemberMgmt = + WithHooks, kreivo_memberships::CopySystemAttributesOnAssign>; type MembershipId = MembershipId; type Polls = CommunityReferenda; @@ -97,16 +101,17 @@ impl pallet_communities_manager::Config for Runtime { type MembershipsManagerOwner = TreasuryAccount; type MembershipsManagerCollectionId = MembershipsCollectionId; type CreateMemberships = CommunityMemberships; + type MakeTank = MembershipsGasTank; type WeightInfo = crate::weights::pallet_communities_manager::WeightInfo; } #[cfg(feature = "runtime-benchmarks")] -type MembershipCollection = - frame_support::traits::nonfungible_v2::ItemOf; +pub struct CommunityBenchmarkHelper; #[cfg(feature = "runtime-benchmarks")] -pub struct CommunityBenchmarkHelper; +type MembershipsManagementCollection = + frame_support::traits::nonfungible_v2::ItemOf; #[cfg(feature = "runtime-benchmarks")] impl BenchmarkHelper for CommunityBenchmarkHelper { @@ -157,7 +162,7 @@ impl BenchmarkHelper for CommunityBenchmarkHelper { ) -> Result<(), BenchmarkError> { let community_account = pallet_communities::Pallet::::community_account(&community_id); - MembershipCollection::mint_into(&membership_id, &community_account, &Default::default(), true)?; + MembershipsManagementCollection::mint_into(&membership_id, &community_account, &Default::default(), true)?; Ok(()) } diff --git a/runtime/kreivo/src/configuration/mod.rs b/runtime/kreivo/src/configuration/mod.rs index dfd80d34..8ee1db9f 100644 --- a/runtime/kreivo/src/configuration/mod.rs +++ b/runtime/kreivo/src/configuration/mod.rs @@ -6,7 +6,7 @@ pub mod monetary_stuff; pub mod system_support; pub use monetary_stuff::{ - ExistentialDeposit, KreivoAssetsCall, KreivoAssetsInstance, MetadataDepositBase, MetadataDepositPerByte, - TransactionByteFee, + ExistentialDeposit, KreivoAssetsCall, KreivoAssetsInstance, MembershipsGasTank, MetadataDepositBase, + MetadataDepositPerByte, TransactionByteFee, }; pub use system_support::RuntimeBlockWeights; diff --git a/runtime/kreivo/src/configuration/monetary_stuff.rs b/runtime/kreivo/src/configuration/monetary_stuff.rs index dc763a21..4ae439bd 100644 --- a/runtime/kreivo/src/configuration/monetary_stuff.rs +++ b/runtime/kreivo/src/configuration/monetary_stuff.rs @@ -1,11 +1,12 @@ use super::*; -use fc_traits_gas_tank::NonFungibleGasBurner; +use fc_traits_gas_tank::{NonFungibleGasTank, SelectNonFungibleItem}; use pallet_asset_tx_payment::FungiblesAdapter; use pallet_assets::BalanceToAssetBalance; use pallet_transaction_payment::FungibleAdapter; use runtime_common::impls::AssetsToBlockAuthor; +use virto_common::MembershipId; // #[runtime::pallet_index(10)] // pub type Balances @@ -136,7 +137,24 @@ impl pallet_skip_feeless_payment::Config for Runtime { // #[runtime::pallet_index(17)] // pub type GasTxPayment + +parameter_types! { + pub MembershipIsNotExpired: Box> = + Box::new(|community, membership| { + use frame_support::traits::nonfungibles_v2::Inspect; + let membership_expiration = b"membership_expiration"; + CommunityMemberships::typed_system_attribute(&community, Some(&membership), &membership_expiration) + // If there's an expiration date, check it against block number + .map(|expiration| System::block_number() <= expiration) + // Otherwise, the membership will not expire + .unwrap_or(true) + }); +} + +pub type MembershipsGasTank = + NonFungibleGasTank; + impl pallet_gas_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type GasBurner = NonFungibleGasBurner; + type GasBurner = MembershipsGasTank; } diff --git a/runtime/kreivo/src/configuration/system_support.rs b/runtime/kreivo/src/configuration/system_support.rs index 0f1081f6..7828be59 100644 --- a/runtime/kreivo/src/configuration/system_support.rs +++ b/runtime/kreivo/src/configuration/system_support.rs @@ -132,9 +132,11 @@ parameter_types! { pub NeverPays: Option> = None; } -pub struct UnincludedBlockHashChallenger; +/// A [`Challenger`][`fc_traits_authn::Challenger`] which verifies the +/// block hash of a block of a given block that's within the last `PAST_BLOCKS`. +pub struct BlockHashChallenger; -impl Challenger for UnincludedBlockHashChallenger { +impl Challenger for BlockHashChallenger { type Context = BlockNumber; fn generate(cx: &Self::Context) -> Challenge { @@ -142,12 +144,13 @@ impl Challenger for UnincludedBlockHashChallenger { } fn check_challenge(cx: &Self::Context, challenge: &[u8]) -> Option<()> { - (*cx >= System::block_number().saturating_sub(3)).then_some(())?; + (*cx >= System::block_number().saturating_sub(PAST_BLOCKS)).then_some(())?; Self::generate(cx).eq(challenge).then_some(()) } } -pub type WebAuthn = pass_webauthn::Authenticator>; +pub type WebAuthn = + pass_webauthn::Authenticator, AuthorityFromPalletId>; pub type Dummy = fc_traits_authn::util::dummy::Dummy>; #[cfg(not(feature = "runtime-benchmarks"))] diff --git a/runtime/kreivo/src/lib.rs b/runtime/kreivo/src/lib.rs index 6eb41423..68b59fce 100644 --- a/runtime/kreivo/src/lib.rs +++ b/runtime/kreivo/src/lib.rs @@ -162,10 +162,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("kreivo-parachain"), impl_name: create_runtime_str!("kreivo-parachain"), authoring_version: 1, - spec_version: 114, + spec_version: 115, impl_version: 0, apis: RUNTIME_API_VERSIONS, - transaction_version: 9, + transaction_version: 10, state_version: 1, }; diff --git a/runtime/kreivo/src/weights/pallet_communities_manager.rs b/runtime/kreivo/src/weights/pallet_communities_manager.rs index ff44634f..425fb77e 100644 --- a/runtime/kreivo/src/weights/pallet_communities_manager.rs +++ b/runtime/kreivo/src/weights/pallet_communities_manager.rs @@ -31,6 +31,7 @@ use frame_support::{traits::Get, weights::Weight}; use core::marker::PhantomData; +use frame_support::weights::constants::RocksDbWeight; /// Weight functions for `pallet_communities_manager`. pub struct WeightInfo(PhantomData); @@ -101,4 +102,11 @@ impl pallet_communities_manager::WeightInfo for WeightI .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(q.into()))) .saturating_add(Weight::from_parts(0, 3334).saturating_mul(q.into())) } + + fn set_gas_tank() -> Weight { + Weight::from_parts(10_000_000, 0) + .saturating_add(Weight::from_parts(0, 102400)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } }