From 58f6a78b142b00f0c8e9579ecb5c07b7f78ed069 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 24 Jun 2024 17:37:19 +0200 Subject: [PATCH 1/7] Revert "New Asset System (#1295)" (#1338) * Revert "New Asset System (#1295)" This reverts commit a956877d596ac41d8bda5c341b35472ef915fa18. * Fix formatting * Update copyright * Remove pallet-assets dependency * Fix fuzz tests --- CODEOWNERS | 1 - Cargo.lock | 53 -- Cargo.toml | 8 - README.md | 2 - docs/changelog_for_devs.md | 24 +- macros/src/lib.rs | 8 +- primitives/Cargo.toml | 1 - primitives/src/{assets.rs => asset.rs} | 58 +- primitives/src/assets/all_assets.rs | 170 ------ primitives/src/assets/campaign_assets.rs | 51 -- primitives/src/assets/currencies.rs | 77 --- primitives/src/assets/custom_assets.rs | 49 -- primitives/src/assets/market_assets.rs | 63 --- primitives/src/assets/subsets/base_assets.rs | 48 -- primitives/src/assets/subsets/mod.rs | 26 - primitives/src/assets/subsets/parimutuel.rs | 38 -- primitives/src/assets/subsets/xcm_assets.rs | 43 -- primitives/src/assets/tests.rs | 24 - primitives/src/assets/tests/conversion.rs | 358 ------------ primitives/src/assets/tests/scale_codec.rs | 146 ----- primitives/src/constants.rs | 2 +- primitives/src/constants/base_multiples.rs | 2 - primitives/src/constants/mock.rs | 36 +- primitives/src/lib.rs | 3 +- primitives/src/market.rs | 192 +++---- primitives/src/serde_wrapper.rs | 66 +++ primitives/src/traits.rs | 4 - primitives/src/traits/dispute_api.rs | 10 +- primitives/src/traits/market_builder.rs | 26 +- .../src/traits/market_commons_pallet_api.rs | 9 +- primitives/src/traits/market_id.rs | 14 +- .../src/traits/market_transition_api.rs | 322 ----------- primitives/src/traits/swaps.rs | 8 +- primitives/src/traits/weights.rs | 60 -- primitives/src/types.rs | 41 +- runtime/battery-station/Cargo.toml | 6 - .../src/integration_tests/xcm/setup.rs | 22 +- .../src/integration_tests/xcm/test_net.rs | 10 +- .../xcm/tests/currency_id_convert.rs | 154 ++---- .../integration_tests/xcm/tests/transfers.rs | 58 +- runtime/battery-station/src/lib.rs | 33 +- runtime/battery-station/src/parameters.rs | 65 +-- .../src/xcm_config/asset_registry.rs | 10 +- .../battery-station/src/xcm_config/config.rs | 130 ++--- .../battery-station/src/xcm_config/fees.rs | 4 +- runtime/common/Cargo.toml | 2 - runtime/common/src/fees.rs | 431 +++++---------- runtime/common/src/lib.rs | 203 ++----- runtime/common/src/weights/mod.rs | 1 - runtime/common/src/weights/pallet_assets.rs | 421 -------------- runtime/zeitgeist/Cargo.toml | 6 - .../src/integration_tests/xcm/setup.rs | 24 +- .../src/integration_tests/xcm/test_net.rs | 10 +- .../xcm/tests/currency_id_convert.rs | 154 ++---- .../integration_tests/xcm/tests/transfers.rs | 77 ++- runtime/zeitgeist/src/lib.rs | 31 +- runtime/zeitgeist/src/parameters.rs | 63 +-- .../src/xcm_config/asset_registry.rs | 10 +- runtime/zeitgeist/src/xcm_config/config.rs | 130 ++--- runtime/zeitgeist/src/xcm_config/fees.rs | 4 +- scripts/benchmarks/configuration.sh | 6 +- zrml/asset-router/Cargo.toml | 39 -- zrml/asset-router/README.md | 61 -- zrml/asset-router/src/lib.rs | 520 ------------------ zrml/asset-router/src/macros.rs | 151 ----- zrml/asset-router/src/mock.rs | 302 ---------- zrml/asset-router/src/pallet_impl/create.rs | 37 -- zrml/asset-router/src/pallet_impl/destroy.rs | 42 -- zrml/asset-router/src/pallet_impl/inspect.rs | 124 ----- .../src/pallet_impl/managed_destroy.rs | 73 --- zrml/asset-router/src/pallet_impl/mod.rs | 28 - .../src/pallet_impl/multi_currency.rs | 217 -------- .../pallet_impl/multi_currency_extended.rs | 80 --- .../pallet_impl/multi_lockable_currency.rs | 81 --- .../pallet_impl/multi_reserveable_currency.rs | 82 --- .../named_multi_reserveable_currency.rs | 130 ----- .../src/pallet_impl/transfer_all.rs | 26 - .../src/pallet_impl/unbalanced.rs | 67 --- zrml/asset-router/src/tests/create.rs | 61 -- zrml/asset-router/src/tests/custom_types.rs | 86 --- zrml/asset-router/src/tests/destroy.rs | 101 ---- zrml/asset-router/src/tests/inspect.rs | 113 ---- .../asset-router/src/tests/managed_destroy.rs | 337 ------------ zrml/asset-router/src/tests/mod.rs | 48 -- zrml/asset-router/src/tests/multi_currency.rs | 152 ----- .../src/tests/multi_lockable_currency.rs | 99 ---- .../src/tests/multi_reservable_currency.rs | 100 ---- .../tests/named_multi_reservable_currency.rs | 118 ---- zrml/asset-router/src/tests/unbalanced.rs | 125 ----- zrml/asset-router/src/types.rs | 120 ---- zrml/authorized/src/lib.rs | 9 +- zrml/authorized/src/weights.rs | 12 +- zrml/court/src/benchmarks.rs | 4 +- zrml/court/src/lib.rs | 4 +- zrml/court/src/tests.rs | 8 +- zrml/court/src/weights.rs | 18 +- zrml/global-disputes/src/utils.rs | 3 +- zrml/global-disputes/src/weights.rs | 8 +- zrml/hybrid-router/Cargo.toml | 5 - zrml/hybrid-router/src/benchmarking.rs | 35 +- zrml/hybrid-router/src/lib.rs | 14 +- zrml/hybrid-router/src/mock.rs | 178 +----- zrml/hybrid-router/src/tests/buy.rs | 97 ++-- zrml/hybrid-router/src/tests/mod.rs | 14 +- zrml/hybrid-router/src/tests/sell.rs | 94 ++-- zrml/hybrid-router/src/utils.rs | 10 +- zrml/liquidity-mining/src/tests.rs | 6 +- zrml/market-commons/src/lib.rs | 19 +- zrml/market-commons/src/migrations.rs | 373 ------------- zrml/market-commons/src/tests.rs | 4 +- .../src/types/market_builder.rs | 22 +- zrml/neo-swaps/Cargo.toml | 8 +- zrml/neo-swaps/src/benchmarking.rs | 2 +- zrml/neo-swaps/src/lib.rs | 10 +- zrml/neo-swaps/src/macros.rs | 6 +- zrml/neo-swaps/src/mock.rs | 182 +----- zrml/neo-swaps/src/tests/deploy_pool.rs | 52 +- zrml/neo-swaps/src/tests/join.rs | 3 +- zrml/neo-swaps/src/tests/mod.rs | 16 +- zrml/neo-swaps/src/tests/sell.rs | 2 +- zrml/neo-swaps/src/types/max_assets.rs | 2 +- zrml/neo-swaps/src/weights.rs | 20 - zrml/orderbook/Cargo.toml | 14 +- .../fuzz/orderbook_v1_full_workflow.rs | 4 +- zrml/orderbook/src/benchmarks.rs | 4 +- zrml/orderbook/src/lib.rs | 206 ++++--- zrml/orderbook/src/mock.rs | 160 +----- zrml/orderbook/src/tests.rs | 281 +++------- zrml/orderbook/src/utils.rs | 9 +- zrml/orderbook/src/weights.rs | 6 - zrml/parimutuel/Cargo.toml | 5 - zrml/parimutuel/src/benchmarking.rs | 81 +-- zrml/parimutuel/src/lib.rs | 259 ++------- zrml/parimutuel/src/mock.rs | 184 +------ zrml/parimutuel/src/tests/buy.rs | 67 ++- zrml/parimutuel/src/tests/claim.rs | 103 ++-- zrml/parimutuel/src/tests/mod.rs | 1 - zrml/parimutuel/src/tests/refund.rs | 51 +- zrml/parimutuel/src/utils.rs | 4 +- zrml/parimutuel/src/weights.rs | 102 +--- zrml/prediction-markets/Cargo.toml | 12 +- .../fuzz/pm_full_workflow.rs | 4 +- .../prediction-markets/runtime-api/src/lib.rs | 6 +- zrml/prediction-markets/src/benchmarks.rs | 18 +- zrml/prediction-markets/src/lib.rs | 204 +++---- zrml/prediction-markets/src/mock.rs | 253 ++------- .../src/tests/admin_move_market_to_closed.rs | 10 +- .../tests/admin_move_market_to_resolved.rs | 17 +- .../src/tests/approve_market.rs | 33 +- .../src/tests/buy_complete_set.rs | 30 +- ...lose_market.rs => close_trusted_market.rs} | 23 +- .../src/tests/create_market.rs | 80 +-- .../tests/create_market_and_deploy_pool.rs | 2 +- zrml/prediction-markets/src/tests/dispute.rs | 45 +- .../src/tests/dispute_early_close.rs | 16 +- .../src/tests/edit_market.rs | 18 +- .../src/tests/integration.rs | 81 ++- .../src/tests/manually_close_market.rs | 8 +- zrml/prediction-markets/src/tests/mod.rs | 47 +- .../src/tests/on_initialize.rs | 2 +- .../src/tests/on_market_close.rs | 30 +- .../src/tests/on_resolution.rs | 140 ++--- .../src/tests/redeem_shares.rs | 56 +- .../src/tests/reject_early_close.rs | 10 +- .../src/tests/reject_market.rs | 25 +- zrml/prediction-markets/src/tests/report.rs | 66 ++- .../src/tests/request_edit.rs | 6 +- .../src/tests/schedule_early_close.rs | 12 +- .../src/tests/sell_complete_set.rs | 33 +- .../src/tests/start_global_dispute.rs | 2 +- zrml/prediction-markets/src/weights.rs | 133 +++-- zrml/simple-disputes/src/lib.rs | 7 +- zrml/simple-disputes/src/mock.rs | 10 +- zrml/simple-disputes/src/tests.rs | 4 +- zrml/swaps/Cargo.toml | 4 +- zrml/swaps/fuzz/create_pool.rs | 7 +- zrml/swaps/fuzz/pool_exit.rs | 20 +- .../fuzz/pool_exit_with_exact_asset_amount.rs | 21 +- .../fuzz/pool_exit_with_exact_pool_amount.rs | 20 +- zrml/swaps/fuzz/pool_join.rs | 13 +- .../fuzz/pool_join_with_exact_asset_amount.rs | 13 +- .../fuzz/pool_join_with_exact_pool_amount.rs | 13 +- zrml/swaps/fuzz/swap_exact_amount_in.rs | 19 +- zrml/swaps/fuzz/swap_exact_amount_out.rs | 11 +- zrml/swaps/fuzz/utils.rs | 4 +- zrml/swaps/rpc/src/lib.rs | 30 +- zrml/swaps/runtime-api/src/lib.rs | 14 +- zrml/swaps/src/benchmarks.rs | 6 +- zrml/swaps/src/lib.rs | 60 +- zrml/swaps/src/mock.rs | 20 +- zrml/swaps/src/utils.rs | 20 +- zrml/swaps/src/weights.rs | 18 - 192 files changed, 2052 insertions(+), 10113 deletions(-) rename primitives/src/{assets.rs => asset.rs} (55%) delete mode 100644 primitives/src/assets/all_assets.rs delete mode 100644 primitives/src/assets/campaign_assets.rs delete mode 100644 primitives/src/assets/currencies.rs delete mode 100644 primitives/src/assets/custom_assets.rs delete mode 100644 primitives/src/assets/market_assets.rs delete mode 100644 primitives/src/assets/subsets/base_assets.rs delete mode 100644 primitives/src/assets/subsets/mod.rs delete mode 100644 primitives/src/assets/subsets/parimutuel.rs delete mode 100644 primitives/src/assets/subsets/xcm_assets.rs delete mode 100644 primitives/src/assets/tests.rs delete mode 100644 primitives/src/assets/tests/conversion.rs delete mode 100644 primitives/src/assets/tests/scale_codec.rs create mode 100644 primitives/src/serde_wrapper.rs delete mode 100644 primitives/src/traits/market_transition_api.rs delete mode 100644 primitives/src/traits/weights.rs delete mode 100644 runtime/common/src/weights/pallet_assets.rs delete mode 100644 zrml/asset-router/Cargo.toml delete mode 100644 zrml/asset-router/README.md delete mode 100644 zrml/asset-router/src/lib.rs delete mode 100644 zrml/asset-router/src/macros.rs delete mode 100644 zrml/asset-router/src/mock.rs delete mode 100644 zrml/asset-router/src/pallet_impl/create.rs delete mode 100644 zrml/asset-router/src/pallet_impl/destroy.rs delete mode 100644 zrml/asset-router/src/pallet_impl/inspect.rs delete mode 100644 zrml/asset-router/src/pallet_impl/managed_destroy.rs delete mode 100644 zrml/asset-router/src/pallet_impl/mod.rs delete mode 100644 zrml/asset-router/src/pallet_impl/multi_currency.rs delete mode 100644 zrml/asset-router/src/pallet_impl/multi_currency_extended.rs delete mode 100644 zrml/asset-router/src/pallet_impl/multi_lockable_currency.rs delete mode 100644 zrml/asset-router/src/pallet_impl/multi_reserveable_currency.rs delete mode 100644 zrml/asset-router/src/pallet_impl/named_multi_reserveable_currency.rs delete mode 100644 zrml/asset-router/src/pallet_impl/transfer_all.rs delete mode 100644 zrml/asset-router/src/pallet_impl/unbalanced.rs delete mode 100644 zrml/asset-router/src/tests/create.rs delete mode 100644 zrml/asset-router/src/tests/custom_types.rs delete mode 100644 zrml/asset-router/src/tests/destroy.rs delete mode 100644 zrml/asset-router/src/tests/inspect.rs delete mode 100644 zrml/asset-router/src/tests/managed_destroy.rs delete mode 100644 zrml/asset-router/src/tests/mod.rs delete mode 100644 zrml/asset-router/src/tests/multi_currency.rs delete mode 100644 zrml/asset-router/src/tests/multi_lockable_currency.rs delete mode 100644 zrml/asset-router/src/tests/multi_reservable_currency.rs delete mode 100644 zrml/asset-router/src/tests/named_multi_reservable_currency.rs delete mode 100644 zrml/asset-router/src/tests/unbalanced.rs delete mode 100644 zrml/asset-router/src/types.rs rename zrml/prediction-markets/src/tests/{close_market.rs => close_trusted_market.rs} (91%) diff --git a/CODEOWNERS b/CODEOWNERS index 03f736322..059ede2ac 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -8,7 +8,6 @@ # Ignore everything but mod.rs in /runtime/common/src/weights/ /runtime/common/src/weights/* /runtime/common/src/weights/mod.rs @sea212 -/zrml/asset-router/ @sea212 /zrml/authorized/ @Chralt98 /zrml/court/ @Chralt98 /zrml/global-disputes/ @Chralt98 diff --git a/Cargo.lock b/Cargo.lock index 1057c1dcf..50d882012 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,6 @@ dependencies = [ "orml-xcm-support", "orml-xtokens", "pallet-asset-tx-payment", - "pallet-assets", "pallet-aura", "pallet-author-inherent", "pallet-author-mapping", @@ -620,7 +619,6 @@ dependencies = [ "xcm-emulator", "xcm-executor", "zeitgeist-primitives", - "zrml-asset-router", "zrml-authorized", "zrml-court", "zrml-global-disputes", @@ -1218,7 +1216,6 @@ dependencies = [ "orml-currencies", "orml-tokens", "pallet-asset-tx-payment", - "pallet-assets", "pallet-author-inherent", "pallet-author-mapping", "pallet-author-slot-filter", @@ -5862,21 +5859,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-assets" -version = "4.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-aura" version = "4.0.0-dev" @@ -14391,7 +14373,6 @@ dependencies = [ "fixed", "frame-support", "frame-system", - "impl-trait-for-tuples", "more-asserts", "num-traits", "orml-currencies", @@ -14439,7 +14420,6 @@ dependencies = [ "orml-xcm-support", "orml-xtokens", "pallet-asset-tx-payment", - "pallet-assets", "pallet-aura", "pallet-author-inherent", "pallet-author-mapping", @@ -14496,7 +14476,6 @@ dependencies = [ "xcm-emulator", "xcm-executor", "zeitgeist-primitives", - "zrml-asset-router", "zrml-authorized", "zrml-court", "zrml-global-disputes", @@ -14534,26 +14513,6 @@ dependencies = [ "syn 2.0.28", ] -[[package]] -name = "zrml-asset-router" -version = "0.4.1" -dependencies = [ - "frame-support", - "frame-system", - "log", - "orml-tokens", - "orml-traits", - "pallet-assets", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "sp-io", - "sp-runtime", - "test-case", - "zeitgeist-macros", - "zeitgeist-primitives", -] - [[package]] name = "zrml-authorized" version = "0.5.2" @@ -14631,7 +14590,6 @@ dependencies = [ "orml-currencies", "orml-tokens", "orml-traits", - "pallet-assets", "pallet-balances", "pallet-randomness-collective-flip", "pallet-timestamp", @@ -14646,7 +14604,6 @@ dependencies = [ "xcm", "xcm-builder", "zeitgeist-primitives", - "zrml-asset-router", "zrml-authorized", "zrml-court", "zrml-global-disputes", @@ -14712,7 +14669,6 @@ dependencies = [ "orml-currencies", "orml-tokens", "orml-traits", - "pallet-assets", "pallet-balances", "pallet-randomness-collective-flip", "pallet-timestamp", @@ -14729,7 +14685,6 @@ dependencies = [ "xcm", "xcm-builder", "zeitgeist-primitives", - "zrml-asset-router", "zrml-authorized", "zrml-court", "zrml-global-disputes", @@ -14753,7 +14708,6 @@ dependencies = [ "orml-currencies", "orml-tokens", "orml-traits", - "pallet-assets", "pallet-balances", "pallet-timestamp", "parity-scale-codec", @@ -14761,9 +14715,7 @@ dependencies = [ "sp-io", "sp-runtime", "test-case", - "zeitgeist-macros", "zeitgeist-primitives", - "zrml-asset-router", "zrml-market-commons", "zrml-orderbook", ] @@ -14790,7 +14742,6 @@ dependencies = [ "orml-currencies", "orml-tokens", "orml-traits", - "pallet-assets", "pallet-balances", "pallet-timestamp", "parity-scale-codec", @@ -14798,9 +14749,7 @@ dependencies = [ "sp-io", "sp-runtime", "test-case", - "zeitgeist-macros", "zeitgeist-primitives", - "zrml-asset-router", "zrml-market-commons", ] @@ -14817,7 +14766,6 @@ dependencies = [ "orml-currencies", "orml-tokens", "orml-traits", - "pallet-assets", "pallet-balances", "pallet-randomness-collective-flip", "pallet-timestamp", @@ -14832,7 +14780,6 @@ dependencies = [ "test-case", "xcm", "zeitgeist-primitives", - "zrml-asset-router", "zrml-authorized", "zrml-court", "zrml-global-disputes", diff --git a/Cargo.toml b/Cargo.toml index 3f94c60a9..4485139ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,6 @@ default-members = [ "runtime/battery-station", "runtime/zeitgeist", "zrml/authorized", - "zrml/asset-router", "zrml/court", "zrml/hybrid-router", "zrml/global-disputes", @@ -33,7 +32,6 @@ members = [ "runtime/battery-station", "runtime/zeitgeist", "zrml/authorized", - "zrml/asset-router", "zrml/court", "zrml/hybrid-router", "zrml/global-disputes", @@ -167,7 +165,6 @@ frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", b frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } pallet-asset-tx-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-assets = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } @@ -237,7 +234,6 @@ zrml-swaps-rpc = { path = "zrml/swaps/rpc" } common-runtime = { path = "runtime/common", default-features = false } zeitgeist-macros = { path = "macros", default-features = false } zeitgeist-primitives = { path = "primitives", default-features = false } -zrml-asset-router = { path = "zrml/asset-router", default-features = false } zrml-authorized = { path = "zrml/authorized", default-features = false } zrml-court = { path = "zrml/court", default-features = false } zrml-global-disputes = { path = "zrml/global-disputes", default-features = false } @@ -269,7 +265,6 @@ arbitrary = { version = "1.3.0", default-features = false } arrayvec = { version = "0.7.4", default-features = false } cfg-if = { version = "1.0.0" } fixed = { version = "=1.15.0", default-features = false, features = ["num-traits"] } -impl-trait-for-tuples = { version = "0.2.2" } # Using math code directly from the HydraDX node repository as https://github.com/galacticcouncil/hydradx-math is outdated and has been archived in May 2023. hydra-dx-math = { git = "https://github.com/galacticcouncil/HydraDX-node", package = "hydra-dx-math", tag = "v21.1.1", default-features = false } # Hashbrown works in no_std by default and default features are used in Rikiddo @@ -339,9 +334,6 @@ opt-level = 3 panic = "unwind" [patch."https://github.com/paritytech/substrate"] -# pallet-asset adjustments (managed asset destruction) -pallet-assets = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } - # fix that allow to build with recent rustc substrate-wasm-builder = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } diff --git a/README.md b/README.md index 1fa93686c..7350560e5 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,6 @@ decentralized court. ## Modules -- [asset-router](./zrml/asset-router) - Routes all asset classes to the - respective pallets and provides a garbage collection for destructible assets. - [authorized](./zrml/authorized) - Offers authorized resolution of disputes. - [court](./zrml/court) - An implementation of a court mechanism used to resolve disputes in a decentralized fashion. diff --git a/docs/changelog_for_devs.md b/docs/changelog_for_devs.md index e12a38733..69c4109a4 100644 --- a/docs/changelog_for_devs.md +++ b/docs/changelog_for_devs.md @@ -128,28 +128,22 @@ if ztg_supply / campaign_asset_supply >= 100 { [#1197]: https://github.com/zeitgeistpm/zeitgeist/pull/1197 [#1178]: https://github.com/zeitgeistpm/zeitgeist/pull/1178 -### Changed +### Changes -- ⚠️ Move the `zeitgeist_primitives::Pool` struct to `zrml_swaps::types::Pool` - and change the following fields ([#1197]): - - Remove `market_id` - - Make `swap_fee` non-optional - - Remove `total_subsidy` - - Make `total_weight` non-optional - - Make `weights` non-optional -- ⚠️ Change the type of `liquidity_shares_manager` in - `zrml_neo_swaps::types::Pool` from `zrml_neo_swaps::types::SoloLp` to - `zrml_neo_swaps::types::LiquidityTree`. Details on the liquidity tree can be - found in the `README.md` of zrml-neo-swaps and the documentation of the - `LiquidityTree` object ([#1179]). +- ⚠️ Move the `zeitgeist_primitives::Pool` struct to `zrml_swaps::types::Pool` and change the following fields ([#1197]): + - Remove `market_id` + - Make `swap_fee` non-optional + - Remove `total_subsidy` + - Make `total_weight` non-optional + - Make `weights` non-optional +- ⚠️ Change the type of `liquidity_shares_manager` in `zrml_neo_swaps::types::Pool` from `zrml_neo_swaps::types::SoloLp` to `zrml_neo_swaps::types::LiquidityTree`. Details on the liquidity tree can be found in the `README.md` of zrml-neo-swaps and the documentation of the `LiquidityTree` object ([#1179]). ### Migrations - Closed all CPMM pools. Withdrawals are still allowed. Creating new pools will be impossible until further updates are deployed. ([#1197]) - Remove all Rikiddo storage elements. ([#1197]) -- Migrate neo-swaps `Pools` storage. The market creator's liquidity position is - translated into a position in the liquidity tree of the same value ([#1178]). +- Migrate neo-swaps `Pools` storage. The market creator's liquidity position is translated into a position in the liquidity tree of the same value ([#1178]). ### Removed diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 6b4609b19..b6ee80362 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -50,7 +50,7 @@ macro_rules! create_b_tree_map { #[macro_export] macro_rules! unreachable_non_terminating { ($condition: expr, $message: literal, $($message_args: tt)*) => { - let message = alloc::format!($message, $($message_args)*); + let message = format!($message, $($message_args)*); #[cfg(test)] assert!($condition, "{}", message); @@ -60,7 +60,7 @@ macro_rules! unreachable_non_terminating { } }; ($condition: expr, $log_target: ident, $message: literal, $($message_args: tt)*) => { - let message = alloc::format!($message, $($message_args)*); + let message = format!($message, $($message_args)*); #[cfg(test)] assert!($condition, "{}", message); @@ -70,7 +70,7 @@ macro_rules! unreachable_non_terminating { } }; ($condition: expr, $extra_code: expr, $message: literal, $($message_args: tt)*) => { - let message = alloc::format!($message, $($message_args)*); + let message = format!($message, $($message_args)*); #[cfg(test)] assert!($condition, "{}", message); @@ -81,7 +81,7 @@ macro_rules! unreachable_non_terminating { } }; ($condition: expr, $log_target: ident, $extra_code: expr, $message: literal, $($message_args: tt)*) => { - let message = alloc::format!($message, $($message_args)*); + let message = format!($message, $($message_args)*); #[cfg(test)] assert!($condition, "{}", message); diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 689562b82..e8007e1ce 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -3,7 +3,6 @@ arbitrary = { workspace = true, optional = true } fixed = { workspace = true } frame-support = { workspace = true } frame-system = { workspace = true } -impl-trait-for-tuples = { workspace = true } num-traits = { workspace = true } orml-currencies = { workspace = true } orml-tokens = { workspace = true } diff --git a/primitives/src/assets.rs b/primitives/src/asset.rs similarity index 55% rename from primitives/src/assets.rs rename to primitives/src/asset.rs index 7de237bb8..513ba1203 100644 --- a/primitives/src/assets.rs +++ b/primitives/src/asset.rs @@ -20,26 +20,52 @@ use crate::traits::ZeitgeistAssetEnumerator; use crate::{ traits::PoolSharesId, - types::{CampaignAssetId, CategoryIndex, CustomAssetId, PoolId}, + types::{CategoryIndex, PoolId, SerdeWrapper}, }; -use parity_scale_codec::{Compact, CompactAs, Decode, Encode, HasCompact, MaxEncodedLen}; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; -pub use all_assets::Asset; -pub use campaign_assets::CampaignAssetClass; -pub use currencies::CurrencyClass; -pub use custom_assets::CustomAssetClass; -pub use market_assets::MarketAssetClass; -pub use subsets::{BaseAssetClass, ParimutuelAssetClass, XcmAssetClass}; +/// The `Asset` enum represents all types of assets available in the Zeitgeist +/// system. +#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +#[derive( + Clone, + Copy, + Debug, + Decode, + Default, + Eq, + Encode, + MaxEncodedLen, + Ord, + PartialEq, + PartialOrd, + TypeInfo, +)] +pub enum Asset { + CategoricalOutcome(MarketId, CategoryIndex), + ScalarOutcome(MarketId, ScalarPosition), + CombinatorialOutcome, + PoolShare(SerdeWrapper), + #[default] + Ztg, + ForeignAsset(u32), + ParimutuelShare(MarketId, CategoryIndex), +} -mod all_assets; -mod campaign_assets; -mod currencies; -mod custom_assets; -mod market_assets; -mod subsets; -#[cfg(test)] -mod tests; +impl PoolSharesId> for Asset { + fn pool_shares_id(pool_id: SerdeWrapper) -> Self { + Self::PoolShare(pool_id) + } +} + +#[cfg(feature = "runtime-benchmarks")] +impl ZeitgeistAssetEnumerator for Asset { + fn create_asset_id(t: MarketId) -> Self { + Asset::CategoricalOutcome(t, 0) + } +} /// In a scalar market, users can either choose a `Long` position, /// meaning that they think the outcome will be closer to the upper bound diff --git a/primitives/src/assets/all_assets.rs b/primitives/src/assets/all_assets.rs deleted file mode 100644 index 012486af9..000000000 --- a/primitives/src/assets/all_assets.rs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -/// The `Asset` enum represents all types of assets available in the Zeitgeist -/// system. -/// -/// This complete enumeration is intended to abstract the common interaction -/// with tokens away. For example, the developer is not forced to be aware -/// about which exact implementation will handle the desired asset class to -/// instruct operations such as `transfer` or `freeze`, instead it is -/// sufficient to call a crate that manages the routing. -/// While it is not recommended to use this enum in storage, it should not pose -/// a problem as long as all other asset types use the same scale encoding for -/// a matching asset variant in this enum. -/// -/// **Deprecated:** Market and Pool assets are "lazy" migrated to -/// pallet-assets. -/// Do not create any new market or pool assets using the deprecated variants -/// in this enum. -/// -/// # Types -/// -/// * `MI`: Market Id -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[derive( - Clone, - Copy, - Debug, - Decode, - Default, - Eq, - Encode, - MaxEncodedLen, - Ord, - PartialEq, - PartialOrd, - TypeInfo, -)] -pub enum Asset { - #[codec(index = 0)] - CategoricalOutcome(MI, CategoryIndex), - - #[codec(index = 1)] - ScalarOutcome(MI, ScalarPosition), - - #[codec(index = 3)] - PoolShare(PoolId), - - #[codec(index = 4)] - #[default] - Ztg, - - #[codec(index = 5)] - ForeignAsset(u32), - - #[codec(index = 6)] - ParimutuelShare(MI, CategoryIndex), - - #[codec(index = 7)] - CampaignAsset(#[codec(compact)] CampaignAssetId), - - #[codec(index = 8)] - CustomAsset(#[codec(compact)] CustomAssetId), -} - -impl PoolSharesId for Asset { - fn pool_shares_id(pool_id: PoolId) -> Self { - Self::PoolShare(pool_id) - } -} - -#[cfg(feature = "runtime-benchmarks")] -impl ZeitgeistAssetEnumerator for Asset { - fn create_asset_id(t: MI) -> Self { - Asset::CategoricalOutcome(t, 0) - } -} - -impl From> for Asset { - fn from(value: MarketAssetClass) -> Self { - match value { - MarketAssetClass::::CategoricalOutcome(market_id, cat_id) => { - Self::CategoricalOutcome(market_id, cat_id) - } - MarketAssetClass::::ScalarOutcome(market_id, scalar_pos) => { - Self::ScalarOutcome(market_id, scalar_pos) - } - MarketAssetClass::::ParimutuelShare(market_id, cat_id) => { - Self::ParimutuelShare(market_id, cat_id) - } - MarketAssetClass::::PoolShare(pool_id) => Self::PoolShare(pool_id), - } - } -} - -impl From for Asset { - fn from(value: CampaignAssetClass) -> Self { - Self::CampaignAsset(value.0) - } -} - -impl From for Asset { - fn from(value: CustomAssetClass) -> Self { - Self::CustomAsset(value.0) - } -} - -impl From> for Asset { - fn from(value: CurrencyClass) -> Self { - match value { - CurrencyClass::::CategoricalOutcome(market_id, cat_id) => { - Self::CategoricalOutcome(market_id, cat_id) - } - CurrencyClass::::ScalarOutcome(market_id, scalar_pos) => { - Self::ScalarOutcome(market_id, scalar_pos) - } - CurrencyClass::::ParimutuelShare(market_id, cat_id) => { - Self::ParimutuelShare(market_id, cat_id) - } - CurrencyClass::::PoolShare(pool_id) => Self::PoolShare(pool_id), - CurrencyClass::::ForeignAsset(asset_id) => Self::ForeignAsset(asset_id), - } - } -} - -impl From for Asset { - fn from(value: BaseAssetClass) -> Self { - match value { - BaseAssetClass::Ztg => Self::Ztg, - BaseAssetClass::ForeignAsset(id) => Self::ForeignAsset(id), - BaseAssetClass::CampaignAsset(id) => Self::CampaignAsset(id), - } - } -} - -impl From> for Asset { - fn from(value: ParimutuelAssetClass) -> Self { - match value { - ParimutuelAssetClass::::Share(market_id, cat_id) => { - Self::ParimutuelShare(market_id, cat_id) - } - } - } -} - -impl From for Asset { - fn from(value: XcmAssetClass) -> Self { - match value { - XcmAssetClass::Ztg => Self::Ztg, - XcmAssetClass::ForeignAsset(id) => Self::ForeignAsset(id), - } - } -} diff --git a/primitives/src/assets/campaign_assets.rs b/primitives/src/assets/campaign_assets.rs deleted file mode 100644 index dcf912a77..000000000 --- a/primitives/src/assets/campaign_assets.rs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -/// The `CampaignAsset` tuple struct represents all campaign assets. -/// Campaign assets can have special properties, such as the capability -/// to pay fees. -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[derive( - Clone, CompactAs, Copy, Debug, Decode, Default, Eq, Encode, MaxEncodedLen, PartialEq, TypeInfo, -)] -pub struct CampaignAssetClass(#[codec(compact)] pub CampaignAssetId); - -impl From> for CampaignAssetClass { - fn from(value: Compact) -> CampaignAssetClass { - CampaignAssetClass(value.into()) - } -} - -impl From for Compact { - fn from(value: CampaignAssetClass) -> Compact { - value.0.into() - } -} - -impl TryFrom> for CampaignAssetClass { - type Error = (); - - fn try_from(value: Asset) -> Result { - match value { - Asset::::CampaignAsset(id) => Ok(Self(id)), - _ => Err(()), - } - } -} diff --git a/primitives/src/assets/currencies.rs b/primitives/src/assets/currencies.rs deleted file mode 100644 index d29359d43..000000000 --- a/primitives/src/assets/currencies.rs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -/// The `CurrencyClass` enum represents all non-ztg currencies -// used in orml-tokens -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[derive( - Clone, Copy, Debug, Decode, Eq, Encode, MaxEncodedLen, Ord, PartialEq, PartialOrd, TypeInfo, -)] -pub enum CurrencyClass { - // All Outcome and Share variants will be removed once the lazy migration from - // orml-tokens to pallet-assets is complete - #[codec(index = 0)] - CategoricalOutcome(MI, CategoryIndex), - - #[codec(index = 1)] - ScalarOutcome(MI, ScalarPosition), - - #[codec(index = 3)] - PoolShare(PoolId), - - #[codec(index = 5)] - ForeignAsset(u32), - - #[codec(index = 6)] - ParimutuelShare(MI, CategoryIndex), -} - -impl CurrencyClass { - pub fn is_foreign_asset(&self) -> bool { - matches!(self, Self::ForeignAsset(_)) - } -} - -impl Default for CurrencyClass { - fn default() -> Self { - Self::ForeignAsset(u32::default()) - } -} - -impl TryFrom> for CurrencyClass { - type Error = (); - - fn try_from(value: Asset) -> Result { - match value { - Asset::::CategoricalOutcome(market_id, cat_id) => { - Ok(Self::CategoricalOutcome(market_id, cat_id)) - } - Asset::::ScalarOutcome(market_id, scalar_pos) => { - Ok(Self::ScalarOutcome(market_id, scalar_pos)) - } - Asset::::ParimutuelShare(market_id, cat_id) => { - Ok(Self::ParimutuelShare(market_id, cat_id)) - } - Asset::::PoolShare(pool_id) => Ok(Self::PoolShare(pool_id)), - Asset::::ForeignAsset(id) => Ok(Self::ForeignAsset(id)), - _ => Err(()), - } - } -} diff --git a/primitives/src/assets/custom_assets.rs b/primitives/src/assets/custom_assets.rs deleted file mode 100644 index b5f8339ec..000000000 --- a/primitives/src/assets/custom_assets.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -/// The `CustomAsset` tuple struct represents all custom assets. -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[derive( - Clone, CompactAs, Copy, Debug, Decode, Default, Eq, Encode, MaxEncodedLen, PartialEq, TypeInfo, -)] -pub struct CustomAssetClass(#[codec(compact)] pub CustomAssetId); - -impl From> for CustomAssetClass { - fn from(value: Compact) -> CustomAssetClass { - CustomAssetClass(value.into()) - } -} - -impl From for Compact { - fn from(value: CustomAssetClass) -> Compact { - value.0.into() - } -} - -impl TryFrom> for CustomAssetClass { - type Error = (); - - fn try_from(value: Asset) -> Result { - match value { - Asset::::CustomAsset(id) => Ok(Self(id)), - _ => Err(()), - } - } -} diff --git a/primitives/src/assets/market_assets.rs b/primitives/src/assets/market_assets.rs deleted file mode 100644 index 7573cf74a..000000000 --- a/primitives/src/assets/market_assets.rs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -/// The `MarketAsset` enum represents all types of assets available in the -/// Prediction Market protocol -/// -/// # Types -/// -/// * `MI`: Market Id -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[derive( - Clone, Copy, Debug, Decode, Eq, Encode, MaxEncodedLen, PartialEq, PartialOrd, Ord, TypeInfo, -)] -pub enum MarketAssetClass { - #[codec(index = 0)] - CategoricalOutcome(MI, CategoryIndex), - - #[codec(index = 1)] - ScalarOutcome(MI, ScalarPosition), - - #[codec(index = 3)] - PoolShare(PoolId), - - #[codec(index = 6)] - ParimutuelShare(MI, CategoryIndex), -} - -impl TryFrom> for MarketAssetClass { - type Error = (); - - fn try_from(value: Asset) -> Result { - match value { - Asset::::CategoricalOutcome(market_id, cat_id) => { - Ok(Self::CategoricalOutcome(market_id, cat_id)) - } - Asset::::ScalarOutcome(market_id, scalar_pos) => { - Ok(Self::ScalarOutcome(market_id, scalar_pos)) - } - Asset::::ParimutuelShare(market_id, cat_id) => { - Ok(Self::ParimutuelShare(market_id, cat_id)) - } - Asset::::PoolShare(pool_id) => Ok(Self::PoolShare(pool_id)), - _ => Err(()), - } - } -} diff --git a/primitives/src/assets/subsets/base_assets.rs b/primitives/src/assets/subsets/base_assets.rs deleted file mode 100644 index 041d0b10c..000000000 --- a/primitives/src/assets/subsets/base_assets.rs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -/// The `BaseAssetClass` enum represents all assets that can be used as collateral in -/// prediction markets. -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[derive(Clone, Copy, Debug, Decode, Default, Eq, Encode, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum BaseAssetClass { - #[codec(index = 4)] - #[default] - Ztg, - - #[codec(index = 5)] - ForeignAsset(u32), - - #[codec(index = 7)] - CampaignAsset(#[codec(compact)] CampaignAssetId), -} - -impl TryFrom> for BaseAssetClass { - type Error = (); - - fn try_from(value: Asset) -> Result { - match value { - Asset::::Ztg => Ok(Self::Ztg), - Asset::::ForeignAsset(id) => Ok(Self::ForeignAsset(id)), - Asset::::CampaignAsset(id) => Ok(Self::CampaignAsset(id)), - _ => Err(()), - } - } -} diff --git a/primitives/src/assets/subsets/mod.rs b/primitives/src/assets/subsets/mod.rs deleted file mode 100644 index eafe22f04..000000000 --- a/primitives/src/assets/subsets/mod.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -pub use base_assets::BaseAssetClass; -pub use parimutuel::ParimutuelAssetClass; -pub use xcm_assets::XcmAssetClass; - -mod base_assets; -mod parimutuel; -mod xcm_assets; diff --git a/primitives/src/assets/subsets/parimutuel.rs b/primitives/src/assets/subsets/parimutuel.rs deleted file mode 100644 index 26d412a4e..000000000 --- a/primitives/src/assets/subsets/parimutuel.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -/// The `ParimutuelAssetClass` enum represents all assets that are specific to parimutuel markets. -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[derive(Clone, Copy, Debug, Decode, Eq, Encode, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum ParimutuelAssetClass { - #[codec(index = 6)] - Share(MI, CategoryIndex), -} - -impl TryFrom> for ParimutuelAssetClass { - type Error = (); - - fn try_from(value: Asset) -> Result { - match value { - Asset::::ParimutuelShare(market_id, cat_id) => Ok(Self::Share(market_id, cat_id)), - _ => Err(()), - } - } -} diff --git a/primitives/src/assets/subsets/xcm_assets.rs b/primitives/src/assets/subsets/xcm_assets.rs deleted file mode 100644 index bbad9de08..000000000 --- a/primitives/src/assets/subsets/xcm_assets.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use super::*; - -/// The `XcmAssetClass` enum represents all assets that can be transferred via XCM. -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[derive(Clone, Copy, Debug, Decode, Default, Eq, Encode, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum XcmAssetClass { - #[codec(index = 4)] - #[default] - Ztg, - - #[codec(index = 5)] - ForeignAsset(u32), -} - -impl TryFrom> for XcmAssetClass { - type Error = (); - - fn try_from(value: Asset) -> Result { - match value { - Asset::::Ztg => Ok(Self::Ztg), - Asset::::ForeignAsset(id) => Ok(Self::ForeignAsset(id)), - _ => Err(()), - } - } -} diff --git a/primitives/src/assets/tests.rs b/primitives/src/assets/tests.rs deleted file mode 100644 index 9aa7bec90..000000000 --- a/primitives/src/assets/tests.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use crate::types::MarketId; - -mod conversion; -mod scale_codec; diff --git a/primitives/src/assets/tests/conversion.rs b/primitives/src/assets/tests/conversion.rs deleted file mode 100644 index 49829978c..000000000 --- a/primitives/src/assets/tests/conversion.rs +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use test_case::test_case; - -// Assets <> MarketAssetClass -#[test_case( - Asset::::CategoricalOutcome(7, 8), - MarketAssetClass::::CategoricalOutcome(7, 8); - "categorical_outcome" -)] -#[test_case( - Asset::::ScalarOutcome(7, ScalarPosition::Long), - MarketAssetClass::::ScalarOutcome(7, ScalarPosition::Long); - "scalar_outcome" -)] -#[test_case( - Asset::::PoolShare(7), - MarketAssetClass::::PoolShare(7); - "pool_share" -)] -#[test_case( - Asset::::ParimutuelShare(7, 8), - MarketAssetClass::::ParimutuelShare(7, 8); - "parimutuel_share" -)] -fn from_all_assets_to_market_assets( - old_asset: Asset, - new_asset: MarketAssetClass, -) { - let new_asset_converted: MarketAssetClass = old_asset.try_into().unwrap(); - assert_eq!(new_asset, new_asset_converted); -} - -#[test_case(Asset::::Ztg; "ztg")] -#[test_case(Asset::::ForeignAsset(7); "foreign_asset")] -#[test_case(Asset::::CampaignAsset(7); "campaign_asset")] -#[test_case(Asset::::CustomAsset(7); "custom_asset")] -fn from_all_assets_to_market_assets_fails(asset: Asset) { - assert!(MarketAssetClass::::try_from(asset).is_err()); -} - -#[test_case( - MarketAssetClass::::CategoricalOutcome(7, 8), - Asset::::CategoricalOutcome(7, 8); - "categorical_outcome" -)] -#[test_case( - MarketAssetClass::::ScalarOutcome(7, ScalarPosition::Long), - Asset::::ScalarOutcome(7, ScalarPosition::Long); - "scalar_outcome" -)] -#[test_case( - MarketAssetClass::::PoolShare(7), - Asset::::PoolShare(7); - "pool_share" -)] -#[test_case( - MarketAssetClass::::ParimutuelShare(7, 8), - Asset::::ParimutuelShare(7, 8); - "parimutuel_share" -)] -fn from_market_assets_to_all_assets( - old_asset: MarketAssetClass, - new_asset: Asset, -) { - let new_asset_converted: Asset = old_asset.into(); - assert_eq!(new_asset, new_asset_converted); -} - -// Assets <> CurrencyClass -#[test_case( - Asset::::CategoricalOutcome(7, 8), - CurrencyClass::::CategoricalOutcome(7, 8); - "categorical_outcome" -)] -#[test_case( - Asset::::ScalarOutcome(7, ScalarPosition::Long), - CurrencyClass::::ScalarOutcome(7, ScalarPosition::Long); - "scalar_outcome" -)] -#[test_case( - Asset::::PoolShare(7), - CurrencyClass::::PoolShare(7); - "pool_share" -)] -#[test_case( - Asset::::ParimutuelShare(7, 8), - CurrencyClass::::ParimutuelShare(7, 8); - "parimutuel_share" -)] -#[test_case( - Asset::::ForeignAsset(7), - CurrencyClass::::ForeignAsset(7); - "foreign_asset" -)] -fn from_all_assets_to_currencies(old_asset: Asset, new_asset: CurrencyClass) { - let new_asset_converted: CurrencyClass = old_asset.try_into().unwrap(); - assert_eq!(new_asset, new_asset_converted); -} - -#[test_case(Asset::::Ztg; "ztg")] -#[test_case(Asset::::CampaignAsset(7); "campaign_asset")] -#[test_case(Asset::::CustomAsset(7); "custom_asset")] -fn from_all_assets_to_currencies_fails(asset: Asset) { - assert!(CurrencyClass::::try_from(asset).is_err()); -} - -#[test_case( - CurrencyClass::::CategoricalOutcome(7, 8), - Asset::::CategoricalOutcome(7, 8); - "categorical_outcome" -)] -#[test_case( - CurrencyClass::::ScalarOutcome(7, ScalarPosition::Long), - Asset::::ScalarOutcome(7, ScalarPosition::Long); - "scalar_outcome" -)] -#[test_case( - CurrencyClass::::PoolShare(7), - Asset::::PoolShare(7); - "pool_share" -)] -#[test_case( - CurrencyClass::::ParimutuelShare(7, 8), - Asset::::ParimutuelShare(7, 8); - "parimutuel_share" -)] -#[test_case( - CurrencyClass::::ForeignAsset(7), - Asset::::ForeignAsset(7); - "foreign_asset" -)] -fn from_currencies_to_all_assets(old_asset: CurrencyClass, new_asset: Asset) { - let new_asset_converted: Asset = old_asset.into(); - assert_eq!(new_asset, new_asset_converted); -} - -// Assets <> CampaignAssetClass -#[test] -fn from_all_assets_to_campaign_assets() { - let old_asset = Asset::::CampaignAsset(7); - let new_asset = CampaignAssetClass(7); - - let new_asset_converted: CampaignAssetClass = old_asset.try_into().unwrap(); - assert_eq!(new_asset, new_asset_converted); -} - -#[test_case(Asset::::CategoricalOutcome(7, 8); "categorical_outcome")] -#[test_case(Asset::::ScalarOutcome(7, ScalarPosition::Long); "scalar_outcome")] -#[test_case(Asset::::PoolShare(7); "pool_share")] -#[test_case(Asset::::Ztg; "ztg")] -#[test_case(Asset::::ForeignAsset(7); "foreign_asset")] -#[test_case(Asset::::ParimutuelShare(7, 8); "parimutuel_share")] -#[test_case(Asset::::CustomAsset(7); "custom_asset")] -fn from_all_assets_to_campaign_assets_fails(asset: Asset) { - assert!(CampaignAssetClass::try_from(asset).is_err()); -} - -#[test] -fn from_campaign_assets_to_all_assets() { - let old_asset = CampaignAssetClass(7); - let new_asset = Asset::::CampaignAsset(7); - let new_asset_converted: Asset = old_asset.into(); - assert_eq!(new_asset, new_asset_converted); -} - -// Assets <> CustomAssetClass -#[test] -fn from_all_assets_to_custom_assets() { - let old_asset = Asset::::CustomAsset(7); - let new_asset = CustomAssetClass(7); - - let new_asset_converted: CustomAssetClass = old_asset.try_into().unwrap(); - assert_eq!(new_asset, new_asset_converted); -} - -#[test_case(Asset::::CategoricalOutcome(7, 8); "categorical_outcome")] -#[test_case(Asset::::ScalarOutcome(7, ScalarPosition::Long); "scalar_outcome")] -#[test_case(Asset::::PoolShare(7); "pool_share")] -#[test_case(Asset::::Ztg; "ztg")] -#[test_case(Asset::::ForeignAsset(7); "foreign_asset")] -#[test_case(Asset::::ParimutuelShare(7, 8); "parimutuel_share")] -#[test_case(Asset::::CampaignAsset(7); "campaign_asset")] -fn from_all_assets_to_custom_assets_fails(asset: Asset) { - assert!(CustomAssetClass::try_from(asset).is_err()); -} - -#[test] -fn from_custom_assets_to_all_assets() { - let old_asset = CampaignAssetClass(7); - let new_asset = Asset::::CampaignAsset(7); - let new_asset_converted: Asset = old_asset.into(); - assert_eq!(new_asset, new_asset_converted); -} - -// Assets <> BaseAssetClass -#[test_case( - Asset::::CampaignAsset(7), - BaseAssetClass::CampaignAsset(7); - "campaign_asset" -)] -#[test_case( - Asset::::ForeignAsset(7), - BaseAssetClass::ForeignAsset(7); - "foreign_asset" -)] -#[test_case( - Asset::::Ztg, - BaseAssetClass::Ztg; - "ztg" -)] -fn from_all_assets_to_base_assets(old_asset: Asset, new_asset: BaseAssetClass) { - let new_asset_converted: BaseAssetClass = old_asset.try_into().unwrap(); - assert_eq!(new_asset, new_asset_converted); -} - -#[test_case(Asset::::CategoricalOutcome(7, 8); "categorical_outcome")] -#[test_case(Asset::::ScalarOutcome(7, ScalarPosition::Long); "scalar_outcome")] -#[test_case(Asset::::PoolShare(7); "pool_share")] -#[test_case(Asset::::ParimutuelShare(7, 8); "parimutuel_share")] -#[test_case(Asset::::CustomAsset(7); "custom_asset")] -fn from_all_assets_to_base_assets_fails(asset: Asset) { - assert!(BaseAssetClass::try_from(asset).is_err()); -} - -#[test_case( - BaseAssetClass::CampaignAsset(7), - Asset::::CampaignAsset(7); - "campaign_asset" -)] -#[test_case( - BaseAssetClass::ForeignAsset(7), - Asset::::ForeignAsset(7); - "foreign_asset" -)] -#[test_case( - BaseAssetClass::Ztg, - Asset::::Ztg; - "ztg" -)] -fn from_base_assets_to_all_assets(old_asset: BaseAssetClass, new_asset: Asset) { - let new_asset_converted: Asset = old_asset.into(); - assert_eq!(new_asset, new_asset_converted); -} - -// Assets <> ParimutuelAssetClass -#[test_case( - Asset::::ParimutuelShare(7, 8), - ParimutuelAssetClass::::Share(7, 8); - "parimutuel_share" -)] -fn from_all_assets_to_parimutuel_assets( - old_asset: Asset, - new_asset: ParimutuelAssetClass, -) { - let new_asset_converted: ParimutuelAssetClass = old_asset.try_into().unwrap(); - assert_eq!(new_asset, new_asset_converted); -} - -#[test_case(Asset::::CategoricalOutcome(7, 8); "categorical_outcome")] -#[test_case(Asset::::ScalarOutcome(7, ScalarPosition::Long); "scalar_outcome")] -#[test_case(Asset::::PoolShare(7); "pool_share")] -#[test_case(Asset::::Ztg; "ztg")] -#[test_case(Asset::::ForeignAsset(7); "foreign_asset")] -#[test_case(Asset::::CampaignAsset(7); "campaign_asset")] -#[test_case(Asset::::CustomAsset(7); "custom_asset")] -fn from_all_assets_to_parimutuel_assets_fails(asset: Asset) { - assert!(ParimutuelAssetClass::::try_from(asset).is_err()); -} - -#[test_case( - ParimutuelAssetClass::::Share(7, 8), - Asset::::ParimutuelShare(7, 8); - "parimutuel_share" -)] -fn from_parimutuel_assets_to_all_assets( - old_asset: ParimutuelAssetClass, - new_asset: Asset, -) { - let new_asset_converted: Asset = old_asset.into(); - assert_eq!(new_asset, new_asset_converted); -} - -// Assets <> XcmAssetClass -#[test_case( - Asset::::ForeignAsset(7), - XcmAssetClass::ForeignAsset(7); - "foreign_asset" -)] -#[test_case( - Asset::::Ztg, - XcmAssetClass::Ztg; - "ztg" -)] -fn from_all_assets_to_xcm_assets(old_asset: Asset, new_asset: XcmAssetClass) { - let new_asset_converted: XcmAssetClass = old_asset.try_into().unwrap(); - assert_eq!(new_asset, new_asset_converted); -} - -#[test_case(Asset::::CategoricalOutcome(7, 8); "categorical_outcome")] -#[test_case(Asset::::ScalarOutcome(7, ScalarPosition::Long); "scalar_outcome")] -#[test_case(Asset::::PoolShare(7); "pool_share")] -#[test_case(Asset::::CampaignAsset(7); "campaign_asset")] -#[test_case(Asset::::CustomAsset(7); "custom_asset")] -fn from_all_assets_to_xcm_assets_fails(asset: Asset) { - assert!(XcmAssetClass::try_from(asset).is_err()); -} - -#[test_case( - XcmAssetClass::ForeignAsset(7), - Asset::::ForeignAsset(7); - "foreign_asset" -)] -#[test_case( - XcmAssetClass::Ztg, - Asset::::Ztg; - "ztg" -)] -fn from_xcm_assets_to_all_assets(old_asset: XcmAssetClass, new_asset: Asset) { - let new_asset_converted: Asset = old_asset.into(); - assert_eq!(new_asset, new_asset_converted); -} - -// CampaignAssetId <> CampaignAssetClass -#[test] -fn from_campaign_asset_id_to_campaign_asset() { - let campaign_asset_id = Compact(7); - let campaign_asset = CampaignAssetClass::from(campaign_asset_id); - let campaign_asset_id_converted = campaign_asset.into(); - assert_eq!(campaign_asset_id, campaign_asset_id_converted); -} - -// CustomAssetId <> CustomAssetClass -#[test] -fn from_custom_asset_id_to_custom_asset() { - let custom_asset_id = Compact(7); - let custom_asset = CustomAssetClass::from(custom_asset_id); - let custom_asset_id_converted = custom_asset.into(); - assert_eq!(custom_asset_id, custom_asset_id_converted); -} diff --git a/primitives/src/assets/tests/scale_codec.rs b/primitives/src/assets/tests/scale_codec.rs deleted file mode 100644 index 050da1db5..000000000 --- a/primitives/src/assets/tests/scale_codec.rs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use test_case::test_case; - -// Assets <> BaseAssetClass -#[test_case( - Asset::::CampaignAsset(7), - BaseAssetClass::CampaignAsset(7); - "campaign_asset" -)] -#[test_case( - Asset::::ForeignAsset(7), - BaseAssetClass::ForeignAsset(7); - "foreign_asset" -)] -#[test_case( - Asset::::Ztg, - BaseAssetClass::Ztg; - "ztg" -)] -fn index_matching_works_for_base_assets(old_asset: Asset, new_asset: BaseAssetClass) { - let old_asset_encoded: Vec = old_asset.encode(); - let new_asset_decoded = - ::decode(&mut old_asset_encoded.as_slice()).unwrap(); - assert_eq!(new_asset_decoded, new_asset); -} - -// Assets <> CurrencyClass -#[test_case( - Asset::::CategoricalOutcome(7, 8), - CurrencyClass::::CategoricalOutcome(7, 8); - "categorical_outcome" -)] -#[test_case( - Asset::::ScalarOutcome(7, ScalarPosition::Long), - CurrencyClass::::ScalarOutcome(7, ScalarPosition::Long); - "scalar_outcome" -)] -#[test_case( - Asset::::PoolShare(7), - CurrencyClass::::PoolShare(7); - "pool_share" -)] -#[test_case( - Asset::::ParimutuelShare(7, 8), - CurrencyClass::::ParimutuelShare(7, 8); - "parimutuel_share" -)] -#[test_case( - Asset::::ForeignAsset(7), - CurrencyClass::::ForeignAsset(7); - "foreign_asset" -)] -fn index_matching_works_for_currencies( - old_asset: Asset, - new_asset: CurrencyClass, -) { - let old_asset_encoded: Vec = old_asset.encode(); - let new_asset_decoded = - as Decode>::decode(&mut old_asset_encoded.as_slice()).unwrap(); - assert_eq!(new_asset_decoded, new_asset); -} - -// Assets <> MarketAssetClass -#[test_case( - Asset::::CategoricalOutcome(7, 8), - MarketAssetClass::::CategoricalOutcome(7, 8); - "categorical_outcome" -)] -#[test_case( - Asset::::ScalarOutcome(7, ScalarPosition::Long), - MarketAssetClass::::ScalarOutcome(7, ScalarPosition::Long); - "scalar_outcome" -)] -#[test_case( - Asset::::PoolShare(7), - MarketAssetClass::::PoolShare(7); - "pool_share" -)] -#[test_case( - Asset::::ParimutuelShare(7, 8), - MarketAssetClass::::ParimutuelShare(7, 8); - "parimutuel_share" -)] -fn index_matching_works_for_market_assets( - old_asset: Asset, - new_asset: MarketAssetClass, -) { - let old_asset_encoded: Vec = old_asset.encode(); - let new_asset_decoded = - as Decode>::decode(&mut old_asset_encoded.as_slice()).unwrap(); - assert_eq!(new_asset_decoded, new_asset); -} - -// Assets <> ParimutuelAssetClass -#[test_case( - Asset::::ParimutuelShare(7, 8), - ParimutuelAssetClass::Share(7, 8); - "parimutuel_share" -)] -fn index_matching_works_for_parimutuel_assets( - old_asset: Asset, - new_asset: ParimutuelAssetClass, -) { - let old_asset_encoded: Vec = old_asset.encode(); - let new_asset_decoded = - as Decode>::decode(&mut old_asset_encoded.as_slice()) - .unwrap(); - assert_eq!(new_asset_decoded, new_asset); -} - -// Assets <> XcmAssetClass -#[test_case( - Asset::::ForeignAsset(7), - XcmAssetClass::ForeignAsset(7); - "foreign_asset" -)] -#[test_case( - Asset::::Ztg, - XcmAssetClass::Ztg; - "ztg" -)] -fn index_matching_works_for_xcm_assets(old_asset: Asset, new_asset: XcmAssetClass) { - let old_asset_encoded: Vec = old_asset.encode(); - let new_asset_decoded = - ::decode(&mut old_asset_encoded.as_slice()).unwrap(); - assert_eq!(new_asset_decoded, new_asset); -} diff --git a/primitives/src/constants.rs b/primitives/src/constants.rs index d5f42caf9..b48768d01 100644 --- a/primitives/src/constants.rs +++ b/primitives/src/constants.rs @@ -22,7 +22,7 @@ clippy::arithmetic_side_effects )] -#[cfg(feature = "mock")] +// #[cfg(any(feature = "mock", feature = "runtime-benchmarks"))] pub mod base_multiples; #[cfg(feature = "mock")] pub mod mock; diff --git a/primitives/src/constants/base_multiples.rs b/primitives/src/constants/base_multiples.rs index e714d61d5..2f8c41d8e 100644 --- a/primitives/src/constants/base_multiples.rs +++ b/primitives/src/constants/base_multiples.rs @@ -15,8 +15,6 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -#![cfg(feature = "mock")] - use crate::constants::BASE; pub const _1: u128 = BASE; diff --git a/primitives/src/constants/mock.rs b/primitives/src/constants/mock.rs index 47530ebea..0e25aa429 100644 --- a/primitives/src/constants/mock.rs +++ b/primitives/src/constants/mock.rs @@ -20,30 +20,13 @@ pub use super::*; use crate::{ - assets::Asset, - types::{Assets, Balance, Currencies, Moment}, + asset::Asset, + types::{Balance, CurrencyId, Moment}, }; -use frame_support::{pallet_prelude::Weight, parameter_types, traits::LockIdentifier, PalletId}; +use frame_support::{parameter_types, traits::LockIdentifier, PalletId}; use orml_traits::parameter_type_with_key; use sp_arithmetic::Perbill; -// Asset-Router -parameter_types! { - pub const DestroyAccountWeight: Weight = Weight::from_all(1000); - pub const DestroyApprovalWeight: Weight = Weight::from_all(1000); - pub const DestroyFinishWeight: Weight = Weight::from_all(1000); -} - -// Assets -parameter_types! { - pub const AssetsAccountDeposit: Balance = 0; - pub const AssetsApprovalDeposit: Balance = 0; - pub const AssetsDeposit: Balance = 0; - pub const AssetsStringLimit: u32 = 256; - pub const AssetsMetadataDepositBase: Balance = 0; - pub const AssetsMetadataDepositPerByte: Balance = 0; -} - // Authorized parameter_types! { pub const AuthorizedPalletId: PalletId = PalletId(*b"zge/atzd"); @@ -178,15 +161,16 @@ parameter_types! { // ORML parameter_types! { // ORML - pub const GetNativeCurrencyId: Assets = Asset::Ztg; -} - -parameter_type_with_key! { - pub ExistentialDeposits: |_currency_id: Currencies| -> Balance {2}; + pub const GetNativeCurrencyId: CurrencyId = Asset::Ztg; } parameter_type_with_key! { - pub ExistentialDepositsAssets: |_asset_id: Assets| -> Balance {2}; + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { + match currency_id { + Asset::Ztg => ExistentialDeposit::get(), + _ => 10 + } + }; } // System diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 2002bcd97..de0033306 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -20,7 +20,7 @@ extern crate alloc; -mod assets; +mod asset; pub mod constants; pub mod hybrid_router_api_types; mod market; @@ -29,5 +29,6 @@ mod max_runtime_usize; pub mod orderbook; mod outcome_report; mod proxy_type; +mod serde_wrapper; pub mod traits; pub mod types; diff --git a/primitives/src/market.rs b/primitives/src/market.rs index 46b1deef8..3b727f4e6 100644 --- a/primitives/src/market.rs +++ b/primitives/src/market.rs @@ -16,68 +16,58 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::types::{MarketAssetClass, OutcomeReport, ScalarPosition}; +use crate::types::{Asset, OutcomeReport, ScalarPosition}; use alloc::{vec, vec::Vec}; use core::ops::{Range, RangeInclusive}; -use parity_scale_codec::{Decode, Encode, HasCompact, MaxEncodedLen}; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_arithmetic::per_things::Perbill; use sp_runtime::RuntimeDebug; -/// Types -/// -/// * `AI`: Account id -/// * `BA`: Balance type -/// * `BN`: Block number -/// * `M`: Moment (time moment) -/// * `A`: Asset -/// * `MI`: Market ID #[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] -pub struct Market { - pub market_id: MI, +pub struct Market { + pub market_id: MarketId, /// Base asset of the market. - pub base_asset: A, + pub base_asset: Asset, /// Creator of this market. - pub creator: AI, + pub creator: AccountId, /// Creation type. pub creation: MarketCreation, /// A fee that is charged each trade and given to the market creator. pub creator_fee: Perbill, /// Oracle that reports the outcome of this market. - pub oracle: AI, + pub oracle: AccountId, /// Metadata for the market, usually a content address of IPFS /// hosted JSON. Currently limited to 66 bytes (see `MaxEncodedLen` implementation) pub metadata: Vec, /// The type of the market. pub market_type: MarketType, /// Market start and end - pub period: MarketPeriod, + pub period: MarketPeriod, /// Market deadlines. - pub deadlines: Deadlines, + pub deadlines: Deadlines, /// The scoring rule used for the market. pub scoring_rule: ScoringRule, /// The current status of the market. pub status: MarketStatus, /// The report of the market. Only `Some` if it has been reported. - pub report: Option>, + pub report: Option>, /// The resolved outcome. pub resolved_outcome: Option, /// See [`MarketDisputeMechanism`]. pub dispute_mechanism: Option, /// The bonds reserved for this market. - pub bonds: MarketBonds, + pub bonds: MarketBonds, /// The time at which the market was closed early. - pub early_close: Option>, + pub early_close: Option>, } -impl Market +impl + Market where - MI: Copy + HasCompact + MaxEncodedLen, + MarketId: Copy + MaxEncodedLen, { - /// Returns the `ResolutionMechanism` of market, currently either: - /// - `RedeemTokens`, which implies that the module that handles the state transitions of - /// a market is also responsible to provide means for redeeming rewards - /// - `Noop`, which implies that another module provides the means for redeeming rewards + /// Returns the `ResolutionMechanism` of this market. pub fn resolution_mechanism(&self) -> ResolutionMechanism { match self.scoring_rule { ScoringRule::AmmCdaHybrid => ResolutionMechanism::RedeemTokens, @@ -85,13 +75,11 @@ where } } - /// Returns whether the market is redeemable, i.e. reward payout is managed within - /// the same module that controls the state transitions of the underlying market. pub fn is_redeemable(&self) -> bool { matches!(self.resolution_mechanism(), ResolutionMechanism::RedeemTokens) } - /// Returns the number of outcomes for a market. + /// Returns the number of outcomes of this market. pub fn outcomes(&self) -> u16 { match self.market_type { MarketType::Categorical(categories) => categories, @@ -116,17 +104,18 @@ where } /// Returns a `Vec` of all outcomes for `market_id`. - pub fn outcome_assets(&self) -> Vec> { + pub fn outcome_assets(&self) -> Vec> { match self.market_type { MarketType::Categorical(categories) => { let mut assets = Vec::new(); for i in 0..categories { match self.scoring_rule { - ScoringRule::AmmCdaHybrid => assets - .push(MarketAssetClass::::CategoricalOutcome(self.market_id, i)), + ScoringRule::AmmCdaHybrid => { + assets.push(Asset::::CategoricalOutcome(self.market_id, i)) + } ScoringRule::Parimutuel => { - assets.push(MarketAssetClass::::ParimutuelShare(self.market_id, i)) + assets.push(Asset::::ParimutuelShare(self.market_id, i)) } }; } @@ -135,8 +124,8 @@ where } MarketType::Scalar(_) => { vec![ - MarketAssetClass::::ScalarOutcome(self.market_id, ScalarPosition::Long), - MarketAssetClass::::ScalarOutcome(self.market_id, ScalarPosition::Short), + Asset::::ScalarOutcome(self.market_id, ScalarPosition::Long), + Asset::::ScalarOutcome(self.market_id, ScalarPosition::Short), ] } } @@ -146,7 +135,7 @@ where /// returns `None` if not possible. Cases where `None` is returned are: /// - The reported outcome does not exist /// - The reported outcome does not have a corresponding asset type - pub fn report_into_asset(&self) -> Option> { + pub fn report_into_asset(&self) -> Option> { let outcome = if let Some(ref report) = self.report { &report.outcome } else { @@ -160,24 +149,21 @@ where /// returns `None` if not possible. Cases where `None` is returned are: /// - The resolved outcome does not exist /// - The resolved outcome does not have a corresponding asset type - pub fn resolved_outcome_into_asset(&self) -> Option> { + pub fn resolved_outcome_into_asset(&self) -> Option> { let outcome = self.resolved_outcome.as_ref()?; self.outcome_report_into_asset(outcome) } /// Tries to convert a `outcome_report` for `market_id` into an asset, /// returns `None` if not possible. - fn outcome_report_into_asset( - &self, - outcome_report: &OutcomeReport, - ) -> Option> { + fn outcome_report_into_asset(&self, outcome_report: &OutcomeReport) -> Option> { match outcome_report { OutcomeReport::Categorical(idx) => match self.scoring_rule { ScoringRule::AmmCdaHybrid => { - Some(MarketAssetClass::::CategoricalOutcome(self.market_id, *idx)) + Some(Asset::::CategoricalOutcome(self.market_id, *idx)) } ScoringRule::Parimutuel => { - Some(MarketAssetClass::::ParimutuelShare(self.market_id, *idx)) + Some(Asset::::ParimutuelShare(self.market_id, *idx)) } }, OutcomeReport::Scalar(_) => None, @@ -187,38 +173,40 @@ where /// Tracks the status of a bond. #[derive(Clone, Decode, Encode, MaxEncodedLen, PartialEq, Eq, RuntimeDebug, TypeInfo)] -pub struct Bond { +pub struct Bond { /// The account that reserved the bond. - pub who: AI, + pub who: AccountId, /// The amount reserved. - pub value: BA, + pub value: Balance, /// `true` if and only if the bond is unreserved and/or (partially) slashed. pub is_settled: bool, } -impl Bond { - pub fn new(who: AI, value: BA) -> Bond { +impl Bond { + pub fn new(who: AccountId, value: Balance) -> Bond { Bond { who, value, is_settled: false } } } /// Tracks bonds associated with a prediction market. #[derive(Clone, Decode, Encode, MaxEncodedLen, PartialEq, Eq, RuntimeDebug, TypeInfo)] -pub struct MarketBonds { - pub creation: Option>, - pub oracle: Option>, - pub outsider: Option>, - pub dispute: Option>, - pub close_request: Option>, - pub close_dispute: Option>, +pub struct MarketBonds { + pub creation: Option>, + pub oracle: Option>, + pub outsider: Option>, + pub dispute: Option>, + pub close_request: Option>, + pub close_dispute: Option>, } -impl MarketBonds { +impl + MarketBonds +{ /// Return the combined value of the open bonds for `who`. - pub fn total_amount_bonded(&self, who: &AI) -> BA { - let value_or_default = |bond: &Option>| match bond { + pub fn total_amount_bonded(&self, who: &AccountId) -> Balance { + let value_or_default = |bond: &Option>| match bond { Some(bond) if bond.who == *who => bond.value, - _ => BA::zero(), + _ => Balance::zero(), }; value_or_default(&self.creation) .saturating_add(value_or_default(&self.oracle)) @@ -230,7 +218,7 @@ impl MarketBonds { } // Used primarily for testing purposes. -impl Default for MarketBonds { +impl Default for MarketBonds { fn default() -> Self { MarketBonds { creation: None, @@ -243,34 +231,34 @@ impl Default for MarketBonds { } } -impl MaxEncodedLen for Market +impl MaxEncodedLen + for Market where - AI: MaxEncodedLen, - BA: MaxEncodedLen, - BN: MaxEncodedLen, - M: MaxEncodedLen, - A: MaxEncodedLen, - MI: MaxEncodedLen, + AccountId: MaxEncodedLen, + Balance: MaxEncodedLen, + BlockNumber: MaxEncodedLen, + Moment: MaxEncodedLen, + MarketId: MaxEncodedLen, { fn max_encoded_len() -> usize { - AI::max_encoded_len() - .saturating_add(MI::max_encoded_len()) - .saturating_add(A::max_encoded_len()) + AccountId::max_encoded_len() + .saturating_add(MarketId::max_encoded_len()) + .saturating_add(Asset::::max_encoded_len()) .saturating_add(MarketCreation::max_encoded_len()) .saturating_add(Perbill::max_encoded_len()) - .saturating_add(AI::max_encoded_len()) + .saturating_add(AccountId::max_encoded_len()) // We assume that at max. a 512 bit hash function is used .saturating_add(u8::max_encoded_len().saturating_mul(68)) .saturating_add(MarketType::max_encoded_len()) - .saturating_add(>::max_encoded_len()) - .saturating_add(Deadlines::::max_encoded_len()) + .saturating_add(>::max_encoded_len()) + .saturating_add(Deadlines::::max_encoded_len()) .saturating_add(ScoringRule::max_encoded_len()) .saturating_add(MarketStatus::max_encoded_len()) - .saturating_add(>>::max_encoded_len()) + .saturating_add(>>::max_encoded_len()) .saturating_add(>::max_encoded_len()) .saturating_add(>::max_encoded_len()) - .saturating_add(>::max_encoded_len()) - .saturating_add(>>::max_encoded_len()) + .saturating_add(>::max_encoded_len()) + .saturating_add(>>::max_encoded_len()) } } @@ -326,22 +314,27 @@ pub enum MarketDisputeMechanism { /// 3. With inclusive ranges it is not possible to express empty ranges and this feature /// mostly conflicts with existent tests and corner cases. #[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] -pub enum MarketPeriod { - Block(Range), - Timestamp(Range), +pub enum MarketPeriod { + Block(Range), + Timestamp(Range), } -impl MaxEncodedLen for MarketPeriod { +impl MaxEncodedLen + for MarketPeriod +{ fn max_encoded_len() -> usize { // Since it is an enum, the biggest element is the only one of interest here. - BN::max_encoded_len().max(M::max_encoded_len()).saturating_mul(2).saturating_add(1) + BlockNumber::max_encoded_len() + .max(Moment::max_encoded_len()) + .saturating_mul(2) + .saturating_add(1) } } #[derive(Clone, Decode, Encode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo)] -pub struct EarlyClose { - pub old: MarketPeriod, - pub new: MarketPeriod, +pub struct EarlyClose { + pub old: MarketPeriod, + pub new: MarketPeriod, pub state: EarlyCloseState, } @@ -357,10 +350,10 @@ pub enum EarlyCloseState { #[derive( Clone, Copy, Decode, Default, Encode, Eq, MaxEncodedLen, PartialEq, RuntimeDebug, TypeInfo, )] -pub struct Deadlines { - pub grace_period: BN, - pub oracle_duration: BN, - pub dispute_duration: BN, +pub struct Deadlines { + pub grace_period: BlockNumber, + pub oracle_duration: BlockNumber, + pub dispute_duration: BlockNumber, } #[derive(TypeInfo, Clone, Copy, Encode, Eq, Decode, MaxEncodedLen, PartialEq, RuntimeDebug)] @@ -424,13 +417,10 @@ pub enum ResolutionMechanism { #[cfg(test)] mod tests { - use crate::{ - market::*, - types::{Asset, MarketAsset}, - }; + use crate::{market::*, types::Asset}; use test_case::test_case; type MarketId = u128; - type Market = crate::market::Market, MarketId>; + type Market = crate::market::Market; #[test_case( MarketType::Categorical(6), @@ -514,28 +504,28 @@ mod tests { #[test_case( MarketType::Categorical(2), ScoringRule::AmmCdaHybrid, - vec![MarketAsset::CategoricalOutcome(0, 0), MarketAsset::CategoricalOutcome(0, 1)]; + vec![Asset::CategoricalOutcome(0, 0), Asset::CategoricalOutcome(0, 1)]; "categorical_market_amm_cda_hybrid" )] #[test_case( MarketType::Categorical(2), ScoringRule::Parimutuel, - vec![MarketAsset::ParimutuelShare(0, 0), MarketAsset::ParimutuelShare(0, 1)]; + vec![Asset::ParimutuelShare(0, 0), Asset::ParimutuelShare(0, 1)]; "categorical_market_parimutuel" )] #[test_case( MarketType::Scalar(12..=34), ScoringRule::AmmCdaHybrid, vec![ - MarketAsset::ScalarOutcome(0, ScalarPosition::Long), - MarketAsset::ScalarOutcome(0, ScalarPosition::Short), + Asset::ScalarOutcome(0, ScalarPosition::Long), + Asset::ScalarOutcome(0, ScalarPosition::Short), ]; "scalar_market" )] fn provides_correct_list_of_assets( market_type: MarketType, scoring_rule: ScoringRule, - expected: Vec, + expected: Vec>, ) { let market = Market { market_id: 0, @@ -567,14 +557,14 @@ mod tests { MarketType::Categorical(2), ScoringRule::AmmCdaHybrid, OutcomeReport::Categorical(2), - Some(MarketAsset::CategoricalOutcome(0, 2)); + Some(Asset::CategoricalOutcome(0, 2)); "categorical_market_amm_cda_hybrid" )] #[test_case( MarketType::Categorical(2), ScoringRule::Parimutuel, OutcomeReport::Categorical(2), - Some(MarketAsset::ParimutuelShare(0, 2)); + Some(Asset::ParimutuelShare(0, 2)); "categorical_market_parimutuel" )] #[test_case( @@ -588,7 +578,7 @@ mod tests { market_type: MarketType, scoring_rule: ScoringRule, outcome: OutcomeReport, - expected: Option, + expected: Option>, ) { let report = Some(Report { at: Default::default(), diff --git a/primitives/src/serde_wrapper.rs b/primitives/src/serde_wrapper.rs new file mode 100644 index 000000000..cf1a9861b --- /dev/null +++ b/primitives/src/serde_wrapper.rs @@ -0,0 +1,66 @@ +// Copyright 2024 Forecasting Technologies LTD. +// Copyright 2021-2022 Zeitgeist PM LLC. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +#[cfg(feature = "std")] +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +/// Used to workaround serde serialization/deserialization problems involving `u128`. +/// +/// # Types +/// +/// * `B`: Balance +#[derive( + scale_info::TypeInfo, + Clone, + Copy, + Debug, + Decode, + Default, + Encode, + Eq, + MaxEncodedLen, + Ord, + PartialEq, + PartialOrd, +)] +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +pub struct SerdeWrapper( + #[cfg_attr(feature = "std", serde(bound(serialize = "B: std::fmt::Display")))] + #[cfg_attr(feature = "std", serde(serialize_with = "serialize_as_string"))] + #[cfg_attr(feature = "std", serde(bound(deserialize = "B: std::str::FromStr")))] + #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_string"))] + pub B, +); + +#[cfg(feature = "std")] +fn serialize_as_string( + t: &T, + serializer: S, +) -> Result { + serializer.serialize_str(&t.to_string()) +} + +#[cfg(feature = "std")] +fn deserialize_from_string<'de, D: Deserializer<'de>, T: std::str::FromStr>( + deserializer: D, +) -> Result { + let s = String::deserialize(deserializer)?; + s.parse::().map_err(|_| serde::de::Error::custom("Parse from string failed")) +} diff --git a/primitives/src/traits.rs b/primitives/src/traits.rs index 7d7bde094..1298baa68 100644 --- a/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -25,9 +25,7 @@ mod hybrid_router_orderbook_api; mod market_builder; mod market_commons_pallet_api; mod market_id; -mod market_transition_api; mod swaps; -mod weights; mod zeitgeist_asset; pub use complete_set_operations_api::*; @@ -39,7 +37,5 @@ pub use hybrid_router_orderbook_api::*; pub use market_builder::*; pub use market_commons_pallet_api::*; pub use market_id::*; -pub use market_transition_api::*; pub use swaps::*; -pub use weights::*; pub use zeitgeist_asset::*; diff --git a/primitives/src/traits/dispute_api.rs b/primitives/src/traits/dispute_api.rs index 8ef6b952b..c8e2c279f 100644 --- a/primitives/src/traits/dispute_api.rs +++ b/primitives/src/traits/dispute_api.rs @@ -20,11 +20,11 @@ extern crate alloc; use crate::{ outcome_report::OutcomeReport, - types::{BaseAsset, GlobalDisputeItem, Market, ResultWithWeightInfo}, + types::{GlobalDisputeItem, Market, ResultWithWeightInfo}, }; use alloc::vec::Vec; use frame_support::pallet_prelude::Weight; -use parity_scale_codec::{HasCompact, MaxEncodedLen}; +use parity_scale_codec::MaxEncodedLen; use sp_runtime::DispatchError; // Abstraction of the market type, which is not a part of `DisputeApi` because Rust doesn't support @@ -34,7 +34,6 @@ pub type MarketOfDisputeApi = Market< ::Balance, ::BlockNumber, ::Moment, - BaseAsset, ::MarketId, >; @@ -46,7 +45,7 @@ pub trait DisputeApi { type Balance; type NegativeImbalance; type BlockNumber; - type MarketId: MaxEncodedLen + HasCompact; + type MarketId: MaxEncodedLen; type Moment; type Origin; @@ -151,7 +150,6 @@ pub type MarketOfDisputeResolutionApi = Market< ::Balance, ::BlockNumber, ::Moment, - BaseAsset, ::MarketId, >; @@ -159,7 +157,7 @@ pub trait DisputeResolutionApi { type AccountId; type Balance; type BlockNumber; - type MarketId: MaxEncodedLen + HasCompact; + type MarketId: MaxEncodedLen; type Moment; /// Resolve a market. diff --git a/primitives/src/traits/market_builder.rs b/primitives/src/traits/market_builder.rs index 7f682c8d7..0bf0d2cf3 100644 --- a/primitives/src/traits/market_builder.rs +++ b/primitives/src/traits/market_builder.rs @@ -16,7 +16,7 @@ // along with Zeitgeist. If not, see . use crate::types::{ - Deadlines, EarlyClose, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, + Asset, Deadlines, EarlyClose, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, OutcomeReport, Report, ScoringRule, }; use alloc::vec::Vec; @@ -36,26 +36,28 @@ macro_rules! builder_methods { /// builder.field1(value1).field2(value2); /// builder.clone().build() /// ``` -pub trait MarketBuilderTrait { - fn build(self) -> Result, DispatchError>; +pub trait MarketBuilderTrait { + fn build( + self, + ) -> Result, DispatchError>; builder_methods! { - market_id: MI, - base_asset: A, - creator: AI, + market_id: MarketId, + base_asset: Asset, + creator: AccountId, creation: MarketCreation, creator_fee: Perbill, - oracle: AI, + oracle: AccountId, metadata: Vec, market_type: MarketType, - period: MarketPeriod, - deadlines: Deadlines, + period: MarketPeriod, + deadlines: Deadlines, scoring_rule: ScoringRule, status: MarketStatus, - report: Option>, + report: Option>, resolved_outcome: Option, dispute_mechanism: Option, - bonds: MarketBonds, - early_close: Option>, + bonds: MarketBonds, + early_close: Option>, } } diff --git a/primitives/src/traits/market_commons_pallet_api.rs b/primitives/src/traits/market_commons_pallet_api.rs index 3b5293d38..c75725295 100644 --- a/primitives/src/traits/market_commons_pallet_api.rs +++ b/primitives/src/traits/market_commons_pallet_api.rs @@ -20,7 +20,7 @@ use crate::{ traits::MarketBuilderTrait, - types::{BaseAsset, Market, PoolId}, + types::{Market, PoolId}, }; use frame_support::{ dispatch::{fmt::Debug, DispatchError, DispatchResult}, @@ -28,17 +28,16 @@ use frame_support::{ storage::PrefixIterator, Parameter, }; -use parity_scale_codec::{FullCodec, HasCompact, MaxEncodedLen}; +use parity_scale_codec::{FullCodec, MaxEncodedLen}; use sp_runtime::traits::{AtLeast32Bit, AtLeast32BitUnsigned}; // Abstraction of the market type, which is not a part of `MarketCommonsPalletApi` because Rust // doesn't support type aliases in traits. -pub type MarketOf = Market< +type MarketOf = Market< ::AccountId, ::Balance, ::BlockNumber, ::Moment, - BaseAsset, ::MarketId, >; @@ -59,7 +58,6 @@ pub trait MarketCommonsPalletApi { + Default + MaybeSerializeDeserialize + MaxEncodedLen - + HasCompact + Member + Parameter; type Moment: AtLeast32Bit + Copy + Default + Parameter + MaxEncodedLen; @@ -105,7 +103,6 @@ pub trait MarketCommonsPalletApi { Self::Balance, Self::BlockNumber, Self::Moment, - BaseAsset, Self::MarketId, >; diff --git a/primitives/src/traits/market_id.rs b/primitives/src/traits/market_id.rs index 1965d408c..cd0007fb5 100644 --- a/primitives/src/traits/market_id.rs +++ b/primitives/src/traits/market_id.rs @@ -1,4 +1,4 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -20,18 +20,11 @@ use frame_support::{ pallet_prelude::{MaybeSerializeDeserialize, Member}, Parameter, }; -use parity_scale_codec::{HasCompact, MaxEncodedLen}; +use parity_scale_codec::MaxEncodedLen; use sp_runtime::traits::AtLeast32Bit; pub trait MarketId: - AtLeast32Bit - + Copy - + Default - + HasCompact - + MaxEncodedLen - + MaybeSerializeDeserialize - + Member - + Parameter + AtLeast32Bit + Copy + Default + MaxEncodedLen + MaybeSerializeDeserialize + Member + Parameter { } @@ -39,7 +32,6 @@ impl MarketId for T where T: AtLeast32Bit + Copy + Default - + HasCompact + MaxEncodedLen + MaybeSerializeDeserialize + Member diff --git a/primitives/src/traits/market_transition_api.rs b/primitives/src/traits/market_transition_api.rs deleted file mode 100644 index 46a613eaa..000000000 --- a/primitives/src/traits/market_transition_api.rs +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::types::ResultWithWeightInfo; -use frame_support::pallet_prelude::{DispatchResult, Weight}; - -/// API that is used to catch market state transitions. -pub trait MarketTransitionApi { - fn on_proposal(_market_id: &MI) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_activation(_market_id: &MI) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_closure(_market_id: &MI) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_report(_market_id: &MI) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_dispute(_market_id: &MI) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_resolution(_market_id: &MI) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } -} - -#[impl_trait_for_tuples::impl_for_tuples(8)] -#[allow(clippy::let_and_return)] -/// Implementation returns on first error or after successful execution of all elements. -impl MarketTransitionApi for Tuple { - fn on_proposal(market_id: &MI) -> ResultWithWeightInfo { - let mut collective_result = ResultWithWeightInfo::new(Ok(()), Weight::zero()); - for_tuples!( #( - let result = Tuple::on_proposal(market_id); - collective_result.result = result.result; - collective_result.weight = collective_result.weight.saturating_add(result.weight); - if collective_result.result.is_err() { - return collective_result; - } - )* ); - collective_result - } - fn on_activation(market_id: &MI) -> ResultWithWeightInfo { - let mut collective_result = ResultWithWeightInfo::new(Ok(()), Weight::zero()); - for_tuples!( #( - let result = Tuple::on_activation(market_id); - collective_result.result = result.result; - collective_result.weight = collective_result.weight.saturating_add(result.weight); - if collective_result.result.is_err() { - return collective_result; - } - )* ); - collective_result - } - fn on_closure(market_id: &MI) -> ResultWithWeightInfo { - let mut collective_result = ResultWithWeightInfo::new(Ok(()), Weight::zero()); - for_tuples!( #( - let result = Tuple::on_closure(market_id); - collective_result.result = result.result; - collective_result.weight = collective_result.weight.saturating_add(result.weight); - if collective_result.result.is_err() { - return collective_result; - } - )* ); - collective_result - } - fn on_report(market_id: &MI) -> ResultWithWeightInfo { - let mut collective_result = ResultWithWeightInfo::new(Ok(()), Weight::zero()); - for_tuples!( #( - let result = Tuple::on_report(market_id); - collective_result.result = result.result; - collective_result.weight = collective_result.weight.saturating_add(result.weight); - if collective_result.result.is_err() { - return collective_result; - } - )* ); - collective_result - } - fn on_dispute(market_id: &MI) -> ResultWithWeightInfo { - let mut collective_result = ResultWithWeightInfo::new(Ok(()), Weight::zero()); - for_tuples!( #( - let result = Tuple::on_dispute(market_id); - collective_result.result = result.result; - collective_result.weight = collective_result.weight.saturating_add(result.weight); - if collective_result.result.is_err() { - return collective_result; - } - )* ); - collective_result - } - fn on_resolution(market_id: &MI) -> ResultWithWeightInfo { - let mut collective_result = ResultWithWeightInfo::new(Ok(()), Weight::zero()); - for_tuples!( #( - let result = Tuple::on_resolution(market_id); - collective_result.result = result.result; - collective_result.weight = collective_result.weight.saturating_add(result.weight); - if collective_result.result.is_err() { - return collective_result; - } - )* ); - collective_result - } -} - -#[cfg(test)] -mod tests { - use super::*; - use frame_support::pallet_prelude::DispatchError; - - const DEFAULT_ERROR: DispatchResult = Err(DispatchError::Other("unimportant")); - const ONE: Weight = Weight::from_all(1); - const TWO: Weight = Weight::from_all(2); - const THREE: Weight = Weight::from_all(3); - - struct ExecutionPath; - impl MarketTransitionApi for ExecutionPath { - fn on_proposal(_market_id: &u128) -> ResultWithWeightInfo { - panic!("on_proposal"); - } - fn on_activation(_market_id: &u128) -> ResultWithWeightInfo { - panic!("on_activation"); - } - fn on_closure(_market_id: &u128) -> ResultWithWeightInfo { - panic!("on_closure"); - } - fn on_report(_market_id: &u128) -> ResultWithWeightInfo { - panic!("on_report"); - } - fn on_dispute(_market_id: &u128) -> ResultWithWeightInfo { - panic!("on_dispute"); - } - fn on_resolution(_market_id: &u128) -> ResultWithWeightInfo { - panic!("on_resolution"); - } - } - - struct SuccessPath; - impl MarketTransitionApi for SuccessPath { - fn on_proposal(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), ONE) - } - fn on_activation(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), ONE) - } - fn on_closure(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), ONE) - } - fn on_report(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), ONE) - } - fn on_dispute(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), ONE) - } - fn on_resolution(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(Ok(()), ONE) - } - } - - struct FailurePath; - impl MarketTransitionApi for FailurePath { - fn on_proposal(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(DEFAULT_ERROR, TWO) - } - fn on_activation(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(DEFAULT_ERROR, TWO) - } - fn on_closure(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(DEFAULT_ERROR, TWO) - } - fn on_report(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(DEFAULT_ERROR, TWO) - } - fn on_dispute(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(DEFAULT_ERROR, TWO) - } - fn on_resolution(_market_id: &u128) -> ResultWithWeightInfo { - ResultWithWeightInfo::new(DEFAULT_ERROR, TWO) - } - } - - #[test] - #[should_panic(expected = "on_proposal")] - fn correct_execution_path_for_tuples_on_proposal() { - <(ExecutionPath,)>::on_proposal(&0); - } - - #[test] - #[should_panic(expected = "on_activation")] - fn correct_execution_path_for_tuples_on_activation() { - <(ExecutionPath,)>::on_activation(&0); - } - - #[test] - #[should_panic(expected = "on_closure")] - fn correct_execution_path_for_tuples_on_closure() { - <(ExecutionPath,)>::on_closure(&0); - } - - #[test] - #[should_panic(expected = "on_report")] - fn correct_execution_path_for_tuples_on_report() { - <(ExecutionPath,)>::on_report(&0); - } - - #[test] - #[should_panic(expected = "on_dispute")] - fn correct_execution_path_for_tuples_on_dispute() { - <(ExecutionPath,)>::on_dispute(&0); - } - - #[test] - #[should_panic(expected = "on_resolution")] - fn correct_execution_path_for_tuples_on_resolution() { - <(ExecutionPath,)>::on_resolution(&0); - } - - #[test] - fn provides_correct_result_on_proposal() { - let mut result = <(SuccessPath,)>::on_proposal(&0); - assert_eq!(result.result, Ok(())); - assert_eq!(result.weight, ONE); - - result = <(SuccessPath, FailurePath)>::on_proposal(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, THREE); - - result = <(FailurePath, SuccessPath)>::on_proposal(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, TWO); - } - - #[test] - fn provides_correct_result_on_activation() { - let mut result = <(SuccessPath,)>::on_activation(&0); - assert_eq!(result.result, Ok(())); - assert_eq!(result.weight, ONE); - - result = <(SuccessPath, FailurePath)>::on_activation(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, THREE); - - result = <(FailurePath, SuccessPath)>::on_activation(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, TWO); - } - - #[test] - fn provides_correct_result_on_closure() { - let mut result = <(SuccessPath,)>::on_closure(&0); - assert_eq!(result.result, Ok(())); - assert_eq!(result.weight, ONE); - - result = <(SuccessPath, FailurePath)>::on_closure(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, THREE); - - result = <(FailurePath, SuccessPath)>::on_closure(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, TWO); - } - - #[test] - fn provides_correct_result_on_report() { - let mut result = <(SuccessPath,)>::on_report(&0); - assert_eq!(result.result, Ok(())); - assert_eq!(result.weight, ONE); - - result = <(SuccessPath, FailurePath)>::on_report(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, THREE); - - result = <(FailurePath, SuccessPath)>::on_report(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, TWO); - } - - #[test] - fn provides_correct_result_on_dispute() { - let mut result = <(SuccessPath,)>::on_dispute(&0); - assert_eq!(result.result, Ok(())); - assert_eq!(result.weight, ONE); - - result = <(SuccessPath, FailurePath)>::on_dispute(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, THREE); - - result = <(FailurePath, SuccessPath)>::on_dispute(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, TWO); - } - - #[test] - fn provides_correct_result_on_resolution() { - let mut result = <(SuccessPath,)>::on_resolution(&0); - assert_eq!(result.result, Ok(())); - assert_eq!(result.weight, ONE); - - result = <(SuccessPath, FailurePath)>::on_resolution(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, THREE); - - result = <(FailurePath, SuccessPath)>::on_resolution(&0); - assert_eq!(result.result, DEFAULT_ERROR); - assert_eq!(result.weight, TWO); - } -} diff --git a/primitives/src/traits/swaps.rs b/primitives/src/traits/swaps.rs index 415c163bd..cff467ac9 100644 --- a/primitives/src/traits/swaps.rs +++ b/primitives/src/traits/swaps.rs @@ -18,12 +18,12 @@ use crate::types::PoolId; use alloc::vec::Vec; -use frame_support::dispatch::{DispatchError, DispatchResult, Weight}; -use parity_scale_codec::{HasCompact, MaxEncodedLen}; +use frame_support::dispatch::{DispatchError, Weight}; +use sp_runtime::DispatchResult; pub trait Swaps { - type Asset: MaxEncodedLen; - type Balance: HasCompact + MaxEncodedLen; + type Asset; + type Balance; /// Creates a new pool. /// diff --git a/primitives/src/traits/weights.rs b/primitives/src/traits/weights.rs deleted file mode 100644 index 8cc25046b..000000000 --- a/primitives/src/traits/weights.rs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// Copyright 2023 Parity Technologies (UK) Ltd. - -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -/// Provides `checked_div_per_component` implementation to determine the -/// smallest division result between two `ref_time` and `proof_size`. -/// To be removed once sp-weights is upgraded to polkadot-v0.9.39 -use frame_support::pallet_prelude::Weight; - -pub trait CheckedDivPerComponent { - /// Calculates how many `other` fit into `self`. - /// - /// Divides each component of `self` against the same component of `other`. Returns the minimum - /// of all those divisions. Returns `None` in case **all** components of `other` are zero. - /// - /// This returns `Some` even if some components of `other` are zero as long as there is at least - /// one non-zero component in `other`. The division for this particular component will then - /// yield the maximum value (e.g u64::MAX). This is because we assume not every operation and - /// hence each `Weight` will necessarily use each resource. - fn checked_div_per_component(self, other: &Self) -> Option; -} - -impl CheckedDivPerComponent for Weight { - fn checked_div_per_component(self, other: &Self) -> Option { - let mut all_zero = true; - let ref_time = match self.ref_time().checked_div(other.ref_time()) { - Some(ref_time) => { - all_zero = false; - ref_time - } - None => u64::MAX, - }; - let proof_size = match self.proof_size().checked_div(other.proof_size()) { - Some(proof_size) => { - all_zero = false; - proof_size - } - None => u64::MAX, - }; - if all_zero { - None - } else { - Some(if ref_time < proof_size { ref_time } else { proof_size }) - } - } -} diff --git a/primitives/src/types.rs b/primitives/src/types.rs index 68ce0b1c1..417a71cc5 100644 --- a/primitives/src/types.rs +++ b/primitives/src/types.rs @@ -17,7 +17,8 @@ // along with Zeitgeist. If not, see . pub use crate::{ - assets::*, market::*, max_runtime_usize::*, outcome_report::OutcomeReport, proxy_type::*, + asset::*, market::*, max_runtime_usize::*, outcome_report::OutcomeReport, proxy_type::*, + serde_wrapper::*, }; #[cfg(feature = "arbitrary")] use arbitrary::{Arbitrary, Result, Unstructured}; @@ -77,38 +78,10 @@ impl<'a> Arbitrary<'a> for MultiHash { } } -/// ORML adapter. +/// ORML adapter pub type BasicCurrencyAdapter = orml_currencies::BasicCurrencyAdapter; -/// ID type for any asset class. -pub type Assets = Asset; - -/// Asset type representing base assets used by prediction markets. -pub type BaseAsset = BaseAssetClass; - -/// Asset type representing campaign assets. -pub type CampaignAsset = CampaignAssetClass; - -// ID type of the campaign asset class. -pub type CampaignAssetId = u128; - -/// Asset type representing custom assets. -pub type CustomAsset = CustomAssetClass; - -// ID type of the custom asset class. -pub type CustomAssetId = u128; - -// Asset type representing currencies (excluding ZTG). -pub type Currencies = CurrencyClass; - -/// Asset type representing assets used by prediction markets. -pub type MarketAsset = MarketAssetClass; - -/// Asset type representing assets used in parimutuel markets. -pub type ParimutuelAsset = ParimutuelAssetClass; - -/// Asset type representing assets that can be transferred via XCM. -pub type XcmAsset = XcmAssetClass; +pub type CurrencyId = Asset; /// The asset id specifically used for pallet_assets_tx_payment for /// paying transaction fees in different assets. @@ -156,12 +129,6 @@ pub struct ResultWithWeightInfo { pub weight: Weight, } -impl ResultWithWeightInfo { - pub fn new(result: R, weight: Weight) -> Self { - ResultWithWeightInfo { result, weight } - } -} - #[derive( Clone, Copy, diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 7350447ee..c8cef23a1 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -11,7 +11,6 @@ orml-currencies = { workspace = true } orml-tokens = { workspace = true } orml-traits = { workspace = true } pallet-asset-tx-payment = { workspace = true } -pallet-assets = { workspace = true } pallet-balances = { workspace = true } pallet-bounties = { workspace = true } pallet-collective = { workspace = true } @@ -109,7 +108,6 @@ xcm-executor = { workspace = true, optional = true } common-runtime = { workspace = true } zeitgeist-primitives = { workspace = true } -zrml-asset-router = { workspace = true } zrml-authorized = { workspace = true } zrml-court = { workspace = true } zrml-global-disputes = { workspace = true, optional = true } @@ -186,7 +184,6 @@ runtime-benchmarks = [ "orml-benchmarking", "orml-tokens/runtime-benchmarks", "orml-xtokens?/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", "pallet-author-inherent?/runtime-benchmarks", "pallet-author-mapping?/runtime-benchmarks", "pallet-author-slot-filter?/runtime-benchmarks", @@ -237,7 +234,6 @@ std = [ "orml-currencies/std", "orml-tokens/std", "orml-traits/std", - "pallet-assets/std", "pallet-asset-tx-payment/std", "pallet-balances/std", "pallet-bounties/std", @@ -360,7 +356,6 @@ try-runtime = [ "pallet-preimage/try-runtime", # Money runtime pallets - "pallet-assets/try-runtime", "pallet-asset-tx-payment/try-runtime", "pallet-balances/try-runtime", "pallet-bounties/try-runtime", @@ -387,7 +382,6 @@ try-runtime = [ "orml-xtokens?/try-runtime", # Zeitgeist runtime pallets - "zrml-asset-router/try-runtime", "zrml-authorized/try-runtime", "zrml-court/try-runtime", "zrml-hybrid-router/try-runtime", diff --git a/runtime/battery-station/src/integration_tests/xcm/setup.rs b/runtime/battery-station/src/integration_tests/xcm/setup.rs index 092184ade..2550140f3 100644 --- a/runtime/battery-station/src/integration_tests/xcm/setup.rs +++ b/runtime/battery-station/src/integration_tests/xcm/setup.rs @@ -18,7 +18,8 @@ use crate::{ xcm_config::config::{battery_station, general_key}, - AccountId, AssetRegistry, Assets, Balance, ExistentialDeposit, Runtime, RuntimeOrigin, System, + AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Runtime, RuntimeOrigin, + System, }; use frame_support::{assert_ok, traits::GenesisBuild}; use orml_traits::asset_registry::AssetMetadata; @@ -27,10 +28,10 @@ use xcm::{ latest::{Junction::Parachain, Junctions::X2, MultiLocation}, VersionedMultiLocation, }; -use zeitgeist_primitives::types::{CustomMetadata, XcmAsset}; +use zeitgeist_primitives::types::{Asset, CustomMetadata}; pub(super) struct ExtBuilder { - balances: Vec<(AccountId, Assets, Balance)>, + balances: Vec<(AccountId, CurrencyId, Balance)>, parachain_id: u32, } @@ -41,7 +42,7 @@ impl Default for ExtBuilder { } impl ExtBuilder { - pub fn set_balances(mut self, balances: Vec<(AccountId, Assets, Balance)>) -> Self { + pub fn set_balances(mut self, balances: Vec<(AccountId, CurrencyId, Balance)>) -> Self { self.balances = balances; self } @@ -53,7 +54,7 @@ impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - let native_currency_id = Assets::Ztg; + let native_currency_id = CurrencyId::Ztg; pallet_balances::GenesisConfig:: { balances: self .balances @@ -71,9 +72,6 @@ impl ExtBuilder { .balances .into_iter() .filter(|(_, currency_id, _)| *currency_id != native_currency_id) - .map(|(account_id, currency_id, initial_balance)| { - (account_id, currency_id.try_into().unwrap(), initial_balance) - }) .collect::>(), } .assimilate_storage(&mut t) @@ -106,10 +104,10 @@ pub const BOB: AccountId32 = AccountId32::new([1u8; 32]); pub const PARA_ID_SIBLING: u32 = 3000; /// IDs that are used to represent tokens from other chains -pub const FOREIGN_ZTG_ID: XcmAsset = XcmAsset::ForeignAsset(0); -pub const FOREIGN_PARENT_ID: XcmAsset = XcmAsset::ForeignAsset(1); -pub const FOREIGN_SIBLING_ID: XcmAsset = XcmAsset::ForeignAsset(2); -pub const BTC_ID: XcmAsset = XcmAsset::ForeignAsset(3); +pub const FOREIGN_ZTG_ID: Asset = CurrencyId::ForeignAsset(0); +pub const FOREIGN_PARENT_ID: Asset = CurrencyId::ForeignAsset(1); +pub const FOREIGN_SIBLING_ID: Asset = CurrencyId::ForeignAsset(2); +pub const BTC_ID: Asset = CurrencyId::ForeignAsset(3); #[inline] pub(super) const fn ztg(amount: Balance) -> Balance { diff --git a/runtime/battery-station/src/integration_tests/xcm/test_net.rs b/runtime/battery-station/src/integration_tests/xcm/test_net.rs index 2ee922bc5..a847389d4 100644 --- a/runtime/battery-station/src/integration_tests/xcm/test_net.rs +++ b/runtime/battery-station/src/integration_tests/xcm/test_net.rs @@ -17,8 +17,8 @@ // along with Zeitgeist. If not, see . use crate::{ - parameters::ZeitgeistTreasuryAccount, xcm_config::config::battery_station, Assets, DmpQueue, - Runtime, RuntimeOrigin, XcmpQueue, + parameters::ZeitgeistTreasuryAccount, xcm_config::config::battery_station, CurrencyId, + DmpQueue, Runtime, RuntimeOrigin, XcmpQueue, }; use frame_support::{traits::GenesisBuild, weights::Weight}; use polkadot_primitives::{ @@ -102,9 +102,9 @@ pub(super) fn relay_ext() -> sp_io::TestExternalities { pub(super) fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { ExtBuilder::default() .set_balances(vec![ - (ALICE, Assets::Ztg, ztg(10)), - (ALICE, FOREIGN_PARENT_ID.into(), roc(10)), - (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID.into(), roc(1)), + (ALICE, CurrencyId::Ztg, ztg(10)), + (ALICE, FOREIGN_PARENT_ID, roc(10)), + (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, roc(1)), ]) .set_parachain_id(parachain_id) .build() diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs b/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs index e28c94407..97cbce60b 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs @@ -26,97 +26,82 @@ use crate::{ test_net::Zeitgeist, }, xcm_config::config::{battery_station, general_key, AssetConvert}, - Assets, CustomMetadata, ScalarPosition, XcmAsset, + CurrencyId, }; -use core::fmt::Debug; + use frame_support::assert_err; use sp_runtime::traits::Convert as C2; -use test_case::test_case; use xcm::latest::{Junction::*, Junctions::*, MultiLocation}; use xcm_emulator::TestExt; use xcm_executor::traits::Convert as C1; -fn convert_common_native(expected: T) -where - T: Copy + Debug + PartialEq, - AssetConvert: C1 + C2>, -{ +#[test] +fn convert_native() { assert_eq!(battery_station::KEY.to_vec(), vec![0, 1]); // The way Ztg is represented relative within the Zeitgeist runtime let ztg_location_inner: MultiLocation = MultiLocation::new(0, X1(general_key(battery_station::KEY))); - assert_eq!(>::convert(ztg_location_inner), Ok(expected)); + assert_eq!(>::convert(ztg_location_inner), Ok(CurrencyId::Ztg)); // The canonical way Ztg is represented out in the wild Zeitgeist::execute_with(|| { - assert_eq!(>::convert(expected), Some(foreign_ztg_multilocation())) + assert_eq!( + >::convert(CurrencyId::Ztg), + Some(foreign_ztg_multilocation()) + ) }); } -fn convert_common_non_native( - expected: T, - multilocation: MultiLocation, - register: fn(Option), -) where - T: Copy + Debug + PartialEq, - AssetConvert: C1 + C2>, -{ +#[test] +fn convert_any_registered_parent_multilocation() { Zeitgeist::execute_with(|| { - assert_err!(>::convert(multilocation), multilocation); - assert_eq!(>::convert(expected), None); + assert_err!( + >::convert(foreign_parent_multilocation()), + foreign_parent_multilocation() + ); + + assert_eq!(>::convert(FOREIGN_PARENT_ID), None); + // Register parent as foreign asset in the Zeitgeist parachain - register(None); - assert_eq!(>::convert(multilocation), Ok(expected)); - assert_eq!(>::convert(expected), Some(multilocation)); - }); -} + register_foreign_parent(None); -#[test] -fn convert_native_assets() { - convert_common_native(Assets::Ztg); -} + assert_eq!( + >::convert(foreign_parent_multilocation()), + Ok(FOREIGN_PARENT_ID), + ); -#[test] -fn convert_native_xcm_assets() { - convert_common_native(XcmAsset::Ztg); + assert_eq!( + >::convert(FOREIGN_PARENT_ID), + Some(foreign_parent_multilocation()) + ); + }); } #[test] -fn convert_any_registered_parent_multilocation_assets() { - convert_common_non_native( - Assets::from(FOREIGN_PARENT_ID), - foreign_parent_multilocation(), - register_foreign_parent, - ); -} +fn convert_any_registered_sibling_multilocation() { + Zeitgeist::execute_with(|| { + assert_err!( + >::convert(foreign_sibling_multilocation()), + foreign_sibling_multilocation() + ); -#[test] -fn convert_any_registered_parent_multilocation_xcm_assets() { - convert_common_non_native( - XcmAsset::try_from(Assets::from(FOREIGN_PARENT_ID)).unwrap(), - foreign_parent_multilocation(), - register_foreign_parent, - ); -} + assert_eq!(>::convert(FOREIGN_SIBLING_ID), None); -#[test] -fn convert_any_registered_sibling_multilocation_assets() { - convert_common_non_native( - Assets::from(FOREIGN_SIBLING_ID), - foreign_sibling_multilocation(), - register_foreign_sibling, - ); -} + // Register sibling as foreign asset in the Zeitgeist parachain + register_foreign_sibling(None); -#[test] -fn convert_any_registered_sibling_multilocation_xcm_assets() { - convert_common_non_native( - XcmAsset::try_from(Assets::from(FOREIGN_SIBLING_ID)).unwrap(), - foreign_sibling_multilocation(), - register_foreign_sibling, - ); + assert_eq!( + >::convert(foreign_sibling_multilocation()), + Ok(FOREIGN_SIBLING_ID), + ); + + assert_eq!( + >::convert(FOREIGN_SIBLING_ID), + Some(foreign_sibling_multilocation()) + ); + }); } #[test] @@ -125,46 +110,13 @@ fn convert_unkown_multilocation() { MultiLocation::new(1, X2(Parachain(battery_station::ID), general_key(&[42]))); Zeitgeist::execute_with(|| { - assert!(>::convert(unknown_location).is_err()); + assert!(>::convert(unknown_location).is_err()); }); } -#[test_case( - Assets::CategoricalOutcome(7, 8); - "assets_categorical" -)] -#[test_case( - Assets::ScalarOutcome(7, ScalarPosition::Long); - "assets_scalar" -)] -#[test_case( - Assets::PoolShare(7); - "assets_pool_share" -)] -#[test_case( - Assets::ForeignAsset(7); - "assets_foreign" -)] -#[test_case( - Assets::ParimutuelShare(7, 8); - "assets_parimutuel_share" -)] -#[test_case( - Assets::CampaignAsset(7); - "assets_campaign_asset" -)] -#[test_case( - Assets::CustomAsset(7); - "assets_custom_asset" -)] -#[test_case( - XcmAsset::ForeignAsset(7); - "xcm_assets_foreign" -)] -fn convert_unsupported_asset(asset: T) -where - T: Copy + Debug + PartialEq, - AssetConvert: C2>, -{ - Zeitgeist::execute_with(|| assert_eq!(>::convert(asset), None)); +#[test] +fn convert_unsupported_currency() { + Zeitgeist::execute_with(|| { + assert_eq!(>::convert(CurrencyId::CombinatorialOutcome), None) + }); } diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs index 109a388dd..20d7350d3 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs @@ -26,7 +26,7 @@ use crate::{ test_net::{RococoNet, Sibling, TestNet, Zeitgeist}, }, xcm_config::{config::battery_station, fees::default_per_second}, - AssetManager, AssetRegistry, Balance, Balances, RuntimeOrigin, XTokens, + AssetRegistry, Balance, Balances, CurrencyId, RuntimeOrigin, Tokens, XTokens, ZeitgeistTreasuryAccount, }; @@ -36,7 +36,7 @@ use xcm::latest::{Junction, Junction::*, Junctions::*, MultiLocation, WeightLimi use xcm_emulator::TestExt; use zeitgeist_primitives::{ constants::{BalanceFractionalDecimals, BASE}, - types::{CustomMetadata, XcmAsset, XcmMetadata}, + types::{CustomMetadata, XcmMetadata}, }; #[test] @@ -49,8 +49,8 @@ fn transfer_ztg_to_sibling() { Sibling::execute_with(|| { treasury_initial_balance = - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &ZeitgeistTreasuryAccount::get()); - assert_eq!(AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB), 0); + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); register_foreign_ztg(None); }); @@ -59,7 +59,7 @@ fn transfer_ztg_to_sibling() { assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(ALICE), - XcmAsset::Ztg, + CurrencyId::Ztg, transfer_amount, Box::new( MultiLocation::new( @@ -82,14 +82,14 @@ fn transfer_ztg_to_sibling() { }); Sibling::execute_with(|| { - let current_balance = AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB); + let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); // Verify that BOB now has (amount transferred - fee) assert_eq!(current_balance, transfer_amount - ztg_fee()); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &ZeitgeistTreasuryAccount::get()), + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), treasury_initial_balance + ztg_fee() ) }); @@ -123,7 +123,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { Sibling::execute_with(|| { assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), 0); - assert_eq!(AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB), bob_initial_balance); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(BOB), FOREIGN_ZTG_ID, @@ -143,7 +143,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { // Confirm that Bobs's balance is initial balance - amount transferred assert_eq!( - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB), + Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance - transfer_amount ); }); @@ -181,12 +181,8 @@ fn transfer_btc_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { register_btc(None); - treasury_initial_balance = - AssetManager::free_balance(BTC_ID.into(), &ZeitgeistTreasuryAccount::get()); - assert_eq!( - AssetManager::free_balance(BTC_ID.into(), &ALICE), - zeitgeist_alice_initial_balance, - ); + treasury_initial_balance = Tokens::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()); + assert_eq!(Tokens::free_balance(BTC_ID, &ALICE), zeitgeist_alice_initial_balance,); }); Sibling::execute_with(|| { @@ -200,8 +196,8 @@ fn transfer_btc_sibling_to_zeitgeist() { )); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(ALICE), - // Target chain will interpret XcmAsset::Ztg as BTC in this context. - XcmAsset::Ztg, + // Target chain will interpret CurrencyId::Ztg as BTC in this context. + CurrencyId::Ztg, transfer_amount, Box::new( MultiLocation::new( @@ -232,13 +228,13 @@ fn transfer_btc_sibling_to_zeitgeist() { // Verify that remote Alice now has initial balance + amount transferred - fee assert_eq!( - AssetManager::free_balance(BTC_ID.into(), &ALICE), + Tokens::free_balance(BTC_ID, &ALICE), zeitgeist_alice_initial_balance + expected_adjusted, ); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - AssetManager::free_balance(BTC_ID.into(), &ZeitgeistTreasuryAccount::get()), + Tokens::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()), // Align decimal fractional places treasury_initial_balance + adjusted_balance(btc(1), btc_fee()) ) @@ -256,7 +252,7 @@ fn transfer_btc_zeitgeist_to_sibling() { transfer_btc_sibling_to_zeitgeist(); Sibling::execute_with(|| { - assert_eq!(AssetManager::free_balance(BTC_ID.into(), &BOB), sibling_bob_initial_balance,); + assert_eq!(Tokens::free_balance(BTC_ID, &BOB), sibling_bob_initial_balance,); }); Zeitgeist::execute_with(|| { @@ -278,7 +274,7 @@ fn transfer_btc_zeitgeist_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(AssetManager::free_balance(BTC_ID.into(), &ALICE), 0); + assert_eq!(Tokens::free_balance(BTC_ID, &ALICE), 0); }); Sibling::execute_with(|| { @@ -306,7 +302,7 @@ fn transfer_roc_from_relay_chain() { Zeitgeist::execute_with(|| { register_foreign_parent(None); treasury_initial_balance = - AssetManager::free_balance(FOREIGN_PARENT_ID.into(), &ZeitgeistTreasuryAccount::get()); + Tokens::free_balance(FOREIGN_PARENT_ID, &ZeitgeistTreasuryAccount::get()); }); RococoNet::execute_with(|| { @@ -325,10 +321,10 @@ fn transfer_roc_from_relay_chain() { Zeitgeist::execute_with(|| { let expected = transfer_amount - roc_fee(); let expected_adjusted = adjusted_balance(roc(1), expected); - assert_eq!(AssetManager::free_balance(FOREIGN_PARENT_ID.into(), &BOB), expected_adjusted); + assert_eq!(Tokens::free_balance(FOREIGN_PARENT_ID, &BOB), expected_adjusted); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - AssetManager::free_balance(FOREIGN_PARENT_ID.into(), &ZeitgeistTreasuryAccount::get()), + Tokens::free_balance(FOREIGN_PARENT_ID, &ZeitgeistTreasuryAccount::get()), // Align decimal fractional places treasury_initial_balance + adjusted_balance(roc(1), roc_fee()) ) @@ -344,7 +340,7 @@ fn transfer_roc_to_relay_chain() { transfer_roc_from_relay_chain(); Zeitgeist::execute_with(|| { - let initial_balance = AssetManager::free_balance(FOREIGN_PARENT_ID.into(), &ALICE); + let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE); assert!(initial_balance >= transfer_amount); assert_ok!(XTokens::transfer( @@ -359,7 +355,7 @@ fn transfer_roc_to_relay_chain() { )); assert_eq!( - AssetManager::free_balance(FOREIGN_PARENT_ID.into(), &ALICE), + Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE), initial_balance - transfer_amount_local ) }); @@ -381,8 +377,8 @@ fn transfer_ztg_to_sibling_with_custom_fee() { Sibling::execute_with(|| { treasury_initial_balance = - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &ZeitgeistTreasuryAccount::get()); - assert_eq!(AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB), 0); + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); register_foreign_ztg(None); let custom_metadata = CustomMetadata { @@ -405,7 +401,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(ALICE), - XcmAsset::Ztg, + CurrencyId::Ztg, transfer_amount, Box::new( MultiLocation::new( @@ -428,7 +424,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { }); Sibling::execute_with(|| { - let current_balance = AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB); + let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); let custom_fee = calc_fee(default_per_second(10) * 10); // Verify that BOB now has (amount transferred - fee) @@ -436,7 +432,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &ZeitgeistTreasuryAccount::get()), + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), treasury_initial_balance + custom_fee ) }); diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index 2393a7634..a57a93716 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -30,7 +30,7 @@ use common_runtime::{ }; pub use frame_system::{ Call as SystemCall, CheckEra, CheckGenesis, CheckNonZeroSender, CheckNonce, CheckSpecVersion, - CheckTxVersion, CheckWeight, EnsureNever, + CheckTxVersion, CheckWeight, }; #[cfg(feature = "parachain")] pub use pallet_author_slot_filter::EligibilityValue; @@ -42,17 +42,12 @@ pub use crate::parachain_params::*; pub use crate::parameters::*; use alloc::vec; use frame_support::{ - traits::{ - AsEnsureOriginWithArg, ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly, - InstanceFilter, - }, + traits::{ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter}, weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee, Weight}, }; -use frame_system::{EnsureRoot, EnsureSigned, EnsureWithSuccess}; +use frame_system::{EnsureRoot, EnsureWithSuccess}; use orml_currencies::Call::transfer; -use pallet_assets::Call::{destroy_accounts, destroy_approvals, finish_destroy}; use pallet_collective::{EnsureProportionAtLeast, PrimeDefaultVote}; -use parity_scale_codec::Compact; use sp_runtime::traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256}; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -69,7 +64,7 @@ use zrml_swaps::Call::{ }; #[cfg(feature = "parachain")] use { - frame_support::traits::{Everything, Nothing}, + frame_support::traits::{AsEnsureOriginWithArg, Everything, Nothing}, xcm_builder::{EnsureXcmOrigin, FixedWeightBounds}, xcm_config::{ asset_registry::CustomAssetProcessor, @@ -173,26 +168,6 @@ impl Contains for IsCallable { fn contains(call: &RuntimeCall) -> bool { #[allow(clippy::match_like_matches_macro)] match call { - // Asset destruction is managed. Instead of deleting those dispatchable calls, they are - // filtered here instead to allow root to interact in case of emergency. - RuntimeCall::CampaignAssets(inner_call) => match inner_call { - destroy_accounts { .. } => false, - destroy_approvals { .. } => false, - finish_destroy { .. } => false, - _ => true, - }, - RuntimeCall::CustomAssets(inner_call) => match inner_call { - destroy_accounts { .. } => false, - destroy_approvals { .. } => false, - finish_destroy { .. } => false, - _ => true, - }, - RuntimeCall::MarketAssets(inner_call) => match inner_call { - destroy_accounts { .. } => false, - destroy_approvals { .. } => false, - finish_destroy { .. } => false, - _ => true, - }, RuntimeCall::SimpleDisputes(_) => false, RuntimeCall::LiquidityMining(_) => false, RuntimeCall::PredictionMarkets(inner_call) => match inner_call { diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 2cf328b9c..4e531ce4b 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -22,7 +22,7 @@ clippy::arithmetic_side_effects )] -use super::{CampaignAssetsInstance, Runtime, VERSION}; +use super::{Runtime, VERSION}; use frame_support::{ dispatch::DispatchClass, parameter_types, @@ -35,7 +35,6 @@ use frame_support::{ }; use frame_system::limits::{BlockLength, BlockWeights}; use orml_traits::parameter_type_with_key; -use pallet_assets::WeightInfo; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use sp_runtime::{ traits::{AccountIdConversion, Bounded}, @@ -64,46 +63,6 @@ parameter_types! { } parameter_types! { - // Asset-Router - pub DestroyAccountWeight: Weight = - >::WeightInfo::destroy_accounts(1); - pub DestroyApprovalWeight: Weight = - >::WeightInfo::destroy_approvals(1); - pub DestroyFinishWeight: Weight = - >::WeightInfo::finish_destroy(); - - // Assets (Campaign) - pub const CampaignAssetsAccountDeposit: Balance = deposit(1, 16); - pub const CampaignAssetsApprovalDeposit: Balance = ExistentialDeposit::get(); - /// The amount of native currency that is frozen during the whole lifetime - /// if an asset class. Freezing happens at asset class creation. - /// Irrelevant - No origin can successfully call the associated dispatchable call. - pub const CampaignAssetsDeposit: Balance = BASE; - pub const CampaignAssetsStringLimit: u32 = 256; - pub const CampaignAssetsMetadataDepositBase: Balance = deposit(1, 68); - pub const CampaignAssetsMetadataDepositPerByte: Balance = deposit(0, 1); - - // Assets (Custom) - pub const CustomAssetsAccountDeposit: Balance = deposit(1, 16); - pub const CustomAssetsApprovalDeposit: Balance = ExistentialDeposit::get(); - /// The amount of native currency that is frozen during the whole lifetime - /// of an asset class. Freezing happens at asset class creation. - pub const CustomAssetsDeposit: Balance = BASE; - pub const CustomAssetsStringLimit: u32 = 50; - pub const CustomAssetsMetadataDepositBase: Balance = deposit(1, 68); - pub const CustomAssetsMetadataDepositPerByte: Balance = deposit(0, 1); - - // Assets (Market) - pub const MarketAssetsAccountDeposit: Balance = deposit(1, 16); - pub const MarketAssetsApprovalDeposit: Balance = ExistentialDeposit::get(); - /// The amount of native currency that is frozen during the whole lifetime - /// of an asset class. Freezing happens at asset class creation. - /// Irrelevant - No origin can successfully call the associated dispatchable call. - pub const MarketAssetsDeposit: Balance = BASE; - pub const MarketAssetsStringLimit: u32 = 50; - pub const MarketAssetsMetadataDepositBase: Balance = deposit(1, 68); - pub const MarketAssetsMetadataDepositPerByte: Balance = deposit(0, 1); - // Authorized pub const AuthorizedPalletId: PalletId = AUTHORIZED_PALLET_ID; pub const CorrectionPeriod: BlockNumber = BLOCKS_PER_DAY; @@ -244,7 +203,7 @@ parameter_types! { pub const MaxLiquidityTreeDepth: u32 = 9u32; // ORML - pub const GetNativeCurrencyId: Assets = Asset::Ztg; + pub const GetNativeCurrencyId: CurrencyId = Asset::Ztg; // Prediction Market parameters /// (Slashable) Bond that is provided for creating an advised market that needs approval. @@ -403,8 +362,6 @@ parameter_types! { .build_or_panic(); // Transaction payment - /// A fee multiplier applied to the calculated fee factor for `CampaignAsset` - pub const CampaignAssetFeeMultiplier: u32 = 100; /// A fee mulitplier for Operational extrinsics to compute “virtual tip” /// to boost their priority. pub const OperationalFeeMultiplier: u8 = 5; @@ -512,17 +469,17 @@ parameter_type_with_key! { // are cleaned up automatically. In case of scalar outcomes, the market account can have dust. // Unless LPs use `pool_exit_with_exact_asset_amount`, there can be some dust pool shares remaining. // Explicit match arms are used to ensure new asset types are respected. - pub ExistentialDeposits: |currency_id: Currencies| -> Balance { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { - Currencies::CategoricalOutcome(_, _) => ExistentialDeposit::get(), - Currencies::ParimutuelShare(_, _) => ExistentialDeposit::get(), - Currencies::PoolShare(_) => ExistentialDeposit::get(), - Currencies::ScalarOutcome(_, _) => ExistentialDeposit::get(), + Asset::CategoricalOutcome(_,_) => ExistentialDeposit::get(), + Asset::CombinatorialOutcome => ExistentialDeposit::get(), + Asset::PoolShare(_) => ExistentialDeposit::get(), + Asset::ScalarOutcome(_,_) => ExistentialDeposit::get(), #[cfg(feature = "parachain")] - Currencies::ForeignAsset(id) => { + Asset::ForeignAsset(id) => { let maybe_metadata = < orml_asset_registry::Pallet as orml_traits::asset_registry::Inspect - >::metadata(&XcmAsset::ForeignAsset(*id)); + >::metadata(&Asset::ForeignAsset(*id)); if let Some(metadata) = maybe_metadata { return metadata.existential_deposit; @@ -531,7 +488,9 @@ parameter_type_with_key! { 1 } #[cfg(not(feature = "parachain"))] - Currencies::ForeignAsset(_) => ExistentialDeposit::get(), + Asset::ForeignAsset(_) => ExistentialDeposit::get(), + Asset::Ztg => ExistentialDeposit::get(), + Asset::ParimutuelShare(_,_) => ExistentialDeposit::get(), } }; } diff --git a/runtime/battery-station/src/xcm_config/asset_registry.rs b/runtime/battery-station/src/xcm_config/asset_registry.rs index 9deb85aa0..92746377d 100644 --- a/runtime/battery-station/src/xcm_config/asset_registry.rs +++ b/runtime/battery-station/src/xcm_config/asset_registry.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{Balance, XcmAsset}; +use crate::{Balance, CurrencyId}; use orml_traits::asset_registry::{AssetMetadata, AssetProcessor}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -29,11 +29,11 @@ use zeitgeist_primitives::types::CustomMetadata; /// Only pre check is to ensure an asset id was passed. pub struct CustomAssetProcessor; -impl AssetProcessor> for CustomAssetProcessor { +impl AssetProcessor> for CustomAssetProcessor { fn pre_register( - id: Option, + id: Option, metadata: AssetMetadata, - ) -> Result<(XcmAsset, AssetMetadata), DispatchError> { + ) -> Result<(CurrencyId, AssetMetadata), DispatchError> { match id { Some(id) => Ok((id, metadata)), None => Err(DispatchError::Other("asset-registry: AssetId is required")), @@ -41,7 +41,7 @@ impl AssetProcessor> for Custom } fn post_register( - _id: XcmAsset, + _id: CurrencyId, _asset_metadata: AssetMetadata, ) -> Result<(), DispatchError> { Ok(()) diff --git a/runtime/battery-station/src/xcm_config/config.rs b/runtime/battery-station/src/xcm_config/config.rs index c68d81f3d..e472ce980 100644 --- a/runtime/battery-station/src/xcm_config/config.rs +++ b/runtime/battery-station/src/xcm_config/config.rs @@ -17,9 +17,9 @@ use super::fees::{native_per_second, FixedConversionRateProvider}; use crate::{ - AccountId, AssetManager, AssetRegistry, Assets, Balance, MaxAssetsIntoHolding, MaxInstructions, - ParachainInfo, ParachainSystem, PolkadotXcm, RelayChainOrigin, RelayNetwork, RuntimeCall, - RuntimeOrigin, UnitWeightCost, UniversalLocation, UnknownTokens, XcmpQueue, + AccountId, AssetManager, AssetRegistry, Balance, CurrencyId, MaxAssetsIntoHolding, + MaxInstructions, ParachainInfo, ParachainSystem, PolkadotXcm, RelayChainOrigin, RelayNetwork, + RuntimeCall, RuntimeOrigin, UnitWeightCost, UniversalLocation, UnknownTokens, XcmpQueue, ZeitgeistTreasuryAccount, }; use alloc::vec::Vec; @@ -50,8 +50,8 @@ use xcm_builder::{ SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, }; -use xcm_executor::{traits::TransactAsset, Assets as ExecutorAssets, Config}; -use zeitgeist_primitives::{constants::BalanceFractionalDecimals, types::XcmAsset}; +use xcm_executor::{traits::TransactAsset, Assets, Config}; +use zeitgeist_primitives::{constants::BalanceFractionalDecimals, types::Asset}; pub mod battery_station { #[cfg(test)] @@ -155,7 +155,7 @@ impl TakeRevenue for ToTreasury { if let MultiAsset { id: Concrete(location), fun: Fungible(_amount) } = revenue { if let Ok(asset_id) = - >::convert(location) + >::convert(location) { let adj_am = AlignedFractionalMultiAssetTransactor::adjust_fractional_places(&revenue).fun; @@ -211,9 +211,9 @@ pub struct AlignedFractionalTransactAsset< } impl< - AssetRegistry: Inspect, + AssetRegistry: Inspect, FracDecPlaces: Get, - CurrencyIdConvert: Convert>, + CurrencyIdConvert: Convert>, TransactAssetDelegate: TransactAsset, > AlignedFractionalTransactAsset< @@ -224,41 +224,29 @@ impl< > { fn adjust_fractional_places(asset: &MultiAsset) -> MultiAsset { - let (asset_id, amount) = - if let Some(ref asset_id) = CurrencyIdConvert::convert(asset.clone()) { - if let Fungible(amount) = asset.fun { - (*asset_id, amount) - } else { - return asset.clone(); + if let Some(ref asset_id) = CurrencyIdConvert::convert(asset.clone()) { + if let Fungible(amount) = asset.fun { + let mut asset_updated = asset.clone(); + let native_decimals = u32::from(FracDecPlaces::get()); + let metadata = AssetRegistry::metadata(asset_id); + + if let Some(metadata) = metadata { + let decimals = metadata.decimals; + + asset_updated.fun = if decimals > native_decimals { + let power = decimals.saturating_sub(native_decimals); + let adjust_factor = 10u128.saturating_pow(power); + // Floors the adjusted token amount, thus no tokens are generated + Fungible(amount.saturating_div(adjust_factor)) + } else { + let power = native_decimals.saturating_sub(decimals); + let adjust_factor = 10u128.saturating_pow(power); + Fungible(amount.saturating_mul(adjust_factor)) + }; + + return asset_updated; } - } else { - return asset.clone(); - }; - - let currency = if let Ok(currency) = XcmAsset::try_from(asset_id) { - currency - } else { - return asset.clone(); - }; - - let metadata = AssetRegistry::metadata(¤cy); - if let Some(metadata) = metadata { - let mut asset_adjusted = asset.clone(); - let decimals = metadata.decimals; - let native_decimals = u32::from(FracDecPlaces::get()); - - asset_adjusted.fun = if decimals > native_decimals { - let power = decimals.saturating_sub(native_decimals); - let adjust_factor = 10u128.saturating_pow(power); - // Floors the adjusted token amount, thus no tokens are generated - Fungible(amount.saturating_div(adjust_factor)) - } else { - let power = native_decimals.saturating_sub(decimals); - let adjust_factor = 10u128.saturating_pow(power); - Fungible(amount.saturating_mul(adjust_factor)) - }; - - return asset_adjusted; + } } asset.clone() @@ -266,8 +254,8 @@ impl< } impl< - AssetRegistry: Inspect, - CurrencyIdConvert: Convert>, + AssetRegistry: Inspect, + CurrencyIdConvert: Convert>, FracDecPlaces: Get, TransactAssetDelegate: TransactAsset, > TransactAsset @@ -291,7 +279,7 @@ impl< asset: &MultiAsset, location: &MultiLocation, maybe_context: Option<&XcmContext>, - ) -> Result { + ) -> Result { let asset_adjusted = Self::adjust_fractional_places(asset); TransactAssetDelegate::withdraw_asset(&asset_adjusted, location, maybe_context) } @@ -301,7 +289,7 @@ impl< from: &MultiLocation, to: &MultiLocation, context: &XcmContext, - ) -> Result { + ) -> Result { let asset_adjusted = Self::adjust_fractional_places(asset); TransactAssetDelegate::transfer_asset(&asset_adjusted, from, to, context) } @@ -322,17 +310,17 @@ pub type MultiAssetTransactor = MultiCurrencyAdapter< UnknownTokens, // This means that this adapter should handle any token that `AssetConvert` can convert // using AssetManager and UnknownTokens in all other cases. - IsNativeConcrete, + IsNativeConcrete, // Our chain's account ID type (we can't get away without mentioning it explicitly). AccountId, // Convert an XCM `MultiLocation` into a local account id. LocationToAccountId, // The AssetId that corresponds to the native currency. - Assets, + CurrencyId, // Struct that provides functions to convert `Asset` <=> `MultiLocation`. AssetConvert, // In case of deposit failure, known assets will be placed in treasury. - DepositToAlternative, + DepositToAlternative, >; /// AssetConvert @@ -344,42 +332,33 @@ pub struct AssetConvert; /// Convert our `Asset` type into its `MultiLocation` representation. /// Other chains need to know how this conversion takes place in order to /// handle it on their side. -impl Convert> for AssetConvert { - fn convert(id: Assets) -> Option { +impl Convert> for AssetConvert { + fn convert(id: CurrencyId) -> Option { match id { - Assets::Ztg => Some(MultiLocation::new( + Asset::Ztg => Some(MultiLocation::new( 1, X2( Junction::Parachain(ParachainInfo::parachain_id().into()), general_key(battery_station::KEY), ), )), - Assets::ForeignAsset(_) => { - let asset = XcmAsset::try_from(id).ok()?; - AssetRegistry::multilocation(&asset).ok()? - } + Asset::ForeignAsset(_) => AssetRegistry::multilocation(&id).ok()?, _ => None, } } } -impl Convert> for AssetConvert { - fn convert(id: XcmAsset) -> Option { - >>::convert(id.into()) - } -} - /// Convert an incoming `MultiLocation` into a `Asset` if possible. /// Here we need to know the canonical representation of all the tokens we handle in order to /// correctly convert their `MultiLocation` representation into our internal `Asset` type. -impl xcm_executor::traits::Convert for AssetConvert { - fn convert(location: MultiLocation) -> Result { +impl xcm_executor::traits::Convert for AssetConvert { + fn convert(location: MultiLocation) -> Result { match location { MultiLocation { parents: 0, interior: X1(GeneralKey { data, length }) } => { let key = &data[..data.len().min(length as usize)]; if key == battery_station::KEY { - return Ok(Assets::Ztg); + return Ok(CurrencyId::Ztg); } Err(location) @@ -392,28 +371,21 @@ impl xcm_executor::traits::Convert for AssetConvert { if para_id == u32::from(ParachainInfo::parachain_id()) { if key == battery_station::KEY { - return Ok(Assets::Ztg); + return Ok(CurrencyId::Ztg); } return Err(location); } - AssetRegistry::location_to_asset_id(location).ok_or(location).map(|a| a.into()) + AssetRegistry::location_to_asset_id(location).ok_or(location) } - _ => AssetRegistry::location_to_asset_id(location).ok_or(location).map(|a| a.into()), + _ => AssetRegistry::location_to_asset_id(location).ok_or(location), } } } -impl xcm_executor::traits::Convert for AssetConvert { - fn convert(location: MultiLocation) -> Result { - >::convert(location) - .and_then(|asset| asset.try_into().map_err(|_| location)) - } -} - -impl Convert> for AssetConvert { - fn convert(asset: MultiAsset) -> Option { +impl Convert> for AssetConvert { + fn convert(asset: MultiAsset) -> Option { if let MultiAsset { id: Concrete(location), .. } = asset { >::convert(location).ok() } else { @@ -422,8 +394,8 @@ impl Convert> for AssetConvert { } } -impl Convert> for AssetConvert { - fn convert(location: MultiLocation) -> Option { +impl Convert> for AssetConvert { + fn convert(location: MultiLocation) -> Option { >::convert(location).ok() } } diff --git a/runtime/battery-station/src/xcm_config/fees.rs b/runtime/battery-station/src/xcm_config/fees.rs index bc6178eee..21936a5b1 100644 --- a/runtime/battery-station/src/xcm_config/fees.rs +++ b/runtime/battery-station/src/xcm_config/fees.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{Balance, XcmAsset}; +use crate::{Balance, CurrencyId}; use core::marker::PhantomData; use frame_support::weights::constants::{ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}; use xcm::latest::MultiLocation; @@ -56,7 +56,7 @@ pub struct FixedConversionRateProvider(PhantomData impl< AssetRegistry: orml_traits::asset_registry::Inspect< - AssetId = XcmAsset, + AssetId = CurrencyId, Balance = Balance, CustomMetadata = CustomMetadata, >, diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 8925275e6..03afedb56 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -6,7 +6,6 @@ frame-system = { workspace = true } orml-currencies = { workspace = true } orml-tokens = { workspace = true } pallet-asset-tx-payment = { workspace = true } -pallet-assets = { workspace = true } pallet-author-inherent = { workspace = true, optional = true } pallet-author-mapping = { workspace = true, optional = true } pallet-author-slot-filter = { workspace = true, optional = true } @@ -50,7 +49,6 @@ std = [ "frame-support/std", "orml-currencies/std", "orml-tokens/std", - "pallet-assets/std", "pallet-asset-tx-payment/std", "pallet-author-inherent?/std", "pallet-author-mapping?/std", diff --git a/runtime/common/src/fees.rs b/runtime/common/src/fees.rs index ce52cdac5..062b9925a 100644 --- a/runtime/common/src/fees.rs +++ b/runtime/common/src/fees.rs @@ -40,8 +40,9 @@ macro_rules! impl_fee_types { } pub struct DealWithForeignFees; - impl OnUnbalanced> for DealWithForeignFees { - fn on_unbalanced(fees_and_tips: CreditOf) { + + impl OnUnbalanced> for DealWithForeignFees { + fn on_unbalanced(fees_and_tips: CreditOf) { // We have to manage the mint / burn ratio on the Zeitgeist chain, // but we do not have the responsibility and necessary knowledge to // manage the mint / burn ratio for any other chain. @@ -50,7 +51,7 @@ macro_rules! impl_fee_types { // on_unbalanced is not implemented for other currencies than the native currency // https://github.com/paritytech/substrate/blob/85415fb3a452dba12ff564e6b093048eed4c5aad/frame/treasury/src/lib.rs#L618-L627 // https://github.com/paritytech/substrate/blob/5ea6d95309aaccfa399c5f72e5a14a4b7c6c4ca1/frame/treasury/src/lib.rs#L490 - let res = AssetRouter::resolve( + let res = >::resolve( &TreasuryPalletId::get().into_account_truncating(), fees_and_tips, ); @@ -63,8 +64,6 @@ macro_rules! impl_fee_types { #[macro_export] macro_rules! impl_foreign_fees { () => { - #[cfg(feature = "parachain")] - use frame_support::ensure; use frame_support::{ pallet_prelude::InvalidTransaction, traits::{ @@ -87,7 +86,7 @@ macro_rules! impl_foreign_fees { }; use zeitgeist_primitives::{ math::fixed::{FixedDiv, FixedMul}, - types::{Assets, TxPaymentAssetId}, + types::TxPaymentAssetId, }; #[repr(u8)] @@ -97,13 +96,12 @@ macro_rules! impl_foreign_fees { NoAssetMetadata = 2, NoFeeFactor = 3, NonForeignAssetPaid = 4, - InvalidAssetType = 5, } // It does calculate foreign fees by extending transactions to include an optional // `AssetId` that specifies the asset to be used for payment (defaulting to the native // token on `None`), such that for each transaction the asset id can be specified. - // For real ZTG `None` is used and for DOT `Some(Currencies::ForeignAsset(0))` is used. + // For real ZTG `None` is used and for DOT `Some(Asset::Foreign(0))` is used. pub(crate) fn calculate_fee( native_fee: Balance, @@ -124,64 +122,15 @@ macro_rules! impl_foreign_fees { Ok(converted_fee) } - fn get_fee_factor_campaign_asset( - campaign_asset: CampaignAsset, - ) -> Result { - let ztg_supply = Balances::total_issuance(); - let campaign_asset_supply = AssetManager::total_issuance(campaign_asset.into()); - let fee_multiplier = Balance::from(CampaignAssetFeeMultiplier::get()); - - let ztg_div_campaign_supply = ztg_supply.checked_div(campaign_asset_supply).ok_or( - TransactionValidityError::Invalid(InvalidTransaction::Custom( - CustomTxError::FeeConversionArith as u8, - )), - )?; - - // Use neutral fee multiplier if the ZTG supply is 100x greater than the campaign - // asset supply. - if ztg_div_campaign_supply >= fee_multiplier { - Ok(BASE) - } else { - campaign_asset_supply.saturating_mul(fee_multiplier).bdiv(ztg_supply).map_err( - |_| { - TransactionValidityError::Invalid(InvalidTransaction::Custom( - CustomTxError::FeeConversionArith as u8, - )) - }, - ) - } - } - - #[cfg(not(feature = "parachain"))] - fn get_fee_factor_foreign_asset( - _foreign_asset: Currencies, - ) -> Result { - Err(TransactionValidityError::Invalid(InvalidTransaction::Custom( - CustomTxError::NoForeignAssetsOnStandaloneChain as u8, - ))) - } - #[cfg(feature = "parachain")] - fn get_fee_factor_foreign_asset( - foreign_asset: Currencies, + pub(crate) fn get_fee_factor( + currency_id: CurrencyId, ) -> Result { - ensure!( - foreign_asset.is_foreign_asset(), + let metadata = ::metadata(¤cy_id).ok_or( TransactionValidityError::Invalid(InvalidTransaction::Custom( - CustomTxError::InvalidAssetType as u8, - )) - ); - let metadata_asset: XcmAsset = - Assets::from(foreign_asset).try_into().map_err(|_| { - TransactionValidityError::Invalid(InvalidTransaction::Custom( - CustomTxError::InvalidAssetType as u8, - )) - })?; - - let metadata = ::metadata(&metadata_asset) - .ok_or(TransactionValidityError::Invalid(InvalidTransaction::Custom( CustomTxError::NoAssetMetadata as u8, - )))?; + )), + )?; let fee_factor = metadata.additional.xcm.fee_factor.ok_or(TransactionValidityError::Invalid( InvalidTransaction::Custom(CustomTxError::NoFeeFactor as u8), @@ -189,54 +138,47 @@ macro_rules! impl_foreign_fees { Ok(fee_factor) } - pub(crate) fn get_fee_factor(asset: Assets) -> Result { - if let Ok(campaign_asset) = CampaignAsset::try_from(asset) { - return get_fee_factor_campaign_asset(campaign_asset); - } else if let Ok(currency) = Currencies::try_from(asset) { - return get_fee_factor_foreign_asset(currency); - } - - Err(TransactionValidityError::Invalid(InvalidTransaction::Custom( - CustomTxError::InvalidAssetType as u8, - ))) - } - pub struct TTCBalanceToAssetBalance; - impl BalanceConversion for TTCBalanceToAssetBalance { + impl BalanceConversion for TTCBalanceToAssetBalance { type Error = TransactionValidityError; fn to_asset_balance( native_fee: Balance, - asset: Assets, + asset_id: TxPaymentAssetId, ) -> Result { - let fee_factor = get_fee_factor(asset)?; - let converted_fee = calculate_fee(native_fee, fee_factor)?; - Ok(converted_fee) + #[cfg(feature = "parachain")] + { + let currency_id = Asset::ForeignAsset(asset_id); + let fee_factor = get_fee_factor(currency_id)?; + let converted_fee = calculate_fee(native_fee, fee_factor)?; + Ok(converted_fee) + } + #[cfg(not(feature = "parachain"))] + { + Err(TransactionValidityError::Invalid(InvalidTransaction::Custom( + CustomTxError::NoForeignAssetsOnStandaloneChain as u8, + ))) + } } } pub struct TTCHandleCredit; - impl HandleCredit for TTCHandleCredit { - fn handle_credit(final_fee: CreditOf) { - let asset = final_fee.asset(); - - if CampaignAsset::try_from(asset).is_ok() { - drop(final_fee); - } else if Currencies::try_from(asset).is_ok() { - DealWithForeignFees::on_unbalanced(final_fee); - } + impl HandleCredit for TTCHandleCredit { + fn handle_credit(final_fee: CreditOf) { + // Handle the final fee and tip, e.g. by transferring to the treasury. + DealWithForeignFees::on_unbalanced(final_fee); } } - pub struct TxCharger; - impl pallet_asset_tx_payment::OnChargeAssetTransaction for TxCharger { - type AssetId = Assets; + pub struct TokensTxCharger; + impl pallet_asset_tx_payment::OnChargeAssetTransaction for TokensTxCharger { + type AssetId = TxPaymentAssetId; type Balance = Balance; - type LiquidityInfo = CreditOf; + type LiquidityInfo = CreditOf; fn withdraw_fee( who: &AccountId, - _call: &RuntimeCall, + call: &RuntimeCall, _dispatch_info: &DispatchInfoOf, asset_id: Self::AssetId, native_fee: Self::Balance, @@ -250,13 +192,13 @@ macro_rules! impl_foreign_fees { let converted_fee = TTCBalanceToAssetBalance::to_asset_balance(native_fee, asset_id)? .max(min_converted_fee); - + let currency_id = Asset::ForeignAsset(asset_id); let can_withdraw = - >::can_withdraw(asset_id, who, converted_fee); + >::can_withdraw(currency_id, who, converted_fee); if can_withdraw != WithdrawConsequence::Success { return Err(InvalidTransaction::Payment.into()); } - >::withdraw(asset_id, who, converted_fee) + >::withdraw(currency_id, who, converted_fee) .map_err(|_| TransactionValidityError::from(InvalidTransaction::Payment)) } @@ -265,23 +207,35 @@ macro_rules! impl_foreign_fees { _dispatch_info: &DispatchInfoOf, _post_info: &PostDispatchInfoOf, corrected_native_fee: Self::Balance, - _tip: Self::Balance, + tip: Self::Balance, paid: Self::LiquidityInfo, ) -> Result<(), TransactionValidityError> { let min_converted_fee = if corrected_native_fee.is_zero() { Zero::zero() } else { One::one() }; - - let asset = paid.asset(); + let asset_id = match paid.asset() { + Asset::ForeignAsset(asset_id) => asset_id, + _ => { + return Err(TransactionValidityError::Invalid(InvalidTransaction::Custom( + CustomTxError::NonForeignAssetPaid as u8, + ))); + } + }; // Convert the corrected fee and tip into the asset used for payment. let converted_fee = - TTCBalanceToAssetBalance::to_asset_balance(corrected_native_fee, asset)? + TTCBalanceToAssetBalance::to_asset_balance(corrected_native_fee, asset_id)? .max(min_converted_fee); + let converted_tip = TTCBalanceToAssetBalance::to_asset_balance(tip, asset_id)?; + // Calculate how much refund we should return. + let (final_fee, refund) = paid.split(converted_fee); // Refund to the account that paid the fees. If this fails, the account might have dropped // below the existential balance. In that case we don't refund anything. - let (final_fee, refund) = paid.split(converted_fee); - let _ = AssetRouter::resolve(who, refund); + let _ = >::resolve(who, refund); + + // Handle the final fee and tip, e.g. by transferring to the treasury. + // Note: The `corrected_native_fee` already includes the `tip`. TTCHandleCredit::handle_credit(final_fee); + Ok(()) } } @@ -348,12 +302,7 @@ macro_rules! impl_market_creator_fees { macro_rules! fee_tests { () => { use crate::*; - use frame_support::{ - assert_noop, assert_ok, - dispatch::DispatchClass, - traits::{fungible::Unbalanced, fungibles::Create}, - weights::Weight, - }; + use frame_support::{assert_noop, assert_ok, dispatch::DispatchClass, weights::Weight}; use orml_traits::MultiCurrency; use pallet_asset_tx_payment::OnChargeAssetTransaction; use sp_core::H256; @@ -396,126 +345,21 @@ macro_rules! fee_tests { frame_system::GenesisConfig::default().build_storage::().unwrap().into(); t.execute_with(|| { let fee_and_tip_balance = 10 * ExistentialDeposit::get(); - let fees_and_tips = AssetRouter::issue(Asset::ForeignAsset(0), fee_and_tip_balance); + let fees_and_tips = >::issue( + Asset::ForeignAsset(0), + fee_and_tip_balance, + ); assert!( - AssetRouter::free_balance(Asset::ForeignAsset(0), &Treasury::account_id()) - .is_zero() + Tokens::free_balance(Asset::ForeignAsset(0), &Treasury::account_id()).is_zero() ); DealWithForeignFees::on_unbalanced(fees_and_tips); assert_eq!( - AssetRouter::free_balance(Asset::ForeignAsset(0), &Treasury::account_id()), + Tokens::free_balance(Asset::ForeignAsset(0), &Treasury::account_id()), fee_and_tip_balance, ); }); } - #[test] - fn fee_payment_campaign_assets_withdraws_correct_amount() { - let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); - t.execute_with(|| { - let asset = Asset::CampaignAsset(0); - let alice = AccountId::from([0u8; 32]); - let initial_balance: Balance = 1_000_000_000_000; - let native_fee: Balance = 1_000_000; - let fee_multiplier: Balance = CampaignAssetFeeMultiplier::get().into(); - - let ztg_supply = initial_balance * fee_multiplier - 1; - let fee_factor = - initial_balance.saturating_mul(fee_multiplier).bdiv(ztg_supply).unwrap(); - let expected_fee = calculate_fee(native_fee, fee_factor).unwrap(); - let mock_call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); - - Balances::set_total_issuance(ztg_supply); - assert_ok!(AssetRouter::create(asset, alice.clone(), true, 1)); - assert_ok!(AssetManager::deposit(asset, &alice, initial_balance)); - - assert_eq!( - TxCharger::withdraw_fee( - &alice, - &mock_call, - &Default::default(), - asset, - native_fee, - 0 - ) - .unwrap() - .peek(), - expected_fee - ); - assert_eq!( - AssetManager::total_balance(asset, &alice), - initial_balance - expected_fee - ); - }); - } - - fn campaign_asset_throttled_fee_common() -> CreditOf { - let asset = Asset::CampaignAsset(0); - let alice = AccountId::from([0u8; 32]); - let initial_balance: Balance = 1_000_000_000_000; - let native_fee: Balance = 1_000_000; - let fee_multiplier: Balance = CampaignAssetFeeMultiplier::get().into(); - - let ztg_supply = initial_balance.bmul(fee_multiplier * initial_balance + 1).unwrap(); - let mock_call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); - - Balances::set_total_issuance(ztg_supply); - assert_ok!(AssetRouter::create(asset, alice.clone(), true, 1)); - assert_ok!(AssetManager::deposit(asset, &alice, initial_balance)); - - let withdrawn = TxCharger::withdraw_fee( - &alice, - &mock_call, - &Default::default(), - asset, - native_fee, - 0, - ) - .unwrap(); - assert_eq!(withdrawn.peek(), native_fee); - assert_eq!(AssetManager::total_balance(asset, &alice), initial_balance - native_fee); - - withdrawn - } - - #[test] - fn fee_payment_campaign_assets_withdraws_correct_amount_throttled() { - let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); - t.execute_with(|| { - let _ = campaign_asset_throttled_fee_common(); - }); - } - - #[test] - fn fee_payment_campaign_assets_corrects_reimburses_and_burns_fees_properly() { - let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); - t.execute_with(|| { - let asset = Asset::CampaignAsset(0); - let withdrawn = campaign_asset_throttled_fee_common(); - let amount = withdrawn.peek(); - let native_fee_adjusted: Balance = 1_000_000 / 2; - let alice = AccountId::from([0u8; 32]); - let initial_balance: Balance = 1_000_000_000_000; - let fee_multiplier = get_fee_factor(asset).unwrap(); - let fee = calculate_fee(native_fee_adjusted, fee_multiplier).unwrap(); - let expected = initial_balance - fee; - - assert_ok!(TxCharger::correct_and_deposit_fee( - &alice, - &Default::default(), - &Default::default(), - native_fee_adjusted, - 0, - withdrawn - )); - assert_eq!(AssetManager::total_balance(asset, &alice), expected); - assert_eq!(AssetManager::total_issuance(Asset::CampaignAsset(0)), expected); - }); - } - #[test] fn fee_multiplier_can_grow_from_zero() { let minimum_multiplier = MinimumMultiplier::get(); @@ -541,59 +385,65 @@ macro_rules! fee_tests { .unwrap() .into(); t.execute_with(|| { - let alice = AccountId::from([0u8; 32]); - let fee_factor = 143_120_520; - let custom_metadata = CustomMetadata { - xcm: XcmMetadata { fee_factor: Some(fee_factor) }, - ..Default::default() - }; - let meta: AssetMetadata = AssetMetadata { - decimals: 10, - name: "Polkadot".into(), - symbol: "DOT".into(), - existential_deposit: ExistentialDeposit::get(), - location: Some(xcm::VersionedMultiLocation::V3( - xcm::latest::MultiLocation::parent(), - )), - additional: custom_metadata, - }; - let dot = Asset::ForeignAsset(0); - - assert_ok!(AssetRegistry::register_asset( - RuntimeOrigin::root(), - meta.clone(), - Some(dot.try_into().unwrap()) - )); - assert_ok!(AssetManager::deposit(dot, &Treasury::account_id(), BASE)); - - let free_balance_treasury_before = - AssetManager::free_balance(dot, &Treasury::account_id()); - let free_balance_alice_before = AssetManager::free_balance(dot, &alice); - let corrected_native_fee = BASE; - let paid = AssetRouter::issue(dot, 2 * BASE); - let paid_balance = paid.peek(); - let tip = 0u128; - assert_ok!(TxCharger::correct_and_deposit_fee( - &alice, - &Default::default(), - &Default::default(), - corrected_native_fee, - tip, - paid, - )); - - let treasury_gain = AssetManager::free_balance(dot, &Treasury::account_id()) - - free_balance_treasury_before; - let alice_gain = - AssetManager::free_balance(dot, &alice) - free_balance_alice_before; - - let decimals = meta.decimals; - let base = 10u128.checked_pow(decimals).unwrap(); - - let dot_fee = ((corrected_native_fee * fee_factor) + (base / 2)) / base; - assert_eq!(dot_fee, treasury_gain); - assert_eq!(143_120_520, treasury_gain); - assert_eq!(paid_balance - treasury_gain, alice_gain); + { + let alice = AccountId::from([0u8; 32]); + let fee_factor = 143_120_520; + let custom_metadata = CustomMetadata { + xcm: XcmMetadata { fee_factor: Some(fee_factor) }, + ..Default::default() + }; + let meta: AssetMetadata = AssetMetadata { + decimals: 10, + name: "Polkadot".into(), + symbol: "DOT".into(), + existential_deposit: ExistentialDeposit::get(), + location: Some(xcm::VersionedMultiLocation::V3(xcm::latest::MultiLocation::parent())), + additional: custom_metadata, + }; + let dot = Asset::ForeignAsset(0); + + assert_ok!(AssetRegistry::register_asset(RuntimeOrigin::root(), meta.clone(), Some(dot))); + + + assert_ok!(>::deposit(dot, &Treasury::account_id(), BASE)); + + let mock_call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); + let mock_dispatch_info = frame_support::dispatch::DispatchInfo { + weight: frame_support::dispatch::Weight::zero(), + class: DispatchClass::Normal, + pays_fee: frame_support::dispatch::Pays::Yes, + }; + let mock_post_info = frame_support::dispatch::PostDispatchInfo { + actual_weight: Some(frame_support::dispatch::Weight::zero()), + pays_fee: frame_support::dispatch::Pays::Yes, + }; + + let free_balance_treasury_before = Tokens::free_balance(dot, &Treasury::account_id()); + let free_balance_alice_before = Tokens::free_balance(dot, &alice); + let corrected_native_fee = BASE; + let paid = >::issue(dot, 2 * BASE); + let paid_balance = paid.peek(); + let tip = 0u128; + assert_ok!(>::correct_and_deposit_fee( + &alice, + &mock_dispatch_info, + &mock_post_info, + corrected_native_fee, + tip, + paid, + )); + + let treasury_gain = Tokens::free_balance(dot, &Treasury::account_id()) - free_balance_treasury_before; + let alice_gain = Tokens::free_balance(dot, &alice) - free_balance_alice_before; + + let decimals = meta.decimals; + let base = 10u128.checked_pow(decimals).unwrap(); + + let dot_fee = ((corrected_native_fee * fee_factor) + (base / 2)) / base; + assert_eq!(dot_fee, treasury_gain); + assert_eq!(143_120_520, treasury_gain); + assert_eq!(paid_balance - treasury_gain, alice_gain); + } }); } @@ -619,7 +469,7 @@ macro_rules! fee_tests { additional: custom_metadata, }; let dot_asset_id = 0u32; - let dot = XcmAsset::ForeignAsset(dot_asset_id); + let dot = Asset::ForeignAsset(dot_asset_id); assert_ok!(AssetRegistry::register_asset( RuntimeOrigin::root(), @@ -627,7 +477,7 @@ macro_rules! fee_tests { Some(dot) )); - assert_eq!(get_fee_factor(dot.into()).unwrap(), 143_120_520u128); + assert_eq!(get_fee_factor(dot).unwrap(), 143_120_520u128); }); } @@ -670,7 +520,7 @@ macro_rules! fee_tests { additional: custom_metadata, }; let dot_asset_id = 0u32; - let dot = XcmAsset::ForeignAsset(dot_asset_id); + let dot = Asset::ForeignAsset(dot_asset_id); assert_ok!(AssetRegistry::register_asset( RuntimeOrigin::root(), @@ -679,7 +529,7 @@ macro_rules! fee_tests { )); assert_noop!( - get_fee_factor(dot.into()), + get_fee_factor(dot), TransactionValidityError::Invalid(InvalidTransaction::Custom(3u8)) ); }); @@ -704,15 +554,15 @@ macro_rules! fee_tests { location: None, additional: custom_metadata, }; - let non_location_token = XcmAsset::ForeignAsset(1); + let non_location_token = Asset::ForeignAsset(1); assert_ok!(AssetRegistry::register_asset( RuntimeOrigin::root(), meta, - Some(Assets::from(non_location_token).try_into().unwrap()) + Some(non_location_token) )); - assert_eq!(get_fee_factor(non_location_token.into()).unwrap(), 10_393); + assert_eq!(get_fee_factor(non_location_token).unwrap(), 10_393); }); } @@ -744,20 +594,29 @@ macro_rules! fee_tests { assert_ok!(AssetRegistry::register_asset( RuntimeOrigin::root(), meta, - Some(dot.try_into().unwrap()) + Some(dot) )); - let fees_and_tips = AssetRouter::issue(dot, 0); - assert_ok!(AssetManager::deposit(dot, &Treasury::account_id(), BASE)); + let fees_and_tips = >::issue(dot, 0); + assert_ok!(>::deposit( + dot, + &Treasury::account_id(), + BASE + )); let mock_call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); + let mock_dispatch_info = frame_support::dispatch::DispatchInfo { + weight: frame_support::dispatch::Weight::zero(), + class: DispatchClass::Normal, + pays_fee: frame_support::dispatch::Pays::Yes, + }; assert_eq!( - TxCharger::withdraw_fee( + >::withdraw_fee( &Treasury::account_id(), &mock_call, - &Default::default(), - dot, + &mock_dispatch_info, + dot_asset_id, BASE / 2, 0, ) @@ -768,5 +627,5 @@ macro_rules! fee_tests { }); } } - }; + } } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index eff5c92c0..03a5a3c04 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -55,17 +55,12 @@ macro_rules! decl_common_types { use orml_traits::MultiCurrency; use sp_runtime::{generic, DispatchError, DispatchResult, SaturatedConversion}; use zeitgeist_primitives::traits::{DeployPoolApi, DistributeFees, MarketCommonsPalletApi}; - use zrml_market_commons::migrations::MigrateScoringRuleAmmCdaHybridAndMarketId; - use zrml_neo_swaps::migration::MigratePoolReservesToBoundedBTreeMap; pub type Block = generic::Block; type Address = sp_runtime::MultiAddress; - type Migrations = ( - MigrateScoringRuleAmmCdaHybridAndMarketId, - MigratePoolReservesToBoundedBTreeMap, - ); + type Migrations = (); pub type Executive = frame_executive::Executive< Runtime, @@ -94,11 +89,6 @@ macro_rules! decl_common_types { pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; - // Asset instances - type CustomAssetsInstance = pallet_assets::Instance1; - type CampaignAssetsInstance = pallet_assets::Instance2; - type MarketAssetsInstance = pallet_assets::Instance3; - // Governance type AdvisoryCommitteeInstance = pallet_collective::Instance1; type AdvisoryCommitteeMembershipInstance = pallet_membership::Instance1; @@ -285,9 +275,6 @@ macro_rules! create_runtime { Multisig: pallet_multisig::{Call, Event, Pallet, Storage} = 14, Bounties: pallet_bounties::{Call, Event, Pallet, Storage} = 15, AssetTxPayment: pallet_asset_tx_payment::{Event, Pallet} = 16, - CustomAssets: pallet_assets::::{Call, Pallet, Storage, Event} = 17, - CampaignAssets: pallet_assets::::{Call, Pallet, Storage, Event} = 18, - MarketAssets: pallet_assets::::{Call, Pallet, Storage, Event} = 19, // Governance Democracy: pallet_democracy::{Pallet, Call, Storage, Config, Event} = 20, @@ -322,7 +309,6 @@ macro_rules! create_runtime { NeoSwaps: zrml_neo_swaps::{Call, Event, Pallet, Storage} = 60, Orderbook: zrml_orderbook::{Call, Event, Pallet, Storage} = 61, Parimutuel: zrml_parimutuel::{Call, Event, Pallet, Storage} = 62, - AssetRouter: zrml_asset_router::{Pallet} = 63, HybridRouter: zrml_hybrid_router::{Call, Event, Pallet, Storage} = 64, $($additional_pallets)* @@ -567,7 +553,7 @@ macro_rules! impl_config_traits { #[cfg(feature = "parachain")] impl orml_asset_registry::Config for Runtime { - type AssetId = XcmAsset; + type AssetId = CurrencyId; type AssetProcessor = CustomAssetProcessor; type AuthorityOrigin = AsEnsureOriginWithArg; type Balance = Balance; @@ -578,14 +564,14 @@ macro_rules! impl_config_traits { impl orml_currencies::Config for Runtime { type GetNativeCurrencyId = GetNativeCurrencyId; - type MultiCurrency = AssetRouter; + type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; type WeightInfo = weights::orml_currencies::WeightInfo; } pub struct CurrencyHooks(sp_std::marker::PhantomData); impl - orml_traits::currency::MutationHooks + orml_traits::currency::MutationHooks for CurrencyHooks { type OnDust = orml_tokens::TransferDust; @@ -602,7 +588,7 @@ macro_rules! impl_config_traits { type Amount = Amount; type Balance = Balance; type CurrencyHooks = CurrencyHooks; - type CurrencyId = Currencies; + type CurrencyId = CurrencyId; type DustRemovalWhitelist = DustRemovalWhitelist; type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; @@ -622,7 +608,7 @@ macro_rules! impl_config_traits { type AccountIdToMultiLocation = AccountIdToMultiLocation; type Balance = Balance; type BaseXcmWeight = BaseXcmWeight; - type CurrencyId = XcmAsset; + type CurrencyId = CurrencyId; type CurrencyIdConvert = AssetConvert; type RuntimeEvent = RuntimeEvent; type MaxAssetsForTransfer = MaxAssetsForTransfer; @@ -635,109 +621,6 @@ macro_rules! impl_config_traits { type XcmExecutor = xcm_executor::XcmExecutor; } - // Required for runtime benchmarks - pallet_assets::runtime_benchmarks_enabled! { - pub struct AssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for AssetsBenchmarkHelper - where - AssetIdParameter: From, - { - fn create_asset_id_parameter(id: u32) -> AssetIdParameter { - (id as u128).into() - } - } - } - - impl pallet_assets::Config for Runtime { - type ApprovalDeposit = CustomAssetsApprovalDeposit; - type AssetAccountDeposit = CustomAssetsAccountDeposit; - type AssetDeposit = CustomAssetsDeposit; - type AssetId = CustomAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Destroyer = AssetRouter; - type Extra = (); - type ForceOrigin = EnsureRootOrTwoThirdsTechnicalCommittee; - type Freezer = (); - type MetadataDepositBase = CustomAssetsMetadataDepositBase; - type MetadataDepositPerByte = CustomAssetsMetadataDepositPerByte; - // TODO(#1176): Figure out sensible number after benchmark on reference machine - type RemoveItemsLimit = ConstU32<{ 50 }>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = CustomAssetsStringLimit; - type WeightInfo = weights::pallet_assets::WeightInfo; - } - - impl pallet_assets::Config for Runtime { - type ApprovalDeposit = CampaignAssetsApprovalDeposit; - type AssetAccountDeposit = CampaignAssetsAccountDeposit; - type AssetDeposit = CampaignAssetsDeposit; - type AssetId = CampaignAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Destroyer = AssetRouter; - type Extra = (); - type ForceOrigin = EnsureRootOrTwoThirdsCouncil; - type Freezer = (); - type MetadataDepositBase = CampaignAssetsMetadataDepositBase; - type MetadataDepositPerByte = CampaignAssetsMetadataDepositPerByte; - // TODO(#1176): Figure out sensible number after benchmark on reference machine - type RemoveItemsLimit = ConstU32<{ 50 }>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = CampaignAssetsStringLimit; - type WeightInfo = weights::pallet_assets::WeightInfo; - } - - // Required for runtime benchmarks - pallet_assets::runtime_benchmarks_enabled! { - pub struct MarketAssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for MarketAssetsBenchmarkHelper - { - fn create_asset_id_parameter(id: u32) -> MarketAsset { - MarketAsset::CategoricalOutcome(0, id as CategoryIndex) - } - } - } - - impl pallet_assets::Config for Runtime { - type ApprovalDeposit = MarketAssetsApprovalDeposit; - type AssetAccountDeposit = MarketAssetsAccountDeposit; - type AssetDeposit = MarketAssetsDeposit; - type AssetId = MarketAsset; - type AssetIdParameter = MarketAsset; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = MarketAssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Destroyer = AssetRouter; - type Extra = (); - type ForceOrigin = EnsureRootOrAllTechnicalCommittee; - type Freezer = (); - type MetadataDepositBase = MarketAssetsMetadataDepositBase; - type MetadataDepositPerByte = MarketAssetsMetadataDepositPerByte; - // TODO(#1176): Figure out sensible number after benchmark on reference machine - type RemoveItemsLimit = ConstU32<{ 50 }>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = MarketAssetsStringLimit; - type WeightInfo = weights::pallet_assets::WeightInfo; - } - impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; @@ -1095,8 +978,8 @@ macro_rules! impl_config_traits { impl pallet_asset_tx_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Fungibles = AssetRouter; - type OnChargeAssetTransaction = TxCharger; + type Fungibles = Tokens; + type OnChargeAssetTransaction = TokensTxCharger; } impl pallet_transaction_payment::Config for Runtime { @@ -1167,22 +1050,6 @@ macro_rules! impl_config_traits { #[cfg(feature = "parachain")] impl parachain_info::Config for Runtime {} - impl zrml_asset_router::Config for Runtime { - type AssetType = Assets; - type Balance = Balance; - type CurrencyType = Currencies; - type Currencies = Tokens; - type CampaignAssetType = CampaignAsset; - type CampaignAssets = CampaignAssets; - type CustomAssetType = CustomAsset; - type CustomAssets = CustomAssets; - type DestroyAccountWeight = DestroyAccountWeight; - type DestroyApprovalWeight = DestroyApprovalWeight; - type DestroyFinishWeight = DestroyFinishWeight; - type MarketAssetType = MarketAsset; - type MarketAssets = MarketAssets; - } - impl zrml_authorized::Config for Runtime { type AuthorizedDisputeResolutionOrigin = EnsureRootOrMoreThanHalfAdvisoryCommittee; type Currency = Balances; @@ -1260,12 +1127,7 @@ macro_rules! impl_config_traits { impl zrml_prediction_markets::Config for Runtime { type AdvisoryBond = AdvisoryBond; type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; - type AssetCreator = AssetRouter; - type AssetDestroyer = AssetRouter; type ApproveOrigin = EnsureRootOrMoreThanOneThirdAdvisoryCommittee; - type AssetManager = AssetManager; - #[cfg(feature = "parachain")] - type AssetRegistry = AssetRegistry; type Authorized = Authorized; type Currency = Balances; type Court = Court; @@ -1295,8 +1157,6 @@ macro_rules! impl_config_traits { type MinCategories = MinCategories; type MaxEditReasonLen = MaxEditReasonLen; type MaxRejectReasonLen = MaxRejectReasonLen; - // Can be a tuple of hooks - type OnStateTransition = (Parimutuel,); type OracleBond = OracleBond; type OutsiderBond = OutsiderBond; type PalletId = PmPalletId; @@ -1305,6 +1165,9 @@ macro_rules! impl_config_traits { type RejectOrigin = EnsureRootOrMoreThanTwoThirdsAdvisoryCommittee; type RequestEditOrigin = EnsureRootOrMoreThanOneThirdAdvisoryCommittee; type ResolveOrigin = EnsureRoot; + type AssetManager = AssetManager; + #[cfg(feature = "parachain")] + type AssetRegistry = AssetRegistry; type SimpleDisputes = SimpleDisputes; type Slash = Treasury; type ValidityBond = ValidityBond; @@ -1356,8 +1219,9 @@ macro_rules! impl_config_traits { } impl zrml_swaps::Config for Runtime { - type Asset = Assets; + type Asset = Asset; type RuntimeEvent = RuntimeEvent; + type MultiCurrency = AssetManager; type ExitFee = ExitFee; type MinAssets = MinAssets; type MaxAssets = MaxAssets; @@ -1366,7 +1230,6 @@ macro_rules! impl_config_traits { type MaxWeight = MaxWeight; type MinWeight = MinWeight; type PalletId = SwapsPalletId; - type AssetManager = AssetManager; type WeightInfo = zrml_swaps::weights::WeightInfo; } @@ -1401,14 +1264,12 @@ macro_rules! impl_config_traits { } impl zrml_parimutuel::Config for Runtime { - type AssetCreator = AssetRouter; - type AssetDestroyer = AssetRouter; - type AssetManager = AssetManager; type ExternalFees = MarketCreatorFee; + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; + type AssetManager = AssetManager; type MinBetSize = MinBetSize; type PalletId = ParimutuelPalletId; - type RuntimeEvent = RuntimeEvent; type WeightInfo = zrml_parimutuel::weights::WeightInfo; } @@ -1514,7 +1375,6 @@ macro_rules! create_runtime_api { list_benchmark!(list, extra, frame_system, SystemBench::); orml_list_benchmark!(list, extra, orml_currencies, crate::benchmarks::currencies); orml_list_benchmark!(list, extra, orml_tokens, crate::benchmarks::tokens); - list_benchmark!(list, extra, pallet_assets, CustomAssets); list_benchmark!(list, extra, pallet_balances, Balances); list_benchmark!(list, extra, pallet_bounties, Bounties); list_benchmark!(list, extra, pallet_collective, AdvisoryCommittee); @@ -1620,7 +1480,6 @@ macro_rules! create_runtime_api { add_benchmark!(params, batches, frame_system, SystemBench::); orml_add_benchmark!(params, batches, orml_currencies, crate::benchmarks::currencies); orml_add_benchmark!(params, batches, orml_tokens, crate::benchmarks::tokens); - add_benchmark!(params, batches, pallet_assets, CustomAssets); add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_bounties, Bounties); add_benchmark!(params, batches, pallet_collective, AdvisoryCommittee); @@ -1930,16 +1789,16 @@ macro_rules! create_runtime_api { asset_in: &Asset, asset_out: &Asset, with_fees: bool, - ) -> Balance { - Swaps::get_spot_price(pool_id, asset_in, asset_out, with_fees).ok().unwrap_or(0) + ) -> SerdeWrapper { + SerdeWrapper(Swaps::get_spot_price(pool_id, asset_in, asset_out, with_fees).ok().unwrap_or(0)) } fn pool_account_id(pool_id: &PoolId) -> AccountId { Swaps::pool_account_id(pool_id) } - fn pool_shares_id(pool_id: PoolId) -> Asset { - Asset::PoolShare(pool_id) + fn pool_shares_id(pool_id: PoolId) -> Asset> { + Asset::PoolShare(SerdeWrapper(pool_id)) } } @@ -2009,7 +1868,7 @@ macro_rules! create_common_benchmark_logic { pub(crate) mod currencies { use super::utils::{lookup_of_account, set_balance}; use crate::{ - AccountId, Amount, AssetManager, Balance, Assets, ExistentialDeposit, + AccountId, Amount, AssetManager, Balance, CurrencyId, ExistentialDeposit, GetNativeCurrencyId, Runtime }; use frame_benchmarking::{account, vec, whitelisted_caller}; @@ -2023,8 +1882,8 @@ macro_rules! create_common_benchmark_logic { }; const SEED: u32 = 0; - const NATIVE: Assets = GetNativeCurrencyId::get(); - const ASSET: Assets = Asset::CategoricalOutcome(0, 0); + const NATIVE: CurrencyId = GetNativeCurrencyId::get(); + const ASSET: CurrencyId = Asset::CategoricalOutcome(0, 0); runtime_benchmarks! { { Runtime, orml_currencies } @@ -2124,15 +1983,15 @@ macro_rules! create_common_benchmark_logic { pub(crate) mod tokens { use super::utils::{lookup_of_account, set_balance as update_balance}; - use crate::{AccountId, Balance, Tokens, Runtime}; + use crate::{AccountId, Balance, CurrencyId, Tokens, Runtime}; use frame_benchmarking::{account, vec, whitelisted_caller}; use frame_system::RawOrigin; use orml_benchmarking::runtime_benchmarks; use orml_traits::MultiCurrency; - use zeitgeist_primitives::{constants::BASE, types::Currencies}; + use zeitgeist_primitives::{constants::BASE, types::Asset}; const SEED: u32 = 0; - const ASSET: Currencies = Currencies::ForeignAsset(7); + const ASSET: CurrencyId = Asset::CategoricalOutcome(0, 0); runtime_benchmarks! { { Runtime, orml_tokens } @@ -2141,7 +2000,7 @@ macro_rules! create_common_benchmark_logic { let amount: Balance = BASE; let from: AccountId = whitelisted_caller(); - update_balance(ASSET.into(), &from, amount); + update_balance(ASSET, &from, amount); let to: AccountId = account("to", 0, SEED); let to_lookup = lookup_of_account(to.clone()); @@ -2154,7 +2013,7 @@ macro_rules! create_common_benchmark_logic { let amount: Balance = BASE; let from: AccountId = whitelisted_caller(); - update_balance(ASSET.into(), &from, amount); + update_balance(ASSET, &from, amount); let to: AccountId = account("to", 0, SEED); let to_lookup = lookup_of_account(to); @@ -2165,7 +2024,7 @@ macro_rules! create_common_benchmark_logic { transfer_keep_alive { let from: AccountId = whitelisted_caller(); - update_balance(ASSET.into(), &from, 2 * BASE); + update_balance(ASSET, &from, 2 * BASE); let to: AccountId = account("to", 0, SEED); let to_lookup = lookup_of_account(to.clone()); @@ -2177,7 +2036,7 @@ macro_rules! create_common_benchmark_logic { force_transfer { let from: AccountId = account("from", 0, SEED); let from_lookup = lookup_of_account(from.clone()); - update_balance(ASSET.into(), &from, 2 * BASE); + update_balance(ASSET, &from, 2 * BASE); let to: AccountId = account("to", 0, SEED); let to_lookup = lookup_of_account(to.clone()); @@ -2207,7 +2066,7 @@ macro_rules! create_common_benchmark_logic { } pub(crate) mod utils { - use crate::{AccountId, AssetManager, Balance, Assets, Runtime, + use crate::{AccountId, AssetManager, Balance, CurrencyId, Runtime, }; use frame_support::assert_ok; use orml_traits::MultiCurrencyExtended; @@ -2219,7 +2078,7 @@ macro_rules! create_common_benchmark_logic { ::Lookup::unlookup(who) } - pub fn set_balance(currency_id: Assets, who: &AccountId, balance: Balance) { + pub fn set_balance(currency_id: CurrencyId, who: &AccountId, balance: Balance) { assert_ok!(>::update_balance( currency_id, who, diff --git a/runtime/common/src/weights/mod.rs b/runtime/common/src/weights/mod.rs index 27fae644e..e1f0aac08 100644 --- a/runtime/common/src/weights/mod.rs +++ b/runtime/common/src/weights/mod.rs @@ -32,7 +32,6 @@ cfg_if::cfg_if! { pub mod frame_system; pub mod orml_currencies; pub mod orml_tokens; -pub mod pallet_assets; pub mod pallet_balances; pub mod pallet_bounties; pub mod pallet_collective; diff --git a/runtime/common/src/weights/pallet_assets.rs b/runtime/common/src/weights/pallet_assets.rs deleted file mode 100644 index 421d14405..000000000 --- a/runtime/common/src/weights/pallet_assets.rs +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright 2022-2024 Forecasting Technologies LTD. -// Copyright 2021-2022 Zeitgeist PM LLC. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -//! Autogenerated weights for pallet_assets -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` - -// Executed Command: -// ./target/production/zeitgeist -// benchmark -// pallet -// --chain=dev -// --steps=50 -// --repeat=20 -// --pallet=pallet_assets -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --template=./misc/frame_weight_template.hbs -// --header=./HEADER_GPL3 -// --output=./runtime/common/src/weights/ - -#![allow(unused_parens)] -#![allow(unused_imports)] - -use core::marker::PhantomData; -use frame_support::{ - traits::Get, - weights::{constants::RocksDbWeight, Weight}, -}; - -/// Weight functions for pallet_assets (automatically generated) -pub struct WeightInfo(PhantomData); -impl pallet_assets::weights::WeightInfo for WeightInfo { - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - fn create() -> Weight { - // Proof Size summary in bytes: - // Measured: `285` - // Estimated: `5304` - // Minimum execution time: 45_580 nanoseconds. - Weight::from_parts(46_600_000, 5304) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - fn force_create() -> Weight { - // Proof Size summary in bytes: - // Measured: `109` - // Estimated: `2697` - // Minimum execution time: 24_880 nanoseconds. - Weight::from_parts(25_780_000, 2697) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) - fn start_destroy() -> Weight { - // Proof Size summary in bytes: - // Measured: `452` - // Estimated: `83563` - // Minimum execution time: 37_170 nanoseconds. - Weight::from_parts(38_891_000, 83563) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:51 w:50) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: System Account (r:50 w:50) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// The range of component `c` is `[0, 50]`. - fn destroy_accounts(c: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `413 + c * (241 ±0)` - // Estimated: `5286 + c * (5196 ±0)` - // Minimum execution time: 35_950 nanoseconds. - Weight::from_parts(27_443_769, 5286) - // Standard Error: 187_706 - .saturating_add(Weight::from_parts(27_794_683, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 5196).saturating_mul(c.into())) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Approvals (r:51 w:50) - /// Proof: CustomAssets Approvals (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// The range of component `a` is `[0, 50]`. - fn destroy_approvals(a: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `499 + a * (86 ±0)` - // Estimated: `5332 + a * (2635 ±0)` - // Minimum execution time: 29_050 nanoseconds. - Weight::from_parts(47_517_757, 5332) - // Standard Error: 73_418 - .saturating_add(Weight::from_parts(24_955_809, 0).saturating_mul(a.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 2635).saturating_mul(a.into())) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Metadata (r:1 w:0) - /// Proof: CustomAssets Metadata (max_values: None, max_size: Some(152), added: 2627, mode: MaxEncodedLen) - fn finish_destroy() -> Weight { - // Proof Size summary in bytes: - // Measured: `376` - // Estimated: `5324` - // Minimum execution time: 27_720 nanoseconds. - Weight::from_parts(29_560_000, 5324) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:1 w:1) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - fn mint() -> Weight { - // Proof Size summary in bytes: - // Measured: `376` - // Estimated: `5286` - // Minimum execution time: 47_300 nanoseconds. - Weight::from_parts(48_191_000, 5286) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:1 w:1) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - fn burn() -> Weight { - // Proof Size summary in bytes: - // Measured: `481` - // Estimated: `5286` - // Minimum execution time: 56_541 nanoseconds. - Weight::from_parts(57_720_000, 5286) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:2 w:2) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `520` - // Estimated: `10482` - // Minimum execution time: 66_921 nanoseconds. - Weight::from_parts(81_670_000, 10482) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:2 w:2) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - fn transfer_keep_alive() -> Weight { - // Proof Size summary in bytes: - // Measured: `520` - // Estimated: `10482` - // Minimum execution time: 70_230 nanoseconds. - Weight::from_parts(71_750_000, 10482) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:2 w:2) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - fn force_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `520` - // Estimated: `10482` - // Minimum execution time: 81_470 nanoseconds. - Weight::from_parts(83_780_000, 10482) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: CustomAssets Asset (r:1 w:0) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:1 w:1) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - fn freeze() -> Weight { - // Proof Size summary in bytes: - // Measured: `481` - // Estimated: `5286` - // Minimum execution time: 31_790 nanoseconds. - Weight::from_parts(32_470_000, 5286) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:0) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:1 w:1) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - fn thaw() -> Weight { - // Proof Size summary in bytes: - // Measured: `481` - // Estimated: `5286` - // Minimum execution time: 31_250 nanoseconds. - Weight::from_parts(32_661_000, 5286) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - fn freeze_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `410` - // Estimated: `2697` - // Minimum execution time: 24_740 nanoseconds. - Weight::from_parts(25_781_000, 2697) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - fn thaw_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `410` - // Estimated: `2697` - // Minimum execution time: 23_900 nanoseconds. - Weight::from_parts(25_160_000, 2697) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Metadata (r:1 w:0) - /// Proof: CustomAssets Metadata (max_values: None, max_size: Some(152), added: 2627, mode: MaxEncodedLen) - fn transfer_ownership() -> Weight { - // Proof Size summary in bytes: - // Measured: `376` - // Estimated: `5324` - // Minimum execution time: 29_690 nanoseconds. - Weight::from_parts(30_700_000, 5324) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - fn set_team() -> Weight { - // Proof Size summary in bytes: - // Measured: `376` - // Estimated: `2697` - // Minimum execution time: 26_960 nanoseconds. - Weight::from_parts(28_210_000, 2697) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:0) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Metadata (r:1 w:1) - /// Proof: CustomAssets Metadata (max_values: None, max_size: Some(152), added: 2627, mode: MaxEncodedLen) - /// The range of component `n` is `[0, 50]`. - /// The range of component `s` is `[0, 50]`. - fn set_metadata(n: u32, s: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `376` - // Estimated: `5324` - // Minimum execution time: 35_650 nanoseconds. - Weight::from_parts(44_501_301, 5324) - // Standard Error: 2_153 - .saturating_add(Weight::from_parts(14_080, 0).saturating_mul(n.into())) - // Standard Error: 2_153 - .saturating_add(Weight::from_parts(8_285, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:0) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Metadata (r:1 w:1) - /// Proof: CustomAssets Metadata (max_values: None, max_size: Some(152), added: 2627, mode: MaxEncodedLen) - fn clear_metadata() -> Weight { - // Proof Size summary in bytes: - // Measured: `569` - // Estimated: `5324` - // Minimum execution time: 45_190 nanoseconds. - Weight::from_parts(45_860_000, 5324) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:0) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Metadata (r:1 w:1) - /// Proof: CustomAssets Metadata (max_values: None, max_size: Some(152), added: 2627, mode: MaxEncodedLen) - /// The range of component `n` is `[0, 50]`. - /// The range of component `s` is `[0, 50]`. - fn force_set_metadata(n: u32, s: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `183` - // Estimated: `5324` - // Minimum execution time: 23_380 nanoseconds. - Weight::from_parts(29_007_377, 5324) - // Standard Error: 1_825 - .saturating_add(Weight::from_parts(5_450, 0).saturating_mul(n.into())) - // Standard Error: 1_825 - .saturating_add(Weight::from_parts(9_969, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:0) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Metadata (r:1 w:1) - /// Proof: CustomAssets Metadata (max_values: None, max_size: Some(152), added: 2627, mode: MaxEncodedLen) - fn force_clear_metadata() -> Weight { - // Proof Size summary in bytes: - // Measured: `569` - // Estimated: `5324` - // Minimum execution time: 36_830 nanoseconds. - Weight::from_parts(44_640_000, 5324) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - fn force_asset_status() -> Weight { - // Proof Size summary in bytes: - // Measured: `376` - // Estimated: `2697` - // Minimum execution time: 22_220 nanoseconds. - Weight::from_parts(26_050_000, 2697) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Approvals (r:1 w:1) - /// Proof: CustomAssets Approvals (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - fn approve_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `410` - // Estimated: `5332` - // Minimum execution time: 40_120 nanoseconds. - Weight::from_parts(49_370_000, 5332) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Approvals (r:1 w:1) - /// Proof: CustomAssets Approvals (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - /// Storage: CustomAssets Account (r:2 w:2) - /// Proof: CustomAssets Account (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - fn transfer_approved() -> Weight { - // Proof Size summary in bytes: - // Measured: `687` - // Estimated: `13117` - // Minimum execution time: 95_171 nanoseconds. - Weight::from_parts(106_670_000, 13117) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(5)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Approvals (r:1 w:1) - /// Proof: CustomAssets Approvals (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - fn cancel_approval() -> Weight { - // Proof Size summary in bytes: - // Measured: `577` - // Estimated: `5332` - // Minimum execution time: 52_550 nanoseconds. - Weight::from_parts(54_550_000, 5332) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: CustomAssets Asset (r:1 w:1) - /// Proof: CustomAssets Asset (max_values: None, max_size: Some(222), added: 2697, mode: MaxEncodedLen) - /// Storage: CustomAssets Approvals (r:1 w:1) - /// Proof: CustomAssets Approvals (max_values: None, max_size: Some(160), added: 2635, mode: MaxEncodedLen) - fn force_cancel_approval() -> Weight { - // Proof Size summary in bytes: - // Measured: `577` - // Estimated: `5332` - // Minimum execution time: 53_511 nanoseconds. - Weight::from_parts(55_160_000, 5332) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index f2a25adea..a32835f6e 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -11,7 +11,6 @@ orml-currencies = { workspace = true } orml-tokens = { workspace = true } orml-traits = { workspace = true } pallet-asset-tx-payment = { workspace = true } -pallet-assets = { workspace = true } pallet-balances = { workspace = true } pallet-bounties = { workspace = true } pallet-collective = { workspace = true } @@ -108,7 +107,6 @@ xcm-executor = { workspace = true, optional = true } common-runtime = { workspace = true } zeitgeist-primitives = { workspace = true } -zrml-asset-router = { workspace = true } zrml-authorized = { workspace = true } zrml-court = { workspace = true } zrml-global-disputes = { workspace = true, optional = true } @@ -186,7 +184,6 @@ runtime-benchmarks = [ "orml-benchmarking", "orml-tokens/runtime-benchmarks", "orml-xtokens?/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", "pallet-author-inherent?/runtime-benchmarks", "pallet-author-mapping?/runtime-benchmarks", "pallet-author-slot-filter?/runtime-benchmarks", @@ -236,7 +233,6 @@ std = [ "orml-currencies/std", "orml-tokens/std", "orml-traits/std", - "pallet-assets/std", "pallet-asset-tx-payment/std", "pallet-balances/std", "pallet-bounties/std", @@ -350,7 +346,6 @@ try-runtime = [ "pallet-preimage/try-runtime", # Money runtime pallets - "pallet-assets/try-runtime", "pallet-asset-tx-payment/try-runtime", "pallet-balances/try-runtime", "pallet-bounties/try-runtime", @@ -377,7 +372,6 @@ try-runtime = [ "orml-xtokens?/try-runtime", # Zeitgeist runtime pallets - "zrml-asset-router/try-runtime", "zrml-authorized/try-runtime", "zrml-court/try-runtime", "zrml-hybrid-router/try-runtime", diff --git a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs index 525a2e369..5343a2bff 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs @@ -18,7 +18,8 @@ use crate::{ xcm_config::config::{general_key, zeitgeist}, - AccountId, AssetRegistry, Assets, Balance, ExistentialDeposit, Runtime, RuntimeOrigin, System, + AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Runtime, RuntimeOrigin, + System, }; use frame_support::{assert_ok, traits::GenesisBuild}; use orml_traits::asset_registry::AssetMetadata; @@ -27,10 +28,10 @@ use xcm::{ latest::{Junction::Parachain, Junctions::X2, MultiLocation}, VersionedMultiLocation, }; -use zeitgeist_primitives::types::{CustomMetadata, XcmAsset}; +use zeitgeist_primitives::types::{Asset, CustomMetadata}; pub(super) struct ExtBuilder { - balances: Vec<(AccountId, Assets, Balance)>, + balances: Vec<(AccountId, CurrencyId, Balance)>, parachain_id: u32, } @@ -41,7 +42,7 @@ impl Default for ExtBuilder { } impl ExtBuilder { - pub fn set_balances(mut self, balances: Vec<(AccountId, Assets, Balance)>) -> Self { + pub fn set_balances(mut self, balances: Vec<(AccountId, CurrencyId, Balance)>) -> Self { self.balances = balances; self } @@ -53,7 +54,7 @@ impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - let native_currency_id = Assets::Ztg; + let native_currency_id = CurrencyId::Ztg; pallet_balances::GenesisConfig:: { balances: self .balances @@ -71,9 +72,6 @@ impl ExtBuilder { .balances .into_iter() .filter(|(_, currency_id, _)| *currency_id != native_currency_id) - .map(|(account_id, currency_id, initial_balance)| { - (account_id, currency_id.try_into().unwrap(), initial_balance) - }) .collect::>(), } .assimilate_storage(&mut t) @@ -106,11 +104,11 @@ pub const BOB: AccountId32 = AccountId32::new([1u8; 32]); pub const PARA_ID_SIBLING: u32 = 3000; /// IDs that are used to represent tokens from other chains -pub const FOREIGN_ZTG_ID: XcmAsset = XcmAsset::ForeignAsset(0); -pub const FOREIGN_PARENT_ID: XcmAsset = XcmAsset::ForeignAsset(1); -pub const FOREIGN_SIBLING_ID: XcmAsset = XcmAsset::ForeignAsset(2); -pub const BTC_ID: XcmAsset = XcmAsset::ForeignAsset(3); -pub const ETH_ID: XcmAsset = XcmAsset::ForeignAsset(4); +pub const FOREIGN_ZTG_ID: Asset = CurrencyId::ForeignAsset(0); +pub const FOREIGN_PARENT_ID: Asset = CurrencyId::ForeignAsset(1); +pub const FOREIGN_SIBLING_ID: Asset = CurrencyId::ForeignAsset(2); +pub const BTC_ID: Asset = CurrencyId::ForeignAsset(3); +pub const ETH_ID: Asset = CurrencyId::ForeignAsset(4); #[inline] pub(super) const fn ztg(amount: Balance) -> Balance { diff --git a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs index c8f212d12..11f94529b 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs @@ -17,8 +17,8 @@ // along with Zeitgeist. If not, see . use crate::{ - parameters::ZeitgeistTreasuryAccount, xcm_config::config::zeitgeist, Assets, DmpQueue, Runtime, - RuntimeOrigin, XcmpQueue, + parameters::ZeitgeistTreasuryAccount, xcm_config::config::zeitgeist, CurrencyId, DmpQueue, + Runtime, RuntimeOrigin, XcmpQueue, }; use frame_support::{traits::GenesisBuild, weights::Weight}; use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; @@ -99,9 +99,9 @@ pub(super) fn relay_ext() -> sp_io::TestExternalities { pub(super) fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { ExtBuilder::default() .set_balances(vec![ - (ALICE, Assets::Ztg, ztg(10)), - (ALICE, FOREIGN_PARENT_ID.into(), dot(10)), - (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID.into(), dot(10)), + (ALICE, CurrencyId::Ztg, ztg(10)), + (ALICE, FOREIGN_PARENT_ID, dot(10)), + (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, dot(10)), ]) .set_parachain_id(parachain_id) .build() diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs index d23021334..da7e3ee03 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs @@ -26,96 +26,81 @@ use crate::{ test_net::Zeitgeist, }, xcm_config::config::{general_key, zeitgeist, AssetConvert}, - Assets, CustomMetadata, ScalarPosition, XcmAsset, + CurrencyId, }; -use core::fmt::Debug; + use frame_support::assert_err; use sp_runtime::traits::Convert as C2; -use test_case::test_case; use xcm::latest::{Junction::*, Junctions::*, MultiLocation}; use xcm_emulator::TestExt; use xcm_executor::traits::Convert as C1; -fn convert_common_native(expected: T) -where - T: Copy + Debug + PartialEq, - AssetConvert: C1 + C2>, -{ +#[test] +fn convert_native() { assert_eq!(zeitgeist::KEY.to_vec(), vec![0, 1]); // The way Ztg is represented relative within the Zeitgeist runtime let ztg_location_inner: MultiLocation = MultiLocation::new(0, X1(general_key(zeitgeist::KEY))); - assert_eq!(>::convert(ztg_location_inner), Ok(expected)); + assert_eq!(>::convert(ztg_location_inner), Ok(CurrencyId::Ztg)); // The canonical way Ztg is represented out in the wild Zeitgeist::execute_with(|| { - assert_eq!(>::convert(expected), Some(foreign_ztg_multilocation())) + assert_eq!( + >::convert(CurrencyId::Ztg), + Some(foreign_ztg_multilocation()) + ) }); } -fn convert_common_non_native( - expected: T, - multilocation: MultiLocation, - register: fn(Option), -) where - T: Copy + Debug + PartialEq, - AssetConvert: C1 + C2>, -{ +#[test] +fn convert_any_registered_parent_multilocation() { Zeitgeist::execute_with(|| { - assert_err!(>::convert(multilocation), multilocation); - assert_eq!(>::convert(expected), None); + assert_err!( + >::convert(foreign_parent_multilocation()), + foreign_parent_multilocation() + ); + + assert_eq!(>::convert(FOREIGN_PARENT_ID), None); + // Register parent as foreign asset in the Zeitgeist parachain - register(None); - assert_eq!(>::convert(multilocation), Ok(expected)); - assert_eq!(>::convert(expected), Some(multilocation)); - }); -} + register_foreign_parent(None); -#[test] -fn convert_native_assets() { - convert_common_native(Assets::Ztg); -} + assert_eq!( + >::convert(foreign_parent_multilocation()), + Ok(FOREIGN_PARENT_ID), + ); -#[test] -fn convert_native_xcm_assets() { - convert_common_native(XcmAsset::Ztg); + assert_eq!( + >::convert(FOREIGN_PARENT_ID), + Some(foreign_parent_multilocation()) + ); + }); } #[test] -fn convert_any_registered_parent_multilocation_assets() { - convert_common_non_native( - Assets::from(FOREIGN_PARENT_ID), - foreign_parent_multilocation(), - register_foreign_parent, - ); -} +fn convert_any_registered_sibling_multilocation() { + Zeitgeist::execute_with(|| { + assert_err!( + >::convert(foreign_sibling_multilocation()), + foreign_sibling_multilocation() + ); -#[test] -fn convert_any_registered_parent_multilocation_xcm_assets() { - convert_common_non_native( - XcmAsset::try_from(Assets::from(FOREIGN_PARENT_ID)).unwrap(), - foreign_parent_multilocation(), - register_foreign_parent, - ); -} + assert_eq!(>::convert(FOREIGN_SIBLING_ID), None); -#[test] -fn convert_any_registered_sibling_multilocation_assets() { - convert_common_non_native( - Assets::from(FOREIGN_SIBLING_ID), - foreign_sibling_multilocation(), - register_foreign_sibling, - ); -} + // Register sibling as foreign asset in the Zeitgeist parachain + register_foreign_sibling(None); -#[test] -fn convert_any_registered_sibling_multilocation_xcm_assets() { - convert_common_non_native( - XcmAsset::try_from(Assets::from(FOREIGN_SIBLING_ID)).unwrap(), - foreign_sibling_multilocation(), - register_foreign_sibling, - ); + assert_eq!( + >::convert(foreign_sibling_multilocation()), + Ok(FOREIGN_SIBLING_ID), + ); + + assert_eq!( + >::convert(FOREIGN_SIBLING_ID), + Some(foreign_sibling_multilocation()) + ); + }); } #[test] @@ -124,46 +109,13 @@ fn convert_unkown_multilocation() { MultiLocation::new(1, X2(Parachain(zeitgeist::ID), general_key(&[42]))); Zeitgeist::execute_with(|| { - assert!(>::convert(unknown_location).is_err()); + assert!(>::convert(unknown_location).is_err()); }); } -#[test_case( - Assets::CategoricalOutcome(7, 8); - "assets_categorical" -)] -#[test_case( - Assets::ScalarOutcome(7, ScalarPosition::Long); - "assets_scalar" -)] -#[test_case( - Assets::PoolShare(7); - "assets_pool_share" -)] -#[test_case( - Assets::ForeignAsset(7); - "assets_foreign" -)] -#[test_case( - Assets::ParimutuelShare(7, 8); - "assets_parimutuel_share" -)] -#[test_case( - Assets::CampaignAsset(7); - "assets_campaign_asset" -)] -#[test_case( - Assets::CustomAsset(7); - "assets_custom_asset" -)] -#[test_case( - XcmAsset::ForeignAsset(7); - "xcm_assets_foreign" -)] -fn convert_unsupported_asset(asset: T) -where - T: Copy + Debug + PartialEq, - AssetConvert: C2>, -{ - Zeitgeist::execute_with(|| assert_eq!(>::convert(asset), None)); +#[test] +fn convert_unsupported_currency() { + Zeitgeist::execute_with(|| { + assert_eq!(>::convert(CurrencyId::CombinatorialOutcome), None) + }); } diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs index bb5d66e3a..2638f76f5 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs @@ -26,7 +26,7 @@ use crate::{ test_net::{PolkadotNet, Sibling, TestNet, Zeitgeist}, }, xcm_config::{config::zeitgeist, fees::default_per_second}, - AssetManager, AssetRegistry, Balance, Balances, RuntimeOrigin, XTokens, + AssetRegistry, Balance, Balances, CurrencyId, RuntimeOrigin, Tokens, XTokens, ZeitgeistTreasuryAccount, }; @@ -36,7 +36,7 @@ use xcm::latest::{Junction, Junction::*, Junctions::*, MultiLocation, WeightLimi use xcm_emulator::TestExt; use zeitgeist_primitives::{ constants::{BalanceFractionalDecimals, BASE}, - types::{CustomMetadata, XcmAsset, XcmMetadata}, + types::{CustomMetadata, XcmMetadata}, }; #[test] @@ -49,8 +49,8 @@ fn transfer_ztg_to_sibling() { Sibling::execute_with(|| { treasury_initial_balance = - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &ZeitgeistTreasuryAccount::get()); - assert_eq!(AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB), 0); + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); register_foreign_ztg(None); }); @@ -59,7 +59,7 @@ fn transfer_ztg_to_sibling() { assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(ALICE), - XcmAsset::Ztg, + CurrencyId::Ztg, transfer_amount, Box::new( MultiLocation::new( @@ -82,14 +82,14 @@ fn transfer_ztg_to_sibling() { }); Sibling::execute_with(|| { - let current_balance = AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB); + let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); // Verify that BOB now has (amount transferred - fee) assert_eq!(current_balance, transfer_amount - ztg_fee()); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &ZeitgeistTreasuryAccount::get()), + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), treasury_initial_balance + ztg_fee() ) }); @@ -123,7 +123,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { Sibling::execute_with(|| { assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), 0); - assert_eq!(AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB), bob_initial_balance); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(BOB), FOREIGN_ZTG_ID, @@ -143,7 +143,7 @@ fn transfer_ztg_sibling_to_zeitgeist() { // Confirm that Bobs's balance is initial balance - amount transferred assert_eq!( - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB), + Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance - transfer_amount ); }); @@ -181,12 +181,8 @@ fn transfer_btc_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { register_btc(None); - treasury_initial_balance = - AssetManager::free_balance(BTC_ID.into(), &ZeitgeistTreasuryAccount::get()); - assert_eq!( - AssetManager::free_balance(BTC_ID.into(), &ALICE), - zeitgeist_alice_initial_balance, - ); + treasury_initial_balance = Tokens::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()); + assert_eq!(Tokens::free_balance(BTC_ID, &ALICE), zeitgeist_alice_initial_balance,); }); Sibling::execute_with(|| { @@ -200,8 +196,8 @@ fn transfer_btc_sibling_to_zeitgeist() { )); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(ALICE), - // Target chain will interpret XcmAsset::Ztg as BTC in this context. - XcmAsset::Ztg, + // Target chain will interpret CurrencyId::Ztg as BTC in this context. + CurrencyId::Ztg, transfer_amount, Box::new( MultiLocation::new( @@ -232,13 +228,13 @@ fn transfer_btc_sibling_to_zeitgeist() { // Verify that remote Alice now has initial balance + amount transferred - fee assert_eq!( - AssetManager::free_balance(BTC_ID.into(), &ALICE), + Tokens::free_balance(BTC_ID, &ALICE), zeitgeist_alice_initial_balance + expected_adjusted, ); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - AssetManager::free_balance(BTC_ID.into(), &ZeitgeistTreasuryAccount::get()), + Tokens::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()), // Align decimal fractional places treasury_initial_balance + adjusted_balance(btc(1), btc_fee()) ) @@ -256,7 +252,7 @@ fn transfer_btc_zeitgeist_to_sibling() { transfer_btc_sibling_to_zeitgeist(); Sibling::execute_with(|| { - assert_eq!(AssetManager::free_balance(BTC_ID.into(), &BOB), sibling_bob_initial_balance,); + assert_eq!(Tokens::free_balance(BTC_ID, &BOB), sibling_bob_initial_balance,); }); Zeitgeist::execute_with(|| { @@ -278,7 +274,7 @@ fn transfer_btc_zeitgeist_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(AssetManager::free_balance(BTC_ID.into(), &ALICE), 0); + assert_eq!(Tokens::free_balance(BTC_ID, &ALICE), 0); }); Sibling::execute_with(|| { @@ -308,12 +304,8 @@ fn transfer_eth_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { register_eth(None); - treasury_initial_balance = - AssetManager::free_balance(ETH_ID.into(), &ZeitgeistTreasuryAccount::get()); - assert_eq!( - AssetManager::free_balance(ETH_ID.into(), &ALICE), - zeitgeist_alice_initial_balance, - ); + treasury_initial_balance = Tokens::free_balance(ETH_ID, &ZeitgeistTreasuryAccount::get()); + assert_eq!(Tokens::free_balance(ETH_ID, &ALICE), zeitgeist_alice_initial_balance,); }); Sibling::execute_with(|| { @@ -333,8 +325,8 @@ fn transfer_eth_sibling_to_zeitgeist() { )); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(ALICE), - // Target chain will interpret XcmAsset::Ztg as ETH in this context. - XcmAsset::Ztg, + // Target chain will interpret CurrencyId::Ztg as ETH in this context. + CurrencyId::Ztg, transfer_amount, Box::new( MultiLocation::new( @@ -365,13 +357,13 @@ fn transfer_eth_sibling_to_zeitgeist() { // Verify that remote Alice now has initial balance + amount transferred - fee assert_eq!( - AssetManager::free_balance(ETH_ID.into(), &ALICE), + Tokens::free_balance(ETH_ID, &ALICE), zeitgeist_alice_initial_balance + expected_adjusted, ); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - AssetManager::free_balance(ETH_ID.into(), &ZeitgeistTreasuryAccount::get()), + Tokens::free_balance(ETH_ID, &ZeitgeistTreasuryAccount::get()), // Align decimal fractional places treasury_initial_balance + adjusted_balance(eth(1), eth_fee()) ) @@ -389,7 +381,7 @@ fn transfer_eth_zeitgeist_to_sibling() { transfer_eth_sibling_to_zeitgeist(); Sibling::execute_with(|| { - assert_eq!(AssetManager::free_balance(ETH_ID.into(), &BOB), sibling_bob_initial_balance,); + assert_eq!(Tokens::free_balance(ETH_ID, &BOB), sibling_bob_initial_balance,); }); Zeitgeist::execute_with(|| { @@ -411,7 +403,7 @@ fn transfer_eth_zeitgeist_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(AssetManager::free_balance(ETH_ID.into(), &ALICE), 0); + assert_eq!(Tokens::free_balance(ETH_ID, &ALICE), 0); }); Sibling::execute_with(|| { @@ -453,10 +445,7 @@ fn transfer_dot_from_relay_chain() { }); Zeitgeist::execute_with(|| { - assert_eq!( - AssetManager::free_balance(FOREIGN_PARENT_ID.into(), &BOB), - transfer_amount - dot_fee() - ); + assert_eq!(Tokens::free_balance(FOREIGN_PARENT_ID, &BOB), transfer_amount - dot_fee()); }); } @@ -468,7 +457,7 @@ fn transfer_dot_to_relay_chain() { transfer_dot_from_relay_chain(); Zeitgeist::execute_with(|| { - let initial_balance = AssetManager::free_balance(FOREIGN_PARENT_ID.into(), &ALICE); + let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE); assert!(initial_balance >= transfer_amount); assert_ok!(XTokens::transfer( @@ -483,7 +472,7 @@ fn transfer_dot_to_relay_chain() { )); assert_eq!( - AssetManager::free_balance(FOREIGN_PARENT_ID.into(), &ALICE), + Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE), initial_balance - transfer_amount ) }); @@ -505,8 +494,8 @@ fn transfer_ztg_to_sibling_with_custom_fee() { Sibling::execute_with(|| { treasury_initial_balance = - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &ZeitgeistTreasuryAccount::get()); - assert_eq!(AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB), 0); + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); + assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); register_foreign_ztg(None); let custom_metadata = CustomMetadata { @@ -529,7 +518,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( RuntimeOrigin::signed(ALICE), - XcmAsset::Ztg, + CurrencyId::Ztg, transfer_amount, Box::new( MultiLocation::new( @@ -552,7 +541,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { }); Sibling::execute_with(|| { - let current_balance = AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &BOB); + let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); let custom_fee = calc_fee(default_per_second(10) * 10); // Verify that BOB now has (amount transferred - fee) @@ -563,7 +552,7 @@ fn transfer_ztg_to_sibling_with_custom_fee() { // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - AssetManager::free_balance(FOREIGN_ZTG_ID.into(), &ZeitgeistTreasuryAccount::get()), + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), treasury_initial_balance + custom_fee ) }); diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index 4fcde1f80..cef575871 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -30,7 +30,7 @@ use common_runtime::{ }; pub use frame_system::{ Call as SystemCall, CheckEra, CheckGenesis, CheckNonZeroSender, CheckNonce, CheckSpecVersion, - CheckTxVersion, CheckWeight, EnsureNever, EnsureSigned, + CheckTxVersion, CheckWeight, }; #[cfg(feature = "parachain")] pub use pallet_author_slot_filter::EligibilityValue; @@ -41,15 +41,11 @@ pub use crate::parachain_params::*; pub use crate::parameters::*; use alloc::vec; use frame_support::{ - traits::{ - AsEnsureOriginWithArg, ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly, - InstanceFilter, Nothing, - }, + traits::{ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter, Nothing}, weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee, Weight}, }; use frame_system::{EnsureRoot, EnsureWithSuccess}; use pallet_collective::{EnsureProportionAtLeast, EnsureProportionMoreThan, PrimeDefaultVote}; -use parity_scale_codec::Compact; use sp_runtime::traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256}; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -58,7 +54,7 @@ use zeitgeist_primitives::{constants::*, types::*}; use zrml_rikiddo::types::{EmaMarketVolume, FeeSigmoid, RikiddoSigmoidMV}; #[cfg(feature = "parachain")] use { - frame_support::traits::Everything, + frame_support::traits::{AsEnsureOriginWithArg, Everything}, xcm_builder::{EnsureXcmOrigin, FixedWeightBounds}, xcm_config::{ asset_registry::CustomAssetProcessor, @@ -116,7 +112,6 @@ impl Contains for IsCallable { kill_prefix, kill_storage, set_code, set_code_without_checks, set_storage, }; use orml_currencies::Call::update_balance; - use pallet_assets::Call::{destroy_accounts, destroy_approvals, finish_destroy}; use pallet_balances::Call::{force_transfer, set_balance}; use pallet_collective::Call::set_members; use pallet_contracts::Call::{ @@ -150,26 +145,6 @@ impl Contains for IsCallable { _ => true, } } - // Asset destruction is managed. Instead of deleting those dispatchable calls, they are - // filtered here instead to allow root to interact in case of emergency. - RuntimeCall::CampaignAssets(inner_call) => match inner_call { - destroy_accounts { .. } => false, - destroy_approvals { .. } => false, - finish_destroy { .. } => false, - _ => true, - }, - RuntimeCall::CustomAssets(inner_call) => match inner_call { - destroy_accounts { .. } => false, - destroy_approvals { .. } => false, - finish_destroy { .. } => false, - _ => true, - }, - RuntimeCall::MarketAssets(inner_call) => match inner_call { - destroy_accounts { .. } => false, - destroy_approvals { .. } => false, - finish_destroy { .. } => false, - _ => true, - }, // Permissioned contracts: Only deployable via utility.dispatch_as(...) RuntimeCall::Contracts(inner_call) => match inner_call { call { .. } => true, diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index a5c1eacf8..250173ea3 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -22,7 +22,7 @@ clippy::arithmetic_side_effects )] -use super::{CampaignAssetsInstance, Runtime, VERSION}; +use super::{Runtime, VERSION}; use frame_support::{ dispatch::DispatchClass, parameter_types, @@ -35,7 +35,6 @@ use frame_support::{ }; use frame_system::limits::{BlockLength, BlockWeights}; use orml_traits::parameter_type_with_key; -use pallet_assets::WeightInfo; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; use sp_runtime::{ traits::{AccountIdConversion, Bounded}, @@ -64,44 +63,6 @@ parameter_types! { } parameter_types! { - // Asset-Router - pub DestroyAccountWeight: Weight = - >::WeightInfo::destroy_accounts(1); - pub DestroyApprovalWeight: Weight = - >::WeightInfo::destroy_approvals(1); - pub DestroyFinishWeight: Weight = - >::WeightInfo::finish_destroy(); - - // Assets (Campaign) - pub const CampaignAssetsAccountDeposit: Balance = deposit(1, 16); - pub const CampaignAssetsApprovalDeposit: Balance = ExistentialDeposit::get(); - /// The amount of native currency that is frozen during the whole lifetime - /// of an asset class. Freezing happens at asset class creation. - /// Irrelevant - No origin can successfully call the associated dispatchable call. - pub const CampaignAssetsDeposit: Balance = 400 * BASE; - pub const CampaignAssetsStringLimit: u32 = 256; - pub const CampaignAssetsMetadataDepositBase: Balance = deposit(1, 68); - pub const CampaignAssetsMetadataDepositPerByte: Balance = deposit(0, 1); - - // Assets (Custom) - pub const CustomAssetsAccountDeposit: Balance = deposit(1, 16); - pub const CustomAssetsApprovalDeposit: Balance = ExistentialDeposit::get(); - pub const CustomAssetsDeposit: Balance = 400 * BASE; - pub const CustomAssetsStringLimit: u32 = 50; - pub const CustomAssetsMetadataDepositBase: Balance = deposit(1, 68); - pub const CustomAssetsMetadataDepositPerByte: Balance = deposit(0, 1); - - // Assets (Market) - pub const MarketAssetsAccountDeposit: Balance = deposit(1, 16); - pub const MarketAssetsApprovalDeposit: Balance = ExistentialDeposit::get(); - /// The amount of native currency that is frozen during the whole lifetime - /// if an asset class. Freezing happens at asset class creation. - /// Irrelevant - No origin can successfully call the associated dispatchable call. - pub const MarketAssetsDeposit: Balance = 400 * BASE; - pub const MarketAssetsStringLimit: u32 = 50; - pub const MarketAssetsMetadataDepositBase: Balance = deposit(1, 68); - pub const MarketAssetsMetadataDepositPerByte: Balance = deposit(0, 1); - // Authorized pub const AuthorizedPalletId: PalletId = AUTHORIZED_PALLET_ID; pub const CorrectionPeriod: BlockNumber = BLOCKS_PER_DAY; @@ -242,7 +203,7 @@ parameter_types! { pub const MaxLiquidityTreeDepth: u32 = 9u32; // ORML - pub const GetNativeCurrencyId: Assets = Asset::Ztg; + pub const GetNativeCurrencyId: CurrencyId = Asset::Ztg; // Prediction Market parameters /// (Slashable) Bond that is provided for creating an advised market that needs approval. @@ -401,8 +362,6 @@ parameter_types! { .build_or_panic(); // Transaction payment - /// A fee multiplier applied to the calculated fee factor for `CampaignAsset` - pub const CampaignAssetFeeMultiplier: u32 = 100; /// A fee mulitplier for Operational extrinsics to compute “virtual tip” /// to boost their priority. pub const OperationalFeeMultiplier: u8 = 5; @@ -510,17 +469,17 @@ parameter_type_with_key! { // are cleaned up automatically. In case of scalar outcomes, the market account can have dust. // Unless LPs use `pool_exit_with_exact_asset_amount`, there can be some dust pool shares remaining. // Explicit match arms are used to ensure new asset types are respected. - pub ExistentialDeposits: |currency_id: Currencies| -> Balance { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { - Currencies::CategoricalOutcome(_, _) => ExistentialDeposit::get(), - Currencies::ParimutuelShare(_, _) => ExistentialDeposit::get(), - Currencies::PoolShare(_) => ExistentialDeposit::get(), - Currencies::ScalarOutcome(_, _) => ExistentialDeposit::get(), + Asset::CategoricalOutcome(_,_) => ExistentialDeposit::get(), + Asset::CombinatorialOutcome => ExistentialDeposit::get(), + Asset::PoolShare(_) => ExistentialDeposit::get(), + Asset::ScalarOutcome(_,_) => ExistentialDeposit::get(), #[cfg(feature = "parachain")] - Currencies::ForeignAsset(id) => { + Asset::ForeignAsset(id) => { let maybe_metadata = < orml_asset_registry::Pallet as orml_traits::asset_registry::Inspect - >::metadata(&XcmAsset::ForeignAsset(*id)); + >::metadata(&Asset::ForeignAsset(*id)); if let Some(metadata) = maybe_metadata { return metadata.existential_deposit; @@ -529,7 +488,9 @@ parameter_type_with_key! { 1 } #[cfg(not(feature = "parachain"))] - Currencies::ForeignAsset(_) => ExistentialDeposit::get(), + Asset::ForeignAsset(_) => ExistentialDeposit::get(), + Asset::Ztg => ExistentialDeposit::get(), + Asset::ParimutuelShare(_, _) => ExistentialDeposit::get(), } }; } diff --git a/runtime/zeitgeist/src/xcm_config/asset_registry.rs b/runtime/zeitgeist/src/xcm_config/asset_registry.rs index 9deb85aa0..92746377d 100644 --- a/runtime/zeitgeist/src/xcm_config/asset_registry.rs +++ b/runtime/zeitgeist/src/xcm_config/asset_registry.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{Balance, XcmAsset}; +use crate::{Balance, CurrencyId}; use orml_traits::asset_registry::{AssetMetadata, AssetProcessor}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -29,11 +29,11 @@ use zeitgeist_primitives::types::CustomMetadata; /// Only pre check is to ensure an asset id was passed. pub struct CustomAssetProcessor; -impl AssetProcessor> for CustomAssetProcessor { +impl AssetProcessor> for CustomAssetProcessor { fn pre_register( - id: Option, + id: Option, metadata: AssetMetadata, - ) -> Result<(XcmAsset, AssetMetadata), DispatchError> { + ) -> Result<(CurrencyId, AssetMetadata), DispatchError> { match id { Some(id) => Ok((id, metadata)), None => Err(DispatchError::Other("asset-registry: AssetId is required")), @@ -41,7 +41,7 @@ impl AssetProcessor> for Custom } fn post_register( - _id: XcmAsset, + _id: CurrencyId, _asset_metadata: AssetMetadata, ) -> Result<(), DispatchError> { Ok(()) diff --git a/runtime/zeitgeist/src/xcm_config/config.rs b/runtime/zeitgeist/src/xcm_config/config.rs index 27d6c1e54..f9424eaea 100644 --- a/runtime/zeitgeist/src/xcm_config/config.rs +++ b/runtime/zeitgeist/src/xcm_config/config.rs @@ -18,9 +18,9 @@ use super::fees::{native_per_second, FixedConversionRateProvider}; use crate::{ - AccountId, AssetManager, AssetRegistry, Assets, Balance, MaxAssetsIntoHolding, MaxInstructions, - ParachainInfo, ParachainSystem, PolkadotXcm, RelayChainOrigin, RelayNetwork, RuntimeCall, - RuntimeOrigin, UnitWeightCost, UniversalLocation, UnknownTokens, XcmpQueue, + AccountId, AssetManager, AssetRegistry, Balance, CurrencyId, MaxAssetsIntoHolding, + MaxInstructions, ParachainInfo, ParachainSystem, PolkadotXcm, RelayChainOrigin, RelayNetwork, + RuntimeCall, RuntimeOrigin, UnitWeightCost, UniversalLocation, UnknownTokens, XcmpQueue, ZeitgeistTreasuryAccount, }; @@ -52,8 +52,8 @@ use xcm_builder::{ SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, }; -use xcm_executor::{traits::TransactAsset, Assets as ExecutorAssets, Config}; -use zeitgeist_primitives::{constants::BalanceFractionalDecimals, types::XcmAsset}; +use xcm_executor::{traits::TransactAsset, Assets, Config}; +use zeitgeist_primitives::{constants::BalanceFractionalDecimals, types::Asset}; pub mod zeitgeist { #[cfg(test)] @@ -157,7 +157,7 @@ impl TakeRevenue for ToTreasury { if let MultiAsset { id: Concrete(location), fun: Fungible(_amount) } = revenue { if let Ok(asset_id) = - >::convert(location) + >::convert(location) { let adj_am = AlignedFractionalMultiAssetTransactor::adjust_fractional_places(&revenue).fun; @@ -213,9 +213,9 @@ pub struct AlignedFractionalTransactAsset< } impl< - AssetRegistry: Inspect, + AssetRegistry: Inspect, FracDecPlaces: Get, - CurrencyIdConvert: Convert>, + CurrencyIdConvert: Convert>, TransactAssetDelegate: TransactAsset, > AlignedFractionalTransactAsset< @@ -226,41 +226,29 @@ impl< > { fn adjust_fractional_places(asset: &MultiAsset) -> MultiAsset { - let (asset_id, amount) = - if let Some(ref asset_id) = CurrencyIdConvert::convert(asset.clone()) { - if let Fungible(amount) = asset.fun { - (*asset_id, amount) - } else { - return asset.clone(); + if let Some(ref asset_id) = CurrencyIdConvert::convert(asset.clone()) { + if let Fungible(amount) = asset.fun { + let mut asset_updated = asset.clone(); + let native_decimals = u32::from(FracDecPlaces::get()); + let metadata = AssetRegistry::metadata(asset_id); + + if let Some(metadata) = metadata { + let decimals = metadata.decimals; + + asset_updated.fun = if decimals > native_decimals { + let power = decimals.saturating_sub(native_decimals); + let adjust_factor = 10u128.saturating_pow(power); + // Floors the adjusted token amount, thus no tokens are generated + Fungible(amount.saturating_div(adjust_factor)) + } else { + let power = native_decimals.saturating_sub(decimals); + let adjust_factor = 10u128.saturating_pow(power); + Fungible(amount.saturating_mul(adjust_factor)) + }; + + return asset_updated; } - } else { - return asset.clone(); - }; - - let currency = if let Ok(currency) = XcmAsset::try_from(asset_id) { - currency - } else { - return asset.clone(); - }; - - let metadata = AssetRegistry::metadata(¤cy); - if let Some(metadata) = metadata { - let mut asset_adjusted = asset.clone(); - let decimals = metadata.decimals; - let native_decimals = u32::from(FracDecPlaces::get()); - - asset_adjusted.fun = if decimals > native_decimals { - let power = decimals.saturating_sub(native_decimals); - let adjust_factor = 10u128.saturating_pow(power); - // Floors the adjusted token amount, thus no tokens are generated - Fungible(amount.saturating_div(adjust_factor)) - } else { - let power = native_decimals.saturating_sub(decimals); - let adjust_factor = 10u128.saturating_pow(power); - Fungible(amount.saturating_mul(adjust_factor)) - }; - - return asset_adjusted; + } } asset.clone() @@ -268,8 +256,8 @@ impl< } impl< - AssetRegistry: Inspect, - CurrencyIdConvert: Convert>, + AssetRegistry: Inspect, + CurrencyIdConvert: Convert>, FracDecPlaces: Get, TransactAssetDelegate: TransactAsset, > TransactAsset @@ -293,7 +281,7 @@ impl< asset: &MultiAsset, location: &MultiLocation, maybe_context: Option<&XcmContext>, - ) -> Result { + ) -> Result { let asset_adjusted = Self::adjust_fractional_places(asset); TransactAssetDelegate::withdraw_asset(&asset_adjusted, location, maybe_context) } @@ -303,7 +291,7 @@ impl< from: &MultiLocation, to: &MultiLocation, context: &XcmContext, - ) -> Result { + ) -> Result { let asset_adjusted = Self::adjust_fractional_places(asset); TransactAssetDelegate::transfer_asset(&asset_adjusted, from, to, context) } @@ -324,17 +312,17 @@ pub type MultiAssetTransactor = MultiCurrencyAdapter< UnknownTokens, // This means that this adapter should handle any token that `AssetConvert` can convert // using AssetManager and UnknownTokens in all other cases. - IsNativeConcrete, + IsNativeConcrete, // Our chain's account ID type (we can't get away without mentioning it explicitly). AccountId, // Convert an XCM `MultiLocation` into a local account id. LocationToAccountId, // The AssetId that corresponds to the native currency. - Assets, + CurrencyId, // Struct that provides functions to convert `Asset` <=> `MultiLocation`. AssetConvert, // In case of deposit failure, known assets will be placed in treasury. - DepositToAlternative, + DepositToAlternative, >; /// AssetConvert @@ -346,42 +334,33 @@ pub struct AssetConvert; /// Convert our `Asset` type into its `MultiLocation` representation. /// Other chains need to know how this conversion takes place in order to /// handle it on their side. -impl Convert> for AssetConvert { - fn convert(id: Assets) -> Option { +impl Convert> for AssetConvert { + fn convert(id: CurrencyId) -> Option { match id { - Assets::Ztg => Some(MultiLocation::new( + Asset::Ztg => Some(MultiLocation::new( 1, X2( Junction::Parachain(ParachainInfo::parachain_id().into()), general_key(zeitgeist::KEY), ), )), - Assets::ForeignAsset(_) => { - let asset = XcmAsset::try_from(id).ok()?; - AssetRegistry::multilocation(&asset).ok()? - } + Asset::ForeignAsset(_) => AssetRegistry::multilocation(&id).ok()?, _ => None, } } } -impl Convert> for AssetConvert { - fn convert(id: XcmAsset) -> Option { - >>::convert(id.into()) - } -} - /// Convert an incoming `MultiLocation` into a `Asset` if possible. /// Here we need to know the canonical representation of all the tokens we handle in order to /// correctly convert their `MultiLocation` representation into our internal `Asset` type. -impl xcm_executor::traits::Convert for AssetConvert { - fn convert(location: MultiLocation) -> Result { +impl xcm_executor::traits::Convert for AssetConvert { + fn convert(location: MultiLocation) -> Result { match location { MultiLocation { parents: 0, interior: X1(GeneralKey { data, length }) } => { let key = &data[..data.len().min(length as usize)]; if key == zeitgeist::KEY { - return Ok(Assets::Ztg); + return Ok(CurrencyId::Ztg); } Err(location) @@ -394,28 +373,21 @@ impl xcm_executor::traits::Convert for AssetConvert { if para_id == u32::from(ParachainInfo::parachain_id()) { if key == zeitgeist::KEY { - return Ok(Assets::Ztg); + return Ok(CurrencyId::Ztg); } return Err(location); } - AssetRegistry::location_to_asset_id(location).ok_or(location).map(|a| a.into()) + AssetRegistry::location_to_asset_id(location).ok_or(location) } - _ => AssetRegistry::location_to_asset_id(location).ok_or(location).map(|a| a.into()), + _ => AssetRegistry::location_to_asset_id(location).ok_or(location), } } } -impl xcm_executor::traits::Convert for AssetConvert { - fn convert(location: MultiLocation) -> Result { - >::convert(location) - .and_then(|asset| asset.try_into().map_err(|_| location)) - } -} - -impl Convert> for AssetConvert { - fn convert(asset: MultiAsset) -> Option { +impl Convert> for AssetConvert { + fn convert(asset: MultiAsset) -> Option { if let MultiAsset { id: Concrete(location), .. } = asset { >::convert(location).ok() } else { @@ -424,8 +396,8 @@ impl Convert> for AssetConvert { } } -impl Convert> for AssetConvert { - fn convert(location: MultiLocation) -> Option { +impl Convert> for AssetConvert { + fn convert(location: MultiLocation) -> Option { >::convert(location).ok() } } diff --git a/runtime/zeitgeist/src/xcm_config/fees.rs b/runtime/zeitgeist/src/xcm_config/fees.rs index 0b2f18661..2affbb614 100644 --- a/runtime/zeitgeist/src/xcm_config/fees.rs +++ b/runtime/zeitgeist/src/xcm_config/fees.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{Balance, XcmAsset}; +use crate::{Balance, CurrencyId}; use core::marker::PhantomData; use frame_support::weights::constants::{ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}; use xcm::latest::MultiLocation; @@ -56,7 +56,7 @@ pub struct FixedConversionRateProvider(PhantomData impl< AssetRegistry: orml_traits::asset_registry::Inspect< - AssetId = XcmAsset, + AssetId = CurrencyId, Balance = Balance, CustomMetadata = CustomMetadata, >, diff --git a/scripts/benchmarks/configuration.sh b/scripts/benchmarks/configuration.sh index cfc5d46bd..9f13d1edf 100644 --- a/scripts/benchmarks/configuration.sh +++ b/scripts/benchmarks/configuration.sh @@ -4,9 +4,9 @@ EXTERNAL_WEIGHTS_PATH="./runtime/common/src/weights/" # This script contains the configuration for other benchmarking scripts. export FRAME_PALLETS=( - frame_system pallet_assets pallet_balances pallet_bounties pallet_collective \ - pallet_contracts pallet_democracy pallet_identity pallet_membership pallet_multisig \ - pallet_preimage pallet_proxy pallet_scheduler pallet_timestamp pallet_treasury pallet_utility \ + frame_system pallet_balances pallet_bounties pallet_collective pallet_contracts \ + pallet_democracy pallet_identity pallet_membership pallet_multisig pallet_preimage \ + pallet_proxy pallet_scheduler pallet_timestamp pallet_treasury pallet_utility \ pallet_vesting \ ) # pallet_grandpa ) export FRAME_PALLETS_RUNS="${FRAME_PALLETS_RUNS:-20}" diff --git a/zrml/asset-router/Cargo.toml b/zrml/asset-router/Cargo.toml deleted file mode 100644 index 3a264a4d2..000000000 --- a/zrml/asset-router/Cargo.toml +++ /dev/null @@ -1,39 +0,0 @@ -[dependencies] -frame-support = { workspace = true } -frame-system = { workspace = true } -log = { workspace = true } -orml-traits = { workspace = true } -pallet-assets = { workspace = true } -parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } -scale-info = { workspace = true, features = ["derive"] } -sp-runtime = { workspace = true } -zeitgeist-macros = { workspace = true } -zeitgeist-primitives = { workspace = true } - -[dev-dependencies] -orml-tokens = { workspace = true, features = ["default"] } -pallet-balances = { workspace = true, features = ["default"] } -sp-io = { workspace = true, features = ["default"] } -test-case = { workspace = true } -zeitgeist-primitives = { workspace = true, features = ["default", "mock"] } - -[features] -default = ["std"] -runtime-benchmarks = ["pallet-assets/runtime-benchmarks"] -std = [ - "frame-support/std", - "frame-system/std", - "orml-traits/std", - "pallet-assets/std", - "parity-scale-codec/std", - "zeitgeist-primitives/std", -] -try-runtime = [ - "frame-support/try-runtime", -] - -[package] -authors = ["Zeitgeist PM "] -edition = "2021" -name = "zrml-asset-router" -version = "0.4.1" diff --git a/zrml/asset-router/README.md b/zrml/asset-router/README.md deleted file mode 100644 index 34908131e..000000000 --- a/zrml/asset-router/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Asset Router - -The asset router allows to interact with different asset classes using one -overaching asset class. The caller is not required to be aware of which pallet -handles the asset class of the asset in question, as the asset router internally -routes the call to the appropriate pallet as defined in the pallet's -configuration. - -## Overview - -The asset router implements various ORML `MultiCurrency` traits as well as -various `Fungible` traits, thus it can be used in other pallets that require -those implementation (such as ORML Currencies). The asset router also provides -managed asset destruction, that handles asset destruction for all the assets -registered through the `ManagedDestroy` interface whenever on-chain execution -time is available. Finally, the asset router also provides a lazy migration -mechanism for asset types from the `CurrencyType` to the `MarketAssetType`. - -### Terminology - -- _Asset Type_: An asset type is used to represent assets that share the same - purpose. -- _Asset Class_: An asset class is an overarching collection of multible asset - types that share common properties. -- _Tokens_: Tokens are a countable number of instantiations of a specific asset - type that can be moved between accounts. -- _Lazy Migration_: A lazy migration migrates data and the control over the data - from a source to a destination over a prolonged amount of time, usually per - request of the data or after expiry of the data. -- _Managed Asset Destruction_: A mechanism to automatically destroy an asset - type. - -### Managed Asset Destruction - -Once an asset was registered for managed destruction, it's assigned a state and -stored in a sorted list within the `DestroyAssets` storage. Whenever weight is -available in a block, this pallet will process as many assets as possible from -that sorted list. To achieve that, it loops through all assets one by one and -for each asset, it runs through a state machine that ensures that every step -necessary to properly destroy an asset is executed and that the states are -updated accordingly. It might occur that the pallet that does the actual -destruction, i.e. that is invoked by the managed destruction routine to destroy -a specific asset (using the `Destroy` interface), throws an error. In that case -an asset is considered as `Indestructible` and stored in the -`IndestructibleAssets` storage, while also logging the incident. - -### Lazy migration from `CurrencyClass` to `MarketAssetClass` - -As some asset types within `CurrencyType` and `MarketAssetType` map to the same -asset type in the overarching `AssetType`, it is necessary to apply some -additional logic to determine when a function call with an asset of `AssetType` -should be invoked in `Currencies` and when it should be invoked in -`MarketAssets`. The approach this pallet uses is as follows: - -- Try to convert `AssetType` into `MarketAssetType` -- On success, check if `MarketAssetType` exists. - - If it does, invoke the function in `MarketAssets` - - If it does not, try to convert to `CurrencyType`. - - On success, invoke `Currencies` - - On failure, invoke `MarketAssets` -- On failure, continue trying to convert into other known asset types. diff --git a/zrml/asset-router/src/lib.rs b/zrml/asset-router/src/lib.rs deleted file mode 100644 index ec97b3937..000000000 --- a/zrml/asset-router/src/lib.rs +++ /dev/null @@ -1,520 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![feature(proc_macro_hygiene)] -#![doc = include_str!("../README.md")] -#![cfg_attr(not(feature = "std"), no_std)] - -extern crate alloc; - -pub use pallet::*; - -#[macro_use] -mod macros; -#[cfg(test)] -mod mock; -pub mod pallet_impl; -#[cfg(test)] -mod tests; -mod types; - -#[frame_support::pallet] -pub mod pallet { - pub(crate) use super::types::*; - pub(crate) use alloc::collections::BTreeMap; - pub(crate) use core::{fmt::Debug, marker::PhantomData}; - pub(crate) use frame_support::{ - ensure, log, - pallet_prelude::{DispatchError, DispatchResult, Hooks, StorageValue, ValueQuery, Weight}, - require_transactional, - traits::{ - tokens::{ - fungibles::{Create, Destroy, Inspect, Mutate, Transfer, Unbalanced}, - DepositConsequence, WithdrawConsequence, - }, - BalanceStatus as Status, ConstU32, - }, - BoundedVec, Parameter, - }; - pub(crate) use orml_traits::{ - arithmetic::Signed, - currency::{ - MultiCurrency, MultiCurrencyExtended, MultiLockableCurrency, MultiReservableCurrency, - NamedMultiReservableCurrency, TransferAll, - }, - BalanceStatus, LockIdentifier, - }; - pub(crate) use pallet_assets::ManagedDestroy; - use parity_scale_codec::{FullCodec, MaxEncodedLen}; - use scale_info::TypeInfo; - pub(crate) use sp_runtime::{ - traits::{ - AtLeast32BitUnsigned, Bounded, Get, MaybeSerializeDeserialize, Member, Saturating, Zero, - }, - FixedPointOperand, SaturatedConversion, - }; - use zeitgeist_macros::unreachable_non_terminating; - pub(crate) use zeitgeist_primitives::traits::CheckedDivPerComponent; - - pub(crate) const LOG_TARGET: &str = "runtime::asset-router"; - pub(crate) const MAX_ASSET_DESTRUCTIONS_PER_BLOCK: u8 = 128; - pub(crate) const MAX_ASSETS_IN_DESTRUCTION: u32 = 2048; - const MAX_INDESTRUCTIBLE_ASSETS: u32 = 256; - // 1 ms minimum computation time. - pub(crate) const MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT: u64 = 1_000_000_000; - - pub trait AssetTraits: - Create - + Destroy - + Inspect - + Transfer - + Mutate - + Unbalanced - { - } - - impl AssetTraits for G - where - G: Create - + Destroy - + Inspect - + Transfer - + Mutate - + Unbalanced, - T: Config, - { - } - - #[pallet::config] - pub trait Config: frame_system::Config { - /// The overarching asset type that contains all assets classes. - type AssetType: Copy - + Debug - + Eq - + From - + From - + From - + From - + FullCodec - + MaxEncodedLen - + MaybeSerializeDeserialize - + Ord - + TypeInfo; - - /// The type that represents balances. - type Balance: Parameter - + Member - + AtLeast32BitUnsigned - + Default - + Copy - + MaybeSerializeDeserialize - + MaxEncodedLen - + FixedPointOperand; - - /// Logic that handles campaign assets by providing multiple fungible - /// trait implementations. - type CampaignAssets: AssetTraits; - /// The custom asset type. - type CampaignAssetType: TryFrom - + Copy - + Debug - + Eq - + FullCodec - + MaxEncodedLen - + MaybeSerializeDeserialize - + TypeInfo; - - /// Logic that handles currencies by providing multiple currencies - /// trait implementations. - type Currencies: TransferAll - + MultiCurrencyExtended< - Self::AccountId, - CurrencyId = Self::CurrencyType, - Balance = Self::Balance, - > + MultiLockableCurrency - + MultiReservableCurrency - + NamedMultiReservableCurrency - + Unbalanced; - /// The currency type. - type CurrencyType: TryFrom - + Copy - + Debug - + Eq - + FullCodec - + MaxEncodedLen - + MaybeSerializeDeserialize - + TypeInfo; - - /// Logic that handles custom assets by providing multiple fungible - /// trait implementations. - type CustomAssets: AssetTraits; - /// The custom asset type. - type CustomAssetType: TryFrom - + Copy - + Debug - + Eq - + FullCodec - + MaxEncodedLen - + MaybeSerializeDeserialize - + TypeInfo; - - /// Weight required for destroying one account. - type DestroyAccountWeight: Get; - /// Weight required for destroying one approval. - type DestroyApprovalWeight: Get; - /// Weight required for finishing the asset destruction process. - type DestroyFinishWeight: Get; - - /// Logic that handles market assets by providing multiple fungible - /// trait implementations. - type MarketAssets: AssetTraits; - /// The market asset type. - type MarketAssetType: TryFrom - + Copy - + Debug - + Eq - + FullCodec - + MaxEncodedLen - + MaybeSerializeDeserialize - + TypeInfo; - } - - /// Keeps track of assets that have to be destroyed. - #[pallet::storage] - pub(super) type DestroyAssets = StorageValue<_, DestroyAssetsT, ValueQuery>; - - /// Keeps track of assets that can't be destroyed. - #[pallet::storage] - pub(crate) type IndestructibleAssets = - StorageValue<_, BoundedVec>, ValueQuery>; - - #[pallet::error] - pub enum Error { - /// Cannot convert Amount (MultiCurrencyExtended implementation) into Balance type. - AmountIntoBalanceFailed, - /// Cannot start managed destruction as the asset was marked as indestructible. - AssetIndestructible, - /// Cannot start managed destruction as a destruction for the asset is in progress. - DestructionInProgress, - /// The vector holding all assets to destroy reached it's boundary. - TooManyManagedDestroys, - /// Asset conversion failed. - UnknownAsset, - /// Operation is not supported for given asset - Unsupported, - } - - #[pallet::pallet] - pub struct Pallet(PhantomData); - - #[pallet::hooks] - impl Hooks for Pallet { - fn on_idle(_: T::BlockNumber, mut remaining_weight: Weight) -> Weight { - let max_extra_weight = Self::on_idle_max_extra_weight(); - - if !remaining_weight - .all_gte(max_extra_weight.saturating_add(T::DbWeight::get().reads(1))) - { - return remaining_weight; - }; - - let mut destroy_assets = DestroyAssets::::get(); - if destroy_assets.len() == 0 { - return remaining_weight.saturating_sub(T::DbWeight::get().reads(1)); - } - - remaining_weight = remaining_weight - .saturating_sub(T::DbWeight::get().reads_writes(1, 1)) - .saturating_sub(max_extra_weight); - - remaining_weight = - Self::handle_asset_destruction(remaining_weight, &mut destroy_assets); - - DestroyAssets::::put(destroy_assets); - remaining_weight - } - } - - impl Pallet { - fn handle_asset_destruction( - mut remaining_weight: Weight, - destroy_assets: &mut DestroyAssetsT, - ) -> Weight { - let mut saftey_counter_outer = 0u8; - - 'outer: while let Some(mut asset) = destroy_assets.pop() { - // Only reachable if there is an error in the implementation of pop() for Vec. - unreachable_non_terminating!( - saftey_counter_outer != MAX_ASSET_DESTRUCTIONS_PER_BLOCK, - LOG_TARGET, - break, - "Destruction outer loop iteration guard triggered, iteration: {:?}", - saftey_counter_outer - ); - - let safety_counter_inner_max = DESTRUCTION_STATES; - let mut safety_counter_inner = 0u8; - - while *asset.state() != DestructionState::Destroyed - && *asset.state() != DestructionState::Indestructible - && safety_counter_inner < safety_counter_inner_max - { - match asset.state() { - DestructionState::Accounts => { - handle_asset_destruction!( - &mut asset, - remaining_weight, - destroy_assets, - handle_destroy_accounts, - 'outer - ); - } - DestructionState::Approvals => { - handle_asset_destruction!( - &mut asset, - remaining_weight, - destroy_assets, - handle_destroy_approvals, - 'outer - ); - } - DestructionState::Finalization => { - handle_asset_destruction!( - &mut asset, - remaining_weight, - destroy_assets, - handle_destroy_finish, - 'outer - ); - } - // Next two states should never occur. Just remove the asset. - DestructionState::Destroyed => { - unreachable_non_terminating!( - false, - LOG_TARGET, - "Asset {:?} has invalid state", - asset - ); - } - DestructionState::Indestructible => { - unreachable_non_terminating!( - false, - LOG_TARGET, - "Asset {:?} has invalid state", - asset - ); - } - } - - safety_counter_inner = safety_counter_inner.saturating_add(1); - } - - // Only reachable if there is an error in the destruction state machine. - unreachable_non_terminating!( - safety_counter_inner != safety_counter_inner_max, - LOG_TARGET, - "Destruction inner loop iteration guard triggered, asset: {:?}", - asset - ); - - saftey_counter_outer = saftey_counter_outer.saturating_add(1); - } - - remaining_weight - } - - fn handle_destroy_accounts( - asset: &mut AssetInDestruction, - mut remaining_weight: Weight, - ) -> DestructionResult { - if *asset.state() != DestructionState::Accounts { - return Err(DestructionError::WrongState(remaining_weight)); - } - let destroy_account_weight = T::DestroyAccountWeight::get(); - - let destroy_account_cap = - match remaining_weight.checked_div_per_component(&destroy_account_weight) { - Some(amount) => amount, - None => return Ok(DestructionOk::Incomplete(remaining_weight)), - }; - - match Self::destroy_accounts(*asset.asset(), destroy_account_cap.saturated_into()) { - Ok(destroyed_accounts) => { - // TODO(#1202): More precise weights - remaining_weight = remaining_weight.saturating_sub( - destroy_account_weight - .saturating_mul(destroyed_accounts.into()) - .max(destroy_account_weight), - ); - - if u64::from(destroyed_accounts) != destroy_account_cap { - asset.transit_state(); - Ok(DestructionOk::Complete(remaining_weight)) - } else { - Ok(DestructionOk::Incomplete(remaining_weight)) - } - } - Err(e) => { - // In this case, it is not known how many accounts have been destroyed prior - // to triggering this error. The only safe handling is consuming all the - // remaining weight. - let _ = Self::mark_asset_as_indestructible( - asset, - remaining_weight, - remaining_weight, - e, - ); - // Play it safe, consume all remaining weight. - Err(DestructionError::Indestructible(Weight::zero())) - } - } - } - - fn handle_destroy_approvals( - asset: &mut AssetInDestruction, - mut remaining_weight: Weight, - ) -> DestructionResult { - if *asset.state() != DestructionState::Approvals { - return Err(DestructionError::WrongState(remaining_weight)); - } - let destroy_approval_weight = T::DestroyApprovalWeight::get(); - - let destroy_approval_cap = - match remaining_weight.checked_div_per_component(&destroy_approval_weight) { - Some(amount) => amount, - None => return Ok(DestructionOk::Incomplete(remaining_weight)), - }; - - match Self::destroy_approvals(*asset.asset(), destroy_approval_cap.saturated_into()) { - Ok(destroyed_approvals) => { - // TODO(#1202): More precise weights - remaining_weight = remaining_weight.saturating_sub( - destroy_approval_weight - .saturating_mul(destroyed_approvals.into()) - .max(destroy_approval_weight), - ); - - if u64::from(destroyed_approvals) != destroy_approval_cap { - asset.transit_state(); - Ok(DestructionOk::Complete(remaining_weight)) - } else { - Ok(DestructionOk::Incomplete(remaining_weight)) - } - } - Err(e) => { - // In this case, it is not known how many approvals have been destroyed prior - // to triggering this error. The only safe handling is consuming all the - // remaining weight. - let _ = Self::mark_asset_as_indestructible( - asset, - remaining_weight, - remaining_weight, - e, - ); - // Play it safe, consume all remaining weight. - Err(DestructionError::Indestructible(Weight::zero())) - } - } - } - - fn handle_destroy_finish( - asset: &mut AssetInDestruction, - remaining_weight: Weight, - ) -> DestructionResult { - if *asset.state() != DestructionState::Finalization { - return Err(DestructionError::WrongState(remaining_weight)); - } - let destroy_finish_weight = T::DestroyFinishWeight::get(); - - if remaining_weight.all_gte(destroy_finish_weight) { - // TODO(#1202): More precise weights - if let Err(e) = Self::finish_destroy(*asset.asset()) { - let remaining_weight_err = Self::mark_asset_as_indestructible( - asset, - remaining_weight, - destroy_finish_weight, - e, - ); - return Err(DestructionError::Indestructible(remaining_weight_err)); - } - - asset.transit_state(); - return Ok(DestructionOk::Complete( - remaining_weight.saturating_sub(destroy_finish_weight), - )); - } - - Ok(DestructionOk::Incomplete(remaining_weight)) - } - - fn mark_asset_as_indestructible( - asset: &mut AssetInDestruction, - mut remaining_weight: Weight, - max_weight: Weight, - error: DispatchError, - ) -> Weight { - let asset_inner = *asset.asset(); - - log::error!( - target: LOG_TARGET, - "Error during managed asset account destruction of {:?}: {:?}", - asset_inner, - error - ); - - remaining_weight = remaining_weight.saturating_sub(max_weight); - - if let Err(e) = IndestructibleAssets::::try_mutate(|assets| { - let idx = assets.partition_point(|&asset_in_vec| asset_in_vec < asset_inner); - assets.try_insert(idx, asset_inner) - }) { - log::error!( - target: LOG_TARGET, - "Error during storage of indestructible asset {:?}, dropping asset: {:?}", - asset_inner, - e - ); - } - - asset.transit_indestructible(); - remaining_weight.saturating_sub(T::DbWeight::get().reads_writes(1, 1)) - } - - fn on_idle_max_extra_weight() -> Weight { - let max_proof_size_destructibles: u64 = - AssetInDestruction::::max_encoded_len() - .saturating_mul(MAX_ASSETS_IN_DESTRUCTION.saturated_into()) - .saturated_into(); - let max_proof_size_indestructibles: u64 = T::AssetType::max_encoded_len() - .saturating_mul(MAX_INDESTRUCTIBLE_ASSETS.saturated_into()) - .saturated_into(); - let max_proof_size_total = - max_proof_size_destructibles.saturating_add(max_proof_size_indestructibles); - - Weight::from_parts( - MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT, - // Maximum proof size assuming writes on full storage. - max_proof_size_total, - ) - } - - #[inline] - pub(crate) fn log_unsupported(asset: T::AssetType, function: &str) { - log::warn!(target: LOG_TARGET, "Asset {:?} not supported in function {:?}", asset, function); - } - } -} diff --git a/zrml/asset-router/src/macros.rs b/zrml/asset-router/src/macros.rs deleted file mode 100644 index 06dff530c..000000000 --- a/zrml/asset-router/src/macros.rs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -/// This macro converts the invoked asset type into the respective -/// implementation that handles it and finally calls the $method on it. -macro_rules! route_call { - ($currency_id:expr, $currency_method:ident, $asset_method:ident, $($args:expr),*) => { - if let Ok(asset) = T::MarketAssetType::try_from($currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - Ok(T::MarketAssets::$asset_method(asset, $($args),*)) - } else { - if let Ok(currency) = T::CurrencyType::try_from($currency_id) { - Ok(>::$currency_method(currency, $($args),*)) - } else { - Ok(T::MarketAssets::$asset_method(asset, $($args),*)) - } - } - } else if let Ok(asset) = T::CampaignAssetType::try_from($currency_id) { - Ok(T::CampaignAssets::$asset_method(asset, $($args),*)) - } else if let Ok(asset) = T::CustomAssetType::try_from($currency_id) { - Ok(T::CustomAssets::$asset_method(asset, $($args),*)) - } else if let Ok(currency) = T::CurrencyType::try_from($currency_id) { - Ok(>::$currency_method(currency, $($args),*)) - } else { - Err(Error::::UnknownAsset) - } - }; -} - -macro_rules! route_call_with_trait { - ($currency_id:expr, $trait:ident, $method:ident, $($args:expr),*) => { - if let Ok(asset) = T::MarketAssetType::try_from($currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - Ok(>::$method(asset, $($args),*)) - } else { - if let Ok(currency) = T::CurrencyType::try_from($currency_id) { - Ok(>::$method(currency, $($args),*)) - } else { - Ok(>::$method(asset, $($args),*)) - } - } - } else if let Ok(asset) = T::CampaignAssetType::try_from($currency_id) { - Ok(>::$method(asset, $($args),*)) - } else if let Ok(asset) = T::CustomAssetType::try_from($currency_id) { - Ok(>::$method(asset, $($args),*)) - } else if let Ok(currency) = T::CurrencyType::try_from($currency_id) { - Ok(>::$method(currency, $($args),*)) - } else { - Err(Error::::UnknownAsset) - } - }; -} - -/// This macro delegates a call to Currencies if the asset represents a currency, otherwise -/// it returns an error. -macro_rules! only_currency { - ($currency_id:expr, $error:expr, $currency_trait:ident, $currency_method:ident, $($args:expr),+) => { - if let Ok(asset) = T::MarketAssetType::try_from($currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - Self::log_unsupported($currency_id, stringify!($currency_method)); - $error - } else { - if let Ok(currency) = T::CurrencyType::try_from($currency_id) { - >::$currency_method(currency, $($args),+) - } else { - Self::log_unsupported($currency_id, stringify!($currency_method)); - $error - } - } - } - else if let Ok(currency) = T::CurrencyType::try_from($currency_id) { - >::$currency_method(currency, $($args),+) - } else { - Self::log_unsupported($currency_id, stringify!($currency_method)); - $error - } - }; -} - -/// This macro delegates a call to one *Asset instance if the asset does not represent a currency, -/// otherwise it returns an error. -macro_rules! only_asset { - ($asset_id:expr, $error:expr, $asset_trait:ident, $asset_method:ident, $($args:expr),*) => { - if let Ok(asset) = T::MarketAssetType::try_from($asset_id) { - >::$asset_method(asset, $($args),*) - } else if let Ok(asset) = T::CampaignAssetType::try_from($asset_id) { - T::CampaignAssets::$asset_method(asset, $($args),*) - } else if let Ok(asset) = T::CustomAssetType::try_from($asset_id) { - T::CustomAssets::$asset_method(asset, $($args),*) - } else { - Self::log_unsupported($asset_id, stringify!($asset_method)); - $error - } - }; -} - -/// This macro handles the single stages of the asset destruction. -macro_rules! handle_asset_destruction { - ($asset:expr, $remaining_weight:expr, $asset_storage:expr, $asset_method:ident, $outer_loop:tt) => { - let state_before = *($asset.state()); - let call_result = Self::$asset_method($asset, $remaining_weight); - match call_result { - Ok(DestructionOk::Incomplete(weight)) => { - // Should be infallible since the asset was just popped and force inserting - // is not possible. - if let Err(e) = $asset_storage.try_insert($asset_storage.len(), *($asset)) { - log::error!( - target: LOG_TARGET, - "Cannot reintroduce asset {:?} into DestroyAssets storage: {:?}", - $asset, - e - ); - } - - $remaining_weight = weight; - break $outer_loop; - }, - Ok(DestructionOk::Complete(weight)) | Err(DestructionError::WrongState(weight)) => { - $remaining_weight = weight; - }, - Err(DestructionError::Indestructible(weight)) => { - $remaining_weight = weight; - - if state_before != DestructionState::Finalization { - break $outer_loop; - } else { - // In case destruction failed during finalization, there is most likely still - // some weight available. - break; - } - } - } - }; -} diff --git a/zrml/asset-router/src/mock.rs b/zrml/asset-router/src/mock.rs deleted file mode 100644 index 716142b96..000000000 --- a/zrml/asset-router/src/mock.rs +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -extern crate alloc; - -use crate::{self as zrml_asset_router}; -use alloc::{collections::BTreeMap, vec, vec::Vec}; -use frame_support::{ - construct_runtime, - pallet_prelude::{DispatchResult, Weight}, - traits::{AsEnsureOriginWithArg, Everything}, -}; -use frame_system::EnsureSigned; -use orml_traits::parameter_type_with_key; -use pallet_assets::ManagedDestroy; -use parity_scale_codec::Compact; -use sp_runtime::{ - testing::Header, - traits::{parameter_types, BlakeTwo256, ConstU128, ConstU32, IdentityLookup}, -}; -use zeitgeist_primitives::{ - constants::mock::{BlockHashCount, ExistentialDeposit, MaxLocks, MaxReserves, BASE}, - types::{ - AccountIdTest, Amount, Assets, Balance, BlockNumber, BlockTest, CampaignAsset, - CampaignAssetClass, CampaignAssetId, Currencies, CustomAsset, CustomAssetClass, - CustomAssetId, Hash, Index, MarketAsset, UncheckedExtrinsicTest, - }, -}; - -pub(super) const ALICE: AccountIdTest = 0; -pub(super) const BOB: AccountIdTest = 1; -pub(super) const CHARLIE: AccountIdTest = 2; - -pub(super) const CAMPAIGN_ASSET: Assets = Assets::CampaignAsset(0); -pub(super) const CAMPAIGN_ASSET_INTERNAL: CampaignAssetClass = CampaignAssetClass(0); -pub(super) const CUSTOM_ASSET: Assets = Assets::CustomAsset(0); -pub(super) const CUSTOM_ASSET_INTERNAL: CustomAssetClass = CustomAssetClass(0); -pub(super) const MARKET_ASSET: Assets = Assets::CategoricalOutcome(7, 8); -pub(super) const MARKET_ASSET_INTERNAL: MarketAsset = MarketAsset::CategoricalOutcome(7, 8); -pub(super) const CURRENCY: Assets = Assets::ForeignAsset(0); -pub(super) const CURRENCY_OLD_OUTCOME: Assets = Assets::CategoricalOutcome(7, 8); -pub(super) const CURRENCY_INTERNAL: Currencies = Currencies::ForeignAsset(0); - -pub(super) const CAMPAIGN_ASSET_MIN_BALANCE: Balance = 2; -pub(super) const CUSTOM_ASSET_MIN_BALANCE: Balance = 3; -pub(super) const MARKET_ASSET_MIN_BALANCE: Balance = 4; -pub(super) const CURRENCY_MIN_BALANCE: Balance = 5; - -pub(super) const CAMPAIGN_ASSET_INITIAL_AMOUNT: Balance = 10; -pub(super) const CUSTOM_ASSET_INITIAL_AMOUNT: Balance = 20; -pub(super) const MARKET_ASSET_INITIAL_AMOUNT: Balance = 30; -pub(super) const CURRENCY_INITIAL_AMOUNT: Balance = 40; - -pub(super) const DESTROY_WEIGHT: Weight = Weight::from_parts(1000, 0); - -pub(super) type AccountId = ::AccountId; -pub(super) type CustomAssetsInstance = pallet_assets::Instance1; -pub(super) type CampaignAssetsInstance = pallet_assets::Instance2; -pub(super) type MarketAssetsInstance = pallet_assets::Instance3; - -parameter_types! { - pub const DestroyWeight: Weight = DESTROY_WEIGHT; -} - -construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - AssetRouter: zrml_asset_router::{Pallet}, - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - CustomAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - CampaignAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - MarketAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, - } -); - -impl crate::Config for Runtime { - type AssetType = Assets; - type Balance = Balance; - type CurrencyType = Currencies; - type Currencies = Tokens; - type CampaignAssetType = CampaignAsset; - type CampaignAssets = CampaignAssets; - type CustomAssetType = CustomAsset; - type CustomAssets = CustomAssets; - type DestroyAccountWeight = DestroyWeight; - type DestroyApprovalWeight = DestroyWeight; - type DestroyFinishWeight = DestroyWeight; - type MarketAssetType = MarketAsset; - type MarketAssets = MarketAssets; -} - -impl frame_system::Config for Runtime { - type AccountData = pallet_balances::AccountData; - type AccountId = AccountIdTest; - type BaseCallFilter = Everything; - type BlockHashCount = BlockHashCount; - type BlockLength = (); - type BlockNumber = BlockNumber; - type BlockWeights = (); - type RuntimeCall = RuntimeCall; - type DbWeight = (); - type RuntimeEvent = RuntimeEvent; - type Hash = Hash; - type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; - type Lookup = IdentityLookup; - type MaxConsumers = frame_support::traits::ConstU32<16>; - type OnKilledAccount = (); - type OnNewAccount = (); - type RuntimeOrigin = RuntimeOrigin; - type PalletInfo = PalletInfo; - type SS58Prefix = (); - type SystemWeightInfo = (); - type Version = (); - type OnSetCode = (); -} - -parameter_type_with_key! { - pub ExistentialDeposits: |_currency_id: Currencies| -> Balance { - CURRENCY_MIN_BALANCE - }; -} - -impl orml_tokens::Config for Runtime { - type Amount = Amount; - type Balance = Balance; - type CurrencyId = Currencies; - type DustRemovalWhitelist = (); - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposits = ExistentialDeposits; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - type CurrencyHooks = (); - type ReserveIdentifier = [u8; 8]; - type WeightInfo = (); -} - -// Required for runtime benchmarks -pallet_assets::runtime_benchmarks_enabled! { - pub struct AssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for AssetsBenchmarkHelper - where - AssetIdParameter: From, - { - fn create_asset_id_parameter(id: u32) -> AssetIdParameter { - (id as u128).into() - } - } -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = ConstU128<0>; - type AssetAccountDeposit = ConstU128<0>; - type AssetDeposit = ConstU128<0>; - type AssetId = CustomAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureSigned; - type Destroyer = AssetRouter; - type Freezer = (); - type MetadataDepositBase = ConstU128<0>; - type MetadataDepositPerByte = ConstU128<0>; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = ConstU32<255>; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = ConstU128<0>; - type AssetAccountDeposit = ConstU128<0>; - type AssetDeposit = ConstU128<0>; - type AssetId = CampaignAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureSigned; - type Destroyer = AssetRouter; - type Freezer = (); - type MetadataDepositBase = ConstU128<0>; - type MetadataDepositPerByte = ConstU128<0>; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = ConstU32<255>; - type WeightInfo = (); -} - -// Required for runtime benchmarks -pallet_assets::runtime_benchmarks_enabled! { - use zeitgeist_primitives::types::CategoryIndex; - - pub struct MarketAssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for MarketAssetsBenchmarkHelper - { - fn create_asset_id_parameter(id: u32) -> MarketAsset { - MarketAsset::CategoricalOutcome(0, id as CategoryIndex) - } - } -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = ConstU128<0>; - type AssetAccountDeposit = ConstU128<0>; - type AssetDeposit = ConstU128<0>; - type AssetId = MarketAsset; - type AssetIdParameter = MarketAsset; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = MarketAssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureSigned; - type Destroyer = AssetRouter; - type Freezer = (); - type MetadataDepositBase = ConstU128<0>; - type MetadataDepositPerByte = ConstU128<0>; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = ConstU32<255>; - type WeightInfo = (); -} - -impl pallet_balances::Config for Runtime { - type AccountStore = System; - type Balance = Balance; - type DustRemoval = (); - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = ExistentialDeposit; - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; - type ReserveIdentifier = [u8; 8]; - type WeightInfo = (); -} - -pub(super) struct ExtBuilder { - balances: Vec<(AccountIdTest, Balance)>, -} - -impl Default for ExtBuilder { - fn default() -> Self { - Self { balances: vec![(ALICE, 1_000 * BASE), (BOB, 1_000 * BASE), (CHARLIE, 1_000 * BASE)] } - } -} - -impl ExtBuilder { - pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - pallet_balances::GenesisConfig:: { balances: self.balances } - .assimilate_storage(&mut t) - .unwrap(); - - t.into() - } -} - -#[frame_support::transactional] -pub(super) fn managed_destroy_multi_transactional( - assets: BTreeMap>, -) -> DispatchResult { - AssetRouter::managed_destroy_multi(assets) -} diff --git a/zrml/asset-router/src/pallet_impl/create.rs b/zrml/asset-router/src/pallet_impl/create.rs deleted file mode 100644 index 3e59e1e5d..000000000 --- a/zrml/asset-router/src/pallet_impl/create.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl Create for Pallet { - fn create( - id: Self::AssetId, - admin: T::AccountId, - is_sufficient: bool, - min_balance: Self::Balance, - ) -> DispatchResult { - only_asset!( - id, - Err(Error::::Unsupported.into()), - Create, - create, - admin, - is_sufficient, - min_balance - ) - } -} diff --git a/zrml/asset-router/src/pallet_impl/destroy.rs b/zrml/asset-router/src/pallet_impl/destroy.rs deleted file mode 100644 index 7058b2499..000000000 --- a/zrml/asset-router/src/pallet_impl/destroy.rs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl Destroy for Pallet { - fn start_destroy(id: Self::AssetId, maybe_check_owner: Option) -> DispatchResult { - only_asset!( - id, - Err(Error::::Unsupported.into()), - Destroy, - start_destroy, - maybe_check_owner - ) - } - - fn destroy_accounts(id: Self::AssetId, max_items: u32) -> Result { - only_asset!(id, Err(Error::::Unsupported.into()), Destroy, destroy_accounts, max_items) - } - - fn destroy_approvals(id: Self::AssetId, max_items: u32) -> Result { - only_asset!(id, Err(Error::::Unsupported.into()), Destroy, destroy_approvals, max_items) - } - - fn finish_destroy(id: Self::AssetId) -> DispatchResult { - only_asset!(id, Err(Error::::Unsupported.into()), Destroy, finish_destroy,) - } -} diff --git a/zrml/asset-router/src/pallet_impl/inspect.rs b/zrml/asset-router/src/pallet_impl/inspect.rs deleted file mode 100644 index 1c19338d4..000000000 --- a/zrml/asset-router/src/pallet_impl/inspect.rs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -// Supertrait of Create and Destroy -impl Inspect for Pallet { - type AssetId = T::AssetType; - type Balance = T::Balance; - - fn total_issuance(asset: Self::AssetId) -> Self::Balance { - route_call!(asset, total_issuance, total_issuance,).unwrap_or(Zero::zero()) - } - - fn minimum_balance(asset: Self::AssetId) -> Self::Balance { - route_call!(asset, minimum_balance, minimum_balance,).unwrap_or(Zero::zero()) - } - - fn balance(asset: Self::AssetId, who: &T::AccountId) -> Self::Balance { - route_call!(asset, total_balance, balance, who).unwrap_or(Zero::zero()) - } - - fn reducible_balance( - asset: Self::AssetId, - who: &T::AccountId, - keep_alive: bool, - ) -> Self::Balance { - if T::CurrencyType::try_from(asset).is_ok() { - >::free_balance(asset, who) - } else { - only_asset!(asset, Zero::zero(), Inspect, reducible_balance, who, keep_alive) - } - } - - fn can_deposit( - asset: Self::AssetId, - who: &T::AccountId, - amount: Self::Balance, - mint: bool, - ) -> DepositConsequence { - if T::CurrencyType::try_from(asset).is_err() { - return only_asset!( - asset, - DepositConsequence::UnknownAsset, - Inspect, - can_deposit, - who, - amount, - mint - ); - } - - let total_balance = >::total_balance(asset, who); - let min_balance = >::minimum_balance(asset); - - if total_balance.saturating_add(amount) < min_balance { - DepositConsequence::BelowMinimum - } else { - DepositConsequence::Success - } - } - - fn can_withdraw( - asset: Self::AssetId, - who: &T::AccountId, - amount: Self::Balance, - ) -> WithdrawConsequence { - if T::CurrencyType::try_from(asset).is_err() { - return only_asset!( - asset, - WithdrawConsequence::UnknownAsset, - Inspect, - can_withdraw, - who, - amount - ); - } - - let can_withdraw = - >::ensure_can_withdraw(asset, who, amount); - - if let Err(_e) = can_withdraw { - return WithdrawConsequence::NoFunds; - } - - let total_balance = >::total_balance(asset, who); - let min_balance = >::minimum_balance(asset); - let remainder = total_balance.saturating_sub(amount); - - if remainder < min_balance { - WithdrawConsequence::ReducedToZero(remainder) - } else { - WithdrawConsequence::Success - } - } - - fn asset_exists(asset: Self::AssetId) -> bool { - if let Ok(currency) = T::CurrencyType::try_from(asset) { - if >::total_issuance(currency) - > Zero::zero() - { - true - } else { - only_asset!(asset, false, Inspect, asset_exists,) - } - } else { - only_asset!(asset, false, Inspect, asset_exists,) - } - } -} diff --git a/zrml/asset-router/src/pallet_impl/managed_destroy.rs b/zrml/asset-router/src/pallet_impl/managed_destroy.rs deleted file mode 100644 index fd22ac6b0..000000000 --- a/zrml/asset-router/src/pallet_impl/managed_destroy.rs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl Pallet { - fn add_asset_to_managed_destruction( - destroy_assets: &mut DestroyAssetsT, - asset: T::AssetType, - maybe_check_owner: Option, - ) -> DispatchResult { - ensure!(Self::asset_exists(asset), Error::::UnknownAsset); - frame_support::ensure!(!destroy_assets.is_full(), Error::::TooManyManagedDestroys); - let asset_to_insert = AssetInDestruction::new(asset); - - let idx = match destroy_assets.binary_search(&asset_to_insert) { - Ok(_) => return Err(Error::::DestructionInProgress.into()), - Err(idx) => { - if IndestructibleAssets::::get().binary_search(&asset).is_ok() { - return Err(Error::::AssetIndestructible.into()); - } - - idx - } - }; - - destroy_assets - .try_insert(idx, asset_to_insert) - .map_err(|_| Error::::TooManyManagedDestroys)?; - - Self::start_destroy(asset, maybe_check_owner)?; - Ok(()) - } -} - -impl ManagedDestroy for Pallet { - fn managed_destroy( - asset: Self::AssetId, - maybe_check_owner: Option, - ) -> DispatchResult { - let mut destroy_assets = DestroyAssets::::get(); - Self::add_asset_to_managed_destruction(&mut destroy_assets, asset, maybe_check_owner)?; - DestroyAssets::::put(destroy_assets); - Ok(()) - } - - fn managed_destroy_multi( - assets: BTreeMap>, - ) -> DispatchResult { - let mut destroy_assets = DestroyAssets::::get(); - - for (asset, maybe_check_owner) in assets { - Self::add_asset_to_managed_destruction(&mut destroy_assets, asset, maybe_check_owner)?; - } - - DestroyAssets::::put(destroy_assets); - Ok(()) - } -} diff --git a/zrml/asset-router/src/pallet_impl/mod.rs b/zrml/asset-router/src/pallet_impl/mod.rs deleted file mode 100644 index d0a94a1c7..000000000 --- a/zrml/asset-router/src/pallet_impl/mod.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -pub mod create; -pub mod destroy; -pub mod inspect; -pub mod managed_destroy; -pub mod multi_currency; -pub mod multi_currency_extended; -pub mod multi_lockable_currency; -pub mod multi_reserveable_currency; -pub mod named_multi_reserveable_currency; -pub mod transfer_all; -pub mod unbalanced; diff --git a/zrml/asset-router/src/pallet_impl/multi_currency.rs b/zrml/asset-router/src/pallet_impl/multi_currency.rs deleted file mode 100644 index 77a87d3a8..000000000 --- a/zrml/asset-router/src/pallet_impl/multi_currency.rs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl MultiCurrency for Pallet { - type CurrencyId = T::AssetType; - type Balance = T::Balance; - - fn minimum_balance(currency_id: Self::CurrencyId) -> Self::Balance { - let min_balance = route_call!(currency_id, minimum_balance, minimum_balance,); - min_balance.unwrap_or_else(|_b| { - Self::log_unsupported(currency_id, "minimum_balance"); - Self::Balance::zero() - }) - } - - fn total_issuance(currency_id: Self::CurrencyId) -> Self::Balance { - let total_issuance = route_call!(currency_id, total_issuance, total_issuance,); - total_issuance.unwrap_or_else(|_b| { - Self::log_unsupported(currency_id, "total_issuance"); - Self::Balance::zero() - }) - } - - fn total_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { - let total_balance = route_call!(currency_id, total_balance, balance, who); - total_balance.unwrap_or_else(|_b| { - Self::log_unsupported(currency_id, "total_balance"); - Self::Balance::zero() - }) - } - - fn free_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - T::MarketAssets::reducible_balance(asset, who, false) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::free_balance(currency, who) - } else { - T::MarketAssets::reducible_balance(asset, who, false) - } - } else if let Ok(asset) = T::CampaignAssetType::try_from(currency_id) { - T::CampaignAssets::reducible_balance(asset, who, false) - } else if let Ok(asset) = T::CustomAssetType::try_from(currency_id) { - T::CustomAssets::reducible_balance(asset, who, false) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::free_balance(currency, who) - } else { - Self::log_unsupported(currency_id, "free_balance"); - Self::Balance::zero() - } - } - - fn ensure_can_withdraw( - currency_id: Self::CurrencyId, - who: &T::AccountId, - amount: Self::Balance, - ) -> DispatchResult { - let withdraw_consequence = if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - T::MarketAssets::can_withdraw(asset, who, amount) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return T::Currencies::ensure_can_withdraw(currency, who, amount); - } else { - T::MarketAssets::can_withdraw(asset, who, amount) - } - } else if let Ok(asset) = T::CampaignAssetType::try_from(currency_id) { - T::CampaignAssets::can_withdraw(asset, who, amount) - } else if let Ok(asset) = T::CustomAssetType::try_from(currency_id) { - T::CustomAssets::can_withdraw(asset, who, amount) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return T::Currencies::ensure_can_withdraw(currency, who, amount); - } else { - return Err(Error::::UnknownAsset.into()); - }; - - withdraw_consequence.into_result().map(|_| ()) - } - - fn transfer( - currency_id: Self::CurrencyId, - from: &T::AccountId, - to: &T::AccountId, - amount: Self::Balance, - ) -> DispatchResult { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - T::MarketAssets::transfer(asset, from, to, amount, false).map(|_| ()) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::transfer(currency, from, to, amount) - } else { - T::MarketAssets::transfer(asset, from, to, amount, false).map(|_| ()) - } - } else if let Ok(asset) = T::CampaignAssetType::try_from(currency_id) { - T::CampaignAssets::transfer(asset, from, to, amount, false).map(|_| ()) - } else if let Ok(asset) = T::CustomAssetType::try_from(currency_id) { - T::CustomAssets::transfer(asset, from, to, amount, false).map(|_| ()) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::transfer(currency, from, to, amount) - } else { - Err(Error::::UnknownAsset.into()) - } - } - - fn deposit( - currency_id: Self::CurrencyId, - who: &T::AccountId, - amount: Self::Balance, - ) -> DispatchResult { - route_call!(currency_id, deposit, mint_into, who, amount)? - } - - fn withdraw( - currency_id: Self::CurrencyId, - who: &T::AccountId, - amount: Self::Balance, - ) -> DispatchResult { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - // Resulting balance can be ignored as `burn_from` ensures that the - // requested amount can be burned. - T::MarketAssets::burn_from(asset, who, amount).map(|_| ()) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::withdraw(currency, who, amount) - } else { - T::MarketAssets::burn_from(asset, who, amount).map(|_| ()) - } - } else if let Ok(asset) = T::CampaignAssetType::try_from(currency_id) { - T::CampaignAssets::burn_from(asset, who, amount).map(|_| ()) - } else if let Ok(asset) = T::CustomAssetType::try_from(currency_id) { - T::CustomAssets::burn_from(asset, who, amount).map(|_| ()) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::withdraw(currency, who, amount) - } else { - Err(Error::::UnknownAsset.into()) - } - } - - fn can_slash(currency_id: Self::CurrencyId, who: &T::AccountId, value: Self::Balance) -> bool { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - // Resulting balance can be ignored as `burn_from` ensures that the - // requested amount can be burned. - T::MarketAssets::reducible_balance(asset, who, false) >= value - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::can_slash(currency, who, value) - } else { - T::MarketAssets::reducible_balance(asset, who, false) >= value - } - } else if let Ok(asset) = T::CampaignAssetType::try_from(currency_id) { - T::CampaignAssets::reducible_balance(asset, who, false) >= value - } else if let Ok(asset) = T::CustomAssetType::try_from(currency_id) { - T::CustomAssets::reducible_balance(asset, who, false) >= value - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::can_slash(currency, who, value) - } else { - Self::log_unsupported(currency_id, "can_slash"); - false - } - } - - fn slash( - currency_id: Self::CurrencyId, - who: &T::AccountId, - amount: Self::Balance, - ) -> Self::Balance { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - // Resulting balance can be ignored as `burn_from` ensures that the - // requested amount can be burned. - T::MarketAssets::slash(asset, who, amount) - .map(|b| amount.saturating_sub(b)) - .unwrap_or_else(|_| amount) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::slash(currency, who, amount) - } else { - T::MarketAssets::slash(asset, who, amount) - .map(|b| amount.saturating_sub(b)) - .unwrap_or_else(|_| amount) - } - } else if let Ok(asset) = T::CampaignAssetType::try_from(currency_id) { - T::CampaignAssets::slash(asset, who, amount) - .map(|b| amount.saturating_sub(b)) - .unwrap_or_else(|_| amount) - } else if let Ok(asset) = T::CustomAssetType::try_from(currency_id) { - T::CustomAssets::slash(asset, who, amount) - .map(|b| amount.saturating_sub(b)) - .unwrap_or_else(|_| amount) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::slash(currency, who, amount) - } else { - Self::log_unsupported(currency_id, "slash"); - amount - } - } -} diff --git a/zrml/asset-router/src/pallet_impl/multi_currency_extended.rs b/zrml/asset-router/src/pallet_impl/multi_currency_extended.rs deleted file mode 100644 index 70ea1f499..000000000 --- a/zrml/asset-router/src/pallet_impl/multi_currency_extended.rs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl Pallet { - fn update_balance_asset( - currency_id: >::CurrencyId, - who: &T::AccountId, - by_amount: >::Amount, - ) -> DispatchResult { - if by_amount.is_zero() { - return Ok(()); - } - - // Ensure that no overflows happen during abs(). - let by_amount_abs = - if by_amount == >::Amount::min_value() { - return Err(Error::::AmountIntoBalanceFailed.into()); - } else { - by_amount.abs() - }; - - let by_balance = - TryInto::<>::Balance>::try_into(by_amount_abs) - .map_err(|_| Error::::AmountIntoBalanceFailed)?; - if by_amount.is_positive() { - Self::deposit(currency_id, who, by_balance) - } else { - Self::withdraw(currency_id, who, by_balance).map(|_| ()) - } - } -} - -impl MultiCurrencyExtended for Pallet { - type Amount = >::Amount; - - fn update_balance( - currency_id: Self::CurrencyId, - who: &T::AccountId, - by_amount: Self::Amount, - ) -> DispatchResult { - if by_amount.is_zero() { - return Ok(()); - } - - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - // Route "pre new asset system" market assets to `CurrencyType` - if T::MarketAssets::asset_exists(asset) { - Self::update_balance_asset(currency_id, who, by_amount) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::update_balance(currency, who, by_amount) - } else { - Self::update_balance_asset(currency_id, who, by_amount) - } - } else if let Ok(_asset) = T::CampaignAssetType::try_from(currency_id) { - Self::update_balance_asset(currency_id, who, by_amount) - } else if let Ok(_asset) = T::CustomAssetType::try_from(currency_id) { - Self::update_balance_asset(currency_id, who, by_amount) - } else if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - T::Currencies::update_balance(currency, who, by_amount) - } else { - Err(Error::::UnknownAsset.into()) - } - } -} diff --git a/zrml/asset-router/src/pallet_impl/multi_lockable_currency.rs b/zrml/asset-router/src/pallet_impl/multi_lockable_currency.rs deleted file mode 100644 index 55e9d5779..000000000 --- a/zrml/asset-router/src/pallet_impl/multi_lockable_currency.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl MultiLockableCurrency for Pallet { - type Moment = T::BlockNumber; - - fn set_lock( - lock_id: LockIdentifier, - currency_id: Self::CurrencyId, - who: &T::AccountId, - amount: Self::Balance, - ) -> DispatchResult { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - if T::MarketAssets::asset_exists(asset) { - return Err(Error::::Unsupported.into()); - } - } - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return >::set_lock( - lock_id, currency, who, amount, - ); - } - - Err(Error::::Unsupported.into()) - } - - fn extend_lock( - lock_id: LockIdentifier, - currency_id: Self::CurrencyId, - who: &T::AccountId, - amount: Self::Balance, - ) -> DispatchResult { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - if T::MarketAssets::asset_exists(asset) { - return Err(Error::::Unsupported.into()); - } - } - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return >::extend_lock( - lock_id, currency, who, amount, - ); - } - - Err(Error::::Unsupported.into()) - } - - fn remove_lock( - lock_id: LockIdentifier, - currency_id: Self::CurrencyId, - who: &T::AccountId, - ) -> DispatchResult { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - if T::MarketAssets::asset_exists(asset) { - return Err(Error::::Unsupported.into()); - } - } - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return >::remove_lock( - lock_id, currency, who, - ); - } - - Err(Error::::Unsupported.into()) - } -} diff --git a/zrml/asset-router/src/pallet_impl/multi_reserveable_currency.rs b/zrml/asset-router/src/pallet_impl/multi_reserveable_currency.rs deleted file mode 100644 index a6bed8360..000000000 --- a/zrml/asset-router/src/pallet_impl/multi_reserveable_currency.rs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl MultiReservableCurrency for Pallet { - fn can_reserve( - currency_id: Self::CurrencyId, - who: &T::AccountId, - value: Self::Balance, - ) -> bool { - only_currency!(currency_id, false, MultiReservableCurrency, can_reserve, who, value) - } - - fn slash_reserved( - currency_id: Self::CurrencyId, - who: &T::AccountId, - value: Self::Balance, - ) -> Self::Balance { - only_currency!(currency_id, value, MultiReservableCurrency, slash_reserved, who, value) - } - - fn reserved_balance(currency_id: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { - only_currency!(currency_id, Zero::zero(), MultiReservableCurrency, reserved_balance, who) - } - - fn reserve( - currency_id: Self::CurrencyId, - who: &T::AccountId, - value: Self::Balance, - ) -> DispatchResult { - only_currency!( - currency_id, - Err(Error::::Unsupported.into()), - MultiReservableCurrency, - reserve, - who, - value - ) - } - - fn unreserve( - currency_id: Self::CurrencyId, - who: &T::AccountId, - value: Self::Balance, - ) -> Self::Balance { - only_currency!(currency_id, value, MultiReservableCurrency, unreserve, who, value) - } - - fn repatriate_reserved( - currency_id: Self::CurrencyId, - slashed: &T::AccountId, - beneficiary: &T::AccountId, - value: Self::Balance, - status: BalanceStatus, - ) -> Result { - only_currency!( - currency_id, - Err(Error::::Unsupported.into()), - MultiReservableCurrency, - repatriate_reserved, - slashed, - beneficiary, - value, - status - ) - } -} diff --git a/zrml/asset-router/src/pallet_impl/named_multi_reserveable_currency.rs b/zrml/asset-router/src/pallet_impl/named_multi_reserveable_currency.rs deleted file mode 100644 index c1f70393d..000000000 --- a/zrml/asset-router/src/pallet_impl/named_multi_reserveable_currency.rs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl NamedMultiReservableCurrency for Pallet { - type ReserveIdentifier = - >::ReserveIdentifier; - - fn reserved_balance_named( - id: &Self::ReserveIdentifier, - currency_id: Self::CurrencyId, - who: &T::AccountId, - ) -> Self::Balance { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - if T::MarketAssets::asset_exists(asset) { - Self::log_unsupported(currency_id, "reserved_balance_named"); - return Zero::zero(); - } - } - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return >::reserved_balance_named( - id, currency, who, - ); - } - - Self::log_unsupported(currency_id, "reserved_balance_named"); - Zero::zero() - } - - fn reserve_named( - id: &Self::ReserveIdentifier, - currency_id: Self::CurrencyId, - who: &T::AccountId, - value: Self::Balance, - ) -> DispatchResult { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - if T::MarketAssets::asset_exists(asset) { - return Err(Error::::Unsupported.into()); - } - } - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return >::reserve_named( - id, currency, who, value, - ); - } - - Err(Error::::Unsupported.into()) - } - - fn unreserve_named( - id: &Self::ReserveIdentifier, - currency_id: Self::CurrencyId, - who: &T::AccountId, - value: Self::Balance, - ) -> Self::Balance { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - if T::MarketAssets::asset_exists(asset) { - Self::log_unsupported(currency_id, "unreserve_named"); - return value; - } - } - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return >::unreserve_named( - id, currency, who, value, - ); - } - - Self::log_unsupported(currency_id, "unreserve_named"); - value - } - - fn slash_reserved_named( - id: &Self::ReserveIdentifier, - currency_id: Self::CurrencyId, - who: &T::AccountId, - value: Self::Balance, - ) -> Self::Balance { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - if T::MarketAssets::asset_exists(asset) { - Self::log_unsupported(currency_id, "slash_reserved_named"); - return value; - } - } - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return >::slash_reserved_named( - id, currency, who, value - ); - } - - Self::log_unsupported(currency_id, "slash_reserved_named"); - value - } - - fn repatriate_reserved_named( - id: &Self::ReserveIdentifier, - currency_id: Self::CurrencyId, - slashed: &T::AccountId, - beneficiary: &T::AccountId, - value: Self::Balance, - status: Status, - ) -> Result { - if let Ok(asset) = T::MarketAssetType::try_from(currency_id) { - if T::MarketAssets::asset_exists(asset) { - return Err(Error::::Unsupported.into()); - } - } - if let Ok(currency) = T::CurrencyType::try_from(currency_id) { - return >::repatriate_reserved_named( - id, currency, slashed, beneficiary, value, status - ); - } - - Err(Error::::Unsupported.into()) - } -} diff --git a/zrml/asset-router/src/pallet_impl/transfer_all.rs b/zrml/asset-router/src/pallet_impl/transfer_all.rs deleted file mode 100644 index 0dd0f829f..000000000 --- a/zrml/asset-router/src/pallet_impl/transfer_all.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; - -impl TransferAll for Pallet { - #[require_transactional] - fn transfer_all(source: &T::AccountId, dest: &T::AccountId) -> DispatchResult { - // Only transfers assets maintained in orml-tokens, not implementable for pallet-assets - >::transfer_all(source, dest) - } -} diff --git a/zrml/asset-router/src/pallet_impl/unbalanced.rs b/zrml/asset-router/src/pallet_impl/unbalanced.rs deleted file mode 100644 index fc91c047a..000000000 --- a/zrml/asset-router/src/pallet_impl/unbalanced.rs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::pallet::*; -use frame_support::traits::tokens::fungibles::Unbalanced; - -impl Unbalanced for Pallet { - fn set_balance( - asset: Self::AssetId, - who: &T::AccountId, - amount: Self::Balance, - ) -> DispatchResult { - route_call_with_trait!(asset, Unbalanced, set_balance, who, amount)? - } - - fn set_total_issuance(asset: Self::AssetId, amount: Self::Balance) { - let _ = route_call_with_trait!(asset, Unbalanced, set_total_issuance, amount); - } - - fn decrease_balance( - asset: Self::AssetId, - who: &T::AccountId, - amount: Self::Balance, - ) -> Result { - route_call_with_trait!(asset, Unbalanced, decrease_balance, who, amount)? - } - - fn decrease_balance_at_most( - asset: Self::AssetId, - who: &T::AccountId, - amount: Self::Balance, - ) -> Self::Balance { - route_call_with_trait!(asset, Unbalanced, decrease_balance_at_most, who, amount) - .unwrap_or(Zero::zero()) - } - - fn increase_balance( - asset: Self::AssetId, - who: &T::AccountId, - amount: Self::Balance, - ) -> Result { - route_call_with_trait!(asset, Unbalanced, increase_balance, who, amount)? - } - - fn increase_balance_at_most( - asset: Self::AssetId, - who: &T::AccountId, - amount: Self::Balance, - ) -> Self::Balance { - route_call_with_trait!(asset, Unbalanced, increase_balance_at_most, who, amount) - .unwrap_or(Zero::zero()) - } -} diff --git a/zrml/asset-router/src/tests/create.rs b/zrml/asset-router/src/tests/create.rs deleted file mode 100644 index 4b81382ac..000000000 --- a/zrml/asset-router/src/tests/create.rs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use frame_support::traits::tokens::fungibles::Inspect; - -#[test] -fn routes_campaign_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - assert!(AssetRouter::asset_exists(CAMPAIGN_ASSET)); - assert!(!AssetRouter::asset_exists(CUSTOM_ASSET)); - assert!(!AssetRouter::asset_exists(MARKET_ASSET)); - }); -} - -#[test] -fn routes_custom_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - assert!(AssetRouter::asset_exists(CUSTOM_ASSET)); - assert!(!AssetRouter::asset_exists(CAMPAIGN_ASSET)); - assert!(!AssetRouter::asset_exists(MARKET_ASSET)); - }); -} - -#[test] -fn routes_market_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - assert!(AssetRouter::asset_exists(MARKET_ASSET)); - assert!(!AssetRouter::asset_exists(CAMPAIGN_ASSET)); - assert!(!AssetRouter::asset_exists(CUSTOM_ASSET)); - }); -} - -#[test] -fn routes_currencies_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_noop!( - AssetRouter::create(CURRENCY, ALICE, true, CURRENCY_MIN_BALANCE), - Error::::Unsupported - ); - }); -} diff --git a/zrml/asset-router/src/tests/custom_types.rs b/zrml/asset-router/src/tests/custom_types.rs deleted file mode 100644 index 0faf7bc68..000000000 --- a/zrml/asset-router/src/tests/custom_types.rs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::{AssetInDestruction, DestructionState}; - -type Aid = AssetInDestruction; - -#[test] -fn asset_in_destruction_created_properly() { - let aid = Aid::new(2); - assert_eq!(*aid.asset(), 2); - assert_eq!(*aid.state(), DestructionState::Accounts); -} - -#[test] -fn asset_in_destruction_transitions_states_properly() { - let mut aid = Aid::new(2); - - aid.transit_state(); - assert_eq!(*aid.state(), DestructionState::Approvals); - - aid.transit_state(); - assert_eq!(*aid.state(), DestructionState::Finalization); - - aid.transit_state(); - assert_eq!(*aid.state(), DestructionState::Destroyed); - - aid.transit_state(); - assert_eq!(*aid.state(), DestructionState::Destroyed); -} - -#[test] -fn asset_in_destruction_indestructible_state_works() { - let mut aid = Aid::new(2); - - aid.transit_indestructible(); - assert_eq!(*aid.state(), DestructionState::Indestructible); - - aid.transit_state(); - assert_eq!(*aid.state(), DestructionState::Indestructible); -} - -#[test] -fn asset_in_destruction_ordering_works() { - // Order by destruction state first. - let asset_1 = Aid::new(0); - let mut asset_2 = asset_1; - assert_eq!(asset_2.transit_state(), Some(&DestructionState::Approvals)); - let mut asset_3 = asset_2; - assert_eq!(asset_3.transit_state(), Some(&DestructionState::Finalization)); - let mut asset_4 = asset_3; - assert_eq!(asset_4.transit_state(), Some(&DestructionState::Destroyed)); - let mut asset_5 = asset_1; - asset_5.transit_indestructible(); - - let mut asset_vec = vec![asset_5, asset_4, asset_3, asset_2, asset_1]; - let mut expected = vec![asset_1, asset_2, asset_3, asset_4, asset_5]; - asset_vec.sort(); - assert_eq!(asset_vec, expected); - - // On equal destruction state, order by asset id. - let mut asset_dif_id_1 = Aid::new(1); - asset_dif_id_1.transit_state(); - let mut asset_dif_id_2 = Aid::new(2); - asset_dif_id_2.transit_state(); - - asset_vec.push(asset_dif_id_1); - asset_vec.push(asset_dif_id_2); - asset_vec.sort(); - expected = vec![asset_1, asset_dif_id_2, asset_dif_id_1, asset_2, asset_3, asset_4, asset_5]; - assert_eq!(asset_vec, expected); -} diff --git a/zrml/asset-router/src/tests/destroy.rs b/zrml/asset-router/src/tests/destroy.rs deleted file mode 100644 index cca618b9b..000000000 --- a/zrml/asset-router/src/tests/destroy.rs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use frame_support::traits::tokens::fungibles::Inspect; - -fn test_helper(asset: Assets, initial_amount: ::Balance) { - assert_ok!(>::deposit( - asset, - &ALICE, - initial_amount - )); - assert!(AssetRouter::asset_exists(asset)); - assert_ok!(AssetRouter::start_destroy(asset, None)); - assert_eq!(AssetRouter::destroy_accounts(asset, 100), Ok(1)); - assert_eq!(AssetRouter::destroy_approvals(asset, 100), Ok(1)); - assert_ok!(AssetRouter::finish_destroy(asset)); - assert!(!AssetRouter::asset_exists(asset)); -} - -#[test] -fn routes_campaign_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE,)); - assert_ok!( - pallet_assets::Call::::approve_transfer { - id: CAMPAIGN_ASSET_INTERNAL.into(), - delegate: BOB, - amount: 1 - } - .dispatch_bypass_filter(Signed(ALICE).into()) - ); - - test_helper(CAMPAIGN_ASSET, CAMPAIGN_ASSET_INITIAL_AMOUNT); - }); -} - -#[test] -fn routes_custom_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE,)); - assert_ok!( - pallet_assets::Call::::approve_transfer { - id: CUSTOM_ASSET_INTERNAL.into(), - delegate: BOB, - amount: 1 - } - .dispatch_bypass_filter(Signed(ALICE).into()) - ); - - test_helper(CUSTOM_ASSET, CUSTOM_ASSET_INITIAL_AMOUNT); - }); -} - -#[test] -fn routes_market_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, MARKET_ASSET_MIN_BALANCE,)); - assert_ok!( - pallet_assets::Call::::approve_transfer { - id: MARKET_ASSET_INTERNAL, - delegate: BOB, - amount: 1 - } - .dispatch_bypass_filter(Signed(ALICE).into()) - ); - - test_helper(MARKET_ASSET, MARKET_ASSET_INITIAL_AMOUNT); - }); -} - -#[test] -fn routes_currencies_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(>::deposit( - CURRENCY, - &ALICE, - CURRENCY_INITIAL_AMOUNT - )); - assert_noop!(AssetRouter::start_destroy(CURRENCY, None), Error::::Unsupported); - assert_noop!(AssetRouter::destroy_accounts(CURRENCY, 100), Error::::Unsupported); - assert_noop!(AssetRouter::destroy_approvals(CURRENCY, 100), Error::::Unsupported); - assert_noop!(AssetRouter::finish_destroy(CURRENCY), Error::::Unsupported); - }); -} diff --git a/zrml/asset-router/src/tests/inspect.rs b/zrml/asset-router/src/tests/inspect.rs deleted file mode 100644 index e762a3115..000000000 --- a/zrml/asset-router/src/tests/inspect.rs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use frame_support::traits::tokens::fungibles::Inspect; - -fn test_helper(asset: Assets, initial_amount: ::Balance) { - assert_ok!(>::deposit( - asset, - &ALICE, - initial_amount - )); - assert!(AssetRouter::asset_exists(asset)); - assert_eq!(AssetRouter::total_issuance(asset), initial_amount); - assert_eq!(AssetRouter::balance(asset, &ALICE), initial_amount); - assert_eq!(AssetRouter::reducible_balance(asset, &ALICE, false), initial_amount); - assert_eq!( - AssetRouter::can_withdraw(asset, &ALICE, initial_amount), - WithdrawConsequence::ReducedToZero(0) - ); - assert_eq!(AssetRouter::can_deposit(asset, &ALICE, 1, true), DepositConsequence::Success); -} - -#[test] -fn routes_campaign_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - use orml_traits::MultiCurrency; - - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE,)); - assert_eq!( - >::minimum_balance(CAMPAIGN_ASSET), - CAMPAIGN_ASSET_MIN_BALANCE - ); - test_helper(CAMPAIGN_ASSET, CAMPAIGN_ASSET_INITIAL_AMOUNT); - assert_eq!(>::total_issuance(CUSTOM_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(MARKET_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(CURRENCY_INTERNAL), 0); - }); -} - -#[test] -fn routes_custom_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - use orml_traits::MultiCurrency; - - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE,)); - assert_eq!( - >::minimum_balance(CUSTOM_ASSET), - CUSTOM_ASSET_MIN_BALANCE - ); - test_helper(CUSTOM_ASSET, CUSTOM_ASSET_INITIAL_AMOUNT); - assert_eq!( - >::total_issuance(CAMPAIGN_ASSET_INTERNAL), - 0 - ); - assert_eq!(>::total_issuance(MARKET_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(CURRENCY_INTERNAL), 0); - }); -} - -#[test] -fn routes_market_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - use orml_traits::MultiCurrency; - - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, MARKET_ASSET_MIN_BALANCE,)); - assert_eq!( - >::minimum_balance(MARKET_ASSET), - MARKET_ASSET_MIN_BALANCE - ); - test_helper(MARKET_ASSET, MARKET_ASSET_INITIAL_AMOUNT); - assert_eq!( - >::total_issuance(CAMPAIGN_ASSET_INTERNAL), - 0 - ); - assert_eq!(>::total_issuance(CUSTOM_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(CURRENCY_INTERNAL), 0); - }); -} - -#[test] -fn routes_currencies_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_eq!(AssetRouter::minimum_balance(CURRENCY), CURRENCY_MIN_BALANCE); - assert_eq!(AssetRouter::minimum_balance(CURRENCY_OLD_OUTCOME), CURRENCY_MIN_BALANCE); - - test_helper(CURRENCY, CURRENCY_INITIAL_AMOUNT); - test_helper(CURRENCY_OLD_OUTCOME, CURRENCY_INITIAL_AMOUNT); - - assert_eq!( - >::total_issuance(CAMPAIGN_ASSET_INTERNAL), - 0 - ); - assert_eq!(>::total_issuance(CUSTOM_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(MARKET_ASSET_INTERNAL), 0); - }); -} diff --git a/zrml/asset-router/src/tests/managed_destroy.rs b/zrml/asset-router/src/tests/managed_destroy.rs deleted file mode 100644 index 1c2700ffb..000000000 --- a/zrml/asset-router/src/tests/managed_destroy.rs +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use crate::{ - AssetInDestruction, DestroyAssets, DestructionState, IndestructibleAssets, Weight, - MAX_ASSET_DESTRUCTIONS_PER_BLOCK, MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT, -}; -use frame_support::{ - traits::{tokens::fungibles::Inspect, Get}, - weights::RuntimeDbWeight, - BoundedVec, -}; -use pallet_assets::ManagedDestroy; - -#[test] -fn adds_assets_properly() { - ExtBuilder::default().build().execute_with(|| { - let campaign_asset = AssetInDestruction::new(CAMPAIGN_ASSET); - let custom_asset = AssetInDestruction::new(CUSTOM_ASSET); - - assert_noop!( - AssetRouter::managed_destroy(CAMPAIGN_ASSET, None), - Error::::UnknownAsset - ); - - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - assert_ok!(AssetRouter::managed_destroy(CAMPAIGN_ASSET, None)); - assert_noop!( - AssetRouter::managed_destroy(CAMPAIGN_ASSET, None), - Error::::DestructionInProgress - ); - assert_eq!(DestroyAssets::::get(), vec![campaign_asset]); - - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE)); - assert_ok!(AssetRouter::managed_destroy(CUSTOM_ASSET, None)); - let mut expected = vec![campaign_asset, custom_asset]; - expected.sort(); - assert_eq!(DestroyAssets::::get(), expected); - - IndestructibleAssets::::put(BoundedVec::truncate_from(vec![ - CAMPAIGN_ASSET, - CUSTOM_ASSET, - ])); - DestroyAssets::::kill(); - assert_noop!( - AssetRouter::managed_destroy(CAMPAIGN_ASSET, None), - Error::::AssetIndestructible - ); - assert_noop!( - AssetRouter::managed_destroy(CUSTOM_ASSET, None), - Error::::AssetIndestructible - ); - }); -} - -#[test] -fn adds_multi_assets_properly() { - ExtBuilder::default().build().execute_with(|| { - let assets = BTreeMap::from([(CAMPAIGN_ASSET, None), (CUSTOM_ASSET, None)]); - let campaign_asset = AssetInDestruction::new(CAMPAIGN_ASSET); - let custom_asset = AssetInDestruction::new(CUSTOM_ASSET); - - assert_noop!( - managed_destroy_multi_transactional(assets.clone()), - Error::::UnknownAsset - ); - - for (asset, _) in assets.clone() { - assert_ok!(AssetRouter::create(asset, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - } - - assert_ok!(managed_destroy_multi_transactional(assets.clone())); - - for (asset, _) in assets.clone() { - assert_noop!( - AssetRouter::managed_destroy(asset, None), - Error::::DestructionInProgress - ); - } - - assert_noop!( - managed_destroy_multi_transactional(assets.clone()), - Error::::DestructionInProgress - ); - let mut expected = vec![campaign_asset, custom_asset]; - expected.sort(); - assert_eq!(DestroyAssets::::get(), expected); - - IndestructibleAssets::::put(BoundedVec::truncate_from(vec![ - CAMPAIGN_ASSET, - CUSTOM_ASSET, - ])); - DestroyAssets::::kill(); - assert_noop!( - managed_destroy_multi_transactional(assets), - Error::::AssetIndestructible - ); - }); -} - -#[test] -fn destroys_assets_fully_works_properly() { - ExtBuilder::default().build().execute_with(|| { - let assets_raw = [(CAMPAIGN_ASSET, None), (CUSTOM_ASSET, None), (MARKET_ASSET, None)]; - let assets = BTreeMap::from_iter(assets_raw.to_vec()); - - for (asset, _) in &assets_raw[..] { - assert_ok!(AssetRouter::create(*asset, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - } - - assert_ok!( - pallet_assets::Call::::approve_transfer { - id: CAMPAIGN_ASSET_INTERNAL.into(), - delegate: BOB, - amount: 1 - } - .dispatch_bypass_filter(Signed(ALICE).into()) - ); - - assert_ok!(managed_destroy_multi_transactional(assets.clone())); - assert_eq!(DestroyAssets::::get().len(), 3); - - let available_weight = (2 * MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT).into(); - let remaining_weight = AssetRouter::on_idle(0, available_weight); - assert!(!AssetRouter::asset_exists(CAMPAIGN_ASSET)); - assert!(!AssetRouter::asset_exists(CUSTOM_ASSET)); - assert!(!AssetRouter::asset_exists(MARKET_ASSET)); - assert_eq!(IndestructibleAssets::::get(), vec![]); - assert_eq!(DestroyAssets::::get(), vec![]); - - let mut consumed_weight = available_weight - 3u64 * 3u64 * DESTROY_WEIGHT; - // Consider safety buffer for extra execution time and storage proof size - consumed_weight = consumed_weight - .saturating_sub(Weight::from_parts(MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT, 45_824)); - assert_eq!(remaining_weight, consumed_weight); - }) -} - -#[test] -fn destroys_assets_partially_properly() { - ExtBuilder::default().build().execute_with(|| { - let assets_raw = [(CAMPAIGN_ASSET, None), (CUSTOM_ASSET, None), (MARKET_ASSET, None)]; - let assets = BTreeMap::from_iter(assets_raw.to_vec()); - - for (asset, _) in &assets_raw[..] { - assert_ok!(AssetRouter::create(*asset, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - } - - assert_ok!(managed_destroy_multi_transactional(assets.clone())); - assert_eq!(DestroyAssets::::get().len(), 3); - - let mut available_weight: Weight = - Weight::from_all(MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT) + 2u64 * DESTROY_WEIGHT; - // Make on_idle only partially delete the first asset - let _ = AssetRouter::on_idle(0, available_weight); - assert_eq!(DestroyAssets::::get().len(), 3); - - // Now delete each asset one by one by supplying exactly the required weight - available_weight = Weight::from_all(MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT) + DESTROY_WEIGHT; - let _ = AssetRouter::on_idle(0, available_weight); - assert_eq!(DestroyAssets::::get().len(), 2); - - available_weight = - Weight::from_all(MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT) + 3u64 * DESTROY_WEIGHT; - let _ = AssetRouter::on_idle(0, available_weight); - assert_eq!(DestroyAssets::::get().len(), 1); - - let _ = AssetRouter::on_idle(0, available_weight); - assert_eq!(DestroyAssets::::get().len(), 0); - - assert!(!AssetRouter::asset_exists(CAMPAIGN_ASSET)); - assert!(!AssetRouter::asset_exists(CUSTOM_ASSET)); - assert!(!AssetRouter::asset_exists(MARKET_ASSET)); - }) -} - -#[test] -fn properly_handles_indestructible_assets() { - ExtBuilder::default().build().execute_with(|| { - let assets_raw = vec![CAMPAIGN_ASSET, CUSTOM_ASSET, MARKET_ASSET]; - let mut destroy_assets = DestroyAssets::::get(); - let available_weight = (4 * MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT).into(); - - for asset in assets_raw { - destroy_assets.force_push(AssetInDestruction::new(asset)); - } - - destroy_assets.sort(); - - let setup_state = || { - assert_ok!(AssetRouter::create( - *destroy_assets[0].asset(), - ALICE, - true, - CAMPAIGN_ASSET_MIN_BALANCE - )); - assert_ok!(AssetRouter::create( - *destroy_assets[2].asset(), - ALICE, - true, - CAMPAIGN_ASSET_MIN_BALANCE - )); - assert_ok!(AssetRouter::start_destroy(*destroy_assets[0].asset(), None)); - assert_ok!(AssetRouter::start_destroy(*destroy_assets[2].asset(), None)); - }; - - // [1] Asset is indestructible and not in Finalization state, - // i.e. weight consumption bounded but unknown. - setup_state(); - DestroyAssets::::put(destroy_assets.clone()); - assert_eq!(DestroyAssets::::get().len(), 3); - let remaining_weight = AssetRouter::on_idle(0, available_weight); - assert_eq!(DestroyAssets::::get().len(), 1); - assert_eq!(remaining_weight, 0.into()); - - // Destroy remaining assets - let _ = AssetRouter::on_idle(0, available_weight); - assert_eq!(DestroyAssets::::get().len(), 0); - assert_eq!(IndestructibleAssets::::get().len(), 1); - - assert!(!AssetRouter::asset_exists(CAMPAIGN_ASSET)); - assert!(!AssetRouter::asset_exists(CUSTOM_ASSET)); - assert!(!AssetRouter::asset_exists(MARKET_ASSET)); - - // [2] Asset is indestructible and in Finalization state, - // i.e. weight consumption bounded and known. - DestroyAssets::::kill(); - IndestructibleAssets::::kill(); - setup_state(); - destroy_assets[1].transit_state(); - destroy_assets[1].transit_state(); - DestroyAssets::::put(destroy_assets); - assert_eq!(DestroyAssets::::get().len(), 3); - let remaining_weight = AssetRouter::on_idle(0, available_weight); - let mut consumed_weight = available_weight - 2u32 * 3u32 * DESTROY_WEIGHT - DESTROY_WEIGHT; - // Consider safety buffer for extra execution time and storage proof size - consumed_weight = consumed_weight - .saturating_sub(Weight::from_parts(MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT, 45_824)); - assert_eq!(remaining_weight, consumed_weight); - assert_eq!(DestroyAssets::::get().len(), 0); - assert_eq!(IndestructibleAssets::::get().len(), 1); - - assert!(!AssetRouter::asset_exists(CAMPAIGN_ASSET)); - assert!(!AssetRouter::asset_exists(CUSTOM_ASSET)); - assert!(!AssetRouter::asset_exists(MARKET_ASSET)); - }) -} - -#[test] -fn does_not_execute_on_insufficient_weight() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - assert_ok!(AssetRouter::managed_destroy(CAMPAIGN_ASSET, None)); - assert_eq!(DestroyAssets::::get().len(), 1); - - let db_weight: RuntimeDbWeight = ::DbWeight::get(); - let mut available_weight = Weight::from_parts(MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT, 45_824) - + db_weight.reads(1) - - 1u64.into(); - let mut remaining_weight = AssetRouter::on_idle(0, available_weight); - assert_eq!(available_weight, remaining_weight); - assert_eq!(DestroyAssets::::get().len(), 1); - - available_weight += Weight::from_all(1u64) + db_weight.writes(1); - let mut remaining_weight_expected: Weight = 0u64.into(); - remaining_weight = AssetRouter::on_idle(0, available_weight); - assert_eq!(remaining_weight_expected, remaining_weight); - assert_eq!(DestroyAssets::::get().len(), 1); - - remaining_weight_expected = 1u64.into(); - available_weight += 3u64 * DESTROY_WEIGHT + remaining_weight_expected; - remaining_weight = AssetRouter::on_idle(0, available_weight); - assert_eq!(remaining_weight_expected, remaining_weight); - assert_eq!(DestroyAssets::::get().len(), 0); - }) -} - -#[test] -fn does_skip_and_remove_assets_in_invalid_state() { - ExtBuilder::default().build().execute_with(|| { - let mut campaign_asset = AssetInDestruction::new(CAMPAIGN_ASSET); - campaign_asset.transit_state(); - campaign_asset.transit_state(); - assert_eq!(*campaign_asset.transit_state().unwrap(), DestructionState::Destroyed); - let mut custom_asset = AssetInDestruction::new(CUSTOM_ASSET); - custom_asset.transit_indestructible(); - - let assets_raw = BoundedVec::truncate_from(vec![campaign_asset, custom_asset]); - DestroyAssets::::put(assets_raw); - let db_weight: RuntimeDbWeight = ::DbWeight::get(); - let available_weight = Weight::from_parts(MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT, 45_824) - + db_weight.reads_writes(1, 1) - + DESTROY_WEIGHT; - - let remaining_weight = AssetRouter::on_idle(0, available_weight); - // No destroy routine was called - assert_eq!(remaining_weight, DESTROY_WEIGHT); - // Asset in invalid states got removed - assert_eq!(DestroyAssets::::get().len(), 0); - }); -} - -#[test] -#[should_panic(expected = "Destruction outer loop iteration guard triggered")] -fn does_trigger_on_idle_outer_loop_safety_guard() { - ExtBuilder::default().build().execute_with(|| { - for asset_num in 0..=MAX_ASSET_DESTRUCTIONS_PER_BLOCK { - let asset = Assets::CampaignAsset(asset_num as u128); - assert_ok!(AssetRouter::create(asset, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - assert_ok!(AssetRouter::managed_destroy(asset, None)); - } - - let db_weight: RuntimeDbWeight = ::DbWeight::get(); - let available_weight = Weight::from_parts(MIN_ON_IDLE_EXTRA_COMPUTATION_WEIGHT, 45_824) - + db_weight.reads(1) - + DESTROY_WEIGHT * 3 * (MAX_ASSET_DESTRUCTIONS_PER_BLOCK + 1) as u64; - - let _ = AssetRouter::on_idle(0, available_weight); - }); -} diff --git a/zrml/asset-router/src/tests/mod.rs b/zrml/asset-router/src/tests/mod.rs deleted file mode 100644 index 48a23763d..000000000 --- a/zrml/asset-router/src/tests/mod.rs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::{mock::*, Error}; -use alloc::collections::BTreeMap; -use frame_support::{ - assert_noop, assert_ok, - dispatch::RawOrigin::Signed, - traits::{ - tokens::{ - fungibles::{Create, Destroy}, - DepositConsequence, WithdrawConsequence, - }, - OnIdle, UnfilteredDispatchable, - }, -}; -use orml_traits::{ - BalanceStatus, MultiCurrencyExtended, MultiLockableCurrency, MultiReservableCurrency, - NamedMultiReservableCurrency, -}; -use zeitgeist_primitives::types::Assets; - -mod create; -mod custom_types; -mod destroy; -mod inspect; -mod managed_destroy; -mod multi_currency; -mod multi_lockable_currency; -mod multi_reservable_currency; -mod named_multi_reservable_currency; -mod unbalanced; diff --git a/zrml/asset-router/src/tests/multi_currency.rs b/zrml/asset-router/src/tests/multi_currency.rs deleted file mode 100644 index 0e6802305..000000000 --- a/zrml/asset-router/src/tests/multi_currency.rs +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use orml_traits::MultiCurrency; -use test_case::test_case; -use zeitgeist_primitives::types::{Amount, Balance}; - -fn test_helper( - asset: Assets, - initial_amount: ::Balance, - min_balance: ::Balance, -) { - assert_eq!(AssetRouter::minimum_balance(asset), min_balance); - assert_ok!(AssetRouter::deposit(asset, &ALICE, initial_amount)); - assert_eq!(AssetRouter::total_issuance(asset), initial_amount); - assert_eq!(AssetRouter::total_balance(asset, &ALICE), initial_amount); - assert_eq!(AssetRouter::free_balance(asset, &ALICE), initial_amount); - assert_ok!(AssetRouter::ensure_can_withdraw(asset, &ALICE, initial_amount)); - assert!(AssetRouter::ensure_can_withdraw(asset, &ALICE, initial_amount + 1).is_err()); - assert_ok!(AssetRouter::transfer(asset, &ALICE, &BOB, min_balance)); - assert_eq!(AssetRouter::free_balance(asset, &BOB), min_balance); - assert_eq!(AssetRouter::free_balance(asset, &ALICE), initial_amount - min_balance); - assert_ok!(AssetRouter::withdraw(asset, &ALICE, 1)); - assert_eq!(AssetRouter::free_balance(asset, &ALICE), initial_amount - min_balance - 1); - assert!(AssetRouter::can_slash(asset, &ALICE, 1)); - assert_eq!(AssetRouter::slash(asset, &ALICE, 1), 0); - assert_eq!(AssetRouter::free_balance(asset, &ALICE), initial_amount - min_balance - 2); - assert_ok!(AssetRouter::update_balance( - asset, - &ALICE, - >::Amount::from(1u8) - - >::Amount::from(2u8) - )); - assert_eq!(AssetRouter::free_balance(asset, &ALICE), initial_amount - min_balance - 3); -} - -#[test] -fn routes_campaign_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - use frame_support::traits::tokens::fungibles::Inspect; - - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - - test_helper(CAMPAIGN_ASSET, CAMPAIGN_ASSET_INITIAL_AMOUNT, CAMPAIGN_ASSET_MIN_BALANCE); - - assert_eq!(>::total_issuance(CUSTOM_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(MARKET_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(CURRENCY_INTERNAL), 0); - }); -} - -#[test] -fn routes_custom_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - use frame_support::traits::tokens::fungibles::Inspect; - - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE)); - - test_helper(CUSTOM_ASSET, CUSTOM_ASSET_INITIAL_AMOUNT, CUSTOM_ASSET_MIN_BALANCE); - - assert_eq!( - >::total_issuance(CAMPAIGN_ASSET_INTERNAL), - 0 - ); - assert_eq!(>::total_issuance(MARKET_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(CURRENCY_INTERNAL), 0); - }); -} - -#[test] -fn routes_market_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - use frame_support::traits::tokens::fungibles::Inspect; - - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, MARKET_ASSET_MIN_BALANCE)); - - test_helper(MARKET_ASSET, MARKET_ASSET_INITIAL_AMOUNT, MARKET_ASSET_MIN_BALANCE); - - assert_eq!( - >::total_issuance(CAMPAIGN_ASSET_INTERNAL), - 0 - ); - assert_eq!(>::total_issuance(CUSTOM_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(CURRENCY_INTERNAL), 0); - }); -} - -#[test] -fn routes_currencies_correctly() { - ExtBuilder::default().build().execute_with(|| { - use frame_support::traits::tokens::fungibles::Inspect; - - test_helper(CURRENCY, CURRENCY_INITIAL_AMOUNT, CURRENCY_MIN_BALANCE); - test_helper(CURRENCY_OLD_OUTCOME, CURRENCY_INITIAL_AMOUNT, CURRENCY_MIN_BALANCE); - - assert_eq!( - >::total_issuance(CAMPAIGN_ASSET_INTERNAL), - 0 - ); - assert_eq!(>::total_issuance(CUSTOM_ASSET_INTERNAL), 0); - assert_eq!(>::total_issuance(MARKET_ASSET_INTERNAL), 0); - }); -} - -#[test_case(0, Some(0); "zero")] -#[test_case(Amount::max_value(), Some(Amount::max_value().unsigned_abs() as Balance); "max")] -#[test_case(Amount::min_value(), None; "min")] -#[test_case(Amount::min_value() + 1, Some((Amount::min_value() + 1).unsigned_abs() as Balance); "min_plus_one")] -fn update_balance_handles_overflows_correctly(update: Amount, expected: Option) { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - - if update.is_negative() { - assert_ok!(AssetRouter::update_balance(CAMPAIGN_ASSET, &ALICE, Amount::max_value())); - } - - if let Some(expected_inner) = expected { - assert_ok!(AssetRouter::update_balance(CAMPAIGN_ASSET, &ALICE, update)); - - if update.is_negative() { - assert_eq!( - AssetRouter::free_balance(CAMPAIGN_ASSET, &ALICE), - Amount::max_value() as Balance - expected_inner - ); - } else { - assert_eq!(AssetRouter::free_balance(CAMPAIGN_ASSET, &ALICE), expected_inner); - } - } else { - assert_noop!( - AssetRouter::update_balance(CAMPAIGN_ASSET, &ALICE, update), - Error::::AmountIntoBalanceFailed - ); - } - }); -} diff --git a/zrml/asset-router/src/tests/multi_lockable_currency.rs b/zrml/asset-router/src/tests/multi_lockable_currency.rs deleted file mode 100644 index 20497d243..000000000 --- a/zrml/asset-router/src/tests/multi_lockable_currency.rs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use orml_traits::MultiCurrency; -use test_case::test_case; - -fn unroutable_test_helper(asset: Assets) { - assert_noop!( - AssetRouter::set_lock(Default::default(), asset, &ALICE, 1), - Error::::Unsupported - ); - assert_noop!( - AssetRouter::extend_lock(Default::default(), asset, &ALICE, 1), - Error::::Unsupported - ); - assert_noop!( - AssetRouter::remove_lock(Default::default(), asset, &ALICE), - Error::::Unsupported - ); -} - -#[test_case(CURRENCY; "foreign")] -#[test_case(CURRENCY_OLD_OUTCOME; "old_outcome")] -fn routes_currencies_correctly(currency_id: Assets) { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::deposit(currency_id, &ALICE, CURRENCY_INITIAL_AMOUNT)); - assert_ok!(AssetRouter::set_lock(Default::default(), currency_id, &ALICE, 1)); - assert_eq!( - orml_tokens::Accounts::::get::< - u128, - ::CurrencyId, - >(ALICE, currency_id.try_into().unwrap()) - .frozen, - 1 - ); - assert_ok!(AssetRouter::extend_lock(Default::default(), currency_id, &ALICE, 2)); - assert_eq!( - orml_tokens::Accounts::::get::< - u128, - ::CurrencyId, - >(ALICE, currency_id.try_into().unwrap()) - .frozen, - 2 - ); - assert_ok!(AssetRouter::remove_lock(Default::default(), currency_id, &ALICE)); - assert_eq!( - orml_tokens::Accounts::::get::< - u128, - ::CurrencyId, - >(ALICE, currency_id.try_into().unwrap()) - .frozen, - 0 - ); - }); -} - -#[test] -fn routes_campaign_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(CAMPAIGN_ASSET); - }); -} - -#[test] -fn routes_custom_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(CUSTOM_ASSET); - }); -} - -#[test] -fn routes_market_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, MARKET_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(MARKET_ASSET); - }); -} diff --git a/zrml/asset-router/src/tests/multi_reservable_currency.rs b/zrml/asset-router/src/tests/multi_reservable_currency.rs deleted file mode 100644 index 029ce57d6..000000000 --- a/zrml/asset-router/src/tests/multi_reservable_currency.rs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use orml_traits::MultiCurrency; -use test_case::test_case; - -fn unroutable_test_helper(asset: Assets, initial_amount: ::Balance) { - assert_ok!(AssetRouter::deposit(asset, &ALICE, initial_amount)); - assert!(!AssetRouter::can_reserve(asset, &ALICE, initial_amount)); - assert_noop!( - AssetRouter::reserve(asset, &ALICE, initial_amount), - Error::::Unsupported - ); - assert_eq!(AssetRouter::reserved_balance(asset, &ALICE), 0); - assert_eq!(AssetRouter::slash_reserved(asset, &ALICE, 1), 1); - assert_noop!( - AssetRouter::repatriate_reserved(asset, &ALICE, &BOB, 1, BalanceStatus::Reserved), - Error::::Unsupported - ); - assert_eq!(AssetRouter::unreserve(asset, &ALICE, 1), 1); -} - -#[test_case(CURRENCY; "foreign")] -#[test_case(CURRENCY_OLD_OUTCOME; "old_outcome")] -fn routes_currencies_correctly(currency_id: Assets) { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::deposit(currency_id, &ALICE, CURRENCY_INITIAL_AMOUNT)); - - assert!(AssetRouter::can_reserve(currency_id, &ALICE, CURRENCY_INITIAL_AMOUNT)); - assert!(!AssetRouter::can_reserve(currency_id, &ALICE, CURRENCY_INITIAL_AMOUNT + 1)); - assert_ok!(AssetRouter::reserve(currency_id, &ALICE, CURRENCY_INITIAL_AMOUNT)); - assert_eq!(AssetRouter::reserved_balance(currency_id, &ALICE), CURRENCY_INITIAL_AMOUNT); - assert_eq!(AssetRouter::slash_reserved(currency_id, &ALICE, 1), 0); - assert_eq!( - AssetRouter::repatriate_reserved( - currency_id, - &ALICE, - &BOB, - CURRENCY_MIN_BALANCE, - BalanceStatus::Reserved - ) - .unwrap(), - 0 - ); - assert_eq!(AssetRouter::reserved_balance(currency_id, &BOB), CURRENCY_MIN_BALANCE); - assert_eq!( - AssetRouter::reserved_balance(currency_id, &ALICE), - CURRENCY_INITIAL_AMOUNT - CURRENCY_MIN_BALANCE - 1 - ); - assert_eq!(AssetRouter::unreserve(currency_id, &ALICE, 1), 0); - assert_eq!( - AssetRouter::reserved_balance(currency_id, &ALICE), - CURRENCY_INITIAL_AMOUNT - CURRENCY_MIN_BALANCE - 2 - ); - }); -} - -#[test] -fn routes_campaign_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(CAMPAIGN_ASSET, CAMPAIGN_ASSET_INITIAL_AMOUNT); - }); -} - -#[test] -fn routes_custom_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(CUSTOM_ASSET, CUSTOM_ASSET_INITIAL_AMOUNT); - }); -} - -#[test] -fn routes_market_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, MARKET_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(MARKET_ASSET, MARKET_ASSET_INITIAL_AMOUNT); - }); -} diff --git a/zrml/asset-router/src/tests/named_multi_reservable_currency.rs b/zrml/asset-router/src/tests/named_multi_reservable_currency.rs deleted file mode 100644 index 94f05ef5c..000000000 --- a/zrml/asset-router/src/tests/named_multi_reservable_currency.rs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use orml_traits::MultiCurrency; -use test_case::test_case; - -fn unroutable_test_helper(asset: Assets, initial_amount: ::Balance) { - assert_ok!(AssetRouter::deposit(asset, &ALICE, initial_amount)); - assert_noop!( - AssetRouter::reserve_named(&Default::default(), asset, &ALICE, initial_amount), - Error::::Unsupported - ); - assert_eq!(AssetRouter::slash_reserved_named(&Default::default(), asset, &ALICE, 1), 1); - assert_noop!( - AssetRouter::repatriate_reserved_named( - &Default::default(), - asset, - &ALICE, - &BOB, - 1, - BalanceStatus::Reserved - ), - Error::::Unsupported - ); - assert_eq!(AssetRouter::unreserve_named(&Default::default(), asset, &ALICE, 1), 1); - assert_eq!(AssetRouter::reserved_balance_named(&Default::default(), asset, &ALICE), 0); -} - -#[test_case(CURRENCY; "foreign")] -#[test_case(CURRENCY_OLD_OUTCOME; "old_outcome")] -fn routes_currencies_correctly(currency_id: Assets) { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::deposit(currency_id, &ALICE, CURRENCY_INITIAL_AMOUNT)); - assert_ok!(AssetRouter::reserve_named( - &Default::default(), - currency_id, - &ALICE, - CURRENCY_INITIAL_AMOUNT - )); - assert_eq!( - AssetRouter::reserved_balance_named(&Default::default(), currency_id, &ALICE), - CURRENCY_INITIAL_AMOUNT - ); - assert_eq!( - AssetRouter::slash_reserved_named(&Default::default(), currency_id, &ALICE, 1), - 0 - ); - assert_eq!( - AssetRouter::repatriate_reserved_named( - &Default::default(), - currency_id, - &ALICE, - &BOB, - CURRENCY_MIN_BALANCE, - BalanceStatus::Reserved - ) - .unwrap(), - 0 - ); - assert_eq!( - AssetRouter::reserved_balance_named(&Default::default(), currency_id, &BOB), - CURRENCY_MIN_BALANCE - ); - assert_eq!( - AssetRouter::reserved_balance_named(&Default::default(), currency_id, &ALICE), - CURRENCY_INITIAL_AMOUNT - CURRENCY_MIN_BALANCE - 1 - ); - assert_eq!(AssetRouter::unreserve_named(&Default::default(), currency_id, &ALICE, 1), 0); - assert_eq!( - AssetRouter::reserved_balance_named(&Default::default(), currency_id, &ALICE), - CURRENCY_INITIAL_AMOUNT - CURRENCY_MIN_BALANCE - 2 - ); - }); -} - -#[test] -fn routes_campaign_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(CAMPAIGN_ASSET, CAMPAIGN_ASSET_INITIAL_AMOUNT); - }); -} - -#[test] -fn routes_custom_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(CUSTOM_ASSET, CUSTOM_ASSET_INITIAL_AMOUNT); - }); -} - -#[test] -fn routes_market_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, MARKET_ASSET_MIN_BALANCE,)); - - unroutable_test_helper(MARKET_ASSET, MARKET_ASSET_INITIAL_AMOUNT); - }); -} diff --git a/zrml/asset-router/src/tests/unbalanced.rs b/zrml/asset-router/src/tests/unbalanced.rs deleted file mode 100644 index 91b78ffad..000000000 --- a/zrml/asset-router/src/tests/unbalanced.rs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(test)] - -use super::*; -use frame_support::traits::tokens::fungibles::Unbalanced; -use orml_traits::MultiCurrency; - -fn test_helper( - asset: Assets, - initial_amount: ::Balance, - min_balance: ::Balance, -) { - assert_eq!(AssetRouter::total_balance(asset, &ALICE), initial_amount); - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, 1)); - assert_eq!(AssetRouter::total_balance(asset, &ALICE), initial_amount + 1); - assert_ok!(AssetRouter::decrease_balance(asset, &ALICE, 1)); - assert_eq!(AssetRouter::total_balance(asset, &ALICE), initial_amount); - assert_eq!(AssetRouter::increase_balance_at_most(asset, &ALICE, 1), 1); - assert_eq!(AssetRouter::total_balance(asset, &ALICE), initial_amount + 1); - let to_decrease = initial_amount + 2 - min_balance; - assert_eq!( - AssetRouter::decrease_balance_at_most(asset, &ALICE, to_decrease), - initial_amount + 1 - ); - assert_eq!(AssetRouter::total_balance(asset, &ALICE), 0); - AssetRouter::set_total_issuance(asset, 1337); - assert_eq!(AssetRouter::total_issuance(asset), 1337); -} - -#[test] -fn routes_campaign_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - assert_ok!(AssetRouter::deposit(CAMPAIGN_ASSET, &ALICE, CAMPAIGN_ASSET_INITIAL_AMOUNT)); - - test_helper(CAMPAIGN_ASSET, CAMPAIGN_ASSET_INITIAL_AMOUNT, CAMPAIGN_ASSET_MIN_BALANCE); - - assert_eq!(AssetRouter::total_issuance(CUSTOM_ASSET), 0); - assert_eq!(AssetRouter::total_issuance(MARKET_ASSET), 0); - assert_eq!(AssetRouter::total_issuance(CURRENCY), 0); - }); -} - -#[test] -#[should_panic] -fn campaign_assets_panic_on_set_balance() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CAMPAIGN_ASSET, ALICE, true, CAMPAIGN_ASSET_MIN_BALANCE)); - let _ = AssetRouter::set_balance(CAMPAIGN_ASSET, &ALICE, 42); - }); -} - -#[test] -fn routes_custom_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE)); - assert_ok!(AssetRouter::deposit(CUSTOM_ASSET, &ALICE, CUSTOM_ASSET_INITIAL_AMOUNT)); - - test_helper(CUSTOM_ASSET, CUSTOM_ASSET_INITIAL_AMOUNT, CUSTOM_ASSET_MIN_BALANCE); - - assert_eq!(AssetRouter::total_issuance(CAMPAIGN_ASSET), 0); - assert_eq!(AssetRouter::total_issuance(MARKET_ASSET), 0); - assert_eq!(AssetRouter::total_issuance(CURRENCY), 0); - }); -} - -#[test] -#[should_panic] -fn custom_assets_panic_on_set_balance() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(CUSTOM_ASSET, ALICE, true, CUSTOM_ASSET_MIN_BALANCE)); - let _ = AssetRouter::set_balance(CUSTOM_ASSET, &ALICE, 42); - }); -} - -#[test] -fn routes_market_assets_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, MARKET_ASSET_MIN_BALANCE)); - assert_ok!(AssetRouter::deposit(MARKET_ASSET, &ALICE, MARKET_ASSET_INITIAL_AMOUNT)); - - test_helper(MARKET_ASSET, MARKET_ASSET_INITIAL_AMOUNT, MARKET_ASSET_MIN_BALANCE); - - assert_eq!(AssetRouter::total_issuance(CAMPAIGN_ASSET), 0); - assert_eq!(AssetRouter::total_issuance(CUSTOM_ASSET), 0); - assert_eq!(AssetRouter::total_issuance(CURRENCY), 0); - }); -} - -#[test] -#[should_panic] -fn market_assets_panic_on_set_balance() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::create(MARKET_ASSET, ALICE, true, MARKET_ASSET_MIN_BALANCE)); - let _ = AssetRouter::set_balance(MARKET_ASSET, &ALICE, 42); - }); -} - -#[test] -fn routes_currencies_correctly() { - ExtBuilder::default().build().execute_with(|| { - assert_ok!(AssetRouter::set_balance(CURRENCY, &ALICE, CURRENCY_INITIAL_AMOUNT)); - test_helper(CURRENCY, CURRENCY_INITIAL_AMOUNT, CURRENCY_MIN_BALANCE); - - assert_eq!(AssetRouter::total_issuance(CAMPAIGN_ASSET), 0); - assert_eq!(AssetRouter::total_issuance(CUSTOM_ASSET), 0); - assert_eq!(AssetRouter::total_issuance(MARKET_ASSET), 0); - }); -} diff --git a/zrml/asset-router/src/types.rs b/zrml/asset-router/src/types.rs deleted file mode 100644 index 91ec53a22..000000000 --- a/zrml/asset-router/src/types.rs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2024 Forecasting Technologies LTD. -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -use crate::{BoundedVec, Config, ConstU32, Weight, MAX_ASSETS_IN_DESTRUCTION}; -use core::cmp::Ordering; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; - -pub(crate) type DestroyAssetsT = BoundedVec< - AssetInDestruction<::AssetType>, - ConstU32<{ MAX_ASSETS_IN_DESTRUCTION }>, ->; - -pub(crate) enum DestructionOk { - Complete(Weight), - Incomplete(Weight), -} - -pub(crate) enum DestructionError { - Indestructible(Weight), - WrongState(Weight), -} - -pub(crate) type DestructionResult = Result; - -#[derive( - Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Ord, Decode, Encode, MaxEncodedLen, TypeInfo, -)] -pub(crate) enum DestructionState { - Accounts, - Approvals, - Finalization, - Destroyed, - Indestructible, -} -pub(crate) const DESTRUCTION_STATES: u8 = 5; - -#[derive(Clone, Copy, Encode, Eq, Debug, Decode, MaxEncodedLen, PartialEq, TypeInfo)] -pub(crate) struct AssetInDestruction { - asset: A, - state: DestructionState, -} - -impl PartialOrd for AssetInDestruction -where - A: Eq + Ord + PartialEq + PartialOrd, -{ - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} - -// Ordering for binary search of assets in destruction. -// Prioritize asset state first, then asset. -impl Ord for AssetInDestruction -where - A: Eq + Ord + PartialEq + PartialOrd, -{ - fn cmp(&self, other: &Self) -> Ordering { - match self.state.cmp(&other.state) { - Ordering::Equal => { - // Since asset destruction will always pop from the vector, sorting has to be reverse. - match self.asset.cmp(&other.asset) { - Ordering::Equal => Ordering::Equal, - Ordering::Less => Ordering::Greater, - Ordering::Greater => Ordering::Less, - } - } - Ordering::Less => Ordering::Less, - Ordering::Greater => Ordering::Greater, - } - } -} - -impl AssetInDestruction { - pub(crate) fn new(asset: A) -> Self { - AssetInDestruction { asset, state: DestructionState::Accounts } - } - - pub(crate) fn asset(&self) -> &A { - &self.asset - } - - pub(crate) fn state(&self) -> &DestructionState { - &self.state - } - - pub(crate) fn transit_indestructible(&mut self) { - self.state = DestructionState::Indestructible; - } - - // Returns the new state on change, None otherwise - pub(crate) fn transit_state(&mut self) -> Option<&DestructionState> { - let state_before = self.state; - - self.state = match self.state { - DestructionState::Accounts => DestructionState::Approvals, - DestructionState::Approvals => DestructionState::Finalization, - DestructionState::Destroyed => DestructionState::Destroyed, - DestructionState::Finalization => DestructionState::Destroyed, - DestructionState::Indestructible => DestructionState::Indestructible, - }; - - if state_before != self.state { Some(&self.state) } else { None } - } -} diff --git a/zrml/authorized/src/lib.rs b/zrml/authorized/src/lib.rs index 1e5644cb6..f155bf38f 100644 --- a/zrml/authorized/src/lib.rs +++ b/zrml/authorized/src/lib.rs @@ -49,8 +49,8 @@ mod pallet { use zeitgeist_primitives::{ traits::{DisputeApi, DisputeMaxWeightApi, DisputeResolutionApi}, types::{ - AuthorityReport, BaseAsset, GlobalDisputeItem, Market, MarketDisputeMechanism, - MarketStatus, OutcomeReport, ResultWithWeightInfo, + AuthorityReport, GlobalDisputeItem, Market, MarketDisputeMechanism, MarketStatus, + OutcomeReport, ResultWithWeightInfo, }, }; use zrml_market_commons::MarketCommonsPalletApi; @@ -72,7 +72,6 @@ mod pallet { BalanceOf, ::BlockNumber, MomentOf, - BaseAsset, MarketIdOf, >; @@ -372,13 +371,13 @@ where use frame_support::traits::Get; use sp_runtime::{traits::AccountIdConversion, Perbill}; use zeitgeist_primitives::types::{ - BaseAsset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, + Asset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, ScoringRule, }; Market { + base_asset: Asset::Ztg, market_id: Default::default(), - base_asset: BaseAsset::Ztg, creation: MarketCreation::Permissionless, creator_fee: Perbill::zero(), creator: T::PalletId::get().into_account_truncating(), diff --git a/zrml/authorized/src/weights.rs b/zrml/authorized/src/weights.rs index 2132a798b..13d00c1be 100644 --- a/zrml/authorized/src/weights.rs +++ b/zrml/authorized/src/weights.rs @@ -87,10 +87,10 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn authorize_market_outcome_existing_report() -> Weight { // Proof Size summary in bytes: - // Measured: `626` - // Estimated: `5691` - // Minimum execution time: 35_520 nanoseconds. - Weight::from_parts(43_000_000, 5691) + // Measured: `577` + // Estimated: `5677` + // Minimum execution time: 35_410 nanoseconds. + Weight::from_parts(36_251_000, 5677) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -105,7 +105,7 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn on_resolution_weight() -> Weight { // Proof Size summary in bytes: - // Measured: `250` + // Measured: `217` // Estimated: `2524` // Minimum execution time: 10_190 nanoseconds. Weight::from_parts(12_490_000, 2524) @@ -123,7 +123,7 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn get_auto_resolve_weight() -> Weight { // Proof Size summary in bytes: - // Measured: `250` + // Measured: `217` // Estimated: `2524` // Minimum execution time: 9_550 nanoseconds. Weight::from_parts(11_820_000, 2524).saturating_add(T::DbWeight::get().reads(1)) diff --git a/zrml/court/src/benchmarks.rs b/zrml/court/src/benchmarks.rs index f463facfc..bd60950b3 100644 --- a/zrml/court/src/benchmarks.rs +++ b/zrml/court/src/benchmarks.rs @@ -41,7 +41,7 @@ use sp_runtime::{ use zeitgeist_primitives::{ traits::{DisputeApi, DisputeResolutionApi}, types::{ - BaseAsset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, + Asset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, OutcomeReport, Report, ScoringRule, }, }; @@ -55,7 +55,7 @@ where { Market { market_id: 0u8.into(), - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: sp_runtime::Perbill::zero(), creator: account("creator", 0, 0), diff --git a/zrml/court/src/lib.rs b/zrml/court/src/lib.rs index d3c83f8c2..3bd7dd9b9 100644 --- a/zrml/court/src/lib.rs +++ b/zrml/court/src/lib.rs @@ -29,6 +29,7 @@ use crate::{ }; use alloc::{ collections::{BTreeMap, BTreeSet}, + format, vec::Vec, }; use core::marker::PhantomData; @@ -65,7 +66,7 @@ use zeitgeist_primitives::{ math::checked_ops_res::{CheckedAddRes, CheckedRemRes, CheckedSubRes}, traits::{DisputeApi, DisputeMaxWeightApi, DisputeResolutionApi}, types::{ - BaseAsset, GlobalDisputeItem, Market, MarketDisputeMechanism, MarketStatus, OutcomeReport, + GlobalDisputeItem, Market, MarketDisputeMechanism, MarketStatus, OutcomeReport, ResultWithWeightInfo, }, }; @@ -224,7 +225,6 @@ mod pallet { BalanceOf, ::BlockNumber, MomentOf, - BaseAsset, MarketIdOf, >; pub(crate) type HashOf = ::Hash; diff --git a/zrml/court/src/tests.rs b/zrml/court/src/tests.rs index b0c80d6dc..42dd23c72 100644 --- a/zrml/court/src/tests.rs +++ b/zrml/court/src/tests.rs @@ -54,9 +54,9 @@ use zeitgeist_primitives::{ }, traits::DisputeApi, types::{ - AccountIdTest, BaseAsset, Deadlines, GlobalDisputeItem, Market, MarketBonds, - MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, - OutcomeReport, Report, ScoringRule, + AccountIdTest, Asset, Deadlines, GlobalDisputeItem, Market, MarketBonds, MarketCreation, + MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, OutcomeReport, Report, + ScoringRule, }, }; use zrml_market_commons::{Error as MError, MarketCommonsPalletApi}; @@ -67,7 +67,7 @@ const ORACLE_REPORT: OutcomeReport = OutcomeReport::Scalar(u128::MAX); const DEFAULT_MARKET: MarketOf = Market { market_id: 0, - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: sp_runtime::Perbill::zero(), creator: 0, diff --git a/zrml/court/src/weights.rs b/zrml/court/src/weights.rs index 54512e245..078b9d1ea 100644 --- a/zrml/court/src/weights.rs +++ b/zrml/court/src/weights.rs @@ -137,7 +137,7 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) fn exit_court_remove() -> Weight { // Proof Size summary in bytes: - // Measured: `340` + // Measured: `307` // Estimated: `6500` // Minimum execution time: 43_340 nanoseconds. Weight::from_parts(52_540_000, 6500) @@ -150,7 +150,7 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) fn exit_court_set() -> Weight { // Proof Size summary in bytes: - // Measured: `340` + // Measured: `307` // Estimated: `6500` // Minimum execution time: 40_611 nanoseconds. Weight::from_parts(50_010_000, 6500) @@ -301,12 +301,12 @@ impl WeightInfoZeitgeist for WeightInfo { /// The range of component `j` is `[1, 1000]`. fn handle_inflation(j: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + j * (267 ±0)` - // Estimated: `96996 + j * (2607 ±0)` - // Minimum execution time: 40_780 nanoseconds. - Weight::from_parts(41_230_000, 96996) - // Standard Error: 31_831 - .saturating_add(Weight::from_parts(21_157_879, 0).saturating_mul(j.into())) + // Measured: `0 + j * (243 ±0)` + // Estimated: `72996 + j * (2607 ±0)` + // Minimum execution time: 33_280 nanoseconds. + Weight::from_parts(34_480_000, 72996) + // Standard Error: 9_174 + .saturating_add(Weight::from_parts(19_968_654, 0).saturating_mul(j.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(j.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(j.into()))) @@ -429,7 +429,7 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) fn get_auto_resolve() -> Weight { // Proof Size summary in bytes: - // Measured: `456` + // Measured: `423` // Estimated: `5339` // Minimum execution time: 12_640 nanoseconds. Weight::from_parts(15_900_000, 5339).saturating_add(T::DbWeight::get().reads(2)) diff --git a/zrml/global-disputes/src/utils.rs b/zrml/global-disputes/src/utils.rs index dabebc965..a593280cd 100644 --- a/zrml/global-disputes/src/utils.rs +++ b/zrml/global-disputes/src/utils.rs @@ -24,7 +24,6 @@ type MarketOf = zeitgeist_primitives::types::Market< BalanceOf, ::BlockNumber, MomentOf, - zeitgeist_primitives::types::BaseAsset, MarketIdOf, >; @@ -38,7 +37,7 @@ where zeitgeist_primitives::types::Market { market_id: Default::default(), - base_asset: zeitgeist_primitives::types::BaseAsset::Ztg, + base_asset: zeitgeist_primitives::types::Asset::Ztg, creation: zeitgeist_primitives::types::MarketCreation::Permissionless, creator_fee: sp_runtime::Perbill::zero(), creator: T::GlobalDisputesPalletId::get().into_account_truncating(), diff --git a/zrml/global-disputes/src/weights.rs b/zrml/global-disputes/src/weights.rs index 7185025ae..3b7541a1f 100644 --- a/zrml/global-disputes/src/weights.rs +++ b/zrml/global-disputes/src/weights.rs @@ -144,10 +144,10 @@ impl WeightInfoZeitgeist for WeightInfo { /// The range of component `w` is `[1, 10]`. fn add_vote_outcome(_w: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `777 + w * (32 ±0)` - // Estimated: `11515` - // Minimum execution time: 70_410 nanoseconds. - Weight::from_parts(98_017_145, 11515) + // Measured: `690 + w * (32 ±0)` + // Estimated: `11501` + // Minimum execution time: 69_591 nanoseconds. + Weight::from_parts(88_511_398, 11501) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/zrml/hybrid-router/Cargo.toml b/zrml/hybrid-router/Cargo.toml index 8c4c2b95f..81a24316b 100644 --- a/zrml/hybrid-router/Cargo.toml +++ b/zrml/hybrid-router/Cargo.toml @@ -13,7 +13,6 @@ zrml-market-commons = { workspace = true } orml-asset-registry = { workspace = true, optional = true } orml-currencies = { workspace = true, optional = true } orml-tokens = { workspace = true, optional = true } -pallet-assets = { workspace = true, optional = true } pallet-balances = { workspace = true, optional = true } pallet-randomness-collective-flip = { workspace = true, optional = true } pallet-timestamp = { workspace = true, optional = true } @@ -23,7 +22,6 @@ serde = { workspace = true, optional = true } sp-io = { workspace = true, optional = true } xcm = { workspace = true, optional = true } xcm-builder = { workspace = true, optional = true } -zrml-asset-router = { workspace = true, optional = true } zrml-authorized = { workspace = true, optional = true } zrml-court = { workspace = true, optional = true } zrml-global-disputes = { workspace = true, optional = true } @@ -44,7 +42,6 @@ mock = [ "orml-asset-registry/default", "orml-currencies/default", "orml-tokens/default", - "pallet-assets/default", "pallet-balances/default", "pallet-randomness-collective-flip/default", "pallet-timestamp/default", @@ -54,7 +51,6 @@ mock = [ "sp-io/default", "xcm/default", "zeitgeist-primitives/mock", - "zrml-asset-router/default", "zrml-market-commons/default", "zrml-neo-swaps/default", "zrml-orderbook/default", @@ -74,7 +70,6 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "xcm-builder/runtime-benchmarks", - "pallet-assets?/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "zrml-prediction-markets/runtime-benchmarks", ] diff --git a/zrml/hybrid-router/src/benchmarking.rs b/zrml/hybrid-router/src/benchmarking.rs index 24e7f5c7d..1aa8718c0 100644 --- a/zrml/hybrid-router/src/benchmarking.rs +++ b/zrml/hybrid-router/src/benchmarking.rs @@ -38,10 +38,7 @@ use zeitgeist_primitives::{ constants::{base_multiples::*, CENT}, math::fixed::{BaseProvider, FixedDiv, ZeitgeistBase}, traits::{CompleteSetOperationsApi, DeployPoolApi, HybridRouterOrderbookApi}, - types::{ - Asset, BaseAssetClass, Market, MarketCreation, MarketPeriod, MarketStatus, MarketType, - ScoringRule, - }, + types::{Asset, Market, MarketCreation, MarketPeriod, MarketStatus, MarketType, ScoringRule}, }; use zrml_market_commons::MarketCommonsPalletApi; @@ -68,11 +65,7 @@ fn create_spot_prices(asset_count: u16) -> Vec> { amounts } -fn create_market( - caller: T::AccountId, - base_asset: BaseAssetClass, - asset_count: u16, -) -> MarketIdOf +fn create_market(caller: T::AccountId, base_asset: AssetOf, asset_count: u16) -> MarketIdOf where T: Config, { @@ -101,7 +94,7 @@ where fn create_market_and_deploy_pool( caller: T::AccountId, - base_asset: BaseAssetClass, + base_asset: AssetOf, asset_count: u16, amount: BalanceOf, ) -> MarketIdOf @@ -109,8 +102,8 @@ where T: Config, { let market_id = create_market::(caller.clone(), base_asset, asset_count); - let total_cost = amount + T::AssetManager::minimum_balance(base_asset.into()); - assert_ok!(T::AssetManager::deposit(base_asset.into(), &caller, total_cost)); + let total_cost = amount + T::AssetManager::minimum_balance(base_asset); + assert_ok!(T::AssetManager::deposit(base_asset, &caller, total_cost)); assert_ok_with_transaction!(T::CompleteSetOperations::buy_complete_set( caller.clone(), market_id, @@ -133,7 +126,7 @@ mod benchmarks { #[benchmark] fn buy(n: Linear<2, 16>, o: Linear<0, 10>) { let buyer: T::AccountId = whitelisted_caller(); - let base_asset = BaseAssetClass::Ztg; + let base_asset = Asset::Ztg; let asset_count = n.try_into().unwrap(); let market_id = create_market_and_deploy_pool::( buyer.clone(), @@ -144,7 +137,7 @@ mod benchmarks { let asset = Asset::CategoricalOutcome(market_id, 0u16); let amount_in = _1000.saturated_into(); - assert_ok!(T::AssetManager::deposit(base_asset.into(), &buyer, amount_in)); + assert_ok!(T::AssetManager::deposit(base_asset, &buyer, amount_in)); let spot_prices = create_spot_prices::(asset_count); let first_spot_price = spot_prices[0]; @@ -153,7 +146,7 @@ mod benchmarks { let orders = (0u128..o as u128).collect::>(); let maker_asset = asset; let maker_amount = _20.saturated_into(); - let taker_asset: AssetOf = base_asset.into(); + let taker_asset = base_asset; let taker_amount: BalanceOf = _11.saturated_into(); assert!(taker_amount.bdiv_floor(maker_amount).unwrap() > first_spot_price); for (i, order_id) in orders.iter().enumerate() { @@ -187,14 +180,14 @@ mod benchmarks { let buyer_limit_order = T::Orderbook::order(o as u128).unwrap(); assert_eq!(buyer_limit_order.market_id, market_id); assert_eq!(buyer_limit_order.maker, buyer); - assert_eq!(buyer_limit_order.maker_asset, base_asset.into()); + assert_eq!(buyer_limit_order.maker_asset, base_asset); assert_eq!(buyer_limit_order.taker_asset, asset); } #[benchmark] fn sell(n: Linear<2, 10>, o: Linear<0, 10>) { let seller: T::AccountId = whitelisted_caller(); - let base_asset = BaseAssetClass::Ztg; + let base_asset = Asset::Ztg; let asset_count = n.try_into().unwrap(); let market_id = create_market_and_deploy_pool::( seller.clone(), @@ -209,15 +202,15 @@ mod benchmarks { // seller base asset amount needs to exist, // otherwise repatriate_reserved_named from order book fails // with DeadAccount for base asset repatriate to seller beneficiary - let min_balance = T::AssetManager::minimum_balance(base_asset.into()); - assert_ok!(T::AssetManager::deposit(base_asset.into(), &seller, min_balance)); + let min_balance = T::AssetManager::minimum_balance(base_asset); + assert_ok!(T::AssetManager::deposit(base_asset, &seller, min_balance)); let spot_prices = create_spot_prices::(asset_count); let first_spot_price = spot_prices[0]; let min_price = _1_100.saturated_into(); let orders = (0u128..o as u128).collect::>(); - let maker_asset: AssetOf = base_asset.into(); + let maker_asset: AssetOf = base_asset; let maker_amount: BalanceOf = _9.saturated_into(); let taker_asset = asset; let taker_amount = _100.saturated_into(); @@ -255,7 +248,7 @@ mod benchmarks { assert_eq!(seller_limit_order.market_id, market_id); assert_eq!(seller_limit_order.maker, seller); assert_eq!(seller_limit_order.maker_asset, asset); - assert_eq!(seller_limit_order.taker_asset, base_asset.into()); + assert_eq!(seller_limit_order.taker_asset, base_asset); } impl_benchmark_test_suite!( diff --git a/zrml/hybrid-router/src/lib.rs b/zrml/hybrid-router/src/lib.rs index 1155ee832..4892585f4 100644 --- a/zrml/hybrid-router/src/lib.rs +++ b/zrml/hybrid-router/src/lib.rs @@ -64,7 +64,7 @@ mod pallet { }, orderbook::{Order, OrderId}, traits::{HybridRouterAmmApi, HybridRouterOrderbookApi}, - types::{Asset, BaseAsset}, + types::Asset, }; use zrml_market_commons::MarketCommonsPalletApi; @@ -424,7 +424,7 @@ mod pallet { mut remaining: BalanceOf, who: &AccountIdOf, market_id: MarketIdOf, - base_asset: BaseAsset, + base_asset: AssetOf, asset: AssetOf, price_limit: BalanceOf, ) -> Result, DispatchError> { @@ -440,7 +440,7 @@ mod pallet { Err(_) => continue, }; - let order_price = order.price(base_asset.into())?; + let order_price = order.price(base_asset)?; match tx_type { TxType::Buy => { @@ -595,8 +595,8 @@ mod pallet { ensure!(asset_count as usize == assets.len(), Error::::AssetCountMismatch); let (asset_in, asset_out) = match tx_type { - TxType::Buy => (market.base_asset.into(), asset), - TxType::Sell => (asset, market.base_asset.into()), + TxType::Buy => (market.base_asset, asset), + TxType::Sell => (asset, market.base_asset), }; T::AssetManager::ensure_can_withdraw(asset_in, &who, amount_in)?; @@ -637,7 +637,7 @@ mod pallet { if !remaining.is_zero() { let (maker_asset, maker_amount, taker_asset, taker_amount) = match tx_type { TxType::Buy => { - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let maker_amount = remaining; let taker_asset = asset; let taker_amount = remaining.bdiv_ceil(price_limit)?; @@ -646,7 +646,7 @@ mod pallet { TxType::Sell => { let maker_asset = asset; let maker_amount = remaining; - let taker_asset = market.base_asset.into(); + let taker_asset = market.base_asset; let taker_amount = price_limit.bmul_floor(remaining)?; (maker_asset, maker_amount, taker_asset, taker_amount) } diff --git a/zrml/hybrid-router/src/mock.rs b/zrml/hybrid-router/src/mock.rs index feb7f3718..2682f950f 100644 --- a/zrml/hybrid-router/src/mock.rs +++ b/zrml/hybrid-router/src/mock.rs @@ -27,46 +27,41 @@ use crate::{AssetOf, BalanceOf, MarketIdOf}; use core::marker::PhantomData; use frame_support::{ construct_runtime, ord_parameter_types, parameter_types, - traits::{AsEnsureOriginWithArg, Contains, Everything, NeverEnsureOrigin}, + traits::{Contains, Everything, NeverEnsureOrigin}, }; -use frame_system::{EnsureRoot, EnsureSigned, EnsureSignedBy}; +use frame_system::{EnsureRoot, EnsureSignedBy}; #[cfg(feature = "parachain")] use orml_asset_registry::AssetMetadata; use orml_traits::MultiCurrency; -use parity_scale_codec::Compact; use sp_runtime::{ testing::Header, - traits::{BlakeTwo256, ConstU32, Get, IdentityLookup, Zero}, + traits::{BlakeTwo256, Get, IdentityLookup, Zero}, Perbill, Percent, SaturatedConversion, }; #[cfg(feature = "parachain")] use zeitgeist_primitives::types::Asset; use zeitgeist_primitives::{ constants::mock::{ - AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AssetsAccountDeposit, - AssetsApprovalDeposit, AssetsDeposit, AssetsMetadataDepositBase, - AssetsMetadataDepositPerByte, AssetsStringLimit, AuthorizedPalletId, BlockHashCount, - BlocksPerYear, CloseEarlyBlockPeriod, CloseEarlyDisputeBond, + AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AuthorizedPalletId, + BlockHashCount, BlocksPerYear, CloseEarlyBlockPeriod, CloseEarlyDisputeBond, CloseEarlyProtectionBlockPeriod, CloseEarlyProtectionTimeFramePeriod, CloseEarlyRequestBond, CloseEarlyTimeFramePeriod, CorrectionPeriod, CourtPalletId, - DestroyAccountWeight, DestroyApprovalWeight, DestroyFinishWeight, ExistentialDeposit, - ExistentialDeposits, GdVotingPeriod, GetNativeCurrencyId, GlobalDisputeLockId, - GlobalDisputesPalletId, HybridRouterPalletId, InflationPeriod, LiquidityMiningPalletId, - LockId, MaxAppeals, MaxApprovals, MaxCourtParticipants, MaxCreatorFee, MaxDelegations, - MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGlobalDisputeVotes, MaxGracePeriod, - MaxLiquidityTreeDepth, MaxLocks, MaxMarketLifetime, MaxOracleDuration, MaxOrders, - MaxOwners, MaxRejectReasonLen, MaxReserves, MaxSelectedDraws, MaxYearlyInflation, - MinCategories, MinDisputeDuration, MinJurorStake, MinOracleDuration, MinOutcomeVoteAmount, - MinimumPeriod, NeoMaxSwapFee, NeoSwapsPalletId, OrderbookPalletId, OutcomeBond, - OutcomeFactor, OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval, + ExistentialDeposit, ExistentialDeposits, GdVotingPeriod, GetNativeCurrencyId, + GlobalDisputeLockId, GlobalDisputesPalletId, HybridRouterPalletId, InflationPeriod, + LiquidityMiningPalletId, LockId, MaxAppeals, MaxApprovals, MaxCourtParticipants, + MaxCreatorFee, MaxDelegations, MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, + MaxGlobalDisputeVotes, MaxGracePeriod, MaxLiquidityTreeDepth, MaxLocks, MaxMarketLifetime, + MaxOracleDuration, MaxOrders, MaxOwners, MaxRejectReasonLen, MaxReserves, MaxSelectedDraws, + MaxYearlyInflation, MinCategories, MinDisputeDuration, MinJurorStake, MinOracleDuration, + MinOutcomeVoteAmount, MinimumPeriod, NeoMaxSwapFee, NeoSwapsPalletId, OrderbookPalletId, + OutcomeBond, OutcomeFactor, OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval, SimpleDisputesPalletId, TreasuryPalletId, VotePeriod, VotingOutcomeFee, BASE, CENT, MAX_ASSETS, }, traits::DistributeFees, types::{ - AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, - CampaignAsset, CampaignAssetId, Currencies, CustomAsset, CustomAssetId, Hash, Index, - MarketAsset, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, + Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, }, }; @@ -153,10 +148,6 @@ impl Contains for DustRemovalWhitelist { } } -pub(super) type CustomAssetsInstance = pallet_assets::Instance1; -pub(super) type CampaignAssetsInstance = pallet_assets::Instance2; -pub(super) type MarketAssetsInstance = pallet_assets::Instance3; - construct_runtime!( pub enum Runtime where @@ -165,16 +156,12 @@ construct_runtime!( UncheckedExtrinsic = UncheckedExtrinsic, { HybridRouter: zrml_hybrid_router::{Pallet, Call, Storage, Event}, + AssetManager: orml_currencies::{Call, Pallet, Storage}, Orderbook: zrml_orderbook::{Call, Event, Pallet, Storage}, - AssetRouter: zrml_asset_router::{Pallet}, NeoSwaps: zrml_neo_swaps::{Call, Event, Pallet}, Authorized: zrml_authorized::{Event, Pallet, Storage}, Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, Court: zrml_court::{Event, Pallet, Storage}, - CampaignAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - CustomAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - MarketAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - AssetManager: orml_currencies::{Call, Pallet, Storage}, LiquidityMining: zrml_liquidity_mining::{Config, Event, Pallet}, MarketCommons: zrml_market_commons::{Pallet, Storage}, PredictionMarkets: zrml_prediction_markets::{Event, Pallet, Storage}, @@ -203,122 +190,6 @@ impl crate::Config for Runtime { type WeightInfo = zrml_hybrid_router::weights::WeightInfo; } -pallet_assets::runtime_benchmarks_enabled! { - pub struct AssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for AssetsBenchmarkHelper - where - AssetIdParameter: From, - { - fn create_asset_id_parameter(id: u32) -> AssetIdParameter { - (id as u128).into() - } - } -} - -pallet_assets::runtime_benchmarks_enabled! { - use zeitgeist_primitives::types::CategoryIndex; - - pub struct MarketAssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for MarketAssetsBenchmarkHelper - { - fn create_asset_id_parameter(id: u32) -> MarketAsset { - MarketAsset::CategoricalOutcome(0, id as CategoryIndex) - } - } -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CampaignAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CustomAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = MarketAsset; - type AssetIdParameter = MarketAsset; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = MarketAssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl zrml_asset_router::Config for Runtime { - type AssetType = Assets; - type Balance = Balance; - type CurrencyType = Currencies; - type Currencies = Tokens; - type CampaignAssetType = CampaignAsset; - type CampaignAssets = CampaignAssets; - type CustomAssetType = CustomAsset; - type CustomAssets = CustomAssets; - type DestroyAccountWeight = DestroyAccountWeight; - type DestroyApprovalWeight = DestroyApprovalWeight; - type DestroyFinishWeight = DestroyFinishWeight; - type MarketAssetType = MarketAsset; - type MarketAssets = MarketAssets; -} - impl zrml_orderbook::Config for Runtime { type AssetManager = AssetManager; type ExternalFees = ExternalFees; @@ -346,8 +217,6 @@ impl zrml_prediction_markets::Config for Runtime { type AdvisoryBond = AdvisoryBond; type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; type ApproveOrigin = EnsureSignedBy; - type AssetCreator = AssetRouter; - type AssetDestroyer = AssetRouter; #[cfg(feature = "parachain")] type AssetRegistry = MockRegistry; type Authorized = Authorized; @@ -378,7 +247,6 @@ impl zrml_prediction_markets::Config for Runtime { type MinCategories = MinCategories; type MaxEditReasonLen = MaxEditReasonLen; type MaxRejectReasonLen = MaxRejectReasonLen; - type OnStateTransition = (); type OracleBond = OracleBond; type OutsiderBond = OutsiderBond; type PalletId = PmPalletId; @@ -469,7 +337,7 @@ impl frame_system::Config for Runtime { impl orml_currencies::Config for Runtime { type GetNativeCurrencyId = GetNativeCurrencyId; - type MultiCurrency = AssetRouter; + type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; type WeightInfo = (); } @@ -477,7 +345,7 @@ impl orml_currencies::Config for Runtime { impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; - type CurrencyId = Currencies; + type CurrencyId = CurrencyId; type DustRemovalWhitelist = DustRemovalWhitelist; type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; @@ -564,7 +432,7 @@ impl pallet_treasury::Config for Runtime { #[cfg(feature = "parachain")] zrml_prediction_markets::impl_mock_registry! { MockRegistry, - zeitgeist_primitives::types::XcmAsset, + CurrencyId, Balance, zeitgeist_primitives::types::CustomMetadata } @@ -604,8 +472,8 @@ impl ExtBuilder { use frame_support::traits::GenesisBuild; orml_tokens::GenesisConfig:: { balances: vec![ - (ALICE, FOREIGN_ASSET.try_into().unwrap(), INITIAL_BALANCE), - (FEE_ACCOUNT, FOREIGN_ASSET.try_into().unwrap(), INITIAL_BALANCE), + (ALICE, FOREIGN_ASSET, INITIAL_BALANCE), + (FEE_ACCOUNT, FOREIGN_ASSET, INITIAL_BALANCE), ], } .assimilate_storage(&mut t) @@ -616,7 +484,7 @@ impl ExtBuilder { }; orml_asset_registry_mock::GenesisConfig { metadata: vec![( - FOREIGN_ASSET.try_into().unwrap(), + FOREIGN_ASSET, AssetMetadata { decimals: 18, name: "MKL".as_bytes().to_vec(), diff --git a/zrml/hybrid-router/src/tests/buy.rs b/zrml/hybrid-router/src/tests/buy.rs index fb3630b5c..6c5a36f82 100644 --- a/zrml/hybrid-router/src/tests/buy.rs +++ b/zrml/hybrid-router/src/tests/buy.rs @@ -16,6 +16,7 @@ // along with Zeitgeist. If not, see . use super::*; +use zeitgeist_primitives::types::Asset; #[test] fn buy_from_amm_and_then_fill_specified_order() { @@ -34,7 +35,7 @@ fn buy_from_amm_and_then_fill_specified_order() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _2; let order_maker_amount = _12; @@ -87,7 +88,7 @@ fn buy_from_amm_and_then_fill_specified_order() { Order { market_id, maker: CHARLIE, - maker_asset: Assets::CategoricalOutcome(market_id, 0), + maker_asset: Asset::CategoricalOutcome(market_id, 0), maker_amount: 85665315968, taker_asset: BASE_ASSET, taker_amount: unfilled_base_asset_amount, @@ -115,7 +116,7 @@ fn buy_from_amm_if_specified_order_has_higher_prices_than_the_amm() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; let order_maker_amount = _4; @@ -153,7 +154,7 @@ fn buy_from_amm_if_specified_order_has_higher_prices_than_the_amm() { Order { market_id, maker: CHARLIE, - maker_asset: Assets::CategoricalOutcome(market_id, 0), + maker_asset: Asset::CategoricalOutcome(market_id, 0), maker_amount: _4, taker_asset: BASE_ASSET, taker_amount: _2, @@ -178,7 +179,7 @@ fn buy_fill_multiple_orders_if_amm_spot_price_higher_than_order_prices() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _2; let order_maker_amount = _1; @@ -237,7 +238,7 @@ fn buy_fill_specified_order_partially_if_amm_spot_price_higher() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; let order_maker_amount = _8; @@ -276,7 +277,7 @@ fn buy_fill_specified_order_partially_if_amm_spot_price_higher() { Order { market_id, maker: CHARLIE, - maker_asset: Assets::CategoricalOutcome(market_id, 0), + maker_asset: Asset::CategoricalOutcome(market_id, 0), maker_amount: _4, taker_asset: BASE_ASSET, taker_amount: _2, @@ -301,7 +302,7 @@ fn buy_fails_if_asset_not_equal_to_order_book_maker_asset() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; let order_maker_amount = _1; assert_ok!(AssetManager::deposit(BASE_ASSET, &CHARLIE, order_maker_amount)); @@ -311,7 +312,7 @@ fn buy_fails_if_asset_not_equal_to_order_book_maker_asset() { market_id, BASE_ASSET, order_maker_amount, - Assets::CategoricalOutcome(market_id, 0), + Asset::CategoricalOutcome(market_id, 0), _2, )); @@ -354,7 +355,7 @@ fn buy_fails_if_order_price_above_max_price() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; let order_maker_amount = _1; @@ -362,7 +363,7 @@ fn buy_fails_if_order_price_above_max_price() { assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(CHARLIE), market_id, - Assets::CategoricalOutcome(market_id, 0), + Asset::CategoricalOutcome(market_id, 0), order_maker_amount, BASE_ASSET, _2, @@ -407,7 +408,7 @@ fn buy_from_amm() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; let max_price = _3_4.saturated_into::>(); let orders = vec![]; @@ -456,7 +457,7 @@ fn buy_max_price_lower_than_amm_spot_price_results_in_place_order() { let market = Markets::::get(market_id).unwrap(); let base_asset = market.base_asset; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; //* max_price is just 1 smaller than the spot price of the AMM //* this results in no buy on the AMM, but places an order on the order book @@ -483,7 +484,7 @@ fn buy_max_price_lower_than_amm_spot_price_results_in_place_order() { Order { market_id, maker: ALICE, - maker_asset: base_asset.into(), + maker_asset: base_asset, maker_amount: _2, taker_asset: asset, taker_amount: _4, @@ -510,7 +511,7 @@ fn buy_from_amm_but_low_amount() { let market = Markets::::get(market_id).unwrap(); let base_asset = market.base_asset; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _2; //* max_price is just 1 larger than the spot price of the AMM //* this results in a low buy amount_in on the AMM @@ -550,7 +551,7 @@ fn buy_from_amm_but_low_amount() { Order { market_id, maker: ALICE, - maker_asset: base_asset.into(), + maker_asset: base_asset, maker_amount: 19999999970, taker_asset: asset, taker_amount: 39999999933, @@ -575,7 +576,7 @@ fn buy_from_amm_only() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; let max_price = _3_4.saturated_into::>(); let orders = vec![]; @@ -623,7 +624,7 @@ fn buy_places_limit_order_no_pool() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -648,7 +649,7 @@ fn buy_places_limit_order_no_pool() { Order { market_id, maker: ALICE, - maker_asset: base_asset.into(), + maker_asset: base_asset, maker_amount: 10 * BASE, taker_asset: asset, taker_amount: 20 * BASE, @@ -670,7 +671,7 @@ fn buy_fails_if_balance_too_low() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; assert_ok!(Balances::set_balance(RuntimeOrigin::root(), ALICE, amount - 1, 0)); @@ -710,7 +711,7 @@ fn buy_emits_event() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _1000 * 100; assert_ok!(AssetManager::deposit(BASE_ASSET, &ALICE, amount_in)); @@ -780,7 +781,7 @@ fn buy_fails_if_asset_count_mismatch() { let asset_count = 2; assert_ne!(required_asset_count, asset_count); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 2 * BASE; let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -814,7 +815,7 @@ fn buy_fails_if_price_limit_too_high() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; let max_price = (BASE + 1).saturated_into::>(); let orders = vec![]; @@ -848,7 +849,7 @@ fn buy_succeeds_for_place_order_below_minimum_balance_soft_failure() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 1; let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -887,7 +888,7 @@ fn buy_succeeds_for_numerical_soft_failure() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _1_100; let max_price = (_3_4).saturated_into::>(); @@ -912,7 +913,7 @@ fn buy_succeeds_for_numerical_soft_failure() { maker: ALICE, maker_asset: BASE_ASSET, maker_amount: _1_100, - taker_asset: Assets::CategoricalOutcome(market_id, 0), + taker_asset: Asset::CategoricalOutcome(market_id, 0), taker_amount: 133333334, } ); @@ -935,7 +936,7 @@ fn buy_just_one_unit_from_amm() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 1; let order_maker_amount = _2; @@ -943,7 +944,7 @@ fn buy_just_one_unit_from_amm() { assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(CHARLIE), market_id, - Assets::CategoricalOutcome(market_id, 0), + Asset::CategoricalOutcome(market_id, 0), order_maker_amount, BASE_ASSET, _1, @@ -956,6 +957,8 @@ fn buy_just_one_unit_from_amm() { let max_price = (_1_2 + 1).saturated_into::>(); let orders = vec![order_id]; let strategy = Strategy::LimitOrder; + // Prevent ED error by giving Alice some extra tokens. + assert_ok!(AssetManager::deposit(asset, &ALICE, _1)); assert_ok!(HybridRouter::buy( RuntimeOrigin::signed(ALICE), market_id, @@ -973,7 +976,7 @@ fn buy_just_one_unit_from_amm() { Order { market_id, maker: CHARLIE, - maker_asset: Assets::CategoricalOutcome(market_id, 0), + maker_asset: Asset::CategoricalOutcome(market_id, 0), maker_amount: _2, taker_asset: BASE_ASSET, taker_amount: _1, @@ -998,7 +1001,7 @@ fn buy_succeeds_for_fill_order_below_minimum_balance_soft_failure() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 1; let order_maker_amount = _2; @@ -1006,7 +1009,7 @@ fn buy_succeeds_for_fill_order_below_minimum_balance_soft_failure() { assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(CHARLIE), market_id, - Assets::CategoricalOutcome(market_id, 0), + Asset::CategoricalOutcome(market_id, 0), order_maker_amount, BASE_ASSET, _1, @@ -1019,6 +1022,8 @@ fn buy_succeeds_for_fill_order_below_minimum_balance_soft_failure() { let max_price = _3_4.saturated_into::>(); let orders = vec![order_id]; let strategy = Strategy::LimitOrder; + // Prevent ED error by giving Alice some extra tokens. + assert_ok!(AssetManager::deposit(asset, &ALICE, _1)); assert_ok!(HybridRouter::buy( RuntimeOrigin::signed(ALICE), market_id, @@ -1036,7 +1041,7 @@ fn buy_succeeds_for_fill_order_below_minimum_balance_soft_failure() { Order { market_id, maker: CHARLIE, - maker_asset: Assets::CategoricalOutcome(market_id, 0), + maker_asset: Asset::CategoricalOutcome(market_id, 0), maker_amount: _2, taker_asset: BASE_ASSET, taker_amount: _1, @@ -1061,7 +1066,7 @@ fn buy_succeeds_for_place_order_partial_fill_near_full_fill_not_allowed() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _1 - 1; let order_maker_amount = _2; @@ -1069,7 +1074,7 @@ fn buy_succeeds_for_place_order_partial_fill_near_full_fill_not_allowed() { assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(CHARLIE), market_id, - Assets::CategoricalOutcome(market_id, 0), + Asset::CategoricalOutcome(market_id, 0), order_maker_amount, BASE_ASSET, _1, @@ -1099,7 +1104,7 @@ fn buy_succeeds_for_place_order_partial_fill_near_full_fill_not_allowed() { Order { market_id, maker: CHARLIE, - maker_asset: Assets::CategoricalOutcome(market_id, 0), + maker_asset: Asset::CategoricalOutcome(market_id, 0), maker_amount: _2, taker_asset: BASE_ASSET, taker_amount: _1, @@ -1124,7 +1129,7 @@ fn buy_only_executes_first_order_from_orders_vector() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _1; let order_maker_amount = _2; @@ -1132,7 +1137,7 @@ fn buy_only_executes_first_order_from_orders_vector() { assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(CHARLIE), market_id, - Assets::CategoricalOutcome(market_id, 0), + Asset::CategoricalOutcome(market_id, 0), order_maker_amount, BASE_ASSET, _1, @@ -1143,7 +1148,7 @@ fn buy_only_executes_first_order_from_orders_vector() { assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(DAVE), market_id, - Assets::CategoricalOutcome(market_id, 0), + Asset::CategoricalOutcome(market_id, 0), order_maker_amount, BASE_ASSET, _1, @@ -1176,7 +1181,7 @@ fn buy_only_executes_first_order_from_orders_vector() { Order { market_id, maker: CHARLIE, - maker_asset: Assets::CategoricalOutcome(market_id, 0), + maker_asset: Asset::CategoricalOutcome(market_id, 0), maker_amount: _2, taker_asset: BASE_ASSET, taker_amount: _1, @@ -1190,7 +1195,7 @@ fn buy_skips_fill_order_if_order_not_present_and_places_new_order() { ExtBuilder::default().build().execute_with(|| { let market_id = 0; let mut market = market_mock::(MARKET_CREATOR); - market.base_asset = BASE_ASSET.try_into().unwrap(); + market.base_asset = BASE_ASSET; let required_asset_count = match &market.market_type { MarketType::Scalar(_) => panic!("Categorical market type is expected!"), MarketType::Categorical(categories) => *categories, @@ -1199,7 +1204,7 @@ fn buy_skips_fill_order_if_order_not_present_and_places_new_order() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; let max_price = (BASE / 2).saturated_into::>(); let orders = vec![42]; @@ -1223,7 +1228,7 @@ fn buy_skips_fill_order_if_order_not_present_and_places_new_order() { maker: ALICE, maker_asset: BASE_ASSET, maker_amount: 10 * BASE, - taker_asset: Assets::CategoricalOutcome(market_id, 0), + taker_asset: Asset::CategoricalOutcome(market_id, 0), taker_amount: 20 * BASE, } ); @@ -1243,7 +1248,7 @@ fn buy_fails_if_max_orders_exceeded() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; let max_price = (BASE / 2).saturated_into::>(); let orders = (0u128..100u128 + 1u128).collect::>(); @@ -1277,7 +1282,7 @@ fn buy_fails_if_amount_is_zero() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 0; let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -1311,7 +1316,7 @@ fn buy_fails_if_cancel_strategy_applied() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -1337,7 +1342,7 @@ fn buy_fails_if_market_does_not_exist() { ExtBuilder::default().build().execute_with(|| { let market_id = 0; let asset_count = 2; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; diff --git a/zrml/hybrid-router/src/tests/mod.rs b/zrml/hybrid-router/src/tests/mod.rs index 1abce4120..4c42c9e25 100644 --- a/zrml/hybrid-router/src/tests/mod.rs +++ b/zrml/hybrid-router/src/tests/mod.rs @@ -27,8 +27,8 @@ use zeitgeist_primitives::{ constants::{base_multiples::*, BASE, CENT}, orderbook::Order, types::{ - AccountIdTest, Assets, Deadlines, MarketCreation, MarketPeriod, MarketStatus, MarketType, - MultiHash, ScoringRule, + AccountIdTest, Asset, Deadlines, MarketCreation, MarketId, MarketPeriod, MarketStatus, + MarketType, MultiHash, ScoringRule, }, }; use zrml_market_commons::{Error as MError, MarketCommonsPalletApi, Markets}; @@ -39,13 +39,13 @@ mod buy; mod sell; #[cfg(not(feature = "parachain"))] -const BASE_ASSET: Assets = Assets::Ztg; +const BASE_ASSET: Asset = Asset::Ztg; #[cfg(feature = "parachain")] -const BASE_ASSET: Assets = FOREIGN_ASSET; +const BASE_ASSET: Asset = FOREIGN_ASSET; fn create_market( creator: AccountIdTest, - base_asset: Assets, + base_asset: AssetOf, market_type: MarketType, scoring_rule: ScoringRule, ) -> MarketIdOf { @@ -54,7 +54,7 @@ fn create_market( metadata[1] = 0x30; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(creator), - base_asset.try_into().unwrap(), + base_asset, Perbill::zero(), EVE, MarketPeriod::Block(0..2), @@ -74,7 +74,7 @@ fn create_market( fn create_market_and_deploy_pool( creator: AccountIdOf, - base_asset: Assets, + base_asset: AssetOf, market_type: MarketType, amount: BalanceOf, spot_prices: Vec>, diff --git a/zrml/hybrid-router/src/tests/sell.rs b/zrml/hybrid-router/src/tests/sell.rs index a1c383945..837b4bac2 100644 --- a/zrml/hybrid-router/src/tests/sell.rs +++ b/zrml/hybrid-router/src/tests/sell.rs @@ -16,7 +16,7 @@ // along with Zeitgeist. If not, see . use super::*; -use frame_support::traits::fungibles::Unbalanced; +use zeitgeist_primitives::types::Asset; #[test] fn sell_to_amm_and_then_fill_specified_order() { @@ -35,7 +35,7 @@ fn sell_to_amm_and_then_fill_specified_order() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _2; let order_maker_amount = _6; @@ -52,7 +52,7 @@ fn sell_to_amm_and_then_fill_specified_order() { let order_ids = Orders::::iter().map(|(k, _)| k).collect::>(); - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); let min_price = _1_4.saturated_into::>(); let strategy = Strategy::LimitOrder; @@ -92,7 +92,7 @@ fn sell_to_amm_and_then_fill_specified_order() { maker: CHARLIE, maker_asset: BASE_ASSET, maker_amount: 52804047165, - taker_asset: Assets::CategoricalOutcome(market_id, 0), + taker_asset: Asset::CategoricalOutcome(market_id, 0), taker_amount: unfilled_base_asset_amount, } ); @@ -118,7 +118,7 @@ fn sell_to_amm_if_specified_order_has_lower_prices_than_the_amm() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _1; let order_maker_amount = _1; @@ -135,7 +135,7 @@ fn sell_to_amm_if_specified_order_has_lower_prices_than_the_amm() { let order_ids = Orders::::iter().map(|(k, _)| k).collect::>(); - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount,)); let min_price = _1_4.saturated_into::>(); let strategy = Strategy::LimitOrder; @@ -162,7 +162,7 @@ fn sell_to_amm_if_specified_order_has_lower_prices_than_the_amm() { maker: CHARLIE, maker_asset: BASE_ASSET, maker_amount: _1, - taker_asset: Assets::CategoricalOutcome(market_id, 0), + taker_asset: Asset::CategoricalOutcome(market_id, 0), taker_amount: _2, } ); @@ -185,7 +185,7 @@ fn sell_fill_multiple_orders_if_amm_spot_price_lower_than_order_prices() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _2; let order_maker_amount = _1_2; @@ -210,7 +210,7 @@ fn sell_fill_multiple_orders_if_amm_spot_price_lower_than_order_prices() { let order_ids = Orders::::iter().map(|(k, _)| k).collect::>(); - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); let min_price = _1_4.saturated_into::>(); let strategy = Strategy::LimitOrder; @@ -246,7 +246,7 @@ fn sell_fill_specified_order_partially_if_amm_spot_price_lower() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; let order_maker_amount = _4; @@ -265,7 +265,7 @@ fn sell_fill_specified_order_partially_if_amm_spot_price_lower() { assert_eq!(order_ids.len(), 1); let order_id = order_ids[0]; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount,)); let min_price = _1_4.saturated_into::>(); let orders = vec![order_id]; @@ -289,7 +289,7 @@ fn sell_fill_specified_order_partially_if_amm_spot_price_lower() { maker: CHARLIE, maker_asset: BASE_ASSET, maker_amount: _3, - taker_asset: Assets::CategoricalOutcome(market_id, 0), + taker_asset: Asset::CategoricalOutcome(market_id, 0), taker_amount: _6, } ); @@ -312,11 +312,11 @@ fn sell_fails_if_asset_not_equal_to_order_book_taker_asset() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _2; let maker_amount = _1; - assert_ok!(AssetRouter::increase_balance(asset, &CHARLIE, maker_amount,)); + assert_ok!(AssetManager::deposit(asset, &CHARLIE, maker_amount,)); assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(CHARLIE), @@ -331,7 +331,7 @@ fn sell_fails_if_asset_not_equal_to_order_book_taker_asset() { assert_eq!(order_ids.len(), 1); let order_id = order_ids[0]; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); let min_price = _1_4.saturated_into::>(); let orders = vec![order_id]; @@ -368,7 +368,7 @@ fn sell_fails_if_order_price_below_min_price() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; let order_maker_amount = _1; @@ -378,7 +378,7 @@ fn sell_fails_if_order_price_below_min_price() { market_id, BASE_ASSET, order_maker_amount, - Assets::CategoricalOutcome(market_id, 0), + Asset::CategoricalOutcome(market_id, 0), amount, )); @@ -386,7 +386,7 @@ fn sell_fails_if_order_price_below_min_price() { assert_eq!(order_ids.len(), 1); let order_id = order_ids[0]; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, 5 * amount,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, 5 * amount,)); let min_price = _3_4.saturated_into::>(); let orders = vec![order_id]; @@ -423,10 +423,10 @@ fn sell_to_amm() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount,)); let min_price = _1_4.saturated_into::>(); let orders = vec![]; @@ -475,10 +475,10 @@ fn sell_min_price_higher_than_amm_spot_price_results_in_place_order() { let market = Markets::::get(market_id).unwrap(); let base_asset = market.base_asset; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount,)); //* spot price of the AMM is 1 smaller than the min_price //* this results in no sell on the AMM, but places an order on the order book @@ -507,7 +507,7 @@ fn sell_min_price_higher_than_amm_spot_price_results_in_place_order() { maker: ALICE, maker_asset: asset, maker_amount: _2, - taker_asset: base_asset.into(), + taker_asset: base_asset, taker_amount: _1, } ); @@ -532,10 +532,10 @@ fn sell_to_amm_but_low_amount() { let market = Markets::::get(market_id).unwrap(); let base_asset = market.base_asset; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _2; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); //* min_price is just 1 smaller than the spot price of the AMM //* this results in a low sell amount_in on the AMM @@ -577,7 +577,7 @@ fn sell_to_amm_but_low_amount() { maker: ALICE, maker_asset: asset, maker_amount: 19999999942, - taker_asset: base_asset.into(), + taker_asset: base_asset, taker_amount: 9999999969, } ); @@ -600,12 +600,10 @@ fn sell_succeeds_for_numerical_soft_failure() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _1000 * 100; - // increase_balance does not set total issuance - AssetRouter::set_total_issuance(asset, amount_in); - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); let min_price = (_1_100 / 1000).saturated_into::>(); let orders = vec![]; @@ -627,7 +625,7 @@ fn sell_succeeds_for_numerical_soft_failure() { Order { market_id, maker: ALICE, - maker_asset: Assets::CategoricalOutcome(market_id, 0), + maker_asset: Asset::CategoricalOutcome(market_id, 0), maker_amount: _1000 * 100, taker_asset: BASE_ASSET, taker_amount: _1, @@ -652,10 +650,10 @@ fn sell_to_amm_only() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = _2; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount,)); let min_price = _1_4.saturated_into::>(); let orders = vec![]; @@ -703,10 +701,10 @@ fn sell_places_limit_order_no_pool() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount,)); let min_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -733,7 +731,7 @@ fn sell_places_limit_order_no_pool() { maker: ALICE, maker_asset: asset, maker_amount: 10 * BASE, - taker_asset: base_asset.into(), + taker_asset: base_asset, taker_amount: 5 * BASE, } ); @@ -753,10 +751,10 @@ fn sell_fails_if_balance_too_low() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount - 1,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount - 1,)); let min_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -794,7 +792,7 @@ fn sell_emits_event() { swap_fee, ); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = _1000 * 100; let min_price = _1_100.saturated_into::>(); @@ -820,9 +818,7 @@ fn sell_emits_event() { let order_ids = Orders::::iter().map(|(k, _)| k).collect::>(); - // increase_balance does not set total issuance - AssetRouter::set_total_issuance(asset, amount_in); - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); let strategy = Strategy::LimitOrder; assert_ok!(HybridRouter::sell( @@ -868,10 +864,10 @@ fn sell_fails_if_asset_count_mismatch() { let asset_count = 2; assert_ne!(required_asset_count, asset_count); - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = 2 * BASE; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -905,7 +901,7 @@ fn sell_fails_if_amount_is_zero() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = 0; let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; @@ -939,9 +935,9 @@ fn sell_fails_if_cancel_strategy_applied() { Markets::::insert(market_id, market); let asset_count = required_asset_count; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = 10 * BASE; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; let strategy = Strategy::ImmediateOrCancel; @@ -966,9 +962,9 @@ fn sell_fails_if_market_does_not_exist() { ExtBuilder::default().build().execute_with(|| { let market_id = 0; let asset_count = 2; - let asset = Assets::CategoricalOutcome(market_id, 0); + let asset = Asset::CategoricalOutcome(market_id, 0); let amount_in = 10 * BASE; - assert_ok!(AssetRouter::increase_balance(asset, &ALICE, amount_in,)); + assert_ok!(AssetManager::deposit(asset, &ALICE, amount_in,)); let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; let strategy = Strategy::ImmediateOrCancel; diff --git a/zrml/hybrid-router/src/utils.rs b/zrml/hybrid-router/src/utils.rs index 0dcc0e1ed..808296e26 100644 --- a/zrml/hybrid-router/src/utils.rs +++ b/zrml/hybrid-router/src/utils.rs @@ -21,13 +21,13 @@ use crate::{AccountIdOf, BalanceOf, MarketIdOf}; use frame_system::pallet_prelude::BlockNumberFor; use zeitgeist_primitives::{ traits::MarketCommonsPalletApi, - types::{BaseAsset, Market}, + types::{Asset, Market}, }; pub(crate) type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; pub(crate) type MarketOf = - Market, BalanceOf, BlockNumberFor, MomentOf, BaseAsset, MarketIdOf>; + Market, BalanceOf, BlockNumberFor, MomentOf, MarketIdOf>; pub(crate) fn market_mock(creator: T::AccountId) -> MarketOf where @@ -37,14 +37,14 @@ where use zeitgeist_primitives::{ constants::mock::PmPalletId, types::{ - BaseAssetClass, Deadlines, MarketBonds, MarketCreation, MarketDisputeMechanism, - MarketPeriod, MarketStatus, MarketType, ScoringRule, + Deadlines, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, + MarketStatus, MarketType, ScoringRule, }, }; zeitgeist_primitives::types::Market { market_id: 0u8.into(), - base_asset: BaseAssetClass::Ztg, + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: Perbill::zero(), creator, diff --git a/zrml/liquidity-mining/src/tests.rs b/zrml/liquidity-mining/src/tests.rs index 68363ff8c..671d52f3f 100644 --- a/zrml/liquidity-mining/src/tests.rs +++ b/zrml/liquidity-mining/src/tests.rs @@ -32,8 +32,8 @@ use frame_support::{ }; use frame_system::RawOrigin; use zeitgeist_primitives::types::{ - BaseAsset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, - MarketPeriod, MarketStatus, MarketType, ScoringRule, + Asset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, + MarketStatus, MarketType, ScoringRule, }; use zrml_market_commons::Markets; @@ -204,7 +204,7 @@ fn create_default_market(market_id: u128, period: Range) { market_id, Market { market_id: Default::default(), - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: sp_runtime::Perbill::zero(), creator: 0, diff --git a/zrml/market-commons/src/lib.rs b/zrml/market-commons/src/lib.rs index 3b2e1af6c..93082ef61 100644 --- a/zrml/market-commons/src/lib.rs +++ b/zrml/market-commons/src/lib.rs @@ -42,7 +42,7 @@ mod pallet { traits::{Hooks, StorageVersion, Time}, Blake2_128Concat, Parameter, }; - use parity_scale_codec::{FullCodec, HasCompact, MaxEncodedLen}; + use parity_scale_codec::{FullCodec, MaxEncodedLen}; use sp_runtime::{ traits::{ AtLeast32Bit, AtLeast32BitUnsigned, MaybeSerializeDeserialize, Member, Saturating, @@ -52,26 +52,19 @@ mod pallet { use zeitgeist_primitives::{ math::checked_ops_res::CheckedAddRes, traits::MarketBuilderTrait, - types::{ - BaseAsset, Deadlines, EarlyClose, Market, MarketBonds, MarketPeriod, PoolId, Report, - }, + types::{Asset, Deadlines, EarlyClose, Market, MarketBonds, MarketPeriod, PoolId, Report}, }; /// The current storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(11); pub(crate) type AccountIdOf = ::AccountId; + pub(crate) type AssetOf = Asset>; pub(crate) type BalanceOf = ::Balance; pub(crate) type BlockNumberOf = ::BlockNumber; pub(crate) type MarketIdOf = ::MarketId; - pub(crate) type MarketOf = Market< - AccountIdOf, - BalanceOf, - BlockNumberOf, - MomentOf, - BaseAsset, - MarketIdOf, - >; + pub(crate) type MarketOf = + Market, BalanceOf, BlockNumberOf, MomentOf, MarketIdOf>; pub(crate) type MomentOf = <::Timestamp as frame_support::traits::Time>::Moment; pub(crate) type DeadlinesOf = Deadlines>; pub(crate) type EarlyCloseOf = EarlyClose, MomentOf>; @@ -97,7 +90,6 @@ mod pallet { type MarketId: AtLeast32Bit + Copy + Default - + HasCompact + MaxEncodedLen + MaybeSerializeDeserialize + Member @@ -208,7 +200,6 @@ mod pallet { Self::Balance, Self::BlockNumber, Self::Moment, - BaseAsset, Self::MarketId, >, { diff --git a/zrml/market-commons/src/migrations.rs b/zrml/market-commons/src/migrations.rs index 2569b4a79..7bcc6e2e5 100644 --- a/zrml/market-commons/src/migrations.rs +++ b/zrml/market-commons/src/migrations.rs @@ -15,376 +15,3 @@ // // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . - -use crate::{AccountIdOf, BalanceOf, BlockNumberOf, Config, MomentOf, Pallet as MarketCommons}; -use alloc::vec::Vec; -use core::marker::PhantomData; -use frame_support::{ - dispatch::Weight, - log, - traits::{Get, OnRuntimeUpgrade, StorageVersion}, -}; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; -use sp_runtime::{Perbill, RuntimeDebug, Saturating}; -use zeitgeist_primitives::types::{ - BaseAsset, Deadlines, EarlyClose, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, - MarketPeriod, MarketStatus, MarketType, OutcomeReport, Report, ScoringRule, -}; - -#[cfg(feature = "try-runtime")] -use { - crate::MarketIdOf, - alloc::{collections::BTreeMap, format}, - frame_support::migration::storage_key_iter, -}; - -#[cfg(any(feature = "try-runtime", feature = "test"))] -use frame_support::Blake2_128Concat; - -#[cfg(any(feature = "try-runtime", test))] -const MARKET_COMMONS: &[u8] = b"MarketCommons"; -#[cfg(any(feature = "try-runtime", test))] -const MARKETS: &[u8] = b"Markets"; - -#[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] -pub struct OldMarket { - pub base_asset: A, - pub creator: AI, - pub creation: MarketCreation, - pub creator_fee: Perbill, - pub oracle: AI, - pub metadata: Vec, - pub market_type: MarketType, - pub period: MarketPeriod, - pub deadlines: Deadlines, - pub scoring_rule: OldScoringRule, - pub status: MarketStatus, - pub report: Option>, - pub resolved_outcome: Option, - pub dispute_mechanism: Option, - pub bonds: MarketBonds, - pub early_close: Option>, -} - -type OldMarketOf = - OldMarket, BalanceOf, BlockNumberOf, MomentOf, BaseAsset>; - -#[derive(TypeInfo, Clone, Copy, Encode, Eq, Decode, MaxEncodedLen, PartialEq, RuntimeDebug)] -pub enum OldScoringRule { - Lmsr, - Orderbook, - Parimutuel, -} - -const MARKET_COMMONS_REQUIRED_STORAGE_VERSION: u16 = 10; -const MARKET_COMMONS_NEXT_STORAGE_VERSION: u16 = 11; - -#[cfg(feature = "try-runtime")] -#[frame_support::storage_alias] -pub(crate) type Markets = - StorageMap, Blake2_128Concat, MarketIdOf, OldMarketOf>; - -pub struct MigrateScoringRuleAmmCdaHybridAndMarketId(PhantomData); - -/// Migrates AMM and CDA markets to the new combined scoring rule and adds the market's ID to the -/// struct. -impl OnRuntimeUpgrade for MigrateScoringRuleAmmCdaHybridAndMarketId -where - T: Config, -{ - fn on_runtime_upgrade() -> Weight { - let mut total_weight = T::DbWeight::get().reads(1); - let market_commons_version = StorageVersion::get::>(); - if market_commons_version != MARKET_COMMONS_REQUIRED_STORAGE_VERSION { - log::info!( - "MigrateScoringRuleAmmCdaHybridAndMarketId: market-commons version is {:?}, but \ - {:?} is required", - market_commons_version, - MARKET_COMMONS_REQUIRED_STORAGE_VERSION, - ); - return total_weight; - } - log::info!("MigrateScoringRuleAmmCdaHybridAndMarketId: Starting..."); - - let mut translated = 0u64; - crate::Markets::::translate::, _>(|market_id, old_market| { - translated.saturating_inc(); - let scoring_rule = match old_market.scoring_rule { - OldScoringRule::Lmsr => ScoringRule::AmmCdaHybrid, - OldScoringRule::Orderbook => ScoringRule::AmmCdaHybrid, - OldScoringRule::Parimutuel => ScoringRule::Parimutuel, - }; - let new_market = Market { - market_id, - base_asset: old_market.base_asset, - creator: old_market.creator, - creation: old_market.creation, - creator_fee: old_market.creator_fee, - oracle: old_market.oracle, - metadata: old_market.metadata, - market_type: old_market.market_type, - period: old_market.period, - deadlines: old_market.deadlines, - scoring_rule, - status: old_market.status, - report: old_market.report, - resolved_outcome: old_market.resolved_outcome, - dispute_mechanism: old_market.dispute_mechanism, - bonds: old_market.bonds, - early_close: old_market.early_close, - }; - Some(new_market) - }); - log::info!("MigrateScoringRuleAmmCdaHybridAndMarketId: Upgraded {} markets.", translated); - total_weight = - total_weight.saturating_add(T::DbWeight::get().reads_writes(translated, translated)); - - StorageVersion::new(MARKET_COMMONS_NEXT_STORAGE_VERSION).put::>(); - total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); - log::info!("MigrateScoringRuleAmmCdaHybridAndMarketId: Done!"); - total_weight - } - - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { - let old_markets = storage_key_iter::, OldMarketOf, Blake2_128Concat>( - MARKET_COMMONS, - MARKETS, - ) - .collect::>(); - let markets = Markets::::iter_keys().count(); - let decodable_markets = Markets::::iter_values().count(); - if markets == decodable_markets { - log::info!("All {} markets could successfully be decoded.", markets); - } else { - log::error!( - "Can only decode {} of {} markets - others will be dropped.", - decodable_markets, - markets - ); - } - - Ok(old_markets.encode()) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(previous_state: Vec) -> Result<(), &'static str> { - let old_markets: BTreeMap, OldMarketOf> = - Decode::decode(&mut &previous_state[..]).unwrap(); - let old_market_count = old_markets.len(); - let new_market_count = crate::Markets::::iter().count(); - assert_eq!(old_market_count, new_market_count); - for (market_id, new_market) in crate::Markets::::iter() { - let old_market = old_markets - .get(&market_id) - .expect(&format!("Market {:?} not found", market_id)[..]); - assert_eq!(market_id, new_market.market_id); - assert_eq!(old_market.base_asset, new_market.base_asset); - assert_eq!(old_market.creator, new_market.creator); - assert_eq!(old_market.creation, new_market.creation); - assert_eq!(old_market.creator_fee, new_market.creator_fee); - assert_eq!(old_market.oracle, new_market.oracle); - assert_eq!(old_market.metadata, new_market.metadata); - assert_eq!(old_market.market_type, new_market.market_type); - assert_eq!(old_market.period, new_market.period); - assert_eq!(old_market.deadlines, new_market.deadlines); - assert_eq!(old_market.status, new_market.status); - assert_eq!(old_market.report, new_market.report); - assert_eq!(old_market.resolved_outcome, new_market.resolved_outcome); - assert_eq!(old_market.dispute_mechanism, new_market.dispute_mechanism); - assert_eq!(old_market.bonds, new_market.bonds); - assert_eq!(old_market.early_close, new_market.early_close); - } - log::info!( - "MigrateScoringRuleAmmCdaHybridAndMarketId: Post-upgrade market count is {}!", - new_market_count - ); - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::{ - mock::{ExtBuilder, Runtime}, - MarketOf, - }; - use alloc::fmt::Debug; - use frame_support::{ - migration::put_storage_value, storage_root, Blake2_128Concat, StorageHasher, - }; - use parity_scale_codec::Encode; - use sp_runtime::{Perbill, StateVersion}; - use test_case::test_case; - use zeitgeist_primitives::types::{BaseAssetClass, Bond, EarlyCloseState, MarketId}; - - #[test] - fn on_runtime_upgrade_increments_the_storage_version() { - ExtBuilder::default().build().execute_with(|| { - set_up_version(); - MigrateScoringRuleAmmCdaHybridAndMarketId::::on_runtime_upgrade(); - assert_eq!( - StorageVersion::get::>(), - MARKET_COMMONS_NEXT_STORAGE_VERSION - ); - }); - } - - #[test_case(OldScoringRule::Orderbook, ScoringRule::AmmCdaHybrid)] - #[test_case(OldScoringRule::Lmsr, ScoringRule::AmmCdaHybrid)] - #[test_case(OldScoringRule::Parimutuel, ScoringRule::Parimutuel)] - fn on_runtime_upgrade_works_as_expected( - old_scoring_rule: OldScoringRule, - new_scoring_rule: ScoringRule, - ) { - ExtBuilder::default().build().execute_with(|| { - set_up_version(); - let (old_markets, new_markets) = - construct_old_new_tuple(old_scoring_rule, new_scoring_rule); - populate_test_data::>( - MARKET_COMMONS, - MARKETS, - old_markets, - ); - MigrateScoringRuleAmmCdaHybridAndMarketId::::on_runtime_upgrade(); - assert_eq!(crate::Markets::::get(0).unwrap(), new_markets[0]); - assert_eq!(crate::Markets::::get(1).unwrap(), new_markets[1]); - assert_eq!(crate::Markets::::get(2).unwrap(), new_markets[2]); - }); - } - - #[test] - fn on_runtime_upgrade_is_noop_if_versions_are_not_correct() { - ExtBuilder::default().build().execute_with(|| { - StorageVersion::new(MARKET_COMMONS_NEXT_STORAGE_VERSION) - .put::>(); - let market = Market { - market_id: 7, - base_asset: BaseAssetClass::Ztg, - creator: 1, - creation: MarketCreation::Permissionless, - creator_fee: Perbill::from_rational(2u32, 3u32), - oracle: 4, - metadata: vec![0x05; 50], - market_type: MarketType::Categorical(999), - period: MarketPeriod::, MomentOf>::Block(6..7), - deadlines: Deadlines { grace_period: 7, oracle_duration: 8, dispute_duration: 9 }, - scoring_rule: ScoringRule::AmmCdaHybrid, - status: MarketStatus::Active, - report: Some(Report { at: 13, by: 14, outcome: OutcomeReport::Categorical(10) }), - resolved_outcome: None, - dispute_mechanism: Some(MarketDisputeMechanism::Court), - bonds: MarketBonds { - creation: Some(Bond::new(11, 12)), - oracle: None, - outsider: None, - dispute: None, - close_dispute: None, - close_request: None, - }, - early_close: None, - }; - crate::Markets::::insert(333, market); - let tmp = storage_root(StateVersion::V1); - MigrateScoringRuleAmmCdaHybridAndMarketId::::on_runtime_upgrade(); - assert_eq!(tmp, storage_root(StateVersion::V1)); - }); - } - - fn set_up_version() { - StorageVersion::new(MARKET_COMMONS_REQUIRED_STORAGE_VERSION) - .put::>(); - } - - fn construct_old_new_tuple( - old_scoring_rule: OldScoringRule, - new_scoring_rule: ScoringRule, - ) -> (Vec>, Vec>) { - let base_asset = BaseAsset::Ztg; - let creation = MarketCreation::Advised; - let creator_fee = Perbill::from_rational(2u32, 3u32); - let oracle = 4; - let metadata = vec![5; 50]; - let market_type = MarketType::Scalar(6..=7); - let period = MarketPeriod::Block(8..9); - let deadlines = Deadlines { grace_period: 10, oracle_duration: 11, dispute_duration: 12 }; - let status = MarketStatus::Resolved; - let report = Some(Report { at: 13, by: 14, outcome: OutcomeReport::Categorical(15) }); - let resolved_outcome = Some(OutcomeReport::Categorical(16)); - let dispute_mechanism = Some(MarketDisputeMechanism::Court); - let bonds = MarketBonds { - creation: Some(Bond { who: 17, value: 18, is_settled: true }), - oracle: Some(Bond { who: 19, value: 20, is_settled: true }), - outsider: Some(Bond { who: 21, value: 22, is_settled: true }), - dispute: Some(Bond { who: 23, value: 24, is_settled: true }), - close_request: Some(Bond { who: 25, value: 26, is_settled: true }), - close_dispute: Some(Bond { who: 27, value: 28, is_settled: true }), - }; - let early_close = Some(EarlyClose { - old: MarketPeriod::Block(29..30), - new: MarketPeriod::Block(31..32), - state: EarlyCloseState::Disputed, - }); - let sentinels = (0..3).map(|i| 10 - i); - let old_markets = sentinels - .clone() - .map(|sentinel| OldMarket { - base_asset, - creator: sentinel, - creation: creation.clone(), - creator_fee, - oracle, - metadata: metadata.clone(), - market_type: market_type.clone(), - period: period.clone(), - deadlines, - scoring_rule: old_scoring_rule, - status, - report: report.clone(), - resolved_outcome: resolved_outcome.clone(), - dispute_mechanism: dispute_mechanism.clone(), - bonds: bonds.clone(), - early_close: early_close.clone(), - }) - .collect(); - let new_markets = sentinels - .enumerate() - .map(|(index, sentinel)| Market { - market_id: index as u128, - base_asset, - creator: sentinel, - creation: creation.clone(), - creator_fee, - oracle, - metadata: metadata.clone(), - market_type: market_type.clone(), - period: period.clone(), - deadlines, - scoring_rule: new_scoring_rule, - status, - report: report.clone(), - resolved_outcome: resolved_outcome.clone(), - dispute_mechanism: dispute_mechanism.clone(), - bonds: bonds.clone(), - early_close: early_close.clone(), - }) - .collect(); - (old_markets, new_markets) - } - - #[allow(unused)] - fn populate_test_data(pallet: &[u8], prefix: &[u8], data: Vec) - where - H: StorageHasher, - K: TryFrom + Encode, - V: Encode + Clone, - >::Error: Debug, - { - for (key, value) in data.iter().enumerate() { - let storage_hash = K::try_from(key).unwrap().using_encoded(H::hash).as_ref().to_vec(); - put_storage_value::(pallet, prefix, &storage_hash, (*value).clone()); - } - } -} diff --git a/zrml/market-commons/src/tests.rs b/zrml/market-commons/src/tests.rs index a7d26af88..a2ba2d317 100644 --- a/zrml/market-commons/src/tests.rs +++ b/zrml/market-commons/src/tests.rs @@ -28,7 +28,7 @@ use sp_runtime::{DispatchError, Perbill}; use zeitgeist_primitives::{ traits::{MarketBuilderTrait, MarketCommonsPalletApi}, types::{ - BaseAsset, Deadlines, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, + Asset, Deadlines, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, ScoringRule, }, }; @@ -37,7 +37,7 @@ use zeitgeist_primitives::{ fn create_market_builder(oracle: AccountIdOf) -> MarketBuilder { let mut market_builder = MarketBuilder::new(); market_builder - .base_asset(BaseAsset::Ztg) + .base_asset(Asset::Ztg) .creation(MarketCreation::Permissionless) .creator_fee(Perbill::zero()) .creator(0) diff --git a/zrml/market-commons/src/types/market_builder.rs b/zrml/market-commons/src/types/market_builder.rs index c121f19e0..f70979c65 100644 --- a/zrml/market-commons/src/types/market_builder.rs +++ b/zrml/market-commons/src/types/market_builder.rs @@ -16,16 +16,16 @@ // along with Zeitgeist. If not, see . use crate::{ - AccountIdOf, BalanceOf, BlockNumberOf, Config, DeadlinesOf, EarlyCloseOf, Error, MarketBondsOf, - MarketIdOf, MarketOf, MarketPeriodOf, MomentOf, ReportOf, + AccountIdOf, AssetOf, BalanceOf, BlockNumberOf, Config, DeadlinesOf, EarlyCloseOf, Error, + MarketBondsOf, MarketIdOf, MarketOf, MarketPeriodOf, MomentOf, ReportOf, }; use alloc::vec::Vec; use sp_runtime::{DispatchError, Perbill}; use zeitgeist_primitives::{ traits::MarketBuilderTrait, types::{ - BaseAsset, Market, MarketCreation, MarketDisputeMechanism, MarketStatus, MarketType, - OutcomeReport, ScoringRule, + Market, MarketCreation, MarketDisputeMechanism, MarketStatus, MarketType, OutcomeReport, + ScoringRule, }, }; @@ -36,7 +36,7 @@ where T: Config, { market_id: Option>, - base_asset: Option, + base_asset: Option>, creator: Option>, creation: Option, creator_fee: Option, @@ -112,14 +112,8 @@ where } impl - MarketBuilderTrait< - AccountIdOf, - BalanceOf, - BlockNumberOf, - MomentOf, - BaseAsset, - MarketIdOf, - > for MarketBuilder + MarketBuilderTrait, BalanceOf, BlockNumberOf, MomentOf, MarketIdOf> + for MarketBuilder where T: Config, { @@ -147,7 +141,7 @@ where impl_builder_methods! { market_id: MarketIdOf, - base_asset: BaseAsset, + base_asset: AssetOf, creator: AccountIdOf, creation: MarketCreation, creator_fee: Perbill, diff --git a/zrml/neo-swaps/Cargo.toml b/zrml/neo-swaps/Cargo.toml index 85e982808..c7611f358 100644 --- a/zrml/neo-swaps/Cargo.toml +++ b/zrml/neo-swaps/Cargo.toml @@ -19,7 +19,6 @@ env_logger = { workspace = true, optional = true } orml-asset-registry = { workspace = true, optional = true } orml-currencies = { workspace = true, optional = true } orml-tokens = { workspace = true, optional = true } -pallet-assets = { workspace = true, optional = true } pallet-balances = { workspace = true, optional = true } pallet-randomness-collective-flip = { workspace = true, optional = true } pallet-timestamp = { workspace = true, optional = true } @@ -30,7 +29,6 @@ sp-api = { workspace = true, optional = true } sp-io = { workspace = true, optional = true } xcm = { workspace = true, optional = true } xcm-builder = { workspace = true, optional = true } -zrml-asset-router = { workspace = true, optional = true } zrml-authorized = { workspace = true, optional = true } zrml-court = { workspace = true, optional = true } zrml-global-disputes = { workspace = true, optional = true } @@ -61,13 +59,11 @@ mock = [ "orml-asset-registry/default", "orml-currencies/default", "orml-tokens/default", - "pallet-assets/default", "pallet-balances/default", "pallet-timestamp/default", "sp-api/default", "sp-io/default", "zrml-court/std", - "zrml-asset-router/std", "zrml-authorized/std", "zrml-liquidity-mining/std", "zrml-simple-disputes/std", @@ -83,10 +79,8 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "pallet-assets?/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", "xcm-builder/runtime-benchmarks", - "zrml-prediction-markets/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", ] std = [ "frame-benchmarking?/std", diff --git a/zrml/neo-swaps/src/benchmarking.rs b/zrml/neo-swaps/src/benchmarking.rs index ad55064b0..1557f349c 100644 --- a/zrml/neo-swaps/src/benchmarking.rs +++ b/zrml/neo-swaps/src/benchmarking.rs @@ -181,7 +181,7 @@ where { let market = Market { market_id: 0u8.into(), - base_asset: base_asset.try_into().unwrap(), + base_asset, creation: MarketCreation::Permissionless, creator_fee: Perbill::zero(), creator: caller.clone(), diff --git a/zrml/neo-swaps/src/lib.rs b/zrml/neo-swaps/src/lib.rs index 6519c130c..1a0518581 100644 --- a/zrml/neo-swaps/src/lib.rs +++ b/zrml/neo-swaps/src/lib.rs @@ -888,14 +888,14 @@ mod pallet { let pool_account_id = Self::pool_account_id(&market_id); let mut reserves = BTreeMap::new(); for (&amount_in, &asset) in amounts_in.iter().zip(market.outcome_assets().iter()) { - T::MultiCurrency::transfer(asset.into(), &who, &pool_account_id, amount_in)?; - let _ = reserves.insert(asset.into(), amount_in); + T::MultiCurrency::transfer(asset, &who, &pool_account_id, amount_in)?; + let _ = reserves.insert(asset, amount_in); } let collateral = market.base_asset; let pool = Pool { account_id: pool_account_id.clone(), reserves: reserves.clone().try_into().map_err(|_| Error::::Unexpected)?, - collateral: collateral.into(), + collateral, liquidity_parameter, liquidity_shares_manager: LiquidityTree::new(who.clone(), amount)?, swap_fee, @@ -906,7 +906,7 @@ mod pallet { pool.collateral, &who, &pool.account_id, - T::MultiCurrency::minimum_balance(collateral.into()), + T::MultiCurrency::minimum_balance(collateral), )?; Pools::::insert(market_id, pool); Self::deposit_event(Event::::PoolDeployed { @@ -914,7 +914,7 @@ mod pallet { market_id, account_id: pool_account_id, reserves, - collateral: collateral.into(), + collateral, liquidity_parameter, pool_shares_amount: amount, swap_fee, diff --git a/zrml/neo-swaps/src/macros.rs b/zrml/neo-swaps/src/macros.rs index c8ea923a6..0c7bbb986 100644 --- a/zrml/neo-swaps/src/macros.rs +++ b/zrml/neo-swaps/src/macros.rs @@ -50,7 +50,6 @@ macro_rules! create_b_tree_map { /// their expected stake. /// - `total_fees`: The sum of all fees (both lazy and distributed) in the pool's liquidity tree. #[macro_export] -#[cfg(test)] macro_rules! assert_pool_state { ( $market_id:expr, @@ -107,7 +106,6 @@ macro_rules! assert_pool_state { /// Asserts that `account` has the specified `balances` of `assets`. #[macro_export] -#[cfg(test)] macro_rules! assert_balances { ($account:expr, $assets:expr, $balances:expr $(,)?) => { assert_eq!( @@ -116,7 +114,7 @@ macro_rules! assert_balances { "assert_balances: Assets and balances length mismatch" ); for (&asset, &expected_balance) in $assets.iter().zip($balances.iter()) { - let actual_balance = AssetManager::free_balance(asset.try_into().unwrap(), &$account); + let actual_balance = AssetManager::free_balance(asset, &$account); assert_eq!( actual_balance, expected_balance, "assert_balances: Balance mismatch for asset {:?}", @@ -128,7 +126,6 @@ macro_rules! assert_balances { /// Asserts that `account` has the specified `balance` of `asset`. #[macro_export] -#[cfg(test)] macro_rules! assert_balance { ($account:expr, $asset:expr, $balance:expr $(,)?) => { assert_balances!($account, [$asset], [$balance]); @@ -137,7 +134,6 @@ macro_rules! assert_balance { /// Asserts that `abs(left - right) < precision`. #[macro_export] -#[cfg(test)] macro_rules! assert_approx { ($left:expr, $right:expr, $precision:expr $(,)?) => { match (&$left, &$right, &$precision) { diff --git a/zrml/neo-swaps/src/mock.rs b/zrml/neo-swaps/src/mock.rs index 610bc955f..af8009a9b 100644 --- a/zrml/neo-swaps/src/mock.rs +++ b/zrml/neo-swaps/src/mock.rs @@ -28,47 +28,44 @@ use crate::{consts::*, AssetOf, MarketIdOf}; use core::marker::PhantomData; use frame_support::{ construct_runtime, ord_parameter_types, parameter_types, - traits::{AsEnsureOriginWithArg, Contains, Everything, NeverEnsureOrigin}, + traits::{Contains, Everything, NeverEnsureOrigin}, }; -use frame_system::{EnsureRoot, EnsureSigned, EnsureSignedBy}; +use frame_system::{EnsureRoot, EnsureSignedBy}; #[cfg(feature = "parachain")] use orml_asset_registry::AssetMetadata; use orml_traits::MultiCurrency; -use parity_scale_codec::Compact; use sp_runtime::{ testing::Header, - traits::{BlakeTwo256, ConstU32, Get, IdentityLookup, Zero}, + traits::{BlakeTwo256, Get, IdentityLookup, Zero}, DispatchResult, Perbill, Percent, SaturatedConversion, }; +#[cfg(feature = "parachain")] +use zeitgeist_primitives::types::Asset; use zeitgeist_primitives::{ constants::{ base_multiples::*, mock::{ - AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AssetsAccountDeposit, - AssetsApprovalDeposit, AssetsDeposit, AssetsMetadataDepositBase, - AssetsMetadataDepositPerByte, AssetsStringLimit, AuthorizedPalletId, BlockHashCount, - BlocksPerYear, CloseEarlyBlockPeriod, CloseEarlyDisputeBond, + AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AuthorizedPalletId, + BlockHashCount, BlocksPerYear, CloseEarlyBlockPeriod, CloseEarlyDisputeBond, CloseEarlyProtectionBlockPeriod, CloseEarlyProtectionTimeFramePeriod, CloseEarlyRequestBond, CloseEarlyTimeFramePeriod, CorrectionPeriod, CourtPalletId, - DestroyAccountWeight, DestroyApprovalWeight, DestroyFinishWeight, ExistentialDeposit, - ExistentialDeposits, GdVotingPeriod, GetNativeCurrencyId, GlobalDisputeLockId, - GlobalDisputesPalletId, InflationPeriod, LiquidityMiningPalletId, LockId, MaxAppeals, - MaxApprovals, MaxCourtParticipants, MaxCreatorFee, MaxDelegations, MaxDisputeDuration, - MaxDisputes, MaxEditReasonLen, MaxGlobalDisputeVotes, MaxGracePeriod, - MaxLiquidityTreeDepth, MaxLocks, MaxMarketLifetime, MaxOracleDuration, MaxOwners, - MaxRejectReasonLen, MaxReserves, MaxSelectedDraws, MaxYearlyInflation, MinCategories, - MinDisputeDuration, MinJurorStake, MinOracleDuration, MinOutcomeVoteAmount, - MinimumPeriod, NeoMaxSwapFee, NeoSwapsPalletId, OutcomeBond, OutcomeFactor, - OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval, SimpleDisputesPalletId, - TreasuryPalletId, VotePeriod, VotingOutcomeFee, BASE, CENT, + ExistentialDeposit, ExistentialDeposits, GdVotingPeriod, GetNativeCurrencyId, + GlobalDisputeLockId, GlobalDisputesPalletId, InflationPeriod, LiquidityMiningPalletId, + LockId, MaxAppeals, MaxApprovals, MaxCourtParticipants, MaxCreatorFee, MaxDelegations, + MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGlobalDisputeVotes, + MaxGracePeriod, MaxLiquidityTreeDepth, MaxLocks, MaxMarketLifetime, MaxOracleDuration, + MaxOwners, MaxRejectReasonLen, MaxReserves, MaxSelectedDraws, MaxYearlyInflation, + MinCategories, MinDisputeDuration, MinJurorStake, MinOracleDuration, + MinOutcomeVoteAmount, MinimumPeriod, NeoMaxSwapFee, NeoSwapsPalletId, OutcomeBond, + OutcomeFactor, OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval, + SimpleDisputesPalletId, TreasuryPalletId, VotePeriod, VotingOutcomeFee, BASE, CENT, }, }, math::fixed::FixedMul, traits::{DeployPoolApi, DistributeFees}, types::{ - AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, - CampaignAsset, CampaignAssetId, Currencies, CustomAsset, CustomAssetId, Hash, Index, - MarketAsset, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, + Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, }, }; use zrml_neo_swaps::BalanceOf; @@ -84,7 +81,7 @@ pub const SUDO: AccountIdTest = 123456; pub const EXTERNAL_FEES: Balance = CENT; #[cfg(feature = "parachain")] -pub const FOREIGN_ASSET: Assets = Assets::ForeignAsset(1); +pub const FOREIGN_ASSET: Asset = Asset::ForeignAsset(1); parameter_types! { pub const FeeAccount: AccountIdTest = FEE_ACCOUNT; @@ -164,10 +161,6 @@ impl Contains for DustRemovalWhitelist { } } -pub(super) type CustomAssetsInstance = pallet_assets::Instance1; -pub(super) type CampaignAssetsInstance = pallet_assets::Instance2; -pub(super) type MarketAssetsInstance = pallet_assets::Instance3; - construct_runtime!( pub enum Runtime where @@ -176,15 +169,11 @@ construct_runtime!( UncheckedExtrinsic = UncheckedExtrinsic, { NeoSwaps: zrml_neo_swaps::{Call, Event, Pallet}, - AssetManager: orml_currencies::{Call, Pallet, Storage}, - AssetRouter: zrml_asset_router::{Pallet}, Authorized: zrml_authorized::{Event, Pallet, Storage}, Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - CampaignAssets: pallet_assets::::{Call, Pallet, Storage, Event}, Court: zrml_court::{Event, Pallet, Storage}, - CustomAssets: pallet_assets::::{Call, Pallet, Storage, Event}, + AssetManager: orml_currencies::{Call, Pallet, Storage}, LiquidityMining: zrml_liquidity_mining::{Config, Event, Pallet}, - MarketAssets: pallet_assets::::{Call, Pallet, Storage, Event}, MarketCommons: zrml_market_commons::{Pallet, Storage}, PredictionMarkets: zrml_prediction_markets::{Event, Pallet, Storage}, RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, @@ -209,130 +198,12 @@ impl crate::Config for Runtime { type WeightInfo = zrml_neo_swaps::weights::WeightInfo; } -pallet_assets::runtime_benchmarks_enabled! { - pub struct AssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for AssetsBenchmarkHelper - where - AssetIdParameter: From, - { - fn create_asset_id_parameter(id: u32) -> AssetIdParameter { - (id as u128).into() - } - } -} - -pallet_assets::runtime_benchmarks_enabled! { - use zeitgeist_primitives::types::CategoryIndex; - - pub struct MarketAssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for MarketAssetsBenchmarkHelper - { - fn create_asset_id_parameter(id: u32) -> MarketAsset { - MarketAsset::CategoricalOutcome(0, id as CategoryIndex) - } - } -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CampaignAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CustomAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = MarketAsset; - type AssetIdParameter = MarketAsset; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = MarketAssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl zrml_asset_router::Config for Runtime { - type AssetType = Assets; - type Balance = Balance; - type CurrencyType = Currencies; - type Currencies = Tokens; - type CampaignAssetType = CampaignAsset; - type CampaignAssets = CampaignAssets; - type CustomAssetType = CustomAsset; - type CustomAssets = CustomAssets; - type DestroyAccountWeight = DestroyAccountWeight; - type DestroyApprovalWeight = DestroyApprovalWeight; - type DestroyFinishWeight = DestroyFinishWeight; - type MarketAssetType = MarketAsset; - type MarketAssets = MarketAssets; -} - impl pallet_randomness_collective_flip::Config for Runtime {} impl zrml_prediction_markets::Config for Runtime { type AdvisoryBond = AdvisoryBond; type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; type ApproveOrigin = EnsureSignedBy; - type AssetCreator = AssetRouter; - type AssetDestroyer = AssetRouter; #[cfg(feature = "parachain")] type AssetRegistry = MockRegistry; type Authorized = Authorized; @@ -363,7 +234,6 @@ impl zrml_prediction_markets::Config for Runtime { type MinCategories = MinCategories; type MaxEditReasonLen = MaxEditReasonLen; type MaxRejectReasonLen = MaxRejectReasonLen; - type OnStateTransition = (); type OracleBond = OracleBond; type OutsiderBond = OutsiderBond; type PalletId = PmPalletId; @@ -454,7 +324,7 @@ impl frame_system::Config for Runtime { impl orml_currencies::Config for Runtime { type GetNativeCurrencyId = GetNativeCurrencyId; - type MultiCurrency = AssetRouter; + type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; type WeightInfo = (); } @@ -462,7 +332,7 @@ impl orml_currencies::Config for Runtime { impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; - type CurrencyId = Currencies; + type CurrencyId = CurrencyId; type DustRemovalWhitelist = DustRemovalWhitelist; type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; @@ -549,7 +419,7 @@ impl pallet_treasury::Config for Runtime { #[cfg(feature = "parachain")] zrml_prediction_markets::impl_mock_registry! { MockRegistry, - zeitgeist_primitives::types::XcmAsset, + CurrencyId, Balance, zeitgeist_primitives::types::CustomMetadata } @@ -580,7 +450,7 @@ impl ExtBuilder { { use frame_support::traits::GenesisBuild; orml_tokens::GenesisConfig:: { - balances: vec![(ALICE, FOREIGN_ASSET.try_into().unwrap(), 100_000_000_001 * _1)], + balances: vec![(ALICE, FOREIGN_ASSET, 100_000_000_001 * _1)], } .assimilate_storage(&mut t) .unwrap(); @@ -590,7 +460,7 @@ impl ExtBuilder { }; orml_asset_registry_mock::GenesisConfig { metadata: vec![( - FOREIGN_ASSET.try_into().unwrap(), + FOREIGN_ASSET, AssetMetadata { decimals: 18, name: "MKL".as_bytes().to_vec(), diff --git a/zrml/neo-swaps/src/tests/deploy_pool.rs b/zrml/neo-swaps/src/tests/deploy_pool.rs index ac02e5955..8d7f4fdec 100644 --- a/zrml/neo-swaps/src/tests/deploy_pool.rs +++ b/zrml/neo-swaps/src/tests/deploy_pool.rs @@ -90,7 +90,6 @@ fn deploy_pool_works_with_scalar_marktes() { ExtBuilder::default().build().execute_with(|| { let alice_before = AssetManager::free_balance(BASE_ASSET, &ALICE); let amount = _100; - let expected_amounts = [amount, 101755598229]; let spot_prices = vec![_1_6, _5_6 + 1]; let swap_fee = CENT; let market_id: MarketId = 0; @@ -98,6 +97,14 @@ fn deploy_pool_works_with_scalar_marktes() { Asset::ScalarOutcome(market_id, ScalarPosition::Long), Asset::ScalarOutcome(market_id, ScalarPosition::Short), ]; + // Deploy some funds in the pool account to ensure that rogue funds don't screw up price + // calculatings. + let rogue_funds = _100; + assert_ok!(AssetManager::deposit( + assets[0], + &Pallet::::pool_account_id(&market_id), + rogue_funds + )); let _ = create_market_and_deploy_pool( ALICE, BASE_ASSET, @@ -107,31 +114,8 @@ fn deploy_pool_works_with_scalar_marktes() { swap_fee, ); let pool = Pools::::get(market_id).unwrap(); - let mut reserves = BTreeMap::new(); - reserves.insert(assets[0], expected_amounts[0]); - reserves.insert(assets[1], expected_amounts[1]); - System::assert_last_event( - Event::PoolDeployed { - who: ALICE, - market_id, - account_id: pool.account_id, - reserves, - collateral: pool.collateral, - liquidity_parameter: pool.liquidity_parameter, - pool_shares_amount: amount, - swap_fee, - } - .into(), - ); - // Deploy some funds in the pool account to ensure that rogue funds don't screw up price - // calculatings. - let rogue_funds = _100; - assert_ok!(AssetManager::deposit( - assets[0], - &Pallet::::pool_account_id(&market_id), - rogue_funds - )); let expected_liquidity = 558110626551; + let expected_amounts = [amount, 101755598229]; let buffer = AssetManager::minimum_balance(pool.collateral); assert_eq!(pool.assets(), assets); assert_approx!(pool.liquidity_parameter, expected_liquidity, 1_000); @@ -161,6 +145,22 @@ fn deploy_pool_works_with_scalar_marktes() { let price_sum = pool.assets().iter().map(|&a| pool.calculate_spot_price(a).unwrap()).sum::(); assert_eq!(price_sum, _1); + let mut reserves = BTreeMap::new(); + reserves.insert(assets[0], expected_amounts[0]); + reserves.insert(assets[1], expected_amounts[1]); + System::assert_last_event( + Event::PoolDeployed { + who: ALICE, + market_id, + account_id: pool.account_id, + reserves, + collateral: pool.collateral, + liquidity_parameter: pool.liquidity_parameter, + pool_shares_amount: amount, + swap_fee, + } + .into(), + ); }); } @@ -429,7 +429,7 @@ fn deploy_pool_fails_on_insufficient_funds() { vec![_3_4, _1_4], CENT ), - pallet_assets::Error::::BalanceLow + orml_tokens::Error::::BalanceTooLow ); }); } diff --git a/zrml/neo-swaps/src/tests/join.rs b/zrml/neo-swaps/src/tests/join.rs index a230bef0b..1e6bc0183 100644 --- a/zrml/neo-swaps/src/tests/join.rs +++ b/zrml/neo-swaps/src/tests/join.rs @@ -208,7 +208,6 @@ fn join_fails_on_insufficient_funds() { vec![_1_2, _1_2], CENT, ); - assert_noop!( NeoSwaps::join( RuntimeOrigin::signed(ALICE), @@ -216,7 +215,7 @@ fn join_fails_on_insufficient_funds() { _100, vec![u128::MAX, u128::MAX] ), - pallet_assets::Error::::NoAccount + orml_tokens::Error::::BalanceTooLow ); }); } diff --git a/zrml/neo-swaps/src/tests/mod.rs b/zrml/neo-swaps/src/tests/mod.rs index 6c8f9c98c..8dc8eb78d 100644 --- a/zrml/neo-swaps/src/tests/mod.rs +++ b/zrml/neo-swaps/src/tests/mod.rs @@ -34,20 +34,20 @@ use zeitgeist_primitives::{ constants::{base_multiples::*, CENT}, math::fixed::{FixedDiv, FixedMul}, types::{ - AccountIdTest, Asset, Assets, Deadlines, MarketCreation, MarketId, MarketPeriod, - MarketStatus, MarketType, MultiHash, ScalarPosition, ScoringRule, + AccountIdTest, Asset, Deadlines, MarketCreation, MarketId, MarketPeriod, MarketStatus, + MarketType, MultiHash, ScalarPosition, ScoringRule, }, }; use zrml_market_commons::{MarketCommonsPalletApi, Markets}; #[cfg(not(feature = "parachain"))] -const BASE_ASSET: Assets = Assets::Ztg; +const BASE_ASSET: Asset = Asset::Ztg; #[cfg(feature = "parachain")] -const BASE_ASSET: Assets = FOREIGN_ASSET; +const BASE_ASSET: Asset = FOREIGN_ASSET; fn create_market( creator: AccountIdTest, - base_asset: Assets, + base_asset: Asset, market_type: MarketType, scoring_rule: ScoringRule, ) -> MarketId { @@ -56,7 +56,7 @@ fn create_market( metadata[1] = 0x30; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(creator), - base_asset.try_into().unwrap(), + base_asset, Perbill::zero(), EVE, MarketPeriod::Block(0..2), @@ -76,7 +76,7 @@ fn create_market( fn create_market_and_deploy_pool( creator: AccountIdOf, - base_asset: Assets, + base_asset: Asset, market_type: MarketType, amount: BalanceOf, spot_prices: Vec>, @@ -104,7 +104,7 @@ fn deposit_complete_set( amount: BalanceOf, ) { let market = MarketCommons::market(&market_id).unwrap(); - assert_ok!(AssetManager::deposit(market.base_asset.into(), &account, amount)); + assert_ok!(AssetManager::deposit(market.base_asset, &account, amount)); assert_ok!(::CompleteSetOperations::buy_complete_set( RuntimeOrigin::signed(account), market_id, diff --git a/zrml/neo-swaps/src/tests/sell.rs b/zrml/neo-swaps/src/tests/sell.rs index dfbd415c8..5c1b9dd60 100644 --- a/zrml/neo-swaps/src/tests/sell.rs +++ b/zrml/neo-swaps/src/tests/sell.rs @@ -352,7 +352,7 @@ fn sell_fails_on_insufficient_funds() { amount_in, u128::MAX, ), - pallet_assets::Error::::BalanceLow, + orml_tokens::Error::::BalanceTooLow, ); }); } diff --git a/zrml/neo-swaps/src/types/max_assets.rs b/zrml/neo-swaps/src/types/max_assets.rs index 3a2595770..823147c7b 100644 --- a/zrml/neo-swaps/src/types/max_assets.rs +++ b/zrml/neo-swaps/src/types/max_assets.rs @@ -1,4 +1,4 @@ -// Copyright 2024 Forecasting Technologies LTD. +// Copyright 2023-2024 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // diff --git a/zrml/neo-swaps/src/weights.rs b/zrml/neo-swaps/src/weights.rs index c03925ef2..d6c42e513 100644 --- a/zrml/neo-swaps/src/weights.rs +++ b/zrml/neo-swaps/src/weights.rs @@ -68,8 +68,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) /// Storage: System Account (r:3 w:3) /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:128 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:129 w:129) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:128 w:128) @@ -92,9 +90,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Storage: MarketCommons Markets (r:1 w:0) /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:128 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:129 w:129) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:3 w:3) @@ -119,9 +114,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Storage: MarketCommons Markets (r:1 w:0) /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:128 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:256 w:256) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:0) @@ -144,9 +136,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Storage: MarketCommons Markets (r:1 w:0) /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:128 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:256 w:256) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:0) @@ -169,9 +158,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Storage: MarketCommons Markets (r:1 w:0) /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:128 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:256 w:256) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:0) @@ -194,9 +180,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Storage: MarketCommons Markets (r:1 w:0) /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:128 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:256 w:256) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:0) @@ -232,9 +215,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Storage: MarketCommons Markets (r:1 w:0) /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:128 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:256 w:256) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) diff --git a/zrml/orderbook/Cargo.toml b/zrml/orderbook/Cargo.toml index 0fe4dcc09..bd8508c76 100644 --- a/zrml/orderbook/Cargo.toml +++ b/zrml/orderbook/Cargo.toml @@ -8,43 +8,37 @@ orml-traits = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } sp-runtime = { workspace = true } -zeitgeist-macros = { workspace = true } zeitgeist-primitives = { workspace = true } # Mock env_logger = { workspace = true, optional = true } orml-currencies = { workspace = true, optional = true } orml-tokens = { workspace = true, optional = true } -pallet-assets = { workspace = true, optional = true } pallet-balances = { workspace = true, optional = true } pallet-timestamp = { workspace = true, optional = true } sp-io = { workspace = true, optional = true } -zrml-asset-router = { workspace = true, optional = true } zrml-market-commons = { workspace = true, optional = true } [dev-dependencies] test-case = { workspace = true } -zrml-orderbook = { workspace = true, features = ["default", "mock"] } +zrml-orderbook = { workspace = true, features = ["mock", "default"] } [features] default = ["std"] mock = [ - "env_logger/default", - "orml-currencies/default", "orml-tokens/default", - "pallet-assets/default", "pallet-balances/default", "pallet-timestamp/default", + "zrml-market-commons/default", + "orml-currencies/default", "sp-io/default", "zeitgeist-primitives/mock", - "zrml-asset-router", - "zrml-market-commons/default", + "env_logger/default", ] runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "pallet-assets?/runtime-benchmarks", ] std = [ "frame-benchmarking?/std", diff --git a/zrml/orderbook/fuzz/orderbook_v1_full_workflow.rs b/zrml/orderbook/fuzz/orderbook_v1_full_workflow.rs index a23fa0330..90863f7fa 100644 --- a/zrml/orderbook/fuzz/orderbook_v1_full_workflow.rs +++ b/zrml/orderbook/fuzz/orderbook_v1_full_workflow.rs @@ -19,7 +19,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zeitgeist_primitives::types::{Asset, ScalarPosition}; +use zeitgeist_primitives::types::{Asset, ScalarPosition, SerdeWrapper}; use zrml_orderbook::mock::{ExtBuilder, Orderbook, RuntimeOrigin}; #[cfg(feature = "arbitrary")] @@ -92,7 +92,7 @@ fn asset(seed: (u128, u16)) -> Asset { if seed1 % 2 == 0 { ScalarPosition::Long } else { ScalarPosition::Short }; Asset::ScalarOutcome(seed0, scalar_position) } - 2 => Asset::PoolShare(seed0), + 2 => Asset::PoolShare(SerdeWrapper(seed0)), _ => Asset::Ztg, } } diff --git a/zrml/orderbook/src/benchmarks.rs b/zrml/orderbook/src/benchmarks.rs index 751f990aa..d42b67710 100644 --- a/zrml/orderbook/src/benchmarks.rs +++ b/zrml/orderbook/src/benchmarks.rs @@ -48,7 +48,7 @@ fn order_common_parameters( &'static str, > { let market = market_mock::(); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let acc = generate_funded_account::(seed, maker_asset)?; let maker_amount: BalanceOf = BASE.saturating_mul(1_000).saturated_into(); let taker_amount: BalanceOf = BASE.saturating_mul(1_000).saturated_into(); @@ -84,7 +84,7 @@ benchmarks! { let taker_asset = Asset::CategoricalOutcome::>(market_id, 0); let (_, _, order_id) = place_default_order::(Some(0), taker_asset)?; let caller = generate_funded_account::(None, taker_asset)?; - let maker_asset = T::MarketCommons::market(&market_id).unwrap().base_asset.into(); + let maker_asset = T::MarketCommons::market(&market_id).unwrap().base_asset; let caller = generate_funded_account::(None, maker_asset)?; }: fill_order(RawOrigin::Signed(caller), order_id, None) diff --git a/zrml/orderbook/src/lib.rs b/zrml/orderbook/src/lib.rs index e2cc1c892..f97fc938c 100644 --- a/zrml/orderbook/src/lib.rs +++ b/zrml/orderbook/src/lib.rs @@ -22,7 +22,7 @@ extern crate alloc; use crate::weights::*; -use alloc::vec; +use alloc::{vec, vec::Vec}; use core::marker::PhantomData; use frame_support::{ ensure, @@ -33,18 +33,18 @@ use frame_support::{ transactional, PalletId, Twox64Concat, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; -use orml_traits::{ - BalanceStatus, MultiCurrency, MultiReservableCurrency, NamedMultiReservableCurrency, -}; +use orml_traits::{BalanceStatus, MultiCurrency, NamedMultiReservableCurrency}; pub use pallet::*; -use sp_runtime::traits::{AccountIdConversion, Get, Zero}; -use zeitgeist_macros::unreachable_non_terminating; +use sp_runtime::traits::{Get, Zero}; use zeitgeist_primitives::{ hybrid_router_api_types::{ApiError, ExternalFee, OrderbookSoftFail, OrderbookTrade}, - math::checked_ops_res::{CheckedAddRes, CheckedSubRes}, + math::{ + checked_ops_res::{CheckedAddRes, CheckedSubRes}, + fixed::FixedMulDiv, + }, orderbook::{Order, OrderId}, traits::{DistributeFees, HybridRouterOrderbookApi, MarketCommonsPalletApi}, - types::{Asset, BaseAsset, MarketStatus, ScoringRule}, + types::{Asset, Market, MarketStatus, MarketType, ScalarPosition, ScoringRule}, }; #[cfg(feature = "runtime-benchmarks")] @@ -97,16 +97,24 @@ mod pallet { /// The current storage version. const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); + pub(crate) type AccountIdOf = ::AccountId; pub(crate) type AssetOf = Asset>; pub(crate) type BalanceOf = <::AssetManager as MultiCurrency< ::AccountId, >>::Balance; + pub(crate) type ExternalFeeOf = ExternalFee, BalanceOf>; pub(crate) type MarketIdOf = <::MarketCommons as MarketCommonsPalletApi>::MarketId; - pub(crate) type AccountIdOf = ::AccountId; + pub(crate) type MarketOf = Market< + AccountIdOf, + BalanceOf, + ::BlockNumber, + MomentOf, + MarketIdOf, + >; + pub(crate) type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; pub(crate) type OrderOf = Order, BalanceOf, MarketIdOf>; pub(crate) type OrderbookTradeOf = OrderbookTrade, BalanceOf>; - pub(crate) type ExternalFeeOf = ExternalFee, BalanceOf>; #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] @@ -242,6 +250,30 @@ mod pallet { } impl Pallet { + /// The reserve ID of the order book pallet. + #[inline] + pub fn reserve_id() -> [u8; 8] { + T::PalletId::get().0 + } + + pub fn outcome_assets(market_id: MarketIdOf, market: &MarketOf) -> Vec> { + match market.market_type { + MarketType::Categorical(categories) => { + let mut assets = Vec::new(); + for i in 0..categories { + assets.push(Asset::CategoricalOutcome(market_id, i)); + } + assets + } + MarketType::Scalar(_) => { + vec![ + Asset::ScalarOutcome(market_id, ScalarPosition::Long), + Asset::ScalarOutcome(market_id, ScalarPosition::Short), + ] + } + } + } + /// Reduces the reserved maker and requested taker amount /// by the amount the maker and taker actually filled. fn decrease_order_amounts( @@ -254,16 +286,20 @@ mod pallet { Ok(()) } - /// The order account for a specific order id. - #[inline] - pub(crate) fn order_account(order_id: OrderId) -> AccountIdOf { - T::PalletId::get().into_sub_account_truncating(order_id) - } - - /// The reserve ID of the order book pallet. - #[inline] - pub(crate) fn reserve_id() -> [u8; 8] { - T::PalletId::get().0 + /// Calculates the amount that the taker is going to get from the maker's amount. + fn get_taker_fill( + order_data: &OrderOf, + maker_fill: BalanceOf, + ) -> Result, DispatchError> { + // the maker_full_fill is the maximum amount of what the maker wants to have + let maker_full_fill = order_data.taker_amount; + // the taker_full_fill is the maximum amount of what the taker wants to have + let taker_full_fill = order_data.maker_amount; + // rounding down: the taker will always get a little bit less than what they asked for. + // This ensures that the reserve of the maker + // is always enough to repatriate successfully! + // `maker_full_fill` is ensured to be never zero in `ensure_ratio_quotient_valid` + maker_fill.bmul_bdiv_floor(taker_full_fill, maker_full_fill) } fn ensure_ratio_quotient_valid(order_data: &OrderOf) -> DispatchResult { @@ -282,29 +318,24 @@ mod pallet { let maker = &order_data.maker; ensure!(who == *maker, Error::::NotOrderCreator); - let order_account = Self::order_account(order_id); - let asset = order_data.maker_asset; - let amount = order_data.maker_amount; - - if !T::AssetManager::reserved_balance_named(&Self::reserve_id(), asset, maker).is_zero() - { - let missing = - T::AssetManager::unreserve_named(&Self::reserve_id(), asset, maker, amount); - - unreachable_non_terminating!( - missing.is_zero(), - LOG_TARGET, - "Could not unreserve all of the amount. reserve_id: {:?}, asset: {:?} who: \ - {:?}, amount: {:?}, missing: {:?}", - Self::reserve_id(), - asset, - maker, - amount, - missing, - ); - } else { - T::AssetManager::transfer(asset, &order_account, maker, amount)?; - } + + let missing = T::AssetManager::unreserve_named( + &Self::reserve_id(), + order_data.maker_asset, + maker, + order_data.maker_amount, + ); + + debug_assert!( + missing.is_zero(), + "Could not unreserve all of the amount. reserve_id: {:?}, asset: {:?} who: {:?}, \ + amount: {:?}, missing: {:?}", + Self::reserve_id(), + order_data.maker_asset, + maker, + order_data.maker_amount, + missing, + ); >::remove(order_id); @@ -322,30 +353,25 @@ mod pallet { /// Returns the adjusted maker fill and the external fee. fn charge_external_fees( order_data: &OrderOf, - base_asset: BaseAsset, + base_asset: AssetOf, maker_fill: BalanceOf, taker: &AccountIdOf, taker_fill: BalanceOf, ) -> Result<(BalanceOf, ExternalFeeOf), DispatchError> { - let maker_asset_is_base_asset = order_data.maker_asset == base_asset.into(); - let base_asset_fill = if maker_asset_is_base_asset { + let maker_asset_is_base = order_data.maker_asset == base_asset; + let base_asset_fill = if maker_asset_is_base { taker_fill } else { - unreachable_non_terminating!( - order_data.taker_asset == base_asset.into(), - LOG_TARGET, - "Order {:?} does not contain a base asset", - order_data - ); + debug_assert!(order_data.taker_asset == base_asset); maker_fill }; let fee_amount = T::ExternalFees::distribute( order_data.market_id, - base_asset.into(), + base_asset, taker, base_asset_fill, ); - if maker_asset_is_base_asset { + if maker_asset_is_base { Ok((maker_fill, ExternalFeeOf:: { account: taker.clone(), amount: fee_amount })) } else { Ok(( @@ -363,12 +389,6 @@ mod pallet { ) -> Result, DispatchError> { let mut order_data = >::get(order_id).ok_or(Error::::OrderDoesNotExist)?; let market = T::MarketCommons::market(&order_data.market_id)?; - unreachable_non_terminating!( - market.scoring_rule == ScoringRule::AmmCdaHybrid, - LOG_TARGET, - "The call to place_order already ensured the scoring rule amm and order book \ - hybrid.", - ); ensure!(market.status == MarketStatus::Active, Error::::MarketIsNotActive); let base_asset = market.base_asset; @@ -383,41 +403,18 @@ mod pallet { let maker_asset = order_data.maker_asset; let taker_asset = order_data.taker_asset; - // the reserve of the maker should always be enough - // to repatriate successfully, e.g. taker gets a little bit less - // it should always ensure that the maker's request (maker_fill) is fully filled - let (taker_fill, _maker_fill) = - order_data.taker_and_maker_fill_from_taker_amount(maker_fill)?; - let order_account = Self::order_account(order_id); - - if !T::AssetManager::reserved_balance_named(&Self::reserve_id(), maker_asset, &maker) - .is_zero() - { - let missing = T::AssetManager::repatriate_reserved_named( - &Self::reserve_id(), - maker_asset, - &maker, - &taker, - taker_fill, - BalanceStatus::Free, - )?; - - unreachable_non_terminating!( - missing.is_zero(), - LOG_TARGET, - "Could not repatriate all of the amount. reserve_id: {:?}, asset: {:?} who: \ - {:?}, amount: {:?}, missing: {:?}", - Self::reserve_id(), - maker_asset, - maker, - taker_fill, - missing, - ); - } else { - T::AssetManager::transfer(maker_asset, &order_account, &taker, taker_fill)?; - } + let taker_fill = Self::get_taker_fill(&order_data, maker_fill)?; // if base asset: fund the full amount, but charge base asset fees from taker later + T::AssetManager::repatriate_reserved_named( + &Self::reserve_id(), + maker_asset, + &maker, + &taker, + taker_fill, + BalanceStatus::Free, + )?; + // always charge fees from the base asset and not the outcome asset let (maybe_adjusted_maker_fill, external_fee) = Self::charge_external_fees( &order_data, @@ -478,19 +475,17 @@ mod pallet { market.scoring_rule == ScoringRule::AmmCdaHybrid, Error::::InvalidScoringRule ); + let base_asset = market.base_asset; - let outcome_asset = if maker_asset == base_asset.into() { + let outcome_asset = if maker_asset == base_asset { taker_asset } else { - ensure!(taker_asset == base_asset.into(), Error::::MarketBaseAssetNotPresent); + ensure!(taker_asset == base_asset, Error::::MarketBaseAssetNotPresent); maker_asset }; - - let outcome_asset_converted = - outcome_asset.try_into().map_err(|_| Error::::InvalidOutcomeAsset)?; let market_assets = market.outcome_assets(); market_assets - .binary_search(&outcome_asset_converted) + .binary_search(&outcome_asset) .map_err(|_| Error::::InvalidOutcomeAsset)?; ensure!( @@ -506,18 +501,7 @@ mod pallet { let next_order_id = order_id.checked_add_res(&1)?; // fees are always only charged in the base asset in fill_order - // reserving the maker_asset is preferred (depends on other pallet support) - if T::AssetManager::can_reserve(maker_asset, &who, maker_amount) { - T::AssetManager::reserve_named( - &Self::reserve_id(), - maker_asset, - &who, - maker_amount, - )?; - } else { - let order_account = Self::order_account(order_id); - T::AssetManager::transfer(maker_asset, &who, &order_account, maker_amount)?; - } + T::AssetManager::reserve_named(&Self::reserve_id(), maker_asset, &who, maker_amount)?; let order = Order { market_id, diff --git a/zrml/orderbook/src/mock.rs b/zrml/orderbook/src/mock.rs index 83f33231c..e5b9f08f3 100644 --- a/zrml/orderbook/src/mock.rs +++ b/zrml/orderbook/src/mock.rs @@ -18,35 +18,25 @@ #![cfg(feature = "mock")] -use crate as orderbook; +use crate as orderbook_v1; use crate::{AssetOf, BalanceOf, MarketIdOf}; use core::marker::PhantomData; -use frame_support::{ - construct_runtime, - pallet_prelude::Get, - parameter_types, - traits::{AsEnsureOriginWithArg, Everything}, -}; -use frame_system::{EnsureRoot, EnsureSigned}; +use frame_support::{construct_runtime, pallet_prelude::Get, parameter_types, traits::Everything}; use orml_traits::MultiCurrency; -use parity_scale_codec::Compact; use sp_runtime::{ testing::Header, - traits::{BlakeTwo256, ConstU32, IdentityLookup, Zero}, + traits::{BlakeTwo256, IdentityLookup, Zero}, Perbill, SaturatedConversion, }; use zeitgeist_primitives::{ constants::mock::{ - AssetsAccountDeposit, AssetsApprovalDeposit, AssetsDeposit, AssetsMetadataDepositBase, - AssetsMetadataDepositPerByte, AssetsStringLimit, BlockHashCount, DestroyAccountWeight, - DestroyApprovalWeight, DestroyFinishWeight, ExistentialDeposit, ExistentialDeposits, - GetNativeCurrencyId, MaxLocks, MaxReserves, MinimumPeriod, OrderbookPalletId, BASE, CENT, + BlockHashCount, ExistentialDeposit, ExistentialDeposits, GetNativeCurrencyId, MaxLocks, + MaxReserves, MinimumPeriod, OrderbookPalletId, BASE, CENT, }, traits::DistributeFees, types::{ - AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, - CampaignAsset, CampaignAssetId, Currencies, CustomAsset, CustomAssetId, Hash, Index, - MarketAsset, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, + Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, }, }; @@ -63,10 +53,6 @@ parameter_types! { pub const FeeAccount: AccountIdTest = MARKET_CREATOR; } -type CustomAssetsInstance = pallet_assets::Instance1; -type CampaignAssetsInstance = pallet_assets::Instance2; -type MarketAssetsInstance = pallet_assets::Instance3; - pub fn fee_percentage() -> Perbill { Perbill::from_rational(EXTERNAL_FEES, BASE) } @@ -111,17 +97,13 @@ construct_runtime!( NodeBlock = BlockTest, UncheckedExtrinsic = UncheckedExtrinsicTest, { - AssetManager: orml_currencies::{Call, Pallet, Storage}, - AssetRouter: zrml_asset_router::{Pallet}, Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - CampaignAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - CustomAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - MarketAssets: pallet_assets::::{Call, Pallet, Storage, Event}, MarketCommons: zrml_market_commons::{Pallet, Storage}, - Orderbook: orderbook::{Call, Event, Pallet}, + Orderbook: orderbook_v1::{Call, Event, Pallet}, System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, Tokens: orml_tokens::{Config, Event, Pallet, Storage}, + AssetManager: orml_currencies::{Call, Pallet, Storage}, + Timestamp: pallet_timestamp::{Pallet}, } ); @@ -131,7 +113,7 @@ impl crate::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type PalletId = OrderbookPalletId; - type WeightInfo = orderbook::weights::WeightInfo; + type WeightInfo = orderbook_v1::weights::WeightInfo; } impl frame_system::Config for Runtime { @@ -163,7 +145,7 @@ impl frame_system::Config for Runtime { impl orml_currencies::Config for Runtime { type GetNativeCurrencyId = GetNativeCurrencyId; - type MultiCurrency = AssetRouter; + type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; type WeightInfo = (); } @@ -171,7 +153,7 @@ impl orml_currencies::Config for Runtime { impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; - type CurrencyId = Currencies; + type CurrencyId = CurrencyId; type DustRemovalWhitelist = Everything; type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; @@ -182,106 +164,6 @@ impl orml_tokens::Config for Runtime { type WeightInfo = (); } -pallet_assets::runtime_benchmarks_enabled! { - pub struct AssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for AssetsBenchmarkHelper - where - AssetIdParameter: From, - { - fn create_asset_id_parameter(id: u32) -> AssetIdParameter { - (id as u128).into() - } - } -} - -pallet_assets::runtime_benchmarks_enabled! { - use zeitgeist_primitives::types::CategoryIndex; - - pub struct MarketAssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for MarketAssetsBenchmarkHelper - { - fn create_asset_id_parameter(id: u32) -> MarketAsset { - MarketAsset::CategoricalOutcome(0, id as CategoryIndex) - } - } -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CampaignAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CustomAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = MarketAsset; - type AssetIdParameter = MarketAsset; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = MarketAssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; @@ -301,22 +183,6 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = (); } -impl zrml_asset_router::Config for Runtime { - type AssetType = Assets; - type Balance = Balance; - type CurrencyType = Currencies; - type Currencies = Tokens; - type CampaignAssetType = CampaignAsset; - type CampaignAssets = CampaignAssets; - type CustomAssetType = CustomAsset; - type CustomAssets = CustomAssets; - type DestroyAccountWeight = DestroyAccountWeight; - type DestroyApprovalWeight = DestroyApprovalWeight; - type DestroyFinishWeight = DestroyFinishWeight; - type MarketAssetType = MarketAsset; - type MarketAssets = MarketAssets; -} - impl zrml_market_commons::Config for Runtime { type Balance = Balance; type MarketId = MarketId; diff --git a/zrml/orderbook/src/tests.rs b/zrml/orderbook/src/tests.rs index f037b408f..d37b70c77 100644 --- a/zrml/orderbook/src/tests.rs +++ b/zrml/orderbook/src/tests.rs @@ -17,7 +17,7 @@ // along with Zeitgeist. If not, see . use crate::{mock::*, utils::market_mock, Error, Event, Order, Orders}; -use frame_support::{assert_noop, assert_ok, traits::fungibles::Create}; +use frame_support::{assert_noop, assert_ok}; use orml_tokens::Error as AError; use orml_traits::{MultiCurrency, MultiReservableCurrency}; use pallet_balances::Error as BError; @@ -26,7 +26,7 @@ use test_case::test_case; use zeitgeist_primitives::{ constants::BASE, hybrid_router_api_types::ExternalFee, - types::{Asset, BaseAsset, MarketStatus, MarketType, ScalarPosition, ScoringRule}, + types::{Asset, MarketStatus, MarketType, ScalarPosition, ScoringRule}, }; use zrml_market_commons::{Error as MError, MarketCommonsPalletApi, Markets}; @@ -45,7 +45,7 @@ fn place_order_fails_with_wrong_scoring_rule(scoring_rule: ScoringRule) { Orderbook::place_order( RuntimeOrigin::signed(ALICE), market_id, - market.base_asset.into(), + market.base_asset, 10 * BASE, Asset::CategoricalOutcome(market_id, 2), 25 * BASE, @@ -74,7 +74,7 @@ fn place_order_fails_if_market_status_not_active(status: MarketStatus) { Orderbook::place_order( RuntimeOrigin::signed(ALICE), market_id, - market.base_asset.into(), + market.base_asset, 10 * BASE, Asset::CategoricalOutcome(0, 2), 25 * BASE, @@ -95,7 +95,7 @@ fn fill_order_fails_if_market_status_not_active(status: MarketStatus) { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let order_id = 0u128; @@ -128,7 +128,7 @@ fn fill_order_fails_if_amount_too_high_for_order() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let order_id = 0u128; @@ -157,7 +157,7 @@ fn fill_order_fails_if_amount_is_below_minimum_balance() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let order_id = 0u128; @@ -190,7 +190,7 @@ fn place_order_fails_if_amount_is_below_minimum_balance() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); assert_noop!( @@ -226,7 +226,7 @@ fn fill_order_fails_if_balance_too_low() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let order_id = 0u128; @@ -259,7 +259,7 @@ fn fill_order_fails_if_partial_fill_near_full_fill_not_allowed() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let order_id = 0u128; @@ -274,7 +274,7 @@ fn fill_order_fails_if_partial_fill_near_full_fill_not_allowed() { taker_amount, )); - assert_ok!(AssetManager::deposit(taker_asset, &BOB, taker_amount)); + AssetManager::deposit(taker_asset, &BOB, taker_amount).unwrap(); assert_noop!( Orderbook::fill_order( @@ -294,7 +294,7 @@ fn fill_order_removes_order() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let order_id = 0u128; @@ -324,7 +324,7 @@ fn fill_order_partially_fills_order() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let order_id = 0u128; @@ -370,37 +370,6 @@ fn fill_order_partially_fills_order() { }); } -#[test] -fn fill_order_does_work_with_reserves_after_funding_order_account() { - ExtBuilder::default().build().execute_with(|| { - let market_id = 0u128; - let mut market = market_mock::(); - market.base_asset = BaseAsset::Ztg; - Markets::::insert(market_id, market.clone()); - - let maker_asset = market.base_asset.into(); - let taker_asset = Asset::CategoricalOutcome(0, 2); - let taker_amount = 10 * BASE; - let maker_amount = 250 * BASE; - - assert_ok!(AssetManager::deposit(maker_asset, &ALICE, maker_amount)); - assert_ok!(AssetManager::deposit(taker_asset, &BOB, taker_amount)); - assert_ok!(Orderbook::place_order( - RuntimeOrigin::signed(ALICE), - market_id, - maker_asset, - maker_amount, - taker_asset, - taker_amount, - )); - - let reserved_funds = AssetManager::reserved_balance(maker_asset, &ALICE); - assert_eq!(reserved_funds, maker_amount); - assert_ok!(AssetManager::deposit(maker_asset, &Orderbook::order_account(0), BASE)); - assert_ok!(Orderbook::fill_order(RuntimeOrigin::signed(BOB), 0, None)); - }); -} - #[test] fn place_order_fails_if_market_base_asset_not_present() { ExtBuilder::default().build().execute_with(|| { @@ -434,7 +403,7 @@ fn place_order_fails_if_invalid_outcome_asset() { assert_eq!(market.market_type, MarketType::Categorical(64u16)); let maker_asset = Asset::ScalarOutcome(0, ScalarPosition::Long); - let taker_asset = market.base_asset.into(); + let taker_asset = market.base_asset; assert_noop!( Orderbook::place_order( @@ -480,7 +449,7 @@ fn place_order_fails_if_maker_has_insufficient_funds() { Markets::::insert(market_id, market.clone()); let maker = ALICE; - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let alice_free_maker_amount = AssetManager::free_balance(maker_asset, &maker); @@ -516,16 +485,11 @@ fn it_fails_order_does_not_exist() { }); } -#[test_case(true; "with_reservable_asset")] -#[test_case(false; "with_non_reservable_asset")] -fn it_places_orders(reservable_maker_asset: bool) { +#[test] +fn it_places_orders() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - let mut market = market_mock::(); - if !reservable_maker_asset { - market.base_asset = BaseAsset::CampaignAsset(0); - assert_ok!(AssetRouter::create(market.base_asset.into(), ALICE, true, 1)); - } + let market = market_mock::(); Markets::::insert(market_id, market.clone()); let taker_asset_0 = Asset::CategoricalOutcome(0, 2); @@ -533,24 +497,18 @@ fn it_places_orders(reservable_maker_asset: bool) { let taker_amount = 10 * BASE; let maker_amount = 250 * BASE; - assert_ok!(AssetManager::deposit(market.base_asset.into(), &ALICE, maker_amount)); + assert_ok!(AssetManager::deposit(market.base_asset, &ALICE, maker_amount)); assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(ALICE), market_id, - market.base_asset.into(), + market.base_asset, maker_amount, taker_asset_0, taker_amount, )); - let reserved_funds = if reservable_maker_asset { - AssetManager::reserved_balance(market.base_asset.into(), &ALICE) - } else { - let order_account = Orderbook::order_account(0); - assert_eq!(AssetManager::free_balance(market.base_asset.into(), &BOB), 0); - AssetManager::free_balance(market.base_asset.into(), &order_account) - }; + let reserved_funds = AssetManager::reserved_balance(market.base_asset, &ALICE); assert_eq!(reserved_funds, maker_amount); let maker_asset = Asset::CategoricalOutcome(0, 1); @@ -564,7 +522,7 @@ fn it_places_orders(reservable_maker_asset: bool) { market_id, maker_asset, maker_amount, - market.base_asset.into(), + market.base_asset, taker_amount, )); @@ -581,7 +539,7 @@ fn it_fills_order_fully_maker_outcome_asset() { Markets::::insert(market_id, market.clone()); let maker_asset = Asset::CategoricalOutcome(0, 1); - let taker_asset = market.base_asset.into(); + let taker_asset = market.base_asset; let maker_amount = 100 * BASE; let taker_amount = 500 * BASE; @@ -634,33 +592,26 @@ fn it_fills_order_fully_maker_outcome_asset() { assert_eq!(alice_maker_asset_free, INITIAL_BALANCE); assert_eq!(alice_taker_asset_free, maker_amount); - let bob_taker_asset_free = AssetManager::free_balance(market.base_asset.into(), &BOB); + let bob_taker_asset_free = AssetManager::free_balance(market.base_asset, &BOB); let bob_maker_asset_free = AssetManager::free_balance(maker_asset, &BOB); assert_eq!(bob_taker_asset_free, INITIAL_BALANCE + taker_amount - taker_fees); assert_eq!(bob_maker_asset_free, 0); }); } -#[test_case(true; "with_reservable_asset")] -#[test_case(false; "with_non_reservable_asset")] -fn it_fills_order_fully_maker_base_asset(reservable_maker_asset: bool) { +#[test] +fn it_fills_order_fully_maker_base_asset() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - let mut market = market_mock::(); - let taker_amount = 10 * BASE; - let maker_amount = 50 * BASE; - - if !reservable_maker_asset { - market.base_asset = BaseAsset::CampaignAsset(0); - assert_ok!(AssetRouter::create(market.base_asset.into(), BOB, true, 1)); - assert_ok!(AssetManager::deposit(market.base_asset.into(), &BOB, maker_amount)); - } - + let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 1); + let taker_amount = 10 * BASE; + let maker_amount = 50 * BASE; + assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(BOB), market_id, @@ -670,14 +621,8 @@ fn it_fills_order_fully_maker_base_asset(reservable_maker_asset: bool) { taker_amount, )); - let reserved_funds = if reservable_maker_asset { - AssetManager::reserved_balance(market.base_asset.into(), &BOB) - } else { - let order_account = Orderbook::order_account(0); - assert_eq!(AssetManager::free_balance(market.base_asset.into(), &BOB), 0); - AssetManager::free_balance(market.base_asset.into(), &order_account) - }; - assert_eq!(reserved_funds, maker_amount); + let reserved_bob = AssetManager::reserved_balance(maker_asset, &BOB); + assert_eq!(reserved_bob, maker_amount); let order_id = 0u128; assert_ok!(AssetManager::deposit(taker_asset, &ALICE, taker_amount)); @@ -707,48 +652,31 @@ fn it_fills_order_fully_maker_base_asset(reservable_maker_asset: bool) { let alice_taker_asset_free = AssetManager::free_balance(taker_asset, &ALICE); let maker_fees = calculate_fee::(maker_amount); let maker_amount_minus_fees = maker_amount - maker_fees; - - if reservable_maker_asset { - assert_eq!(alice_maker_asset_free, INITIAL_BALANCE + maker_amount_minus_fees); - } else { - assert_eq!(alice_maker_asset_free, maker_amount_minus_fees); - } - + assert_eq!(alice_maker_asset_free, INITIAL_BALANCE + maker_amount_minus_fees); assert_eq!(alice_taker_asset_free, 0); let bob_bal = AssetManager::free_balance(maker_asset, &BOB); let bob_shares = AssetManager::free_balance(taker_asset, &BOB); - - if reservable_maker_asset { - assert_eq!(bob_bal, INITIAL_BALANCE - maker_amount); - } else { - assert_eq!(bob_bal, 0); - } - + assert_eq!(bob_bal, INITIAL_BALANCE - maker_amount); assert_eq!(bob_shares, taker_amount); }); } -#[test_case(true; "with_reservable_asset")] -#[test_case(false; "with_non_reservable_asset")] -fn it_fills_order_partially_maker_base_asset(reservable_maker_asset: bool) { +#[test] +fn it_fills_order_partially_maker_base_asset() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - let mut market = market_mock::(); - let maker_amount = 500 * BASE; - let taker_amount = 100 * BASE; - - if !reservable_maker_asset { - market.base_asset = BaseAsset::CampaignAsset(0); - assert_ok!(AssetRouter::create(market.base_asset.into(), BOB, true, 1)); - } - + let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 1); + let maker_amount = 500 * BASE; + let taker_amount = 100 * BASE; + assert_ok!(AssetManager::deposit(maker_asset, &BOB, maker_amount)); + assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(BOB), market_id, @@ -758,14 +686,8 @@ fn it_fills_order_partially_maker_base_asset(reservable_maker_asset: bool) { taker_amount, )); - let reserved_funds = if reservable_maker_asset { - AssetManager::reserved_balance(market.base_asset.into(), &BOB) - } else { - let order_account = Orderbook::order_account(0); - assert_eq!(AssetManager::free_balance(market.base_asset.into(), &BOB), 0); - AssetManager::free_balance(market.base_asset.into(), &order_account) - }; - assert_eq!(reserved_funds, maker_amount); + let reserved_bob = AssetManager::reserved_balance(maker_asset, &BOB); + assert_eq!(reserved_bob, maker_amount); let order_id = 0u128; assert_ok!(AssetManager::deposit(taker_asset, &ALICE, taker_amount)); @@ -825,34 +747,16 @@ fn it_fills_order_partially_maker_base_asset(reservable_maker_asset: bool) { Perquintill::from_rational(alice_portion, taker_amount).mul_floor(maker_amount); let filled_maker_amount_minus_fees = filled_maker_amount - calculate_fee::(filled_maker_amount); - - if reservable_maker_asset { - assert_eq!(alice_maker_asset_free, INITIAL_BALANCE + filled_maker_amount_minus_fees); - } else { - assert_eq!(alice_maker_asset_free, filled_maker_amount_minus_fees); - } - + assert_eq!(alice_maker_asset_free, INITIAL_BALANCE + filled_maker_amount_minus_fees); assert_eq!(alice_taker_asset_free, alice_taker_asset_free_left); let bob_maker_asset_free = AssetManager::free_balance(maker_asset, &BOB); let bob_taker_asset_free = AssetManager::free_balance(taker_asset, &BOB); - - if reservable_maker_asset { - assert_eq!(bob_maker_asset_free, INITIAL_BALANCE); - } else { - assert_eq!(bob_maker_asset_free, 0); - } - + assert_eq!(bob_maker_asset_free, INITIAL_BALANCE); assert_eq!(bob_taker_asset_free, alice_portion); - if reservable_maker_asset { - let reserved_bob = AssetManager::reserved_balance(maker_asset, &BOB); - assert_eq!(reserved_bob, unfilled_maker_amount); - } else { - let order_account = Orderbook::order_account(0); - let remaining = AssetManager::free_balance(maker_asset, &order_account); - assert_eq!(remaining, unfilled_maker_amount); - } + let reserved_bob = AssetManager::reserved_balance(maker_asset, &BOB); + assert_eq!(reserved_bob, unfilled_maker_amount); }); } @@ -864,7 +768,7 @@ fn it_fills_order_partially_maker_outcome_asset() { Markets::::insert(market_id, market.clone()); let maker_asset = Asset::CategoricalOutcome(0, 1); - let taker_asset = market.base_asset.into(); + let taker_asset = market.base_asset; let maker_amount = 100 * BASE; let taker_amount = 500 * BASE; @@ -886,7 +790,7 @@ fn it_fills_order_partially_maker_outcome_asset() { let order_id = 0u128; let market_creator_free_balance_before = - AssetManager::free_balance(market.base_asset.into(), &MARKET_CREATOR); + AssetManager::free_balance(market.base_asset, &MARKET_CREATOR); // instead of buying 500 of the base asset, Alice buys 70 shares let alice_portion = 70 * BASE; @@ -894,7 +798,7 @@ fn it_fills_order_partially_maker_outcome_asset() { assert_ok!(Orderbook::fill_order(RuntimeOrigin::signed(ALICE), order_id, portion,)); let market_creator_free_balance_after = - AssetManager::free_balance(market.base_asset.into(), &MARKET_CREATOR); + AssetManager::free_balance(market.base_asset, &MARKET_CREATOR); let external_fee_amount = calculate_fee::(70 * BASE); assert_eq!( market_creator_free_balance_after - market_creator_free_balance_before, @@ -956,25 +860,19 @@ fn it_fills_order_partially_maker_outcome_asset() { }); } -#[test_case(true; "with_reservable_asset")] -#[test_case(false; "with_non_reservable_asset")] -fn it_removes_order(reservable_maker_asset: bool) { +#[test] +fn it_removes_order() { ExtBuilder::default().build().execute_with(|| { let market_id = 0u128; - let mut market = market_mock::(); - let taker_amount = 25 * BASE; - let maker_amount = 10 * BASE; - - if !reservable_maker_asset { - market.base_asset = BaseAsset::CampaignAsset(0); - assert_ok!(AssetRouter::create(market.base_asset.into(), ALICE, true, 1)); - assert_ok!(AssetManager::deposit(market.base_asset.into(), &ALICE, maker_amount)); - } - + let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); + let taker_amount = 25 * BASE; + let maker_amount = 10 * BASE; + assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(ALICE), market_id, @@ -984,13 +882,7 @@ fn it_removes_order(reservable_maker_asset: bool) { taker_amount, )); - let reserved_funds = if reservable_maker_asset { - AssetManager::reserved_balance(market.base_asset.into(), &ALICE) - } else { - let order_account = Orderbook::order_account(0); - assert_eq!(AssetManager::free_balance(market.base_asset.into(), &BOB), 0); - AssetManager::free_balance(market.base_asset.into(), &order_account) - }; + let reserved_funds = AssetManager::reserved_balance(market.base_asset, &ALICE); assert_eq!(reserved_funds, maker_amount); let order_id = 0u128; @@ -1000,16 +892,12 @@ fn it_removes_order(reservable_maker_asset: bool) { Order { market_id, maker: ALICE, maker_asset, maker_amount, taker_asset, taker_amount } ); + let reserved_funds = AssetManager::reserved_balance(market.base_asset, &ALICE); + assert_eq!(reserved_funds, maker_amount); + assert_ok!(Orderbook::remove_order(RuntimeOrigin::signed(ALICE), order_id)); - let reserved_funds = if reservable_maker_asset { - AssetManager::reserved_balance(market.base_asset.into(), &ALICE) - } else { - let order_account = Orderbook::order_account(0); - let alice_balance = AssetManager::free_balance(market.base_asset.into(), &ALICE); - assert_eq!(alice_balance, maker_amount); - AssetManager::free_balance(market.base_asset.into(), &order_account) - }; + let reserved_funds = AssetManager::reserved_balance(market.base_asset, &ALICE); assert_eq!(reserved_funds, 0); assert!(Orders::::get(order_id).is_none()); @@ -1023,7 +911,7 @@ fn remove_order_emits_event() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let taker_amount = 25 * BASE; @@ -1053,7 +941,7 @@ fn remove_order_fails_if_not_order_creator() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let taker_amount = 25 * BASE; @@ -1077,39 +965,6 @@ fn remove_order_fails_if_not_order_creator() { }); } -#[test] -fn remove_order_does_work_with_reserves_after_funding_order_account() { - ExtBuilder::default().build().execute_with(|| { - let market_id = 0u128; - let mut market = market_mock::(); - market.base_asset = BaseAsset::Ztg; - Markets::::insert(market_id, market.clone()); - - let maker_asset = market.base_asset.into(); - let taker_asset = Asset::CategoricalOutcome(0, 2); - let taker_amount = 10 * BASE; - let maker_amount = 250 * BASE; - - assert_ok!(AssetManager::deposit(maker_asset, &ALICE, maker_amount)); - assert_ok!(AssetManager::deposit(taker_asset, &BOB, taker_amount)); - assert_ok!(Orderbook::place_order( - RuntimeOrigin::signed(ALICE), - market_id, - maker_asset, - maker_amount, - taker_asset, - taker_amount, - )); - - let mut reserved_funds = AssetManager::reserved_balance(maker_asset, &ALICE); - assert_eq!(reserved_funds, maker_amount); - assert_ok!(AssetManager::deposit(maker_asset, &Orderbook::order_account(0), BASE)); - assert_ok!(Orderbook::remove_order(RuntimeOrigin::signed(ALICE), 0)); - reserved_funds = AssetManager::reserved_balance(maker_asset, &ALICE); - assert_eq!(reserved_funds, 0); - }); -} - #[test] fn place_order_emits_event() { ExtBuilder::default().build().execute_with(|| { @@ -1117,7 +972,7 @@ fn place_order_emits_event() { let market = market_mock::(); Markets::::insert(market_id, market.clone()); - let maker_asset = market.base_asset.into(); + let maker_asset = market.base_asset; let taker_asset = Asset::CategoricalOutcome(0, 2); let taker_amount = 25 * BASE; diff --git a/zrml/orderbook/src/utils.rs b/zrml/orderbook/src/utils.rs index 6504fa01f..0e83c12a1 100644 --- a/zrml/orderbook/src/utils.rs +++ b/zrml/orderbook/src/utils.rs @@ -20,18 +20,15 @@ use crate::*; use sp_runtime::traits::AccountIdConversion; use zeitgeist_primitives::types::{ - BaseAsset, Deadlines, Market, MarketCreation, MarketDisputeMechanism, MarketPeriod, - MarketStatus, MarketType, ScoringRule, + Asset, Deadlines, Market, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, + MarketType, ScoringRule, }; -type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; - type MarketOf = Market< ::AccountId, BalanceOf, ::BlockNumber, MomentOf, - BaseAsset, MarketIdOf, >; @@ -41,7 +38,7 @@ where { Market { market_id: Default::default(), - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: sp_runtime::Perbill::zero(), creator: T::PalletId::get().into_account_truncating(), diff --git a/zrml/orderbook/src/weights.rs b/zrml/orderbook/src/weights.rs index be82826e6..420e8ea95 100644 --- a/zrml/orderbook/src/weights.rs +++ b/zrml/orderbook/src/weights.rs @@ -73,9 +73,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Storage: Orderbook Orders (r:1 w:1) /// Proof: Orderbook Orders (max_values: None, max_size: Some(142), added: 2617, mode: MaxEncodedLen) /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:1 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Balances Reserves (r:1 w:1) /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) @@ -92,9 +89,6 @@ impl WeightInfoZeitgeist for WeightInfo { .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:1 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Orderbook NextOrderId (r:1 w:1) /// Proof: Orderbook NextOrderId (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) /// Storage: Balances Reserves (r:1 w:1) diff --git a/zrml/parimutuel/Cargo.toml b/zrml/parimutuel/Cargo.toml index 6c0721295..4db93d8f4 100644 --- a/zrml/parimutuel/Cargo.toml +++ b/zrml/parimutuel/Cargo.toml @@ -3,11 +3,9 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } orml-traits = { workspace = true } -pallet-assets = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } sp-runtime = { workspace = true } -zeitgeist-macros = { workspace = true } zeitgeist-primitives = { workspace = true } zrml-market-commons = { workspace = true } @@ -19,7 +17,6 @@ pallet-balances = { workspace = true, features = ["default"] } pallet-timestamp = { workspace = true, features = ["default"] } sp-io = { workspace = true, features = ["default"] } zeitgeist-primitives = { workspace = true, features = ["mock", "default"] } -zrml-asset-router = { workspace = true, features = ["default"] } test-case = { workspace = true } @@ -29,14 +26,12 @@ runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", ] std = [ "frame-benchmarking?/std", "frame-support/std", "frame-system/std", "orml-traits/std", - "pallet-assets/std", "parity-scale-codec/std", "sp-runtime/std", "zeitgeist-primitives/std", diff --git a/zrml/parimutuel/src/benchmarking.rs b/zrml/parimutuel/src/benchmarking.rs index b45816e8c..bf70b76f3 100644 --- a/zrml/parimutuel/src/benchmarking.rs +++ b/zrml/parimutuel/src/benchmarking.rs @@ -23,17 +23,11 @@ use crate::{utils::*, Pallet as Parimutuel, *}; use frame_benchmarking::v2::*; -use frame_support::{ - assert_ok, - traits::{fungibles::Inspect, Get}, -}; +use frame_support::traits::Get; use frame_system::RawOrigin; use orml_traits::MultiCurrency; use sp_runtime::{SaturatedConversion, Saturating}; -use zeitgeist_primitives::{ - traits::MarketTransitionApi, - types::{MarketStatus, MarketType, OutcomeReport}, -}; +use zeitgeist_primitives::types::{Asset, MarketStatus, MarketType, OutcomeReport}; use zrml_market_commons::MarketCommonsPalletApi; fn setup_market(market_type: MarketType) -> MarketIdOf { @@ -48,12 +42,12 @@ fn setup_market(market_type: MarketType) -> MarketIdOf { fn buy_asset( market_id: MarketIdOf, - asset: ParimutuelShareOf, + asset: AssetOf, buyer: &T::AccountId, amount: BalanceOf, ) { let market = T::MarketCommons::market(&market_id).unwrap(); - T::AssetManager::deposit(market.base_asset.into(), buyer, amount).unwrap(); + T::AssetManager::deposit(market.base_asset, buyer, amount).unwrap(); Parimutuel::::buy(RawOrigin::Signed(buyer.clone()).into(), asset, amount).unwrap(); } @@ -68,10 +62,10 @@ mod benchmarks { let market_id = setup_market::(MarketType::Categorical(64u16)); let amount = T::MinBetSize::get().saturating_mul(10u128.saturated_into::>()); - let asset = ParimutuelShareOf::::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let market = T::MarketCommons::market(&market_id).unwrap(); - T::AssetManager::deposit(market.base_asset.into(), &buyer, amount).unwrap(); + T::AssetManager::deposit(market.base_asset, &buyer, amount).unwrap(); #[extrinsic_call] buy(RawOrigin::Signed(buyer), asset, amount); @@ -81,16 +75,15 @@ mod benchmarks { fn claim_rewards() { // max category index is worst case let market_id = setup_market::(MarketType::Categorical(64u16)); - assert_ok!(Parimutuel::::on_activation(&market_id).result); let winner = whitelisted_caller(); - let winner_asset = ParimutuelShareOf::::Share(market_id, 0u16); + let winner_asset = Asset::ParimutuelShare(market_id, 0u16); let winner_amount = T::MinBetSize::get().saturating_mul(20u128.saturated_into::>()); buy_asset::(market_id, winner_asset, &winner, winner_amount); let loser = whitelisted_caller(); - let loser_asset = ParimutuelShareOf::::Share(market_id, 1u16); + let loser_asset = Asset::ParimutuelShare(market_id, 1u16); let loser_amount = T::MinBetSize::get().saturating_mul(10u128.saturated_into::>()); buy_asset::(market_id, loser_asset, &loser, loser_amount); @@ -109,18 +102,17 @@ mod benchmarks { fn claim_refunds() { // max category index is worst case let market_id = setup_market::(MarketType::Categorical(64u16)); - assert_ok!(Parimutuel::::on_activation(&market_id).result); let loser_0 = whitelisted_caller(); let loser_0_index = 0u16; - let loser_0_asset = ParimutuelShareOf::::Share(market_id, loser_0_index); + let loser_0_asset = Asset::ParimutuelShare(market_id, loser_0_index); let loser_0_amount = T::MinBetSize::get().saturating_mul(20u128.saturated_into::>()); buy_asset::(market_id, loser_0_asset, &loser_0, loser_0_amount); let loser_1 = whitelisted_caller(); let loser_1_index = 1u16; - let loser_1_asset = ParimutuelShareOf::::Share(market_id, loser_1_index); + let loser_1_asset = Asset::ParimutuelShare(market_id, loser_1_index); let loser_1_amount = T::MinBetSize::get().saturating_mul(10u128.saturated_into::>()); buy_asset::(market_id, loser_1_asset, &loser_1, loser_1_amount); @@ -131,8 +123,8 @@ mod benchmarks { let resolved_outcome = OutcomeReport::Categorical(resolved_index); assert_ne!(resolved_index, loser_0_index); assert_ne!(resolved_index, loser_1_index); - let resolved_asset = ParimutuelShareOf::::Share(market_id, resolved_index); - let resolved_issuance_asset = T::AssetManager::total_issuance(resolved_asset.into()); + let resolved_asset = Asset::ParimutuelShare(market_id, resolved_index); + let resolved_issuance_asset = T::AssetManager::total_issuance(resolved_asset); assert!(resolved_issuance_asset.is_zero()); market.resolved_outcome = Some(resolved_outcome); Ok(()) @@ -142,55 +134,6 @@ mod benchmarks { claim_refunds(RawOrigin::Signed(loser_0), loser_0_asset); } - #[benchmark] - fn on_activation() { - let market_id = setup_market::(MarketType::Categorical(64u16)); - - #[block] - { - Parimutuel::::on_activation(&market_id); - } - - for asset_idx in 0..64 { - let asset = ParimutuelShareOf::::Share(Zero::zero(), asset_idx).into(); - assert!(T::AssetCreator::asset_exists(asset)); - } - } - - #[benchmark] - fn on_resolution() { - let market_id = setup_market::(MarketType::Categorical(64u16)); - assert_ok!(Parimutuel::::on_activation(&market_id).result); - - for asset_idx in 0..64 { - let asset = ParimutuelShareOf::::Share(Zero::zero(), asset_idx).into(); - assert!(T::AssetCreator::asset_exists(asset)); - } - - T::MarketCommons::mutate_market(&market_id, |market| { - market.status = MarketStatus::Resolved; - let resolved_outcome = OutcomeReport::Categorical(0u16); - market.resolved_outcome = Some(resolved_outcome); - Ok(()) - })?; - - #[block] - { - Parimutuel::::on_resolution(&market_id); - } - - #[cfg(test)] - { - use frame_support::{pallet_prelude::Weight, traits::OnIdle}; - - crate::mock::AssetRouter::on_idle(Zero::zero(), Weight::MAX); - for asset_idx in 0..64 { - let asset = ParimutuelShareOf::::Share(Zero::zero(), asset_idx).into(); - assert!(!T::AssetCreator::asset_exists(asset)); - } - } - } - impl_benchmark_test_suite!( Parimutuel, crate::mock::ExtBuilder::default().build(), diff --git a/zrml/parimutuel/src/lib.rs b/zrml/parimutuel/src/lib.rs index c04b70900..81953d92c 100644 --- a/zrml/parimutuel/src/lib.rs +++ b/zrml/parimutuel/src/lib.rs @@ -18,8 +18,6 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] -extern crate alloc; - mod benchmarking; mod mock; mod tests; @@ -31,16 +29,12 @@ pub use pallet::*; #[frame_support::pallet] mod pallet { use crate::weights::WeightInfoZeitgeist; - use alloc::collections::BTreeMap; use core::marker::PhantomData; use frame_support::{ ensure, log, pallet_prelude::{Decode, DispatchError, Encode, TypeInfo}, require_transactional, - traits::{ - fungibles::{Create, Inspect}, - Get, IsType, StorageVersion, - }, + traits::{Get, IsType, StorageVersion}, PalletId, RuntimeDebug, }; use frame_system::{ @@ -48,36 +42,25 @@ mod pallet { pallet_prelude::{BlockNumberFor, OriginFor}, }; use orml_traits::MultiCurrency; - use pallet_assets::ManagedDestroy; use sp_runtime::{ traits::{AccountIdConversion, CheckedSub, Zero}, DispatchResult, }; - use zeitgeist_macros::unreachable_non_terminating; use zeitgeist_primitives::{ math::fixed::FixedMulDiv, - traits::{DistributeFees, MarketTransitionApi}, - types::{ - Asset, BaseAsset, Market, MarketAssetClass, MarketStatus, MarketType, OutcomeReport, - ParimutuelAssetClass, ResultWithWeightInfo, ScoringRule, - }, + traits::DistributeFees, + types::{Asset, Market, MarketStatus, MarketType, OutcomeReport, ScoringRule}, }; use zrml_market_commons::MarketCommonsPalletApi; #[pallet::config] pub trait Config: frame_system::Config { - /// The module handling the creation of market assets. - type AssetCreator: Create, Balance = BalanceOf>; - /// The api to handle different asset classes. type AssetManager: MultiCurrency>; - /// The module handling the destruction of market assets. - type AssetDestroyer: ManagedDestroy, Balance = BalanceOf>; - /// The way how fees are taken from the market base asset. type ExternalFees: DistributeFees< - Asset = AssetOf, + Asset = Asset>, AccountId = AccountIdOf, Balance = BalanceOf, MarketId = MarketIdOf, @@ -108,21 +91,14 @@ mod pallet { const LOG_TARGET: &str = "runtime::zrml-parimutuel"; pub(crate) type AssetOf = Asset>; - pub(crate) type ParimutuelShareOf = ParimutuelAssetClass>; pub(crate) type AccountIdOf = ::AccountId; pub(crate) type BalanceOf = <::AssetManager as MultiCurrency>>::Balance; pub(crate) type MarketIdOf = <::MarketCommons as MarketCommonsPalletApi>::MarketId; pub(crate) type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; - pub(crate) type MarketOf = Market< - AccountIdOf, - BalanceOf, - BlockNumberFor, - MomentOf, - BaseAsset, - MarketIdOf, - >; + pub(crate) type MarketOf = + Market, BalanceOf, BlockNumberFor, MomentOf, MarketIdOf>; #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] @@ -164,51 +140,38 @@ mod pallet { /// There was no buyer for the winning outcome or all winners already claimed their rewards. /// Use the `refund` extrinsic to get the initial bet back, /// in case there was no buyer for the winning outcome. - #[codec(index = 0)] NoRewardShareOutstanding, /// The market is not active. - #[codec(index = 1)] MarketIsNotActive, /// The specified amount is below the minimum bet size. - #[codec(index = 2)] AmountBelowMinimumBetSize, + /// The specified asset is not a parimutuel share. + NotParimutuelOutcome, /// The specified asset was not found in the market assets. - #[codec(index = 4)] InvalidOutcomeAsset, /// The scoring rule is not parimutuel. - #[codec(index = 5)] InvalidScoringRule, /// The specified amount can not be transferred. - #[codec(index = 6)] InsufficientBalance, /// The market is not resolved yet. - #[codec(index = 7)] MarketIsNotResolvedYet, /// An unexpected error occured. This should never happen! /// There was an internal coding mistake. - #[codec(index = 8)] Unexpected, /// There is no resolved outcome present for the market. - #[codec(index = 9)] NoResolvedOutcome, /// The refund is not allowed. - #[codec(index = 10)] RefundNotAllowed, /// There is no balance to refund. - #[codec(index = 11)] RefundableBalanceIsZero, /// There is no reward, because there are no winning shares. - #[codec(index = 12)] NoWinningShares, /// Only categorical markets are allowed for parimutuels. - #[codec(index = 13)] NotCategorical, /// There is no reward to distribute. - #[codec(index = 14)] NoRewardToDistribute, /// Action cannot be completed because an unexpected error has occurred. This should be /// reported to protocol maintainers. - #[codec(index = 15)] InconsistentState(InconsistentStateError), } @@ -238,7 +201,7 @@ mod pallet { #[frame_support::transactional] pub fn buy( origin: OriginFor, - asset: ParimutuelShareOf, + asset: Asset>, #[pallet::compact] amount: BalanceOf, ) -> DispatchResult { let who = ensure_signed(origin)?; @@ -273,10 +236,7 @@ mod pallet { #[pallet::call_index(2)] #[pallet::weight(T::WeightInfo::claim_refunds())] #[frame_support::transactional] - pub fn claim_refunds( - origin: OriginFor, - refund_asset: ParimutuelShareOf, - ) -> DispatchResult { + pub fn claim_refunds(origin: OriginFor, refund_asset: AssetOf) -> DispatchResult { let who = ensure_signed(origin)?; Self::do_claim_refunds(who, refund_asset)?; @@ -331,36 +291,29 @@ mod pallet { Ok(()) } - pub fn market_assets_contains( - market: &MarketOf, - asset: &ParimutuelShareOf, - ) -> DispatchResult { - let index = match asset { - ParimutuelShareOf::::Share(_, idx) => *idx, - }; - - match market.market_type { - MarketType::Categorical(categories) => { - ensure!(index < categories, Error::::InvalidOutcomeAsset); - Ok(()) + pub fn market_assets_contains(market: &MarketOf, asset: &AssetOf) -> DispatchResult { + if let Asset::ParimutuelShare(_, i) = asset { + match market.market_type { + MarketType::Categorical(categories) => { + ensure!(*i < categories, Error::::InvalidOutcomeAsset); + return Ok(()); + } + MarketType::Scalar(_) => return Err(Error::::NotCategorical.into()), } - MarketType::Scalar(_) => Err(Error::::NotCategorical.into()), } + Err(Error::::NotParimutuelOutcome.into()) } #[require_transactional] - fn do_buy( - who: T::AccountId, - asset: ParimutuelShareOf, - amount: BalanceOf, - ) -> DispatchResult { + fn do_buy(who: T::AccountId, asset: AssetOf, amount: BalanceOf) -> DispatchResult { let market_id = match asset { - ParimutuelShareOf::::Share(market_id, _) => market_id, + Asset::ParimutuelShare(market_id, _) => market_id, + _ => return Err(Error::::NotParimutuelOutcome.into()), }; let market = T::MarketCommons::market(&market_id)?; let base_asset = market.base_asset; ensure!( - T::AssetManager::ensure_can_withdraw(base_asset.into(), &who, amount).is_ok(), + T::AssetManager::ensure_can_withdraw(base_asset, &who, amount).is_ok(), Error::::InsufficientBalance ); ensure!(market.status == MarketStatus::Active, Error::::MarketIsNotActive); @@ -371,23 +324,23 @@ mod pallet { ); Self::market_assets_contains(&market, &asset)?; - let external_fees = - T::ExternalFees::distribute(market_id, base_asset.into(), &who, amount); + let external_fees = T::ExternalFees::distribute(market_id, base_asset, &who, amount); let amount_minus_fees = amount.checked_sub(&external_fees).ok_or(Error::::Unexpected)?; ensure!( amount_minus_fees >= T::MinBetSize::get(), Error::::AmountBelowMinimumBetSize ); + let pot_account = Self::pot_account(market_id); - T::AssetManager::transfer(base_asset.into(), &who, &pot_account, amount_minus_fees)?; - T::AssetManager::deposit(asset.into(), &who, amount_minus_fees)?; + T::AssetManager::transfer(market.base_asset, &who, &pot_account, amount_minus_fees)?; + T::AssetManager::deposit(asset, &who, amount_minus_fees)?; Self::deposit_event(Event::OutcomeBought { market_id, buyer: who, - asset: asset.into(), + asset, amount_minus_fees, fees: external_fees, }); @@ -443,7 +396,7 @@ mod pallet { } let pot_account = Self::pot_account(market_id); - let pot_total = T::AssetManager::free_balance(market.base_asset.into(), &pot_account); + let pot_total = T::AssetManager::free_balance(market.base_asset, &pot_account); let payoff = pot_total.bmul_bdiv(winning_balance, outcome_total)?; Self::check_values(winning_balance, pot_total, outcome_total, payoff)?; @@ -452,27 +405,10 @@ mod pallet { T::AssetManager::withdraw(winning_asset, &who, withdrawn_asset_balance)?; - let remaining_bal = - T::AssetManager::free_balance(market.base_asset.into(), &pot_account); + let remaining_bal = T::AssetManager::free_balance(market.base_asset, &pot_account); let base_asset_payoff = payoff.min(remaining_bal); - T::AssetManager::transfer( - market.base_asset.into(), - &pot_account, - &who, - base_asset_payoff, - )?; - - if outcome_total == winning_balance { - let destroy_result = T::AssetDestroyer::managed_destroy(winning_asset, None); - unreachable_non_terminating!( - destroy_result.is_ok(), - LOG_TARGET, - "Can't destroy winning outcome asset {:?}: {:?}", - winning_asset, - destroy_result.err() - ); - } + T::AssetManager::transfer(market.base_asset, &pot_account, &who, base_asset_payoff)?; Self::deposit_event(Event::RewardsClaimed { market_id, @@ -486,12 +422,10 @@ mod pallet { } #[require_transactional] - fn do_claim_refunds( - who: T::AccountId, - refund_asset: ParimutuelShareOf, - ) -> DispatchResult { + fn do_claim_refunds(who: T::AccountId, refund_asset: AssetOf) -> DispatchResult { let market_id = match refund_asset { - ParimutuelShareOf::::Share(market_id, _) => market_id, + Asset::ParimutuelShare(market_id, _) => market_id, + _ => return Err(Error::::NotParimutuelOutcome.into()), }; let market = T::MarketCommons::market(&market_id)?; Self::ensure_parimutuel_market_resolved(&market)?; @@ -500,10 +434,9 @@ mod pallet { let outcome_total = T::AssetManager::total_issuance(winning_asset); ensure!(outcome_total == >::zero(), Error::::RefundNotAllowed); - let refund_asset_general: AssetOf = refund_asset.into(); - let refund_balance = T::AssetManager::free_balance(refund_asset_general, &who); + let refund_balance = T::AssetManager::free_balance(refund_asset, &who); ensure!(!refund_balance.is_zero(), Error::::RefundableBalanceIsZero); - if refund_asset_general == winning_asset { + if refund_asset == winning_asset { log::debug!( target: LOG_TARGET, "Since we were checking the total issuance of the winning asset to be zero, if \ @@ -513,10 +446,10 @@ mod pallet { debug_assert!(false); } - T::AssetManager::withdraw(refund_asset_general, &who, refund_balance)?; + T::AssetManager::withdraw(refund_asset, &who, refund_balance)?; let pot_account = Self::pot_account(market_id); - let pot_total = T::AssetManager::free_balance(market.base_asset.into(), &pot_account); + let pot_total = T::AssetManager::free_balance(market.base_asset, &pot_account); if pot_total < refund_balance { log::debug!( target: LOG_TARGET, @@ -526,128 +459,16 @@ mod pallet { } let refund_balance = refund_balance.min(pot_total); - T::AssetManager::transfer( - market.base_asset.into(), - &pot_account, - &who, - refund_balance, - )?; - - if T::AssetCreator::total_issuance(refund_asset_general).is_zero() { - let destroy_result = T::AssetDestroyer::managed_destroy(refund_asset_general, None); - unreachable_non_terminating!( - destroy_result.is_ok(), - LOG_TARGET, - "Can't destroy losing outcome asset {:?}: {:?}", - refund_asset_general, - destroy_result - ); - } + T::AssetManager::transfer(market.base_asset, &pot_account, &who, refund_balance)?; Self::deposit_event(Event::BalanceRefunded { market_id, - asset: refund_asset_general, + asset: refund_asset, refunded_balance: refund_balance, sender: who.clone(), }); Ok(()) } - - fn get_assets_to_destroy( - market: &MarketOf, - filter: F, - ) -> BTreeMap, Option> - where - F: Copy + FnOnce(MarketAssetClass>) -> bool, - { - BTreeMap::, Option>::from_iter( - market - .outcome_assets() - .into_iter() - .filter(|asset| filter(*asset)) - .map(|asset| (AssetOf::::from(asset), None)), - ) - } - } - - impl MarketTransitionApi> for Pallet { - fn on_activation(market_id: &MarketIdOf) -> ResultWithWeightInfo { - let market_result = T::MarketCommons::market(market_id); - - let market = match market_result { - Ok(market) if market.scoring_rule == ScoringRule::Parimutuel => market, - Err(e) => { - return ResultWithWeightInfo::new(Err(e), T::DbWeight::get().reads(1)); - } - _ => { - return ResultWithWeightInfo::new(Ok(()), T::DbWeight::get().reads(1)); - } - }; - - for outcome in market.outcome_assets() { - let admin = Self::pot_account(*market_id); - let is_sufficient = true; - let min_balance = 1u8; - if let Err(e) = T::AssetCreator::create( - outcome.into(), - admin, - is_sufficient, - min_balance.into(), - ) { - return ResultWithWeightInfo::new(Err(e), T::WeightInfo::on_activation()); - } - } - - ResultWithWeightInfo::new(Ok(()), T::WeightInfo::on_activation()) - } - - fn on_resolution(market_id: &MarketIdOf) -> ResultWithWeightInfo { - let market_result = T::MarketCommons::market(market_id); - - let market = match market_result { - Ok(market) if market.scoring_rule == ScoringRule::Parimutuel => market, - Err(e) => { - return ResultWithWeightInfo::new(Err(e), T::DbWeight::get().reads(1)); - } - _ => { - return ResultWithWeightInfo::new(Ok(()), T::DbWeight::get().reads(1)); - } - }; - - let winning_asset_option = market.resolved_outcome_into_asset(); - let winning_asset = if let Some(winning_asset) = winning_asset_option { - winning_asset - } else { - unreachable_non_terminating!( - winning_asset_option.is_some(), - LOG_TARGET, - "Resolved market with id {:?} does not have a resolved outcome", - market_id, - ); - return ResultWithWeightInfo::new(Ok(()), T::DbWeight::get().reads(1)); - }; - - let outcome_total = T::AssetManager::total_issuance(winning_asset.into()); - let assets_to_destroy = if outcome_total.is_zero() { - Self::get_assets_to_destroy(&market, |asset| { - T::AssetCreator::total_issuance(asset.into()).is_zero() - }) - } else { - Self::get_assets_to_destroy(&market, |asset| asset != winning_asset) - }; - - let destroy_result = - T::AssetDestroyer::managed_destroy_multi(assets_to_destroy.clone()); - unreachable_non_terminating!( - destroy_result.is_ok(), - LOG_TARGET, - "Can't destroy losing outcome assets {:?}: {:?}", - assets_to_destroy, - destroy_result - ); - - ResultWithWeightInfo::new(Ok(()), T::WeightInfo::on_resolution()) - } } } diff --git a/zrml/parimutuel/src/mock.rs b/zrml/parimutuel/src/mock.rs index 0d8fab509..fa78bc29c 100644 --- a/zrml/parimutuel/src/mock.rs +++ b/zrml/parimutuel/src/mock.rs @@ -23,15 +23,8 @@ use crate as zrml_parimutuel; use crate::{AssetOf, BalanceOf, MarketIdOf}; use alloc::{vec, vec::Vec}; use core::marker::PhantomData; -use frame_support::{ - construct_runtime, - pallet_prelude::{ConstU32, Get}, - parameter_types, - traits::{AsEnsureOriginWithArg, Everything}, -}; -use frame_system::{EnsureRoot, EnsureSigned}; +use frame_support::{construct_runtime, pallet_prelude::Get, parameter_types, traits::Everything}; use orml_traits::MultiCurrency; -use parity_scale_codec::Compact; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, @@ -39,16 +32,13 @@ use sp_runtime::{ }; use zeitgeist_primitives::{ constants::mock::{ - AssetsAccountDeposit, AssetsApprovalDeposit, AssetsDeposit, AssetsMetadataDepositBase, - AssetsMetadataDepositPerByte, AssetsStringLimit, BlockHashCount, DestroyAccountWeight, - DestroyApprovalWeight, DestroyFinishWeight, ExistentialDeposits, GetNativeCurrencyId, - MaxReserves, MinBetSize, MinimumPeriod, ParimutuelPalletId, BASE, CENT, + BlockHashCount, ExistentialDeposits, GetNativeCurrencyId, MaxReserves, MinBetSize, + MinimumPeriod, ParimutuelPalletId, BASE, CENT, }, traits::DistributeFees, types::{ - AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, - CampaignAsset, CampaignAssetId, Currencies, CustomAsset, CustomAssetId, Hash, Index, - MarketAsset, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, + Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, }, }; @@ -101,10 +91,6 @@ where } } -type CustomAssetsInstance = pallet_assets::Instance1; -type CampaignAssetsInstance = pallet_assets::Instance2; -type MarketAssetsInstance = pallet_assets::Instance3; - construct_runtime!( pub enum Runtime where @@ -112,27 +98,21 @@ construct_runtime!( NodeBlock = BlockTest, UncheckedExtrinsic = UncheckedExtrinsicTest, { - AssetManager: orml_currencies::{Call, Pallet, Storage}, - AssetRouter: zrml_asset_router::{Pallet}, + Parimutuel: zrml_parimutuel::{Event, Pallet, Storage}, Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - CampaignAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - CustomAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - MarketAssets: pallet_assets::::{Call, Pallet, Storage, Event}, + AssetManager: orml_currencies::{Call, Pallet, Storage}, + Tokens: orml_tokens::{Config, Event, Pallet, Storage}, MarketCommons: zrml_market_commons::{Pallet, Storage}, - Parimutuel: zrml_parimutuel::{Event, Pallet, Storage}, System: frame_system::{Call, Config, Event, Pallet, Storage}, Timestamp: pallet_timestamp::{Pallet}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, } ); impl crate::Config for Runtime { - type AssetCreator = AssetRouter; - type AssetDestroyer = AssetRouter; - type AssetManager = AssetManager; type ExternalFees = ExternalFees; type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; + type AssetManager = AssetManager; type MinBetSize = MinBetSize; type PalletId = ParimutuelPalletId; type WeightInfo = crate::weights::WeightInfo; @@ -165,106 +145,6 @@ impl frame_system::Config for Runtime { type OnSetCode = (); } -pallet_assets::runtime_benchmarks_enabled! { - pub struct AssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for AssetsBenchmarkHelper - where - AssetIdParameter: From, - { - fn create_asset_id_parameter(id: u32) -> AssetIdParameter { - (id as u128).into() - } - } -} - -pallet_assets::runtime_benchmarks_enabled! { - use zeitgeist_primitives::types::CategoryIndex; - - pub struct MarketAssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for MarketAssetsBenchmarkHelper - { - fn create_asset_id_parameter(id: u32) -> MarketAsset { - MarketAsset::CategoricalOutcome(0, id as CategoryIndex) - } - } -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CampaignAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CustomAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = MarketAsset; - type AssetIdParameter = MarketAsset; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = MarketAssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; @@ -277,9 +157,22 @@ impl pallet_balances::Config for Runtime { type WeightInfo = (); } +impl zrml_market_commons::Config for Runtime { + type Balance = Balance; + type MarketId = MarketId; + type Timestamp = Timestamp; +} + +impl pallet_timestamp::Config for Runtime { + type MinimumPeriod = MinimumPeriod; + type Moment = Moment; + type OnTimestampSet = (); + type WeightInfo = (); +} + impl orml_currencies::Config for Runtime { type GetNativeCurrencyId = GetNativeCurrencyId; - type MultiCurrency = AssetRouter; + type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; type WeightInfo = (); } @@ -287,7 +180,7 @@ impl orml_currencies::Config for Runtime { impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; - type CurrencyId = Currencies; + type CurrencyId = CurrencyId; type DustRemovalWhitelist = Everything; type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; @@ -298,35 +191,6 @@ impl orml_tokens::Config for Runtime { type WeightInfo = (); } -impl zrml_asset_router::Config for Runtime { - type AssetType = Assets; - type Balance = Balance; - type CurrencyType = Currencies; - type Currencies = Tokens; - type CampaignAssetType = CampaignAsset; - type CampaignAssets = CampaignAssets; - type CustomAssetType = CustomAsset; - type CustomAssets = CustomAssets; - type DestroyAccountWeight = DestroyAccountWeight; - type DestroyApprovalWeight = DestroyApprovalWeight; - type DestroyFinishWeight = DestroyFinishWeight; - type MarketAssetType = MarketAsset; - type MarketAssets = MarketAssets; -} - -impl zrml_market_commons::Config for Runtime { - type Balance = Balance; - type MarketId = MarketId; - type Timestamp = Timestamp; -} - -impl pallet_timestamp::Config for Runtime { - type MinimumPeriod = MinimumPeriod; - type Moment = Moment; - type OnTimestampSet = (); - type WeightInfo = (); -} - pub struct ExtBuilder { balances: Vec<(AccountIdTest, Balance)>, } diff --git a/zrml/parimutuel/src/tests/buy.rs b/zrml/parimutuel/src/tests/buy.rs index 782767b8c..fcee01f23 100644 --- a/zrml/parimutuel/src/tests/buy.rs +++ b/zrml/parimutuel/src/tests/buy.rs @@ -15,12 +15,14 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . +#![cfg(test)] + use crate::{mock::*, utils::*, *}; use core::ops::RangeInclusive; use frame_support::{assert_noop, assert_ok}; use orml_traits::MultiCurrency; use test_case::test_case; -use zeitgeist_primitives::types::{MarketStatus, MarketType, ParimutuelAsset, ScoringRule}; +use zeitgeist_primitives::types::{Asset, MarketStatus, MarketType, ScoringRule}; use zrml_market_commons::{Error as MError, Markets}; #[test] @@ -31,7 +33,7 @@ fn buy_emits_event() { market.status = MarketStatus::Active; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount)); @@ -40,14 +42,7 @@ fn buy_emits_event() { assert_eq!(amount, amount_minus_fees + fees); System::assert_last_event( - Event::OutcomeBought { - market_id, - buyer: ALICE, - asset: asset.into(), - amount_minus_fees, - fees, - } - .into(), + Event::OutcomeBought { market_id, buyer: ALICE, asset, amount_minus_fees, fees }.into(), ); }); } @@ -62,12 +57,12 @@ fn buy_balances_change_correctly() { let base_asset = market.base_asset; - let free_alice_before = AssetManager::free_balance(base_asset.into(), &ALICE); - let free_creator_before = AssetManager::free_balance(base_asset.into(), &market.creator); + let free_alice_before = AssetManager::free_balance(base_asset, &ALICE); + let free_creator_before = AssetManager::free_balance(base_asset, &market.creator); let free_pot_before = - AssetManager::free_balance(base_asset.into(), &Parimutuel::pot_account(market_id)); + AssetManager::free_balance(base_asset, &Parimutuel::pot_account(market_id)); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount)); @@ -75,23 +70,37 @@ fn buy_balances_change_correctly() { let fees = 1000000000; assert_eq!(amount, amount_minus_fees + fees); + assert_eq!(AssetManager::free_balance(base_asset, &ALICE), free_alice_before - amount); assert_eq!( - AssetManager::free_balance(base_asset.into(), &ALICE), - free_alice_before - amount - ); - assert_eq!( - AssetManager::free_balance(base_asset.into(), &Parimutuel::pot_account(market_id)) + AssetManager::free_balance(base_asset, &Parimutuel::pot_account(market_id)) - free_pot_before, amount_minus_fees ); - assert_eq!(AssetManager::free_balance(asset.into(), &ALICE), amount_minus_fees); + assert_eq!(AssetManager::free_balance(asset, &ALICE), amount_minus_fees); assert_eq!( - AssetManager::free_balance(base_asset.into(), &market.creator) - free_creator_before, + AssetManager::free_balance(base_asset, &market.creator) - free_creator_before, fees ); }); } +#[test] +fn buy_fails_if_asset_not_parimutuel_share() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0; + let mut market = market_mock::(MARKET_CREATOR); + market.status = MarketStatus::Active; + Markets::::insert(market_id, market.clone()); + + let asset = Asset::CategoricalOutcome(market_id, 0u16); + let amount = ::MinBetSize::get(); + assert_noop!( + Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount), + Error::::NotParimutuelOutcome + ); + }); +} + #[test_case(ScoringRule::AmmCdaHybrid; "amm_cda_hybrid")] fn buy_fails_if_invalid_scoring_rule(scoring_rule: ScoringRule) { ExtBuilder::default().build().execute_with(|| { @@ -102,7 +111,7 @@ fn buy_fails_if_invalid_scoring_rule(scoring_rule: ScoringRule) { Markets::::insert(market_id, market.clone()); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = ::MinBetSize::get(); assert_noop!( Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount), @@ -124,7 +133,7 @@ fn buy_fails_if_market_status_is_not_active(status: MarketStatus) { Markets::::insert(market_id, market.clone()); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = ::MinBetSize::get(); assert_noop!( Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount), @@ -143,7 +152,7 @@ fn buy_fails_if_market_type_is_scalar() { market.status = MarketStatus::Active; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = ::MinBetSize::get() + ::MinBetSize::get(); assert_noop!( @@ -161,10 +170,10 @@ fn buy_fails_if_insufficient_balance() { market.status = MarketStatus::Active; Markets::::insert(market_id, market.clone()); - let free_alice = AssetManager::free_balance(market.base_asset.into(), &ALICE); - AssetManager::slash(market.base_asset.into(), &ALICE, free_alice); + let free_alice = AssetManager::free_balance(market.base_asset, &ALICE); + AssetManager::slash(market.base_asset, &ALICE, free_alice); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = ::MinBetSize::get(); assert_noop!( Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount), @@ -181,7 +190,7 @@ fn buy_fails_if_below_minimum_bet_size() { market.status = MarketStatus::Active; Markets::::insert(market_id, market.clone()); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = ::MinBetSize::get() - 1; assert_noop!( Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount), @@ -195,7 +204,7 @@ fn buy_fails_if_market_does_not_exist() { ExtBuilder::default().build().execute_with(|| { let market_id = 0; - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = ::MinBetSize::get(); assert_noop!( Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount), diff --git a/zrml/parimutuel/src/tests/claim.rs b/zrml/parimutuel/src/tests/claim.rs index 3ac7d390f..972473596 100644 --- a/zrml/parimutuel/src/tests/claim.rs +++ b/zrml/parimutuel/src/tests/claim.rs @@ -15,16 +15,15 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . +#![cfg(test)] + use crate::{mock::*, utils::*, *}; use core::ops::RangeInclusive; -use frame_support::{assert_noop, assert_ok, traits::fungibles::Create}; +use frame_support::{assert_noop, assert_ok}; use orml_traits::MultiCurrency; use sp_runtime::Percent; use test_case::test_case; -use zeitgeist_primitives::{ - traits::MarketTransitionApi, - types::{MarketStatus, MarketType, OutcomeReport, ParimutuelAsset, ScoringRule}, -}; +use zeitgeist_primitives::types::{Asset, MarketStatus, MarketType, OutcomeReport, ScoringRule}; use zrml_market_commons::{Error as MError, Markets}; #[test] @@ -35,12 +34,11 @@ fn claim_rewards_emits_event() { market.status = MarketStatus::Active; Markets::::insert(market_id, market); - let winner_asset = ParimutuelAsset::Share(market_id, 0u16); - AssetRouter::create(winner_asset.into(), Default::default(), true, 1).unwrap(); + let winner_asset = Asset::ParimutuelShare(market_id, 0u16); let winner_amount = 20 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), winner_asset, winner_amount)); - let loser_asset = ParimutuelAsset::Share(market_id, 1u16); + let loser_asset = Asset::ParimutuelShare(market_id, 1u16); let loser_amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(BOB), loser_asset, loser_amount)); @@ -57,7 +55,7 @@ fn claim_rewards_emits_event() { System::assert_last_event( Event::RewardsClaimed { market_id, - asset: winner_asset.into(), + asset: winner_asset, withdrawn_asset_balance, base_asset_payoff: actual_payoff, sender: ALICE, @@ -75,15 +73,14 @@ fn claim_rewards_categorical_changes_balances_correctly() { market.status = MarketStatus::Active; Markets::::insert(market_id, market); - let winner_asset = ParimutuelAsset::Share(market_id, 0u16); - AssetRouter::create(winner_asset.into(), Default::default(), true, 1).unwrap(); + let winner_asset = Asset::ParimutuelShare(market_id, 0u16); let winner_amount_0 = 20 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), winner_asset, winner_amount_0)); let winner_amount_1 = 30 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(CHARLIE), winner_asset, winner_amount_1)); - let loser_asset = ParimutuelAsset::Share(market_id, 1u16); + let loser_asset = Asset::ParimutuelShare(market_id, 1u16); let loser_amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(BOB), loser_asset, loser_amount)); @@ -106,66 +103,52 @@ fn claim_rewards_categorical_changes_balances_correctly() { assert_eq!(Percent::from_percent(60) * actual_payoff, actual_payoff_charlie); assert_eq!(actual_payoff_alice + actual_payoff_charlie, actual_payoff); - let free_winner_asset_alice_before = - AssetManager::free_balance(winner_asset.into(), &ALICE); + let free_winner_asset_alice_before = AssetManager::free_balance(winner_asset, &ALICE); let winner_amount_0_minus_fees = winner_amount_0 - Percent::from_percent(1) * winner_amount_0; assert_eq!(free_winner_asset_alice_before, winner_amount_0_minus_fees); - let free_base_asset_alice_before = - AssetManager::free_balance(market.base_asset.into(), &ALICE); - let free_base_asset_pot_before = AssetManager::free_balance( - market.base_asset.into(), - &Parimutuel::pot_account(market_id), - ); + let free_base_asset_alice_before = AssetManager::free_balance(market.base_asset, &ALICE); + let free_base_asset_pot_before = + AssetManager::free_balance(market.base_asset, &Parimutuel::pot_account(market_id)); assert_eq!(free_base_asset_pot_before, total_pot_amount - total_fees); assert_ok!(Parimutuel::claim_rewards(RuntimeOrigin::signed(ALICE), market_id)); assert_eq!( - free_winner_asset_alice_before - - AssetManager::free_balance(winner_asset.into(), &ALICE), + free_winner_asset_alice_before - AssetManager::free_balance(winner_asset, &ALICE), winner_amount_0_minus_fees ); assert_eq!( - AssetManager::free_balance(market.base_asset.into(), &ALICE) - - free_base_asset_alice_before, + AssetManager::free_balance(market.base_asset, &ALICE) - free_base_asset_alice_before, actual_payoff_alice ); assert_eq!( - AssetManager::free_balance( - market.base_asset.into(), - &Parimutuel::pot_account(market_id) - ), + AssetManager::free_balance(market.base_asset, &Parimutuel::pot_account(market_id)), actual_payoff_charlie ); - let free_winner_asset_charlie_before = - AssetManager::free_balance(winner_asset.into(), &CHARLIE); + let free_winner_asset_charlie_before = AssetManager::free_balance(winner_asset, &CHARLIE); let winner_amount_1_minus_fees = winner_amount_1 - Percent::from_percent(1) * winner_amount_1; assert_eq!(free_winner_asset_charlie_before, winner_amount_1_minus_fees); let free_base_asset_charlie_before = - AssetManager::free_balance(market.base_asset.into(), &CHARLIE); + AssetManager::free_balance(market.base_asset, &CHARLIE); assert_ok!(Parimutuel::claim_rewards(RuntimeOrigin::signed(CHARLIE), market_id)); assert_eq!( - free_winner_asset_charlie_before - - AssetManager::free_balance(winner_asset.into(), &CHARLIE), + free_winner_asset_charlie_before - AssetManager::free_balance(winner_asset, &CHARLIE), winner_amount_1_minus_fees ); assert_eq!( - AssetManager::free_balance(market.base_asset.into(), &CHARLIE) + AssetManager::free_balance(market.base_asset, &CHARLIE) - free_base_asset_charlie_before, actual_payoff_charlie ); assert_eq!( - AssetManager::free_balance( - market.base_asset.into(), - &Parimutuel::pot_account(market_id) - ), + AssetManager::free_balance(market.base_asset, &Parimutuel::pot_account(market_id)), 0 ); }); @@ -261,11 +244,11 @@ fn claim_rewards_categorical_fails_if_no_winner() { market.status = MarketStatus::Active; Markets::::insert(market_id, market); - let winner_asset = ParimutuelAsset::Share(market_id, 0u16); + let winner_asset = Asset::ParimutuelShare(market_id, 0u16); let winner_amount = 20 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), winner_asset, winner_amount)); - let loser_asset = ParimutuelAsset::Share(market_id, 1u16); + let loser_asset = Asset::ParimutuelShare(market_id, 1u16); let loser_amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(BOB), loser_asset, loser_amount)); @@ -291,11 +274,11 @@ fn claim_rewards_categorical_fails_if_no_winning_shares() { market.status = MarketStatus::Active; Markets::::insert(market_id, market); - let winner_asset = ParimutuelAsset::Share(market_id, 0u16); + let winner_asset = Asset::ParimutuelShare(market_id, 0u16); let winner_amount = 20 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), winner_asset, winner_amount)); - let loser_asset = ParimutuelAsset::Share(market_id, 1u16); + let loser_asset = Asset::ParimutuelShare(market_id, 1u16); let loser_amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(BOB), loser_asset, loser_amount)); @@ -320,13 +303,12 @@ fn claim_refunds_works() { market.market_type = MarketType::Categorical(10u16); market.status = MarketStatus::Active; Markets::::insert(market_id, market); - assert_ok!(Parimutuel::on_activation(&market_id).result); - let alice_asset = ParimutuelAsset::Share(market_id, 0u16); + let alice_asset = Asset::ParimutuelShare(market_id, 0u16); let alice_amount = 20 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), alice_asset, alice_amount)); - let bob_asset = ParimutuelAsset::Share(market_id, 1u16); + let bob_asset = Asset::ParimutuelShare(market_id, 1u16); let bob_amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(BOB), bob_asset, bob_amount)); @@ -347,46 +329,33 @@ fn claim_refunds_works() { let alice_amount_minus_fees = alice_amount - alice_paid_fees; let bob_amount_minus_fees = bob_amount - bob_paid_fees; - let free_base_asset_alice_before = - AssetManager::free_balance(market.base_asset.into(), &ALICE); - let free_base_asset_bob_before = AssetManager::free_balance(market.base_asset.into(), &BOB); - let free_base_asset_pot_before = AssetManager::free_balance( - market.base_asset.into(), - &Parimutuel::pot_account(market_id), - ); + let free_base_asset_alice_before = AssetManager::free_balance(market.base_asset, &ALICE); + let free_base_asset_bob_before = AssetManager::free_balance(market.base_asset, &BOB); + let free_base_asset_pot_before = + AssetManager::free_balance(market.base_asset, &Parimutuel::pot_account(market_id)); assert_ok!(Parimutuel::claim_refunds(RuntimeOrigin::signed(ALICE), alice_asset)); assert_eq!( - AssetManager::free_balance(market.base_asset.into(), &ALICE) - - free_base_asset_alice_before, + AssetManager::free_balance(market.base_asset, &ALICE) - free_base_asset_alice_before, alice_amount_minus_fees ); assert_eq!( - AssetManager::free_balance( - market.base_asset.into(), - &Parimutuel::pot_account(market_id) - ), + AssetManager::free_balance(market.base_asset, &Parimutuel::pot_account(market_id)), free_base_asset_pot_before - alice_amount_minus_fees ); assert_eq!( - AssetManager::free_balance( - market.base_asset.into(), - &Parimutuel::pot_account(market_id) - ), + AssetManager::free_balance(market.base_asset, &Parimutuel::pot_account(market_id)), bob_amount_minus_fees ); assert_ok!(Parimutuel::claim_refunds(RuntimeOrigin::signed(BOB), bob_asset)); assert_eq!( - AssetManager::free_balance(market.base_asset.into(), &BOB) - free_base_asset_bob_before, + AssetManager::free_balance(market.base_asset, &BOB) - free_base_asset_bob_before, bob_amount_minus_fees ); assert_eq!( - AssetManager::free_balance( - market.base_asset.into(), - &Parimutuel::pot_account(market_id) - ), + AssetManager::free_balance(market.base_asset, &Parimutuel::pot_account(market_id)), 0 ); }); diff --git a/zrml/parimutuel/src/tests/mod.rs b/zrml/parimutuel/src/tests/mod.rs index 454cec9af..52de08fb9 100644 --- a/zrml/parimutuel/src/tests/mod.rs +++ b/zrml/parimutuel/src/tests/mod.rs @@ -17,7 +17,6 @@ #![cfg(test)] -mod assets; mod buy; mod claim; mod refund; diff --git a/zrml/parimutuel/src/tests/refund.rs b/zrml/parimutuel/src/tests/refund.rs index e5bd80863..09cf0c0d7 100644 --- a/zrml/parimutuel/src/tests/refund.rs +++ b/zrml/parimutuel/src/tests/refund.rs @@ -15,16 +15,35 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . +#![cfg(test)] + use crate::{mock::*, utils::*, *}; use frame_support::{assert_noop, assert_ok}; use sp_runtime::Percent; use test_case::test_case; -use zeitgeist_primitives::{ - traits::MarketTransitionApi, - types::{MarketStatus, MarketType, OutcomeReport, ParimutuelAsset, ScoringRule}, -}; +use zeitgeist_primitives::types::{Asset, MarketStatus, MarketType, OutcomeReport, ScoringRule}; use zrml_market_commons::Markets; +#[test] +fn refund_fails_if_not_parimutuel_outcome() { + ExtBuilder::default().build().execute_with(|| { + let market_id = 0; + let mut market = market_mock::(MARKET_CREATOR); + market.market_type = MarketType::Categorical(10u16); + market.resolved_outcome = Some(OutcomeReport::Categorical(0u16)); + market.status = MarketStatus::Resolved; + Markets::::insert(market_id, market); + + assert_noop!( + Parimutuel::claim_refunds( + RuntimeOrigin::signed(ALICE), + Asset::CategoricalOutcome(market_id, 0u16) + ), + Error::::NotParimutuelOutcome + ); + }); +} + #[test_case(MarketStatus::Active; "active")] #[test_case(MarketStatus::Proposed; "proposed")] #[test_case(MarketStatus::Closed; "closed")] @@ -38,7 +57,7 @@ fn refund_fails_if_market_not_resolved(status: MarketStatus) { market.status = status; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); assert_noop!( Parimutuel::claim_refunds(RuntimeOrigin::signed(ALICE), asset), Error::::MarketIsNotResolvedYet @@ -58,7 +77,7 @@ fn refund_fails_if_invalid_scoring_rule(scoring_rule: ScoringRule) { market.scoring_rule = scoring_rule; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); assert_noop!( Parimutuel::claim_refunds(RuntimeOrigin::signed(ALICE), asset), Error::::InvalidScoringRule @@ -76,7 +95,7 @@ fn refund_fails_if_invalid_outcome_asset() { market.status = MarketStatus::Resolved; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 20u16); + let asset = Asset::ParimutuelShare(market_id, 20u16); assert_noop!( Parimutuel::claim_refunds(RuntimeOrigin::signed(ALICE), asset), Error::::InvalidOutcomeAsset @@ -94,7 +113,7 @@ fn refund_fails_if_no_resolved_outcome() { market.resolved_outcome = None; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); assert_noop!( Parimutuel::claim_refunds(RuntimeOrigin::signed(ALICE), asset), Error::::NoResolvedOutcome @@ -111,7 +130,7 @@ fn refund_fails_if_refund_not_allowed() { market.status = MarketStatus::Active; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount)); @@ -120,7 +139,7 @@ fn refund_fails_if_refund_not_allowed() { market.status = MarketStatus::Resolved; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); assert_noop!( Parimutuel::claim_refunds(RuntimeOrigin::signed(ALICE), asset), Error::::RefundNotAllowed @@ -136,9 +155,8 @@ fn refund_fails_if_refundable_balance_is_zero() { market.market_type = MarketType::Categorical(10u16); market.status = MarketStatus::Active; Markets::::insert(market_id, market); - assert_ok!(Parimutuel::on_activation(&market_id).result); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = 2 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount)); @@ -147,7 +165,7 @@ fn refund_fails_if_refundable_balance_is_zero() { market.status = MarketStatus::Resolved; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); assert_ok!(Parimutuel::claim_refunds(RuntimeOrigin::signed(ALICE), asset)); // already refunded above @@ -166,9 +184,8 @@ fn refund_emits_event() { market.market_type = MarketType::Categorical(10u16); market.status = MarketStatus::Active; Markets::::insert(market_id, market); - assert_ok!(Parimutuel::on_activation(&market_id).result); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); let amount = 10 * ::MinBetSize::get(); assert_ok!(Parimutuel::buy(RuntimeOrigin::signed(ALICE), asset, amount)); @@ -177,7 +194,7 @@ fn refund_emits_event() { market.status = MarketStatus::Resolved; Markets::::insert(market_id, market); - let asset = ParimutuelAsset::Share(market_id, 0u16); + let asset = Asset::ParimutuelShare(market_id, 0u16); assert_ok!(Parimutuel::claim_refunds(RuntimeOrigin::signed(ALICE), asset)); let amount_minus_fees = amount - (Percent::from_percent(1) * amount); @@ -185,7 +202,7 @@ fn refund_emits_event() { System::assert_last_event( Event::BalanceRefunded { market_id, - asset: asset.into(), + asset, refunded_balance: amount_minus_fees, sender: ALICE, } diff --git a/zrml/parimutuel/src/utils.rs b/zrml/parimutuel/src/utils.rs index b8a99edcd..35b0422f6 100644 --- a/zrml/parimutuel/src/utils.rs +++ b/zrml/parimutuel/src/utils.rs @@ -23,13 +23,13 @@ where use frame_support::traits::Get; use sp_runtime::{traits::AccountIdConversion, Perbill}; use zeitgeist_primitives::types::{ - BaseAsset, Deadlines, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, + Asset, Deadlines, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, ScoringRule, }; zeitgeist_primitives::types::Market { market_id: Default::default(), - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: Perbill::zero(), creator, diff --git a/zrml/parimutuel/src/weights.rs b/zrml/parimutuel/src/weights.rs index de83ae773..490bcdb54 100644 --- a/zrml/parimutuel/src/weights.rs +++ b/zrml/parimutuel/src/weights.rs @@ -52,8 +52,6 @@ pub trait WeightInfoZeitgeist { fn buy() -> Weight; fn claim_rewards() -> Weight; fn claim_refunds() -> Weight; - fn on_activation() -> Weight; - fn on_resolution() -> Weight; } /// Weight functions for zrml_parimutuel (automatically generated) @@ -63,97 +61,51 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:1 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:1 w:1) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) fn buy() -> Weight { // Proof Size summary in bytes: - // Measured: `1940` - // Estimated: `13590` - // Minimum execution time: 132_371 nanoseconds. - Weight::from_parts(162_240_000, 13590) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `1815` + // Estimated: `10876` + // Minimum execution time: 134_190 nanoseconds. + Weight::from_parts(155_681_000, 10876) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:1 w:1) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: MarketAssets Account (r:1 w:1) - /// Proof: MarketAssets Account (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Proof: MarketCommons Markets (max_values: None, max_size: Some(678), added: 3153, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:1 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) fn claim_rewards() -> Weight { // Proof Size summary in bytes: - // Measured: `3241` - // Estimated: `94450` - // Minimum execution time: 159_601 nanoseconds. - Weight::from_parts(222_111_000, 94450) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `2312` + // Estimated: `10876` + // Minimum execution time: 127_580 nanoseconds. + Weight::from_parts(180_511_000, 10876) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:1) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: MarketAssets Account (r:1 w:1) - /// Proof: MarketAssets Account (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) + /// Proof: MarketCommons Markets (max_values: None, max_size: Some(678), added: 3153, mode: MaxEncodedLen) + /// Storage: Tokens TotalIssuance (r:2 w:1) + /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: Tokens Accounts (r:1 w:1) + /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) fn claim_refunds() -> Weight { // Proof Size summary in bytes: - // Measured: `3544` - // Estimated: `97150` - // Minimum execution time: 193_471 nanoseconds. - Weight::from_parts(222_400_000, 97150) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:64 w:64) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - fn on_activation() -> Weight { - // Proof Size summary in bytes: - // Measured: `1203` - // Estimated: `175967` - // Minimum execution time: 592_941 nanoseconds. - Weight::from_parts(720_612_000, 175967) - .saturating_add(T::DbWeight::get().reads(65)) - .saturating_add(T::DbWeight::get().writes(64)) - } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:64 w:64) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:64 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) - fn on_resolution() -> Weight { - // Proof Size summary in bytes: - // Measured: `18393` - // Estimated: `417985` - // Minimum execution time: 1_162_074 nanoseconds. - Weight::from_parts(1_508_734_000, 417985) - .saturating_add(T::DbWeight::get().reads(131)) - .saturating_add(T::DbWeight::get().writes(65)) + // Measured: `2312` + // Estimated: `13394` + // Minimum execution time: 119_110 nanoseconds. + Weight::from_parts(132_660_000, 13394) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) } } diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index a2a8121cb..066928568 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -3,7 +3,6 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } orml-traits = { workspace = true } -pallet-assets = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } serde = { workspace = true, optional = true } @@ -30,7 +29,6 @@ pallet-treasury = { workspace = true, optional = true } sp-api = { workspace = true, optional = true } sp-io = { workspace = true, optional = true } xcm = { workspace = true, optional = true } -zrml-asset-router = { workspace = true, optional = true } zrml-prediction-markets-runtime-api = { workspace = true, optional = true } [dev-dependencies] @@ -41,12 +39,9 @@ zrml-prediction-markets = { workspace = true, features = ["mock", "default"] } [features] default = ["std"] mock = [ - "env_logger/default", - "orml-asset-registry/default", "orml-currencies/default", "orml-tokens/default", - "pallet-assets/default", - "pallet-balances/default", + "pallet-balances", "pallet-randomness-collective-flip/default", "pallet-timestamp/default", "pallet-treasury/default", @@ -54,9 +49,10 @@ mock = [ "sp-api/default", "sp-io/default", "zeitgeist-primitives/mock", - "zrml-asset-router/default", "zrml-prediction-markets-runtime-api/default", "xcm/default", + "orml-asset-registry/default", + "env_logger/default", ] parachain = [] runtime-benchmarks = [ @@ -64,7 +60,6 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "orml-asset-registry?/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "zeitgeist-primitives/mock", ] @@ -74,7 +69,6 @@ std = [ "frame-system/std", "orml-asset-registry?/std", "orml-traits/std", - "pallet-assets/std", "parity-scale-codec/std", 'scale-info/std', "serde?/std", diff --git a/zrml/prediction-markets/fuzz/pm_full_workflow.rs b/zrml/prediction-markets/fuzz/pm_full_workflow.rs index f3799a127..506b9e5cd 100644 --- a/zrml/prediction-markets/fuzz/pm_full_workflow.rs +++ b/zrml/prediction-markets/fuzz/pm_full_workflow.rs @@ -26,7 +26,7 @@ use sp_arithmetic::Perbill; use zeitgeist_primitives::{ constants::mock::MaxCreatorFee, types::{ - BaseAsset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketType, + Asset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketType, MultiHash, OutcomeReport, ScoringRule, }, }; @@ -48,7 +48,7 @@ fuzz_target!(|data: Data| { let fee = Perbill::from_parts(bounded_parts.try_into().unwrap()); let _ = PredictionMarkets::create_market( RuntimeOrigin::signed(data.create_scalar_market_origin.into()), - BaseAsset::Ztg, + Asset::Ztg, fee, data.create_scalar_market_oracle.into(), MarketPeriod::Block(data.create_scalar_market_period), diff --git a/zrml/prediction-markets/runtime-api/src/lib.rs b/zrml/prediction-markets/runtime-api/src/lib.rs index 4a488b52b..b90dcaac9 100644 --- a/zrml/prediction-markets/runtime-api/src/lib.rs +++ b/zrml/prediction-markets/runtime-api/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -19,12 +19,12 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] -use parity_scale_codec::{Codec, HasCompact, MaxEncodedLen}; +use parity_scale_codec::{Codec, MaxEncodedLen}; use zeitgeist_primitives::types::Asset; sp_api::decl_runtime_apis! { pub trait PredictionMarketsApi where - MarketId: Codec + HasCompact + MaxEncodedLen, + MarketId: Codec + MaxEncodedLen, Hash: Codec, { fn market_outcome_share_id(market_id: MarketId, outcome: u16) -> Asset; diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index 01903a795..61d18b4c1 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -46,8 +46,8 @@ use zeitgeist_primitives::{ math::fixed::{BaseProvider, ZeitgeistBase}, traits::DisputeApi, types::{ - Asset, BaseAsset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketPeriod, - MarketStatus, MarketType, MultiHash, OutcomeReport, ScoringRule, + Asset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, + MarketType, MultiHash, OutcomeReport, ScoringRule, }, }; use zrml_authorized::Pallet as AuthorizedPallet; @@ -97,7 +97,7 @@ fn create_market_common( let (caller, oracle, deadlines, metadata) = create_market_common_parameters::(dispute_mechanism.is_some())?; Call::::create_market { - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creator_fee, oracle, period, @@ -491,7 +491,7 @@ benchmarks! { } }: _( RawOrigin::Signed(caller), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), oracle, period, @@ -515,7 +515,7 @@ benchmarks! { let (caller, oracle, deadlines, metadata) = create_market_common_parameters::(true)?; Call::::create_market { - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creator_fee: Perbill::zero(), oracle: oracle.clone(), period: period.clone(), @@ -547,7 +547,7 @@ benchmarks! { }; }: _( RawOrigin::Signed(caller), - BaseAsset::Ztg, + Asset::Ztg, market_id, oracle, period, @@ -856,7 +856,7 @@ benchmarks! { let end: MomentOf = 1_000_000u64.saturated_into(); let (caller, oracle, _, metadata) = create_market_common_parameters::(false)?; Call::::create_market { - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creator_fee: Perbill::zero(), oracle: caller.clone(), period: MarketPeriod::Timestamp(start..end), @@ -1288,7 +1288,7 @@ benchmarks! { let m in 0..63; // Number of markets closing on the same block. let n in 2..T::MaxCategories::get() as u32; // Number of assets in the market. - let base_asset = BaseAsset::Ztg; + let base_asset = Asset::Ztg; let range_start = (5 * MILLISECS_PER_BLOCK) as u64; let range_end = (100 * MILLISECS_PER_BLOCK) as u64; let period = MarketPeriod::Timestamp(range_start..range_end); @@ -1298,7 +1298,7 @@ benchmarks! { let amount = (10u128 * BASE).saturated_into(); ::AssetManager::deposit( - base_asset.into(), + base_asset, &caller, amount, )?; diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index abefb9275..d9eef6771 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -35,7 +35,7 @@ pub use pallet::*; #[frame_support::pallet] mod pallet { use crate::weights::*; - use alloc::{collections::BTreeMap, format, vec, vec::Vec}; + use alloc::{format, vec, vec::Vec}; use core::{cmp, marker::PhantomData}; use frame_support::{ dispatch::{DispatchResultWithPostInfo, Pays, Weight}, @@ -44,22 +44,16 @@ mod pallet { require_transactional, storage::{with_transaction, TransactionOutcome}, traits::{ - fungibles::{Create, Inspect}, - tokens::BalanceStatus, - Currency, EnsureOrigin, Get, Hooks, Imbalance, IsType, NamedReservableCurrency, - OnUnbalanced, StorageVersion, + tokens::BalanceStatus, Currency, EnsureOrigin, Get, Hooks, Imbalance, IsType, + NamedReservableCurrency, OnUnbalanced, StorageVersion, }, transactional, Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; - use pallet_assets::ManagedDestroy; use sp_runtime::traits::AccountIdConversion; #[cfg(feature = "parachain")] - use { - orml_traits::asset_registry::Inspect as RegistryInspect, - zeitgeist_primitives::types::{CustomMetadata, XcmAsset}, - }; + use {orml_traits::asset_registry::Inspect, zeitgeist_primitives::types::CustomMetadata}; use orml_traits::{MultiCurrency, NamedMultiReservableCurrency}; use sp_arithmetic::per_things::{Perbill, Percent}; @@ -71,13 +65,13 @@ mod pallet { constants::MILLISECS_PER_BLOCK, traits::{ CompleteSetOperationsApi, DeployPoolApi, DisputeApi, DisputeMaxWeightApi, - DisputeResolutionApi, MarketBuilderTrait, MarketTransitionApi, + DisputeResolutionApi, MarketBuilderTrait, }, types::{ - Asset, BaseAsset, Bond, Deadlines, EarlyClose, EarlyCloseState, GlobalDisputeItem, - Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, - MarketStatus, MarketType, MultiHash, OutcomeReport, Report, ResultWithWeightInfo, - ScalarPosition, ScoringRule, + Asset, Bond, Deadlines, EarlyClose, EarlyCloseState, GlobalDisputeItem, Market, + MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, + MarketType, MultiHash, OutcomeReport, Report, ResultWithWeightInfo, ScalarPosition, + ScoringRule, }, }; use zrml_global_disputes::{types::InitialItem, GlobalDisputesPalletApi}; @@ -92,6 +86,7 @@ mod pallet { /// the automatic market openings and closings from a chain stall. /// Currently 10 blocks is 2 minutes (assuming block time is 12 seconds). pub(crate) const MAX_RECOVERY_TIME_FRAMES: TimeFrame = 10; + pub(crate) type AccountIdOf = ::AccountId; pub(crate) type AssetOf = Asset>; pub(crate) type BalanceOf = ::Balance; @@ -102,14 +97,8 @@ mod pallet { pub(crate) type InitialItemOf = InitialItem, BalanceOf>; pub(crate) type MarketBondsOf = MarketBonds, BalanceOf>; pub(crate) type MarketIdOf = ::MarketId; - pub(crate) type MarketOf = Market< - AccountIdOf, - BalanceOf, - BlockNumberOf, - MomentOf, - BaseAsset, - MarketIdOf, - >; + pub(crate) type MarketOf = + Market, BalanceOf, BlockNumberOf, MomentOf, MarketIdOf>; pub(crate) type MarketPeriodOf = MarketPeriod, MomentOf>; pub(crate) type MomentOf = <::Timestamp as frame_support::traits::Time>::Moment; @@ -449,27 +438,11 @@ mod pallet { Error::::MarketEditRequestAlreadyInProgress ); m.status = new_status; - - if m.is_redeemable() { - for outcome in m.outcome_assets() { - let admin = Self::market_account(market_id); - let is_sufficient = true; - let min_balance = 1u8; - T::AssetCreator::create( - outcome.into(), - admin, - is_sufficient, - min_balance.into(), - )?; - } - } - Ok(()) })?; Self::unreserve_creation_bond(&market_id)?; - T::OnStateTransition::on_activation(&market_id).result?; Self::deposit_event(Event::MarketApproved(market_id, new_status)); // The ApproveOrigin should not pay fees for providing this service let default_weight: Option = None; @@ -603,7 +576,6 @@ mod pallet { Ok(()) })?; - T::OnStateTransition::on_dispute(&market_id).result?; Self::deposit_event(Event::MarketDisputed(market_id, MarketStatus::Disputed, who)); Ok((Some(weight)).into()) } @@ -619,7 +591,7 @@ mod pallet { #[transactional] pub fn create_market( origin: OriginFor, - base_asset: BaseAsset, + base_asset: AssetOf, creator_fee: Perbill, oracle: T::AccountId, period: MarketPeriodOf, @@ -671,7 +643,7 @@ mod pallet { #[transactional] pub fn edit_market( origin: OriginFor, - base_asset: BaseAsset, + base_asset: AssetOf, market_id: MarketIdOf, oracle: T::AccountId, period: MarketPeriodOf, @@ -759,7 +731,7 @@ mod pallet { // Ensure the market account has enough to pay out - if this is // ever not true then we have an accounting problem. ensure!( - T::AssetManager::free_balance(market.base_asset.into(), &market_account) + T::AssetManager::free_balance(market.base_asset, &market_account) >= winning_balance, Error::::InsufficientFundsInMarketAccount, ); @@ -813,7 +785,7 @@ mod pallet { // Ensure the market account has enough to pay out - if this is // ever not true then we have an accounting problem. ensure!( - T::AssetManager::free_balance(market.base_asset.into(), &market_account) + T::AssetManager::free_balance(market.base_asset, &market_account) >= long_payout.saturating_add(short_payout), Error::::InsufficientFundsInMarketAccount, ); @@ -839,25 +811,18 @@ mod pallet { // Pay out the winner. let remaining_bal = - T::AssetManager::free_balance(market.base_asset.into(), &market_account); + T::AssetManager::free_balance(market.base_asset, &market_account); let actual_payout = payout.min(remaining_bal); T::AssetManager::transfer( - market.base_asset.into(), + market.base_asset, &market_account, &sender, actual_payout, )?; - // The if-check prevents scalar markets to emit events even if sender only owns one // of the outcome tokens. if balance != BalanceOf::::zero() { - if T::AssetManager::total_issuance(currency_id).is_zero() { - // Ensure managed_destroy does not error during lazy migration because - // it tried to delete an old outcome asset from orml-tokens - let _ = T::AssetDestroyer::managed_destroy(currency_id, None); - } - Self::deposit_event(Event::TokensRedeemed( market_id, currency_id, @@ -1066,7 +1031,6 @@ mod pallet { m.status = MarketStatus::Disputed; Ok(()) })?; - T::OnStateTransition::on_dispute(&market_id).result?; } // global disputes uses DisputeResolution API to control its resolution @@ -1094,7 +1058,7 @@ mod pallet { #[pallet::call_index(17)] pub fn create_market_and_deploy_pool( origin: OriginFor, - base_asset: BaseAsset, + base_asset: AssetOf, creator_fee: Perbill, oracle: T::AccountId, period: MarketPeriodOf, @@ -1547,15 +1511,8 @@ mod pallet { /// The origin that is allowed to approve / reject pending advised markets. type ApproveOrigin: EnsureOrigin; - /// The module handling the creation of market assets. - type AssetCreator: Create, Balance = BalanceOf>; - - /// The module handling the destruction of market assets. - type AssetDestroyer: ManagedDestroy, Balance = BalanceOf>; - - /// The module managing collateral and market assets. - type AssetManager: MultiCurrency, CurrencyId = AssetOf> - + NamedMultiReservableCurrency< + /// Shares of outcome assets and native currency + type AssetManager: NamedMultiReservableCurrency< Self::AccountId, Balance = BalanceOf, CurrencyId = AssetOf, @@ -1563,8 +1520,8 @@ mod pallet { >; #[cfg(feature = "parachain")] - type AssetRegistry: RegistryInspect< - AssetId = XcmAsset, + type AssetRegistry: Inspect< + AssetId = Asset>, Balance = BalanceOf, CustomMetadata = CustomMetadata, >; @@ -1725,9 +1682,6 @@ mod pallet { /// The origin that is allowed to reject pending advised markets. type RejectOrigin: EnsureOrigin; - /// Additional handler during state transitions. - type OnStateTransition: MarketTransitionApi>; - /// The base amount of currency that must be bonded to ensure the oracle reports /// in a timely manner. #[pallet::constant] @@ -1946,6 +1900,7 @@ mod pallet { #[pallet::hooks] impl Hooks for Pallet { + // TODO(#792): Remove outcome assets for accounts! Delete "resolved" assets of `orml_tokens` with storage migration. fn on_initialize(now: T::BlockNumber) -> Weight { let mut total_weight: Weight = Weight::zero(); @@ -2118,7 +2073,7 @@ mod pallet { #[require_transactional] fn do_create_market( who: T::AccountId, - base_asset: BaseAsset, + base_asset: AssetOf, creator_fee: Perbill, oracle: T::AccountId, period: MarketPeriodOf, @@ -2170,33 +2125,32 @@ mod pallet { let (market_id, market) = >::build_market(market_builder)?; let market_account = Self::market_account(market_id); - match market.status { - MarketStatus::Active => { - if market.is_redeemable() { - for outcome in market.outcome_assets() { - let admin = market_account.clone(); - let is_sufficient = true; - let min_balance = 1u8; - T::AssetCreator::create( - outcome.into(), - admin, - is_sufficient, - min_balance.into(), - )?; - } - } - - T::OnStateTransition::on_activation(&market_id).result? - } - MarketStatus::Proposed => T::OnStateTransition::on_proposal(&market_id).result?, - _ => (), - } let ids_amount: u32 = Self::insert_auto_close(&market_id)?; + Self::deposit_event(Event::MarketCreated(market_id, market_account, market)); + Ok((ids_amount, market_id)) } + pub fn outcome_assets(market_id: MarketIdOf, market: &MarketOf) -> Vec> { + match market.market_type { + MarketType::Categorical(categories) => { + let mut assets = Vec::new(); + for i in 0..categories { + assets.push(Asset::CategoricalOutcome(market_id, i)); + } + assets + } + MarketType::Scalar(_) => { + vec![ + Asset::ScalarOutcome(market_id, ScalarPosition::Long), + Asset::ScalarOutcome(market_id, ScalarPosition::Short), + ] + } + } + } + fn insert_auto_close(market_id: &MarketIdOf) -> Result { let market = >::market(market_id)?; @@ -2311,7 +2265,7 @@ mod pallet { let market_account = Self::market_account(market_id); ensure!( - T::AssetManager::free_balance(market.base_asset.into(), &market_account) >= amount, + T::AssetManager::free_balance(market.base_asset, &market_account) >= amount, "Market account does not have sufficient reserves.", ); @@ -2322,14 +2276,14 @@ mod pallet { // Ensures that the sender has sufficient amount of each // share in the set. ensure!( - T::AssetManager::free_balance((*asset).into(), &who) >= amount, + T::AssetManager::free_balance(*asset, &who) >= amount, Error::::InsufficientShareBalance, ); } // write last. for asset in assets.iter() { - let missing = T::AssetManager::slash((*asset).into(), &who, amount); + let missing = T::AssetManager::slash(*asset, &who, amount); debug_assert!( missing.is_zero(), "Could not slash all of the amount. asset {:?}, who: {:?}, amount: {:?}.", @@ -2339,7 +2293,7 @@ mod pallet { ); } - T::AssetManager::transfer(market.base_asset.into(), &market_account, &who, amount)?; + T::AssetManager::transfer(market.base_asset, &market_account, &who, amount)?; Self::deposit_event(Event::SoldCompleteSet(market_id, amount, who)); @@ -2355,18 +2309,18 @@ mod pallet { ensure!(amount != BalanceOf::::zero(), Error::::ZeroAmount); let market = >::market(&market_id)?; ensure!( - T::AssetManager::free_balance(market.base_asset.into(), &who) >= amount, + T::AssetManager::free_balance(market.base_asset, &who) >= amount, Error::::NotEnoughBalance ); ensure!(market.is_redeemable(), Error::::InvalidScoringRule); Self::ensure_market_is_active(&market)?; let market_account = Self::market_account(market_id); - T::AssetManager::transfer(market.base_asset.into(), &who, &market_account, amount)?; + T::AssetManager::transfer(market.base_asset, &who, &market_account, amount)?; let assets = market.outcome_assets(); for asset in assets.iter() { - T::AssetManager::deposit((*asset).into(), &who, amount)?; + T::AssetManager::deposit(*asset, &who, amount)?; } Self::deposit_event(Event::BoughtCompleteSet(market_id, amount, who)); @@ -2549,12 +2503,9 @@ mod pallet { market.status = MarketStatus::Closed; Ok(()) })?; - - let mut total_weight = T::DbWeight::get().reads_writes(1, 2); - let on_state_transition_result = T::OnStateTransition::on_closure(market_id); - on_state_transition_result.result?; - total_weight = total_weight.saturating_add(on_state_transition_result.weight); + let mut total_weight = T::DbWeight::get().reads_writes(1, 1); Self::deposit_event(Event::MarketClosed(*market_id)); + total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); Ok(total_weight) } @@ -2799,44 +2750,20 @@ mod pallet { // Following call should return weight consumed by it. T::LiquidityMining::distribute_market_incentives(market_id)?; - let mut updated_market = market.clone(); - + // NOTE: Currently we don't clean up outcome assets. + // TODO(#792): Remove outcome assets for accounts! Delete "resolved" assets of `orml_tokens` with storage migration. >::mutate_market(market_id, |m| { m.status = MarketStatus::Resolved; m.resolved_outcome = Some(resolved_outcome.clone()); - updated_market = m.clone(); Ok(()) })?; - let winning_outcome = updated_market.resolved_outcome_into_asset(); - if market.is_redeemable() { - if let Some(winning_outcome_inner) = winning_outcome { - // Destroy losing assets. - let assets_to_destroy = BTreeMap::, Option>::from_iter( - market - .outcome_assets() - .into_iter() - .filter(|outcome| *outcome != winning_outcome_inner) - .map(|asset| (AssetOf::::from(asset), None)), - ); - // Ensure managed_destroy_multi does not error during lazy migration because - // it tried to delete an old outcome asset from orml-tokens - let _ = T::AssetDestroyer::managed_destroy_multi(assets_to_destroy); - } - } - - let on_state_transition_result = T::OnStateTransition::on_resolution(market_id); - on_state_transition_result.result?; - total_weight = total_weight.saturating_add(on_state_transition_result.weight); - total_weight = - total_weight.saturating_add(Self::calculate_internal_resolve_weight(market)); - Self::deposit_event(Event::MarketResolved( *market_id, MarketStatus::Resolved, resolved_outcome, )); - Ok(total_weight) + Ok(total_weight.saturating_add(Self::calculate_internal_resolve_weight(market))) } /// The reserve ID of the prediction-markets pallet. @@ -2940,7 +2867,7 @@ mod pallet { fn construct_market( market_id: Option>, - base_asset: BaseAsset, + base_asset: AssetOf, creator: T::AccountId, creator_fee: Perbill, oracle: T::AccountId, @@ -2956,21 +2883,16 @@ mod pallet { bonds: MarketBondsOf, ) -> Result, DispatchError> { let valid_base_asset = match base_asset { - BaseAsset::CampaignAsset(idx) => { - T::AssetCreator::asset_exists(BaseAsset::CampaignAsset(idx).into()) - } - BaseAsset::Ztg => true, + Asset::Ztg => true, #[cfg(feature = "parachain")] - BaseAsset::ForeignAsset(id) => { - if let Some(metadata) = T::AssetRegistry::metadata(&XcmAsset::ForeignAsset(id)) - { + Asset::ForeignAsset(fa) => { + if let Some(metadata) = T::AssetRegistry::metadata(&Asset::ForeignAsset(fa)) { metadata.additional.allow_as_base_asset } else { return Err(Error::::UnregisteredForeignAsset.into()); } } - #[cfg(not(feature = "parachain"))] - BaseAsset::ForeignAsset(_) => false, + _ => false, }; ensure!(creator_fee <= T::MaxCreatorFee::get(), Error::::FeeTooHigh); @@ -3074,7 +2996,6 @@ mod pallet { Ok(()) })?; - T::OnStateTransition::on_report(&market_id).result?; let market = >::market(&market_id)?; let block_after_dispute_duration = report.at.saturating_add(market.deadlines.dispute_duration); @@ -3101,7 +3022,6 @@ mod pallet { market.status = MarketStatus::Reported; Ok(()) })?; - T::OnStateTransition::on_report(&market_id).result?; let market = >::market(&market_id)?; Self::on_resolution(&market_id, &market)?; Ok(Some(T::WeightInfo::report_trusted_market()).into()) diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index 392a7d2df..f371ebf0b 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -24,61 +24,43 @@ use crate as prediction_markets; use frame_support::{ - construct_runtime, ord_parameter_types, - pallet_prelude::Weight, - parameter_types, - storage::unhashed::put, - traits::{ - AsEnsureOriginWithArg, Everything, GenesisBuild, NeverEnsureOrigin, OnFinalize, OnIdle, - OnInitialize, - }, + construct_runtime, ord_parameter_types, parameter_types, + traits::{Everything, NeverEnsureOrigin, OnFinalize, OnInitialize}, }; -use frame_system::{EnsureRoot, EnsureSigned, EnsureSignedBy}; -use parity_scale_codec::Compact; +use frame_system::{EnsureRoot, EnsureSignedBy}; +#[cfg(feature = "parachain")] +use orml_asset_registry::AssetMetadata; use sp_arithmetic::per_things::Percent; use sp_runtime::{ testing::Header, - traits::{BlakeTwo256, ConstU32, IdentityLookup}, + traits::{BlakeTwo256, IdentityLookup}, DispatchError, DispatchResult, }; use std::cell::RefCell; use zeitgeist_primitives::{ constants::mock::{ - AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AssetsAccountDeposit, - AssetsApprovalDeposit, AssetsDeposit, AssetsMetadataDepositBase, - AssetsMetadataDepositPerByte, AssetsStringLimit, AuthorizedPalletId, BlockHashCount, - BlocksPerYear, CloseEarlyBlockPeriod, CloseEarlyDisputeBond, + AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AuthorizedPalletId, + BlockHashCount, BlocksPerYear, CloseEarlyBlockPeriod, CloseEarlyDisputeBond, CloseEarlyProtectionBlockPeriod, CloseEarlyProtectionTimeFramePeriod, CloseEarlyRequestBond, CloseEarlyTimeFramePeriod, CorrectionPeriod, CourtPalletId, - DestroyAccountWeight, DestroyApprovalWeight, DestroyFinishWeight, ExistentialDeposit, - ExistentialDeposits, GdVotingPeriod, GetNativeCurrencyId, GlobalDisputeLockId, - GlobalDisputesPalletId, InflationPeriod, LiquidityMiningPalletId, LockId, MaxAppeals, - MaxApprovals, MaxCategories, MaxCourtParticipants, MaxCreatorFee, MaxDelegations, - MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGlobalDisputeVotes, MaxGracePeriod, - MaxMarketLifetime, MaxOracleDuration, MaxOwners, MaxRejectReasonLen, MaxReserves, - MaxSelectedDraws, MaxYearlyInflation, MinCategories, MinDisputeDuration, MinJurorStake, - MinOracleDuration, MinOutcomeVoteAmount, MinimumPeriod, OutcomeBond, OutcomeFactor, - OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval, SimpleDisputesPalletId, - TreasuryPalletId, VotePeriod, VotingOutcomeFee, BASE, CENT, MILLISECS_PER_BLOCK, + ExistentialDeposit, ExistentialDeposits, GdVotingPeriod, GetNativeCurrencyId, + GlobalDisputeLockId, GlobalDisputesPalletId, InflationPeriod, LiquidityMiningPalletId, + LockId, MaxAppeals, MaxApprovals, MaxCategories, MaxCourtParticipants, MaxCreatorFee, + MaxDelegations, MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGlobalDisputeVotes, + MaxGracePeriod, MaxMarketLifetime, MaxOracleDuration, MaxOwners, MaxRejectReasonLen, + MaxReserves, MaxSelectedDraws, MaxYearlyInflation, MinCategories, MinDisputeDuration, + MinJurorStake, MinOracleDuration, MinOutcomeVoteAmount, MinimumPeriod, OutcomeBond, + OutcomeFactor, OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval, + SimpleDisputesPalletId, TreasuryPalletId, VotePeriod, VotingOutcomeFee, BASE, CENT, + MILLISECS_PER_BLOCK, }, - traits::{DeployPoolApi, MarketTransitionApi}, + traits::DeployPoolApi, types::{ - AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, - CampaignAsset, CampaignAssetClass, CampaignAssetId, Currencies, CustomAsset, CustomAssetId, - Hash, Index, MarketAsset, MarketId, Moment, ResultWithWeightInfo, UncheckedExtrinsicTest, + AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, + CurrencyId, Hash, Index, MarketId, Moment, SerdeWrapper, UncheckedExtrinsicTest, }, }; -#[cfg(feature = "parachain")] -use {orml_asset_registry::AssetMetadata, zeitgeist_primitives::types::XcmAsset}; - -pub(super) const ON_PROPOSAL_STORAGE: [u8; 4] = [0x09, 0x09, 0x00, 0x00]; -pub(super) const ON_ACTIVATION_STORAGE: [u8; 4] = [0x09, 0x09, 0x00, 0x01]; -pub(super) const ON_CLOSURE_STORAGE: [u8; 4] = [0x09, 0x09, 0x00, 0x02]; -pub(super) const ON_REPORT_STORAGE: [u8; 4] = [0x09, 0x09, 0x00, 0x03]; -pub(super) const ON_DISPUTE_STORAGE: [u8; 4] = [0x09, 0x09, 0x00, 0x04]; -pub(super) const ON_RESOLUTION_STORAGE: [u8; 4] = [0x09, 0x09, 0x00, 0x05]; - pub const ALICE: AccountIdTest = 0; pub const BOB: AccountIdTest = 1; pub const CHARLIE: AccountIdTest = 2; @@ -108,36 +90,6 @@ pub struct DeployPoolArgs { swap_fee: Balance, } -// It just writes true to specific memory locations depending on the hook that's invoked. -pub struct StateTransitionMock; - -impl MarketTransitionApi for StateTransitionMock { - fn on_proposal(_market_id: &MarketId) -> ResultWithWeightInfo { - put(&ON_PROPOSAL_STORAGE, &true); - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_activation(_market_id: &MarketId) -> ResultWithWeightInfo { - put(&ON_ACTIVATION_STORAGE, &true); - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_closure(_market_id: &MarketId) -> ResultWithWeightInfo { - put(&ON_CLOSURE_STORAGE, &true); - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_report(_market_id: &MarketId) -> ResultWithWeightInfo { - put(&ON_REPORT_STORAGE, &true); - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_dispute(_market_id: &MarketId) -> ResultWithWeightInfo { - put(&ON_DISPUTE_STORAGE, &true); - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } - fn on_resolution(_market_id: &MarketId) -> ResultWithWeightInfo { - put(&ON_RESOLUTION_STORAGE, &true); - ResultWithWeightInfo::new(Ok(()), Weight::zero()) - } -} - thread_local! { pub static DEPLOY_POOL_CALL_DATA: RefCell> = const { RefCell::new(vec![]) }; pub static DEPLOY_POOL_RETURN_VALUE: RefCell = const { RefCell::new(Ok(())) }; @@ -212,10 +164,6 @@ parameter_types! { pub const DisputeBond: Balance = 109 * CENT; } -type CustomAssetsInstance = pallet_assets::Instance1; -type CampaignAssetsInstance = pallet_assets::Instance2; -type MarketAssetsInstance = pallet_assets::Instance3; - construct_runtime!( pub enum Runtime where @@ -223,15 +171,11 @@ construct_runtime!( NodeBlock = BlockTest, UncheckedExtrinsic = UncheckedExtrinsicTest, { - AssetRouter: zrml_asset_router::{Pallet}, Authorized: zrml_authorized::{Event, Pallet, Storage}, Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - CampaignAssets: pallet_assets::::{Call, Pallet, Storage, Event}, - CustomAssets: pallet_assets::::{Call, Pallet, Storage, Event}, Court: zrml_court::{Event, Pallet, Storage}, AssetManager: orml_currencies::{Call, Pallet, Storage}, LiquidityMining: zrml_liquidity_mining::{Config, Event, Pallet}, - MarketAssets: pallet_assets::::{Call, Pallet, Storage, Event}, MarketCommons: zrml_market_commons::{Pallet, Storage}, PredictionMarkets: prediction_markets::{Event, Pallet, Storage}, RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, @@ -248,9 +192,6 @@ impl crate::Config for Runtime { type AdvisoryBond = AdvisoryBond; type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; type ApproveOrigin = EnsureSignedBy; - type AssetCreator = AssetRouter; - type AssetDestroyer = AssetRouter; - type AssetManager = AssetManager; #[cfg(feature = "parachain")] type AssetRegistry = MockRegistry; type Authorized = Authorized; @@ -279,7 +220,6 @@ impl crate::Config for Runtime { type MinCategories = MinCategories; type MaxEditReasonLen = MaxEditReasonLen; type MaxRejectReasonLen = MaxRejectReasonLen; - type OnStateTransition = (StateTransitionMock,); type OracleBond = OracleBond; type OutsiderBond = OutsiderBond; type PalletId = PmPalletId; @@ -288,6 +228,7 @@ impl crate::Config for Runtime { type RejectOrigin = EnsureSignedBy; type RequestEditOrigin = EnsureSignedBy; type ResolveOrigin = EnsureSignedBy; + type AssetManager = AssetManager; type SimpleDisputes = SimpleDisputes; type Slash = Treasury; type ValidityBond = ValidityBond; @@ -323,7 +264,7 @@ impl frame_system::Config for Runtime { impl orml_currencies::Config for Runtime { type GetNativeCurrencyId = GetNativeCurrencyId; - type MultiCurrency = AssetRouter; + type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; type WeightInfo = (); } @@ -331,7 +272,7 @@ impl orml_currencies::Config for Runtime { impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; - type CurrencyId = Currencies; + type CurrencyId = CurrencyId; type DustRemovalWhitelist = Everything; type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; @@ -345,7 +286,7 @@ impl orml_tokens::Config for Runtime { #[cfg(feature = "parachain")] crate::orml_asset_registry::impl_mock_registry! { MockRegistry, - XcmAsset, + CurrencyId, Balance, zeitgeist_primitives::types::CustomMetadata } @@ -375,122 +316,6 @@ ord_parameter_types! { pub const AuthorizedDisputeResolutionUser: AccountIdTest = ALICE; } -pallet_assets::runtime_benchmarks_enabled! { - pub struct AssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for AssetsBenchmarkHelper - where - AssetIdParameter: From, - { - fn create_asset_id_parameter(id: u32) -> AssetIdParameter { - (id as u128).into() - } - } -} - -pallet_assets::runtime_benchmarks_enabled! { - use zeitgeist_primitives::types::CategoryIndex; - - pub struct MarketAssetsBenchmarkHelper; - - impl pallet_assets::BenchmarkHelper - for MarketAssetsBenchmarkHelper - { - fn create_asset_id_parameter(id: u32) -> MarketAsset { - MarketAsset::CategoricalOutcome(0, id as CategoryIndex) - } - } -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CampaignAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = CustomAsset; - type AssetIdParameter = Compact; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = AssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl pallet_assets::Config for Runtime { - type ApprovalDeposit = AssetsApprovalDeposit; - type AssetAccountDeposit = AssetsAccountDeposit; - type AssetDeposit = AssetsDeposit; - type AssetId = MarketAsset; - type AssetIdParameter = MarketAsset; - type Balance = Balance; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = MarketAssetsBenchmarkHelper; - type CallbackHandle = (); - type CreateOrigin = AsEnsureOriginWithArg>; - type Currency = Balances; - type Extra = (); - type ForceOrigin = EnsureRoot; - type Freezer = (); - type Destroyer = AssetRouter; - type MetadataDepositBase = AssetsMetadataDepositBase; - type MetadataDepositPerByte = AssetsMetadataDepositPerByte; - type RemoveItemsLimit = ConstU32<50>; - type RuntimeEvent = RuntimeEvent; - type StringLimit = AssetsStringLimit; - type WeightInfo = (); -} - -impl zrml_asset_router::Config for Runtime { - type AssetType = Assets; - type Balance = Balance; - type CurrencyType = Currencies; - type Currencies = Tokens; - type CampaignAssetType = CampaignAsset; - type CampaignAssets = CampaignAssets; - type CustomAssetType = CustomAsset; - type CustomAssets = CustomAssets; - type DestroyAccountWeight = DestroyAccountWeight; - type DestroyApprovalWeight = DestroyApprovalWeight; - type DestroyFinishWeight = DestroyFinishWeight; - type MarketAssetType = MarketAsset; - type MarketAssets = MarketAssets; -} - impl zrml_authorized::Config for Runtime { type AuthorizedDisputeResolutionOrigin = EnsureSignedBy; @@ -621,42 +446,29 @@ impl ExtBuilder { // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); - pallet_assets::GenesisConfig:: { - assets: vec![(CampaignAssetClass(100), ALICE, true, 1)], - metadata: vec![], - accounts: self - .balances - .iter() - .map(|(account, balance)| (CampaignAssetClass(100), *account, *balance)) - .collect(), - } - .assimilate_storage(&mut t) - .unwrap(); - pallet_balances::GenesisConfig:: { balances: self.balances } .assimilate_storage(&mut t) .unwrap(); - + #[cfg(feature = "parachain")] + use frame_support::traits::GenesisBuild; #[cfg(feature = "parachain")] orml_tokens::GenesisConfig:: { balances: (0..69) - .map(|idx| (idx, Currencies::ForeignAsset(100), INITIAL_BALANCE)) + .map(|idx| (idx, CurrencyId::ForeignAsset(100), INITIAL_BALANCE)) .collect(), } .assimilate_storage(&mut t) .unwrap(); - #[cfg(feature = "parachain")] let custom_metadata = zeitgeist_primitives::types::CustomMetadata { allow_as_base_asset: true, ..Default::default() }; - #[cfg(feature = "parachain")] orml_asset_registry_mock::GenesisConfig { metadata: vec![ ( - XcmAsset::ForeignAsset(100), + CurrencyId::ForeignAsset(100), AssetMetadata { decimals: 18, name: "ACALA USD".as_bytes().to_vec(), @@ -667,7 +479,7 @@ impl ExtBuilder { }, ), ( - XcmAsset::ForeignAsset(420), + CurrencyId::ForeignAsset(420), AssetMetadata { decimals: 18, name: "FANCY_TOKEN".as_bytes().to_vec(), @@ -699,7 +511,6 @@ pub fn run_to_block(n: BlockNumber) { PredictionMarkets::on_initialize(System::block_number()); Court::on_initialize(System::block_number()); Balances::on_initialize(System::block_number()); - AssetRouter::on_idle(System::block_number(), Weight::MAX); } } @@ -716,8 +527,8 @@ pub fn set_timestamp_for_on_initialize(time: Moment) { sp_api::mock_impl_runtime_apis! { impl zrml_prediction_markets_runtime_api::PredictionMarketsApi, MarketId, Hash> for Runtime { - fn market_outcome_share_id(_: MarketId, _: u16) -> Assets { - Assets::PoolShare(1) + fn market_outcome_share_id(_: MarketId, _: u16) -> Asset { + Asset::PoolShare(SerdeWrapper(1)) } } } diff --git a/zrml/prediction-markets/src/tests/admin_move_market_to_closed.rs b/zrml/prediction-markets/src/tests/admin_move_market_to_closed.rs index 90896a335..5417f1e6a 100644 --- a/zrml/prediction-markets/src/tests/admin_move_market_to_closed.rs +++ b/zrml/prediction-markets/src/tests/admin_move_market_to_closed.rs @@ -28,7 +28,7 @@ fn admin_move_market_to_closed_successfully_closes_market_and_sets_end_blocknumb let now = frame_system::Pallet::::block_number(); let end = 42; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, now..end, ScoringRule::AmmCdaHybrid, @@ -59,7 +59,7 @@ fn admin_move_market_to_closed_successfully_closes_market_and_sets_end_timestamp let end = start + 42u64 * (MILLISECS_PER_BLOCK as u64); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(start..end), @@ -114,7 +114,7 @@ fn admin_move_market_to_closed_fails_if_market_does_not_exist() { fn admin_move_market_to_closed_fails_if_market_is_not_active(market_status: MarketStatus) { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..2, ScoringRule::AmmCdaHybrid, @@ -140,7 +140,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_close_blocks() { let category_count = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Block(22..66), @@ -153,7 +153,7 @@ fn admin_move_market_to_closed_correctly_clears_auto_close_blocks() { )); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Block(33..66), diff --git a/zrml/prediction-markets/src/tests/admin_move_market_to_resolved.rs b/zrml/prediction-markets/src/tests/admin_move_market_to_resolved.rs index 9835169eb..6a6f9759e 100644 --- a/zrml/prediction-markets/src/tests/admin_move_market_to_resolved.rs +++ b/zrml/prediction-markets/src/tests/admin_move_market_to_resolved.rs @@ -24,7 +24,7 @@ use zeitgeist_primitives::types::OutcomeReport; #[test] fn admin_move_market_to_resolved_resolves_reported_market() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { let end = 33; simple_create_categorical_market( base_asset, @@ -83,21 +83,18 @@ fn admin_move_market_to_resolved_resolves_reported_market() { ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test] fn admin_move_market_to_resolved_resolves_disputed_market() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { let end = 33; simple_create_categorical_market( base_asset, @@ -159,11 +156,11 @@ fn admin_move_market_to_resolved_resolves_disputed_market() { ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -175,7 +172,7 @@ fn admin_move_market_to_resolved_fails_if_market_is_not_reported_or_disputed( ) { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..33, ScoringRule::AmmCdaHybrid, diff --git a/zrml/prediction-markets/src/tests/approve_market.rs b/zrml/prediction-markets/src/tests/approve_market.rs index 6eabd8566..6405e59db 100644 --- a/zrml/prediction-markets/src/tests/approve_market.rs +++ b/zrml/prediction-markets/src/tests/approve_market.rs @@ -30,7 +30,7 @@ use sp_runtime::DispatchError; fn fails_if_market_status_is_not_proposed(market_status: MarketStatus) { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, @@ -54,7 +54,7 @@ fn fails_if_market_status_is_not_proposed(market_status: MarketStatus) { fn it_allows_advisory_origin_to_approve_markets() { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, @@ -84,7 +84,7 @@ fn market_with_edit_request_cannot_be_approved() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, @@ -113,7 +113,7 @@ fn market_with_edit_request_cannot_be_approved() { #[test] fn approve_market_correctly_unreserves_advisory_bond() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), @@ -141,31 +141,10 @@ fn approve_market_correctly_unreserves_advisory_bond() { assert!(market.bonds.creation.unwrap().is_settled); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); - }); -} - -#[test] -fn does_trigger_market_transition_api() { - ExtBuilder::default().build().execute_with(|| { - StateTransitionMock::ensure_empty_state(); - simple_create_categorical_market( - BaseAsset::Ztg, - MarketCreation::Advised, - 1..2, - ScoringRule::AmmCdaHybrid, - ); - assert_ok!(PredictionMarkets::approve_market( - RuntimeOrigin::signed(ApproveOrigin::get()), - 0 - )); - assert!(StateTransitionMock::on_activation_triggered()); + test(Asset::ForeignAsset(100)); }); } diff --git a/zrml/prediction-markets/src/tests/buy_complete_set.rs b/zrml/prediction-markets/src/tests/buy_complete_set.rs index 68b551cd1..71f51caa0 100644 --- a/zrml/prediction-markets/src/tests/buy_complete_set.rs +++ b/zrml/prediction-markets/src/tests/buy_complete_set.rs @@ -21,7 +21,7 @@ use test_case::test_case; #[test] fn buy_complete_set_works() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { simple_create_categorical_market( base_asset, MarketCreation::Permissionless, @@ -42,27 +42,24 @@ fn buy_complete_set_works() { let assets = market.outcome_assets(); for asset in assets.iter() { - let bal = AssetManager::free_balance((*asset).into(), &who); + let bal = Tokens::free_balance(*asset, &who); assert_eq!(bal, amount); } - let bal = AssetManager::free_balance(base_asset.into(), &who); + let bal = AssetManager::free_balance(base_asset, &who); assert_eq!(bal, 1_000 * BASE - amount); let market_account = PredictionMarkets::market_account(market_id); - let market_bal = AssetManager::free_balance(base_asset.into(), &market_account); + let market_bal = AssetManager::free_balance(base_asset, &market_account); assert_eq!(market_bal, amount); System::assert_last_event(Event::BoughtCompleteSet(market_id, amount, who).into()); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -70,7 +67,7 @@ fn buy_complete_set_works() { fn buy_complete_fails_on_zero_amount() { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..2, ScoringRule::AmmCdaHybrid, @@ -84,7 +81,7 @@ fn buy_complete_fails_on_zero_amount() { #[test] fn buy_complete_set_fails_on_insufficient_balance() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { simple_create_categorical_market( base_asset, MarketCreation::Permissionless, @@ -97,14 +94,11 @@ fn buy_complete_set_fails_on_insufficient_balance() { ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -116,7 +110,7 @@ fn buy_complete_set_fails_on_insufficient_balance() { fn buy_complete_set_fails_if_market_is_not_active(status: MarketStatus) { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..2, ScoringRule::AmmCdaHybrid, @@ -137,7 +131,7 @@ fn buy_complete_set_fails_if_market_is_not_active(status: MarketStatus) { fn buy_complete_set_fails_if_market_has_wrong_scoring_rule(scoring_rule: ScoringRule) { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..2, scoring_rule, diff --git a/zrml/prediction-markets/src/tests/close_market.rs b/zrml/prediction-markets/src/tests/close_trusted_market.rs similarity index 91% rename from zrml/prediction-markets/src/tests/close_market.rs rename to zrml/prediction-markets/src/tests/close_trusted_market.rs index 2fc116d0a..bdd5537b8 100644 --- a/zrml/prediction-markets/src/tests/close_market.rs +++ b/zrml/prediction-markets/src/tests/close_trusted_market.rs @@ -30,7 +30,7 @@ fn close_trusted_market_works() { let market_creator = ALICE; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(market_creator), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -80,7 +80,7 @@ fn fails_if_caller_is_not_market_creator() { let market_creator = ALICE; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(market_creator), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -110,7 +110,7 @@ fn close_trusted_market_fails_if_not_trusted() { let market_creator = ALICE; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(market_creator), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -156,7 +156,7 @@ fn close_trusted_market_fails_if_invalid_market_state(status: MarketStatus) { let market_creator = ALICE; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(market_creator), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -197,18 +197,3 @@ fn fails_if_market_is_not_found() { ); }); } - -#[test] -fn does_trigger_market_transition_api_permissionless() { - ExtBuilder::default().build().execute_with(|| { - StateTransitionMock::ensure_empty_state(); - simple_create_categorical_market( - BaseAsset::Ztg, - MarketCreation::Permissionless, - 1..2, - ScoringRule::AmmCdaHybrid, - ); - assert_ok!(PredictionMarkets::close_market(&0)); - assert!(StateTransitionMock::on_closure_triggered()); - }); -} diff --git a/zrml/prediction-markets/src/tests/create_market.rs b/zrml/prediction-markets/src/tests/create_market.rs index bb2baf79d..2dd3c407c 100644 --- a/zrml/prediction-markets/src/tests/create_market.rs +++ b/zrml/prediction-markets/src/tests/create_market.rs @@ -44,7 +44,7 @@ fn fails_if_user_cannot_afford_bonds_advised( assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(creator), - BaseAsset::Ztg, + Asset::Ztg, ::MaxCreatorFee::get(), BOB, MarketPeriod::Block(123..456), @@ -67,7 +67,7 @@ fn fails_on_fee_too_high() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, ::MaxCreatorFee::get() + one_billionth, BOB, MarketPeriod::Block(123..456), @@ -93,7 +93,7 @@ fn fails_on_invalid_multihash() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, ::MaxCreatorFee::get(), BOB, MarketPeriod::Block(123..456), @@ -116,7 +116,7 @@ fn create_scalar_market_fails_on_invalid_range(range: RangeInclusive) { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -143,7 +143,7 @@ fn create_market_fails_on_min_dispute_period() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -170,7 +170,7 @@ fn create_market_fails_on_min_oracle_duration() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -197,7 +197,7 @@ fn create_market_fails_on_max_dispute_period() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -224,7 +224,7 @@ fn create_market_fails_on_max_grace_period() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -251,7 +251,7 @@ fn create_market_fails_on_max_oracle_duration() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -283,7 +283,7 @@ fn create_market_with_foreign_assets() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::ForeignAsset(420), + Asset::ForeignAsset(420), Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -300,7 +300,7 @@ fn create_market_with_foreign_assets() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::ForeignAsset(50), + Asset::ForeignAsset(50), Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -316,7 +316,7 @@ fn create_market_with_foreign_assets() { // As per Mock asset_registry genesis ForeignAsset(100) has allow_as_base_asset set to true. assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::ForeignAsset(100), + Asset::ForeignAsset(100), Perbill::zero(), BOB, MarketPeriod::Block(123..456), @@ -328,7 +328,7 @@ fn create_market_with_foreign_assets() { ScoringRule::AmmCdaHybrid, )); let market = MarketCommons::market(&0).unwrap(); - assert_eq!(market.base_asset, BaseAsset::ForeignAsset(100)); + assert_eq!(market.base_asset, Asset::ForeignAsset(100)); }); } @@ -338,7 +338,7 @@ fn it_does_not_create_market_with_too_few_categories() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..100), @@ -360,7 +360,7 @@ fn it_does_not_create_market_with_too_many_categories() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..100), @@ -389,7 +389,7 @@ fn create_categorical_market_fails_if_market_period_is_invalid( assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, period, @@ -413,7 +413,7 @@ fn create_categorical_market_fails_if_end_is_not_far_enough_ahead() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end_block), @@ -431,7 +431,7 @@ fn create_categorical_market_fails_if_end_is_not_far_enough_ahead() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(0..end_time), @@ -460,7 +460,7 @@ fn create_market_succeeds_if_market_duration_is_maximal_in_blocks() { ); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(start..end), @@ -488,7 +488,7 @@ fn create_market_suceeds_if_market_duration_is_maximal_in_moments() { ); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(start..end), @@ -516,7 +516,7 @@ fn create_market_fails_if_market_duration_is_too_long_in_blocks() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(start..end), @@ -547,7 +547,7 @@ fn create_market_fails_if_market_duration_is_too_long_in_moments() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(start..end), @@ -611,7 +611,7 @@ fn create_market_sets_the_correct_market_parameters_and_reserves_the_correct_amo let creator_fee = Perbill::from_parts(1); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(creator), - BaseAsset::Ztg, + Asset::Ztg, creator_fee, oracle, period.clone(), @@ -646,7 +646,7 @@ fn create_market_fails_on_trusted_market_with_non_zero_dispute_period() { assert_noop!( PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(1..2), @@ -670,7 +670,7 @@ fn create_market_fails_on_trusted_market_with_non_zero_dispute_period() { fn create_categorical_market_deposits_the_correct_event() { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 1..2, ScoringRule::AmmCdaHybrid, @@ -686,7 +686,7 @@ fn create_categorical_market_deposits_the_correct_event() { fn create_scalar_market_deposits_the_correct_event() { ExtBuilder::default().build().execute_with(|| { simple_create_scalar_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 1..2, ScoringRule::AmmCdaHybrid, @@ -697,31 +697,3 @@ fn create_scalar_market_deposits_the_correct_event() { System::assert_last_event(Event::MarketCreated(0, market_account, market).into()); }); } - -#[test] -fn does_trigger_market_transition_api() { - ExtBuilder::default().build().execute_with(|| { - StateTransitionMock::ensure_empty_state(); - simple_create_categorical_market( - BaseAsset::Ztg, - MarketCreation::Advised, - 1..2, - ScoringRule::AmmCdaHybrid, - ); - assert!(StateTransitionMock::on_proposal_triggered()); - }); -} - -#[test] -fn does_trigger_market_transition_api_permissionless() { - ExtBuilder::default().build().execute_with(|| { - StateTransitionMock::ensure_empty_state(); - simple_create_categorical_market( - BaseAsset::Ztg, - MarketCreation::Permissionless, - 1..2, - ScoringRule::AmmCdaHybrid, - ); - assert!(StateTransitionMock::on_activation_triggered()); - }); -} diff --git a/zrml/prediction-markets/src/tests/create_market_and_deploy_pool.rs b/zrml/prediction-markets/src/tests/create_market_and_deploy_pool.rs index a87cb2dc5..82087b6e2 100644 --- a/zrml/prediction-markets/src/tests/create_market_and_deploy_pool.rs +++ b/zrml/prediction-markets/src/tests/create_market_and_deploy_pool.rs @@ -45,7 +45,7 @@ fn create_market_and_deploy_pool_works() { let market_id = 0; assert_ok!(PredictionMarkets::create_market_and_deploy_pool( RuntimeOrigin::signed(creator), - BaseAsset::Ztg, + Asset::Ztg, creator_fee, oracle, period.clone(), diff --git a/zrml/prediction-markets/src/tests/dispute.rs b/zrml/prediction-markets/src/tests/dispute.rs index b762eb548..20627b9c4 100644 --- a/zrml/prediction-markets/src/tests/dispute.rs +++ b/zrml/prediction-markets/src/tests/dispute.rs @@ -31,7 +31,7 @@ fn it_allows_to_dispute_the_outcome_of_a_market() { ExtBuilder::default().build().execute_with(|| { let end = 2; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -76,7 +76,7 @@ fn dispute_fails_disputed_already() { let end = 2; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -117,7 +117,7 @@ fn dispute_fails_if_market_not_reported() { let end = 2; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -152,7 +152,7 @@ fn dispute_reserves_dispute_bond() { let end = 2; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -198,7 +198,7 @@ fn dispute_updates_market() { let end = 2; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -245,7 +245,7 @@ fn dispute_emits_event() { let end = 2; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -287,7 +287,7 @@ fn dispute_fails_unless_reported_or_disputed_market(status: MarketStatus) { ExtBuilder::default().build().execute_with(|| { // Creates a permissionless market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..2, ScoringRule::AmmCdaHybrid, @@ -304,34 +304,3 @@ fn dispute_fails_unless_reported_or_disputed_market(status: MarketStatus) { ); }); } - -#[test] -fn does_trigger_market_transition_api() { - ExtBuilder::default().build().execute_with(|| { - StateTransitionMock::ensure_empty_state(); - let end = 2; - simple_create_categorical_market( - BaseAsset::Ztg, - MarketCreation::Permissionless, - 0..end, - ScoringRule::AmmCdaHybrid, - ); - - // Run to the end of the trading phase. - let market = MarketCommons::market(&0).unwrap(); - let grace_period = end + market.deadlines.grace_period; - run_to_block(grace_period + 1); - - assert_ok!(PredictionMarkets::report( - RuntimeOrigin::signed(BOB), - 0, - OutcomeReport::Categorical(1) - )); - - let dispute_at = grace_period + 2; - run_to_block(dispute_at); - - assert_ok!(PredictionMarkets::dispute(RuntimeOrigin::signed(CHARLIE), 0)); - assert!(StateTransitionMock::on_dispute_triggered()); - }); -} diff --git a/zrml/prediction-markets/src/tests/dispute_early_close.rs b/zrml/prediction-markets/src/tests/dispute_early_close.rs index d5f75802f..9043c44e9 100644 --- a/zrml/prediction-markets/src/tests/dispute_early_close.rs +++ b/zrml/prediction-markets/src/tests/dispute_early_close.rs @@ -30,7 +30,7 @@ fn dispute_early_close_emits_event() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -55,7 +55,7 @@ fn dispute_early_close_from_market_creator_works() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -129,7 +129,7 @@ fn dispute_early_close_fails_if_scheduled_as_sudo() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -162,7 +162,7 @@ fn dispute_early_close_fails_if_already_disputed() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -200,7 +200,7 @@ fn dispute_early_close_fails_if_already_rejected() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -243,7 +243,7 @@ fn settles_early_close_bonds_with_resolution_in_state_disputed() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -306,7 +306,7 @@ fn settles_early_close_bonds_with_resolution_in_state_scheduled_as_market_creato let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -354,7 +354,7 @@ fn schedule_early_close_disputed_sudo_schedule_and_settle_bonds() { let old_period = MarketPeriod::Block(0..end); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, old_period.clone(), diff --git a/zrml/prediction-markets/src/tests/edit_market.rs b/zrml/prediction-markets/src/tests/edit_market.rs index a1d5d3e93..553289ab7 100644 --- a/zrml/prediction-markets/src/tests/edit_market.rs +++ b/zrml/prediction-markets/src/tests/edit_market.rs @@ -29,7 +29,7 @@ use crate::MarketIdsForEdit; fn only_creator_can_edit_market() { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, @@ -54,7 +54,7 @@ fn only_creator_can_edit_market() { assert_noop!( PredictionMarkets::edit_market( RuntimeOrigin::signed(BOB), - BaseAsset::Ztg, + Asset::Ztg, 0, CHARLIE, MarketPeriod::Block(0..2), @@ -73,7 +73,7 @@ fn only_creator_can_edit_market() { fn edit_cycle_for_proposed_markets() { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 2..4, ScoringRule::AmmCdaHybrid, @@ -97,7 +97,7 @@ fn edit_cycle_for_proposed_markets() { // After this edit its changed to ALICE assert_ok!(PredictionMarkets::edit_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, 0, CHARLIE, MarketPeriod::Block(2..4), @@ -122,7 +122,7 @@ fn edit_market_with_foreign_asset() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, @@ -148,7 +148,7 @@ fn edit_market_with_foreign_asset() { assert_noop!( PredictionMarkets::edit_market( RuntimeOrigin::signed(ALICE), - BaseAsset::ForeignAsset(50), + Asset::ForeignAsset(50), 0, CHARLIE, MarketPeriod::Block(0..2), @@ -164,7 +164,7 @@ fn edit_market_with_foreign_asset() { assert_noop!( PredictionMarkets::edit_market( RuntimeOrigin::signed(ALICE), - BaseAsset::ForeignAsset(420), + Asset::ForeignAsset(420), 0, CHARLIE, MarketPeriod::Block(0..2), @@ -179,7 +179,7 @@ fn edit_market_with_foreign_asset() { // As per Mock asset_registry genesis ForeignAsset(100) has allow_as_base_asset set to true. assert_ok!(PredictionMarkets::edit_market( RuntimeOrigin::signed(ALICE), - BaseAsset::ForeignAsset(100), + Asset::ForeignAsset(100), 0, CHARLIE, MarketPeriod::Block(0..2), @@ -190,6 +190,6 @@ fn edit_market_with_foreign_asset() { ScoringRule::AmmCdaHybrid )); let market = MarketCommons::market(&0).unwrap(); - assert_eq!(market.base_asset, BaseAsset::ForeignAsset(100)); + assert_eq!(market.base_asset, Asset::ForeignAsset(100)); }); } diff --git a/zrml/prediction-markets/src/tests/integration.rs b/zrml/prediction-markets/src/tests/integration.rs index 4ea7749ff..48e1a0db3 100644 --- a/zrml/prediction-markets/src/tests/integration.rs +++ b/zrml/prediction-markets/src/tests/integration.rs @@ -33,7 +33,7 @@ use zrml_global_disputes::{ #[test] fn it_appeals_a_court_market_to_global_dispute() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { let mut free_before = BTreeMap::new(); let jurors = 1000..(1000 + ::MaxSelectedDraws::get() as u128); @@ -128,14 +128,11 @@ fn it_appeals_a_court_market_to_global_dispute() { ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -145,7 +142,7 @@ fn the_entire_market_lifecycle_works_with_timestamps() { // Creates a permissionless market. assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -182,7 +179,7 @@ fn the_entire_market_lifecycle_works_with_timestamps() { #[test] fn full_scalar_market_lifecycle() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), base_asset, @@ -208,9 +205,10 @@ fn full_scalar_market_lifecycle() { let assets = market.outcome_assets(); assert_eq!(assets.len(), 2); for asset in assets.iter() { - let bal = AssetManager::free_balance((*asset).into(), &CHARLIE); + let bal = Tokens::free_balance(*asset, &CHARLIE); assert_eq!(bal, 100 * BASE); } + let market = MarketCommons::market(&0).unwrap(); set_timestamp_for_on_initialize(100_000_000); let report_at = 2; @@ -250,7 +248,7 @@ fn full_scalar_market_lifecycle() { assert_eq!(disputes.len(), 0); // give EVE some shares - assert_ok!(AssetManager::transfer( + assert_ok!(Tokens::transfer( RuntimeOrigin::signed(CHARLIE), EVE, Asset::ScalarOutcome(0, ScalarPosition::Short), @@ -258,19 +256,19 @@ fn full_scalar_market_lifecycle() { )); assert_eq!( - AssetManager::free_balance(Asset::ScalarOutcome(0, ScalarPosition::Short), &CHARLIE), + Tokens::free_balance(Asset::ScalarOutcome(0, ScalarPosition::Short), &CHARLIE), 50 * BASE ); assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); for asset in assets.iter() { - let bal = AssetManager::free_balance((*asset).into(), &CHARLIE); + let bal = Tokens::free_balance(*asset, &CHARLIE); assert_eq!(bal, 0); } // check payouts is right for each CHARLIE and EVE - let base_asset_bal_charlie = AssetManager::free_balance(base_asset.into(), &CHARLIE); - let base_asset_bal_eve = AssetManager::free_balance(base_asset.into(), &EVE); + let base_asset_bal_charlie = AssetManager::free_balance(base_asset, &CHARLIE); + let base_asset_bal_eve = AssetManager::free_balance(base_asset, &EVE); assert_eq!(base_asset_bal_charlie, 98750 * CENT); // 75 (LONG) + 12.5 (SHORT) + 900 (balance) assert_eq!(base_asset_bal_eve, 1000 * BASE); System::assert_has_event( @@ -295,7 +293,7 @@ fn full_scalar_market_lifecycle() { ); assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(EVE), 0)); - let base_asset_bal_eve_after = AssetManager::free_balance(base_asset.into(), &EVE); + let base_asset_bal_eve_after = AssetManager::free_balance(base_asset, &EVE); assert_eq!(base_asset_bal_eve_after, 101250 * CENT); // 12.5 (SHORT) + 1000 (balance) System::assert_last_event( Event::TokensRedeemed( @@ -309,21 +307,18 @@ fn full_scalar_market_lifecycle() { ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test] fn authorized_correctly_resolves_disputed_market() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { let end = 2; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), @@ -349,14 +344,14 @@ fn authorized_correctly_resolves_disputed_market() { OutcomeReport::Categorical(0) )); - let charlie_balance = AssetManager::free_balance(base_asset.into(), &CHARLIE); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - CENT); let dispute_at = grace_period + 1 + 1; run_to_block(dispute_at); assert_ok!(PredictionMarkets::dispute(RuntimeOrigin::signed(CHARLIE), 0,)); - if base_asset == BaseAsset::Ztg { + if base_asset == Asset::Ztg { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!( charlie_balance, @@ -365,7 +360,7 @@ fn authorized_correctly_resolves_disputed_market() { } else { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - ::DisputeBond::get()); - let charlie_balance = AssetManager::free_balance(base_asset.into(), &CHARLIE); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - CENT); } @@ -393,7 +388,7 @@ fn authorized_correctly_resolves_disputed_market() { ); assert_eq!(market_ids_1.len(), 1); - if base_asset == BaseAsset::Ztg { + if base_asset == Asset::Ztg { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!( charlie_balance, @@ -402,7 +397,7 @@ fn authorized_correctly_resolves_disputed_market() { } else { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - ::DisputeBond::get()); - let charlie_balance = AssetManager::free_balance(base_asset.into(), &CHARLIE); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - CENT); } @@ -411,7 +406,7 @@ fn authorized_correctly_resolves_disputed_market() { let market_after = MarketCommons::market(&0).unwrap(); assert_eq!(market_after.status, MarketStatus::Disputed); - if base_asset == BaseAsset::Ztg { + if base_asset == Asset::Ztg { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!( charlie_balance, @@ -420,13 +415,13 @@ fn authorized_correctly_resolves_disputed_market() { } else { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - ::DisputeBond::get()); - let charlie_balance = AssetManager::free_balance(base_asset.into(), &CHARLIE); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - CENT); } run_blocks(1); - if base_asset == BaseAsset::Ztg { + if base_asset == Asset::Ztg { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!( charlie_balance, @@ -435,7 +430,7 @@ fn authorized_correctly_resolves_disputed_market() { } else { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE + ::OracleBond::get()); - let charlie_balance = AssetManager::free_balance(base_asset.into(), &CHARLIE); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE - CENT); } @@ -446,13 +441,13 @@ fn authorized_correctly_resolves_disputed_market() { assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); - if base_asset == BaseAsset::Ztg { + if base_asset == Asset::Ztg { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE + ::OracleBond::get()); } else { let charlie_balance = AssetManager::free_balance(Asset::Ztg, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE + ::OracleBond::get()); - let charlie_balance = AssetManager::free_balance(base_asset.into(), &CHARLIE); + let charlie_balance = AssetManager::free_balance(base_asset, &CHARLIE); assert_eq!(charlie_balance, 1_000 * BASE); } let charlie_reserved_2 = AssetManager::reserved_balance(Asset::Ztg, &CHARLIE); @@ -470,20 +465,17 @@ fn authorized_correctly_resolves_disputed_market() { assert!(market_after.bonds.oracle.unwrap().is_settled); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test] fn it_resolves_a_disputed_court_market() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { let juror_0 = 1000; let juror_1 = 1001; let juror_2 = 1002; @@ -709,18 +701,18 @@ fn it_resolves_a_disputed_court_market() { assert_eq!(free_juror_2_after, free_juror_2_before + juror_2_share * total_slashed); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test] fn outsider_reports_wrong_outcome() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; @@ -795,13 +787,10 @@ fn outsider_reports_wrong_outcome() { assert_eq!(Balances::free_balance(DAVE), dave_balance_before + outcome_bond); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } diff --git a/zrml/prediction-markets/src/tests/manually_close_market.rs b/zrml/prediction-markets/src/tests/manually_close_market.rs index 8af1ee78c..b88cab214 100644 --- a/zrml/prediction-markets/src/tests/manually_close_market.rs +++ b/zrml/prediction-markets/src/tests/manually_close_market.rs @@ -36,7 +36,7 @@ fn manually_close_market_after_long_stall() { let category_count = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), @@ -49,7 +49,7 @@ fn manually_close_market_after_long_stall() { )); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), @@ -105,7 +105,7 @@ fn manually_close_market_fails_if_market_not_in_close_time_frame_list() { let category_count = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), @@ -146,7 +146,7 @@ fn manually_close_market_fails_if_not_allowed_for_block_based_markets() { let end = 5; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Block(0..end), diff --git a/zrml/prediction-markets/src/tests/mod.rs b/zrml/prediction-markets/src/tests/mod.rs index 662ff84f8..95d13c1a8 100644 --- a/zrml/prediction-markets/src/tests/mod.rs +++ b/zrml/prediction-markets/src/tests/mod.rs @@ -22,7 +22,7 @@ mod admin_move_market_to_closed; mod admin_move_market_to_resolved; mod approve_market; mod buy_complete_set; -mod close_market; +mod close_trusted_market; mod create_market; mod create_market_and_deploy_pool; mod dispute; @@ -42,19 +42,19 @@ mod schedule_early_close; mod sell_complete_set; mod start_global_dispute; -use crate::{mock::*, AccountIdOf, BalanceOf, Config, Error, Event, MarketIdsPerDisputeBlock}; -use core::ops::Range; -use frame_support::{ - assert_noop, assert_ok, storage::unhashed::get_or, traits::NamedReservableCurrency, +use crate::{ + mock::*, AccountIdOf, AssetOf, BalanceOf, Config, Error, Event, MarketIdsPerDisputeBlock, }; +use core::ops::Range; +use frame_support::{assert_noop, assert_ok, traits::NamedReservableCurrency}; use orml_traits::MultiCurrency; use sp_arithmetic::Perbill; use sp_runtime::traits::{BlakeTwo256, Hash, Zero}; use zeitgeist_primitives::{ constants::mock::{BASE, CENT}, types::{ - Asset, BaseAsset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketId, - MarketPeriod, MarketStatus, MarketType, MultiHash, OutcomeReport, ScoringRule, + Asset, Deadlines, MarketCreation, MarketDisputeMechanism, MarketId, MarketPeriod, + MarketStatus, MarketType, MultiHash, OutcomeReport, ScoringRule, }, }; use zrml_court::types::VoteItem; @@ -62,35 +62,6 @@ use zrml_market_commons::MarketCommonsPalletApi; const SENTINEL_AMOUNT: u128 = BASE; -impl StateTransitionMock { - pub(super) fn on_proposal_triggered() -> bool { - get_or(&ON_PROPOSAL_STORAGE, false) - } - pub(super) fn on_activation_triggered() -> bool { - get_or(&ON_ACTIVATION_STORAGE, false) - } - pub(super) fn on_closure_triggered() -> bool { - get_or(&ON_CLOSURE_STORAGE, false) - } - pub(super) fn on_report_triggered() -> bool { - get_or(&ON_REPORT_STORAGE, false) - } - pub(super) fn on_dispute_triggered() -> bool { - get_or(&ON_DISPUTE_STORAGE, false) - } - pub(super) fn on_resolution_triggered() -> bool { - get_or(&ON_RESOLUTION_STORAGE, false) - } - pub(super) fn ensure_empty_state() { - assert!(!StateTransitionMock::on_proposal_triggered()); - assert!(!StateTransitionMock::on_activation_triggered()); - assert!(!StateTransitionMock::on_closure_triggered()); - assert!(!StateTransitionMock::on_report_triggered()); - assert!(!StateTransitionMock::on_dispute_triggered()); - assert!(!StateTransitionMock::on_resolution_triggered()); - } -} - fn get_deadlines() -> Deadlines<::BlockNumber> { Deadlines { grace_period: 1_u32.into(), @@ -107,7 +78,7 @@ fn gen_metadata(byte: u8) -> MultiHash { } fn simple_create_categorical_market( - base_asset: BaseAsset, + base_asset: AssetOf, creation: MarketCreation, period: Range, scoring_rule: ScoringRule, @@ -128,7 +99,7 @@ fn simple_create_categorical_market( } fn simple_create_scalar_market( - base_asset: BaseAsset, + base_asset: AssetOf, creation: MarketCreation, period: Range, scoring_rule: ScoringRule, diff --git a/zrml/prediction-markets/src/tests/on_initialize.rs b/zrml/prediction-markets/src/tests/on_initialize.rs index b8c5588c1..b78388fbf 100644 --- a/zrml/prediction-markets/src/tests/on_initialize.rs +++ b/zrml/prediction-markets/src/tests/on_initialize.rs @@ -31,7 +31,7 @@ fn on_initialize_skips_the_genesis_block() { let category_count = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), diff --git a/zrml/prediction-markets/src/tests/on_market_close.rs b/zrml/prediction-markets/src/tests/on_market_close.rs index 866797798..63054872c 100644 --- a/zrml/prediction-markets/src/tests/on_market_close.rs +++ b/zrml/prediction-markets/src/tests/on_market_close.rs @@ -24,7 +24,7 @@ use zeitgeist_primitives::constants::MILLISECS_PER_BLOCK; #[test] fn on_market_close_auto_rejects_expired_advised_market() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { // Give ALICE `SENTINEL_AMOUNT` free and reserved ZTG; we record the free balance to check // that the AdvisoryBond and the OracleBond gets unreserved, when the advised market expires. assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); @@ -60,20 +60,17 @@ fn on_market_close_auto_rejects_expired_advised_market() { System::assert_has_event(Event::MarketExpired(market_id).into()); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test] fn on_market_close_auto_rejects_expired_advised_market_with_edit_request() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { // Give ALICE `SENTINEL_AMOUNT` free and reserved ZTG; we record the free balance to check // that the AdvisoryBond and the OracleBond gets unreserved, when the advised market expires. assert_ok!(AssetManager::deposit(Asset::Ztg, &ALICE, 2 * SENTINEL_AMOUNT)); @@ -122,14 +119,11 @@ fn on_market_close_auto_rejects_expired_advised_market_with_edit_request() { System::assert_has_event(Event::MarketExpired(market_id).into()); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -140,7 +134,7 @@ fn on_market_close_successfully_auto_closes_market_with_blocks() { let category_count = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Block(0..end), @@ -172,7 +166,7 @@ fn on_market_close_successfully_auto_closes_market_with_timestamps() { let category_count = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), @@ -212,7 +206,7 @@ fn on_market_close_successfully_auto_closes_multiple_markets_after_stall() { let category_count = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), @@ -225,7 +219,7 @@ fn on_market_close_successfully_auto_closes_multiple_markets_after_stall() { )); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), @@ -263,7 +257,7 @@ fn on_market_close_market_status_manager_exceeds_max_recovery_time_frames_after_ let category_count = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), @@ -276,7 +270,7 @@ fn on_market_close_market_status_manager_exceeds_max_recovery_time_frames_after_ )); assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), ALICE, MarketPeriod::Timestamp(0..end), diff --git a/zrml/prediction-markets/src/tests/on_resolution.rs b/zrml/prediction-markets/src/tests/on_resolution.rs index 08b965073..7e70a6730 100644 --- a/zrml/prediction-markets/src/tests/on_resolution.rs +++ b/zrml/prediction-markets/src/tests/on_resolution.rs @@ -27,7 +27,7 @@ fn it_correctly_resolves_a_market_that_was_reported_on() { ExtBuilder::default().build().execute_with(|| { let end = 2; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -58,21 +58,22 @@ fn it_correctly_resolves_a_market_that_was_reported_on() { // Check balance of winning outcome asset. let share_b = Asset::CategoricalOutcome(0, 1); - let share_b_total = AssetManager::total_issuance(share_b); + let share_b_total = Tokens::total_issuance(share_b); assert_eq!(share_b_total, CENT); - let share_b_bal = AssetManager::free_balance(share_b, &CHARLIE); + let share_b_bal = Tokens::free_balance(share_b, &CHARLIE); assert_eq!(share_b_bal, CENT); + // TODO(#792): Remove other assets. let share_a = Asset::CategoricalOutcome(0, 0); - let share_a_total = AssetManager::total_issuance(share_a); - assert_eq!(share_a_total, 0); - let share_a_bal = AssetManager::free_balance(share_a, &CHARLIE); - assert_eq!(share_a_bal, 0); + let share_a_total = Tokens::total_issuance(share_a); + assert_eq!(share_a_total, CENT); + let share_a_bal = Tokens::free_balance(share_a, &CHARLIE); + assert_eq!(share_a_bal, CENT); let share_c = Asset::CategoricalOutcome(0, 2); - let share_c_total = AssetManager::total_issuance(share_c); + let share_c_total = Tokens::total_issuance(share_c); assert_eq!(share_c_total, 0); - let share_c_bal = AssetManager::free_balance(share_c, &CHARLIE); + let share_c_bal = Tokens::free_balance(share_c, &CHARLIE); assert_eq!(share_c_bal, 0); assert!(market.bonds.creation.unwrap().is_settled); @@ -84,7 +85,7 @@ fn it_correctly_resolves_a_market_that_was_reported_on() { fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_market_on_oracle_report() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -121,14 +122,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma assert_eq!(Balances::free_balance(ALICE), alice_balance_before + OracleBond::get()); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -136,7 +134,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_market_on_outsider_report() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -173,14 +171,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma assert_eq!(Balances::free_balance(ALICE), alice_balance_before); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -189,7 +184,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark { // Oracle reports in time but incorrect report, so OracleBond gets slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -227,14 +222,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark assert_eq!(Balances::free_balance(ALICE), alice_balance_before + ValidityBond::get()); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -243,7 +235,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma { // Oracle reports in time but incorrect report, so OracleBond gets slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -285,14 +277,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_approved_advised_ma assert_eq!(Balances::free_balance(ALICE), alice_balance_before); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -301,7 +290,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark { // Oracle reports in time and correct report, so OracleBond does not get slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -348,14 +337,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -364,7 +350,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma { // Oracle reports in time and correct report, so OracleBond does not get slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -412,14 +398,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma assert_eq!(Balances::free_balance(ALICE), alice_balance_before + OracleBond::get()); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -428,7 +411,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark { // Oracle does not report in time, so OracleBond gets slashed on resolution // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -487,14 +470,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -503,7 +483,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma { // Oracle does not report in time, so OracleBond gets slashed on resolution // NOTE: Bonds are always in ZTG - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -565,14 +545,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_advised_approved_ma ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -582,7 +559,7 @@ fn trusted_market_complete_lifecycle() { let end = 3; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -629,7 +606,7 @@ fn trusted_market_complete_lifecycle() { fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_market_on_oracle_report() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -663,14 +640,11 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -678,7 +652,7 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_market_on_outsider_report() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { reserve_sentinel_amounts(); let end = 100; assert_ok!(PredictionMarkets::create_market( @@ -737,42 +711,10 @@ fn on_resolution_correctly_reserves_and_unreserves_bonds_for_permissionless_mark assert!(market.bonds.outsider.unwrap().is_settled); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); - }); -} - -#[test] -fn does_trigger_market_transition_api() { - ExtBuilder::default().build().execute_with(|| { - StateTransitionMock::ensure_empty_state(); - let end = 3; - assert_ok!(PredictionMarkets::create_market( - RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, - Perbill::zero(), - BOB, - MarketPeriod::Block(0..end), - Deadlines { - grace_period: 0, - oracle_duration: ::MinOracleDuration::get(), - dispute_duration: Zero::zero(), - }, - gen_metadata(0x99), - MarketCreation::Permissionless, - MarketType::Categorical(3), - None, - ScoringRule::AmmCdaHybrid, - )); - run_to_block(end); - let outcome = OutcomeReport::Categorical(1); - assert_ok!(PredictionMarkets::report(RuntimeOrigin::signed(BOB), 0, outcome.clone())); - assert!(StateTransitionMock::on_resolution_triggered()); + test(Asset::ForeignAsset(100)); }); } diff --git a/zrml/prediction-markets/src/tests/redeem_shares.rs b/zrml/prediction-markets/src/tests/redeem_shares.rs index c71921add..f95511119 100644 --- a/zrml/prediction-markets/src/tests/redeem_shares.rs +++ b/zrml/prediction-markets/src/tests/redeem_shares.rs @@ -27,7 +27,7 @@ use zeitgeist_primitives::types::{OutcomeReport, ScalarPosition}; #[test] fn it_allows_to_redeem_shares() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { let end = 2; simple_create_categorical_market( base_asset, @@ -58,20 +58,17 @@ fn it_allows_to_redeem_shares() { ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test_case(ScoringRule::Parimutuel; "parimutuel")] fn redeem_shares_fails_if_invalid_resolution_mechanism(scoring_rule: ScoringRule) { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { let end = 2; simple_create_categorical_market( base_asset, @@ -91,57 +88,48 @@ fn redeem_shares_fails_if_invalid_resolution_mechanism(scoring_rule: ScoringRule ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test] fn scalar_market_correctly_resolves_on_out_of_range_outcomes_below_threshold() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { scalar_market_correctly_resolves_common(base_asset, 50); - assert_eq!(AssetManager::free_balance(base_asset.into(), &CHARLIE), 900 * BASE); - assert_eq!(AssetManager::free_balance(base_asset.into(), &EVE), 1100 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &CHARLIE), 900 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &EVE), 1100 * BASE); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test] fn scalar_market_correctly_resolves_on_out_of_range_outcomes_above_threshold() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { scalar_market_correctly_resolves_common(base_asset, 250); - assert_eq!(AssetManager::free_balance(base_asset.into(), &CHARLIE), 1000 * BASE); - assert_eq!(AssetManager::free_balance(base_asset.into(), &EVE), 1000 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &CHARLIE), 1000 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &EVE), 1000 * BASE); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } // Common code of `scalar_market_correctly_resolves_*` -fn scalar_market_correctly_resolves_common(base_asset: BaseAsset, reported_value: u128) { +fn scalar_market_correctly_resolves_common(base_asset: AssetOf, reported_value: u128) { let end = 100; simple_create_scalar_market( base_asset, @@ -150,7 +138,7 @@ fn scalar_market_correctly_resolves_common(base_asset: BaseAsset, reported_value ScoringRule::AmmCdaHybrid, ); assert_ok!(PredictionMarkets::buy_complete_set(RuntimeOrigin::signed(CHARLIE), 0, 100 * BASE)); - assert_ok!(AssetManager::transfer( + assert_ok!(Tokens::transfer( RuntimeOrigin::signed(CHARLIE), EVE, Asset::ScalarOutcome(0, ScalarPosition::Short), @@ -179,15 +167,15 @@ fn scalar_market_correctly_resolves_common(base_asset: BaseAsset, reported_value // Check balances before redeeming (just to make sure that our tests are based on correct // assumptions)! - assert_eq!(AssetManager::free_balance(base_asset.into(), &CHARLIE), 900 * BASE); - assert_eq!(AssetManager::free_balance(base_asset.into(), &EVE), 1000 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &CHARLIE), 900 * BASE); + assert_eq!(AssetManager::free_balance(base_asset, &EVE), 1000 * BASE); assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(CHARLIE), 0)); assert_ok!(PredictionMarkets::redeem_shares(RuntimeOrigin::signed(EVE), 0)); let market = &MarketCommons::market(&0).unwrap(); let assets = market.outcome_assets(); for asset in assets.iter() { - assert_eq!(AssetManager::free_balance((*asset).into(), &CHARLIE), 0); - assert_eq!(AssetManager::free_balance((*asset).into(), &EVE), 0); + assert_eq!(AssetManager::free_balance(*asset, &CHARLIE), 0); + assert_eq!(AssetManager::free_balance(*asset, &EVE), 0); } } diff --git a/zrml/prediction-markets/src/tests/reject_early_close.rs b/zrml/prediction-markets/src/tests/reject_early_close.rs index e4b0de19c..fc40098c6 100644 --- a/zrml/prediction-markets/src/tests/reject_early_close.rs +++ b/zrml/prediction-markets/src/tests/reject_early_close.rs @@ -29,7 +29,7 @@ fn reject_early_close_emits_event() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -58,7 +58,7 @@ fn reject_early_close_fails_if_state_is_scheduled_as_market_creator() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -89,7 +89,7 @@ fn reject_early_close_fails_if_state_is_rejected() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -126,7 +126,7 @@ fn reject_early_close_resets_to_old_market_period() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -170,7 +170,7 @@ fn reject_early_close_settles_bonds() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), diff --git a/zrml/prediction-markets/src/tests/reject_market.rs b/zrml/prediction-markets/src/tests/reject_market.rs index 3af2f2a74..462d794df 100644 --- a/zrml/prediction-markets/src/tests/reject_market.rs +++ b/zrml/prediction-markets/src/tests/reject_market.rs @@ -27,7 +27,7 @@ use crate::{MarketIdsForEdit, MarketIdsPerCloseBlock}; fn it_allows_the_advisory_origin_to_reject_markets() { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 4..6, ScoringRule::AmmCdaHybrid, @@ -58,7 +58,7 @@ fn reject_errors_if_reject_reason_is_too_long() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, @@ -86,7 +86,7 @@ fn it_allows_the_advisory_origin_to_reject_markets_with_edit_request() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, @@ -122,7 +122,7 @@ fn it_allows_the_advisory_origin_to_reject_markets_with_edit_request() { #[test] fn reject_market_unreserves_oracle_bond_and_slashes_advisory_bond() { // NOTE: Bonds are always in ZTG, irrespective of base_asset. - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { simple_create_categorical_market( base_asset, MarketCreation::Advised, @@ -179,14 +179,11 @@ fn reject_market_unreserves_oracle_bond_and_slashes_advisory_bond() { assert_eq!(balance_treasury_after, slash_amount_advisory_bond); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -196,19 +193,19 @@ fn reject_market_clears_auto_close_blocks() { // can not be deployed on pending advised pools. ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 33..66, ScoringRule::AmmCdaHybrid, ); simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 22..66, ScoringRule::AmmCdaHybrid, ); simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 22..33, ScoringRule::AmmCdaHybrid, @@ -232,7 +229,7 @@ fn reject_market_fails_on_permissionless_market() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..2, ScoringRule::AmmCdaHybrid, @@ -255,7 +252,7 @@ fn reject_market_fails_on_approved_market() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, diff --git a/zrml/prediction-markets/src/tests/report.rs b/zrml/prediction-markets/src/tests/report.rs index 34f5e72d6..0cd5fe807 100644 --- a/zrml/prediction-markets/src/tests/report.rs +++ b/zrml/prediction-markets/src/tests/report.rs @@ -18,7 +18,6 @@ use super::*; -use test_case::test_case; use zeitgeist_primitives::{constants::MILLISECS_PER_BLOCK, types::OutcomeReport}; // TODO(#1239) MarketDoesNotExist @@ -33,7 +32,7 @@ fn it_allows_to_report_the_outcome_of_a_market() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -66,7 +65,7 @@ fn report_fails_before_grace_period_is_over() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -92,7 +91,7 @@ fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duratio ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -134,7 +133,7 @@ fn it_allows_only_oracle_to_report_the_outcome_of_a_market_during_oracle_duratio ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -175,7 +174,7 @@ fn report_fails_on_mismatched_outcome_for_categorical_market() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -198,7 +197,7 @@ fn report_fails_on_out_of_range_outcome_for_categorical_market() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -221,7 +220,7 @@ fn report_fails_on_mismatched_outcome_for_scalar_market() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_scalar_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -244,7 +243,7 @@ fn it_allows_anyone_to_report_an_unreported_market() { ExtBuilder::default().build().execute_with(|| { let end = 2; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -282,7 +281,7 @@ fn report_fails_on_market_state_proposed() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -305,7 +304,7 @@ fn report_fails_on_market_state_closed_for_advised_market() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -328,7 +327,7 @@ fn report_fails_on_market_state_active() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -351,7 +350,7 @@ fn report_fails_on_market_state_resolved() { ExtBuilder::default().build().execute_with(|| { assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(0..100_000_000), @@ -373,38 +372,35 @@ fn report_fails_on_market_state_resolved() { }); } -#[test_case(Some(MarketDisputeMechanism::SimpleDisputes); "with_dispute_mechanism")] -#[test_case(None; "without_dispute_mechanism")] -fn does_trigger_market_transition_api(dispute_mechanism: Option) { +#[test] +fn report_fails_if_reporter_is_not_the_oracle() { ExtBuilder::default().build().execute_with(|| { - StateTransitionMock::ensure_empty_state(); - let mut deadlines = get_deadlines(); - - if dispute_mechanism.is_none() { - deadlines.dispute_duration = Zero::zero(); - } - assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, - MarketPeriod::Block(0..2), - deadlines, + MarketPeriod::Timestamp(0..100_000_000), + get_deadlines(), gen_metadata(2), MarketCreation::Permissionless, MarketType::Categorical(2), - dispute_mechanism, + Some(MarketDisputeMechanism::SimpleDisputes), ScoringRule::AmmCdaHybrid, )); - let market = MarketCommons::market(&0).unwrap(); - run_to_block(2 + market.deadlines.grace_period + market.deadlines.oracle_duration + 1); - assert_ok!(PredictionMarkets::report( - RuntimeOrigin::signed(BOB), - 0, - OutcomeReport::Categorical(1) - )); - assert!(StateTransitionMock::on_report_triggered()); + set_timestamp_for_on_initialize(100_000_000); + // Trigger hooks which close the market. + run_to_block(2); + let grace_period: u64 = market.deadlines.grace_period * MILLISECS_PER_BLOCK as u64; + set_timestamp_for_on_initialize(100_000_000 + grace_period + MILLISECS_PER_BLOCK as u64); + assert_noop!( + PredictionMarkets::report( + RuntimeOrigin::signed(CHARLIE), + 0, + OutcomeReport::Categorical(1) + ), + Error::::ReporterNotOracle, + ); }); } diff --git a/zrml/prediction-markets/src/tests/request_edit.rs b/zrml/prediction-markets/src/tests/request_edit.rs index 3736f06c9..fb09532a1 100644 --- a/zrml/prediction-markets/src/tests/request_edit.rs +++ b/zrml/prediction-markets/src/tests/request_edit.rs @@ -27,7 +27,7 @@ use sp_runtime::DispatchError; fn it_allows_request_edit_origin_to_request_edits_for_markets() { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 2..4, ScoringRule::AmmCdaHybrid, @@ -68,7 +68,7 @@ fn request_edit_fails_on_bad_origin() { frame_system::Pallet::::set_block_number(1); // Creates an advised market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 2..4, ScoringRule::AmmCdaHybrid, @@ -92,7 +92,7 @@ fn edit_request_fails_if_edit_reason_is_too_long() { ExtBuilder::default().build().execute_with(|| { // Creates an advised market. simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Advised, 0..2, ScoringRule::AmmCdaHybrid, diff --git a/zrml/prediction-markets/src/tests/schedule_early_close.rs b/zrml/prediction-markets/src/tests/schedule_early_close.rs index 3709df23e..2e3886235 100644 --- a/zrml/prediction-markets/src/tests/schedule_early_close.rs +++ b/zrml/prediction-markets/src/tests/schedule_early_close.rs @@ -36,7 +36,7 @@ fn schedule_early_close_emits_event() { ExtBuilder::default().build().execute_with(|| { let end = 100; simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..end, ScoringRule::AmmCdaHybrid, @@ -71,7 +71,7 @@ fn sudo_schedule_early_close_at_block_works() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -143,7 +143,7 @@ fn sudo_schedule_early_close_at_timeframe_works() { let end = start + (42 * MILLISECS_PER_BLOCK) as u64; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(start..end), @@ -213,7 +213,7 @@ fn schedule_early_close_block_fails_if_early_close_request_too_late() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), @@ -245,7 +245,7 @@ fn schedule_early_close_timestamp_fails_if_early_close_request_too_late() { let end = start + (42 * MILLISECS_PER_BLOCK) as u64; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Timestamp(start..end), @@ -274,7 +274,7 @@ fn schedule_early_close_as_market_creator_works() { let end = 100; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..end), diff --git a/zrml/prediction-markets/src/tests/sell_complete_set.rs b/zrml/prediction-markets/src/tests/sell_complete_set.rs index a2ed720b2..899b3f3c0 100644 --- a/zrml/prediction-markets/src/tests/sell_complete_set.rs +++ b/zrml/prediction-markets/src/tests/sell_complete_set.rs @@ -23,7 +23,7 @@ use test_case::test_case; #[test_case(ScoringRule::AmmCdaHybrid)] fn sell_complete_set_works(scoring_rule: ScoringRule) { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { simple_create_categorical_market( base_asset, MarketCreation::Permissionless, @@ -51,24 +51,21 @@ fn sell_complete_set_works(scoring_rule: ScoringRule) { let market = MarketCommons::market(&market_id).unwrap(); let assets = market.outcome_assets(); for asset in assets.iter() { - let bal = AssetManager::free_balance((*asset).into(), &who); + let bal = AssetManager::free_balance(*asset, &who); assert_eq!(bal, expected_amount); } - let bal = AssetManager::free_balance(base_asset.into(), &who); + let bal = AssetManager::free_balance(base_asset, &who); assert_eq!(bal, 1_000 * BASE - expected_amount); System::assert_last_event(Event::SoldCompleteSet(market_id, sell_amount, who).into()); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } @@ -76,7 +73,7 @@ fn sell_complete_set_works(scoring_rule: ScoringRule) { fn sell_complete_set_fails_on_zero_amount() { ExtBuilder::default().build().execute_with(|| { simple_create_categorical_market( - BaseAsset::Ztg, + Asset::Ztg, MarketCreation::Permissionless, 0..2, ScoringRule::AmmCdaHybrid, @@ -90,7 +87,7 @@ fn sell_complete_set_fails_on_zero_amount() { #[test] fn sell_complete_set_fails_on_insufficient_share_balance() { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { simple_create_categorical_market( base_asset, MarketCreation::Permissionless, @@ -112,20 +109,17 @@ fn sell_complete_set_fails_on_insufficient_share_balance() { ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } #[test_case(ScoringRule::Parimutuel; "parimutuel")] fn sell_complete_set_fails_if_market_has_wrong_scoring_rule(scoring_rule: ScoringRule) { - let test = |base_asset: BaseAsset| { + let test = |base_asset: AssetOf| { simple_create_categorical_market( base_asset, MarketCreation::Permissionless, @@ -138,13 +132,10 @@ fn sell_complete_set_fails_if_market_has_wrong_scoring_rule(scoring_rule: Scorin ); }; ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::CampaignAsset(100)); - }); - ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::Ztg); + test(Asset::Ztg); }); #[cfg(feature = "parachain")] ExtBuilder::default().build().execute_with(|| { - test(BaseAsset::ForeignAsset(100)); + test(Asset::ForeignAsset(100)); }); } diff --git a/zrml/prediction-markets/src/tests/start_global_dispute.rs b/zrml/prediction-markets/src/tests/start_global_dispute.rs index b87ed6ac8..2ed871296 100644 --- a/zrml/prediction-markets/src/tests/start_global_dispute.rs +++ b/zrml/prediction-markets/src/tests/start_global_dispute.rs @@ -33,7 +33,7 @@ fn start_global_dispute_fails_on_wrong_mdm() { let end = 2; assert_ok!(PredictionMarkets::create_market( RuntimeOrigin::signed(ALICE), - BaseAsset::Ztg, + Asset::Ztg, Perbill::zero(), BOB, MarketPeriod::Block(0..2), diff --git a/zrml/prediction-markets/src/weights.rs b/zrml/prediction-markets/src/weights.rs index 5ac4c5a91..fb9b4d4cc 100644 --- a/zrml/prediction-markets/src/weights.rs +++ b/zrml/prediction-markets/src/weights.rs @@ -238,10 +238,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:64 w:64) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: MarketAssets Account (r:64 w:64) - /// Proof: MarketAssets Account (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) /// The range of component `a` is `[2, 64]`. fn buy_complete_set(a: u32) -> Weight { // Proof Size summary in bytes: @@ -272,14 +268,14 @@ impl WeightInfoZeitgeist for WeightInfo { /// The range of component `m` is `[0, 63]`. fn create_market(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `316 + m * (16 ±0)` - // Estimated: `181063` - // Minimum execution time: 580_722 nanoseconds. - Weight::from_parts(746_949_580, 181063) - // Standard Error: 134_673 - .saturating_add(Weight::from_parts(95_879, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(68)) - .saturating_add(T::DbWeight::get().writes(68)) + // Measured: `240 + m * (16 ±0)` + // Estimated: `8263` + // Minimum execution time: 55_550 nanoseconds. + Weight::from_parts(74_259_340, 8263) + // Standard Error: 7_534 + .saturating_add(Weight::from_parts(63_015, 0).saturating_mul(m.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) /// Proof: PredictionMarkets MarketIdsForEdit (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) @@ -290,14 +286,12 @@ impl WeightInfoZeitgeist for WeightInfo { /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// The range of component `m` is `[0, 63]`. - fn edit_market(m: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `751 + m * (16 ±0)` - // Estimated: `10720` - // Minimum execution time: 56_321 nanoseconds. - Weight::from_parts(74_197_986, 10720) - // Standard Error: 12_078 - .saturating_add(Weight::from_parts(99_545, 0).saturating_mul(m.into())) + fn edit_market(_m: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `735 + m * (16 ±0)` + // Estimated: `10706` + // Minimum execution time: 53_490 nanoseconds. + Weight::from_parts(75_146_182, 10706) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -462,11 +456,6 @@ impl WeightInfoZeitgeist for WeightInfo { .saturating_add(T::DbWeight::get().writes(5)) } /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:1 w:1) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: MarketAssets Account (r:1 w:1) - /// Proof: MarketAssets Account (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) /// Storage: AssetRouter DestroyAssets (r:1 w:1) @@ -485,11 +474,6 @@ impl WeightInfoZeitgeist for WeightInfo { .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:2) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: MarketAssets Account (r:2 w:2) - /// Proof: MarketAssets Account (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) /// Storage: AssetRouter DestroyAssets (r:1 w:1) @@ -573,10 +557,6 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:64 w:64) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: MarketAssets Account (r:64 w:64) - /// Proof: MarketAssets Account (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) /// The range of component `a` is `[2, 64]`. fn sell_complete_set(a: u32) -> Weight { // Proof Size summary in bytes: @@ -650,14 +630,16 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. - fn schedule_early_close_as_authority(o: u32, _n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `763 + o * (16 ±0)` - // Estimated: `10720` - // Minimum execution time: 53_380 nanoseconds. - Weight::from_parts(69_829_159, 10720) - // Standard Error: 9_438 - .saturating_add(Weight::from_parts(58_622, 0).saturating_mul(o.into())) + fn schedule_early_close_as_authority(o: u32, n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `747 + o * (16 ±0)` + // Estimated: `10706` + // Minimum execution time: 51_230 nanoseconds. + Weight::from_parts(61_363_456, 10706) + // Standard Error: 13_970 + .saturating_add(Weight::from_parts(50_244, 0).saturating_mul(o.into())) + // Standard Error: 13_970 + .saturating_add(Weight::from_parts(62_184, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -671,12 +653,16 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. - fn schedule_early_close_after_dispute(_o: u32, _n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `986 + o * (16 ±0)` - // Estimated: `14444` - // Minimum execution time: 98_240 nanoseconds. - Weight::from_parts(129_586_211, 14444) + fn schedule_early_close_after_dispute(o: u32, n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `970 + o * (16 ±0)` + // Estimated: `14430` + // Minimum execution time: 96_271 nanoseconds. + Weight::from_parts(119_475_237, 14430) + // Standard Error: 22_292 + .saturating_add(Weight::from_parts(90_541, 0).saturating_mul(o.into())) + // Standard Error: 22_292 + .saturating_add(Weight::from_parts(12_780, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -692,14 +678,14 @@ impl WeightInfoZeitgeist for WeightInfo { /// The range of component `n` is `[0, 63]`. fn schedule_early_close_as_market_creator(o: u32, n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `824 + o * (16 ±0)` - // Estimated: `14444` - // Minimum execution time: 75_620 nanoseconds. - Weight::from_parts(92_020_605, 14444) - // Standard Error: 13_677 - .saturating_add(Weight::from_parts(115_579, 0).saturating_mul(o.into())) - // Standard Error: 13_677 - .saturating_add(Weight::from_parts(28_959, 0).saturating_mul(n.into())) + // Measured: `808 + o * (16 ±0)` + // Estimated: `14430` + // Minimum execution time: 74_650 nanoseconds. + Weight::from_parts(92_510_070, 14430) + // Standard Error: 11_870 + .saturating_add(Weight::from_parts(29_343, 0).saturating_mul(o.into())) + // Standard Error: 11_870 + .saturating_add(Weight::from_parts(37_672, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -713,14 +699,16 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. - fn dispute_early_close(_o: u32, n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `940 + o * (16 ±0) + n * (16 ±0)` - // Estimated: `14444` - // Minimum execution time: 72_551 nanoseconds. - Weight::from_parts(96_247_822, 14444) - // Standard Error: 11_213 - .saturating_add(Weight::from_parts(22_013, 0).saturating_mul(n.into())) + fn dispute_early_close(o: u32, n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `924 + o * (16 ±0) + n * (16 ±0)` + // Estimated: `14430` + // Minimum execution time: 71_610 nanoseconds. + Weight::from_parts(86_696_361, 14430) + // Standard Error: 13_050 + .saturating_add(Weight::from_parts(59_792, 0).saturating_mul(o.into())) + // Standard Error: 13_050 + .saturating_add(Weight::from_parts(64_792, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } @@ -732,12 +720,16 @@ impl WeightInfoZeitgeist for WeightInfo { /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. - fn reject_early_close_after_authority(_o: u32, _n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `830 + o * (16 ±0) + n * (16 ±0)` - // Estimated: `10720` - // Minimum execution time: 57_031 nanoseconds. - Weight::from_parts(75_086_876, 10720) + fn reject_early_close_after_authority(o: u32, n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `814 + o * (16 ±0) + n * (16 ±0)` + // Estimated: `10706` + // Minimum execution time: 55_950 nanoseconds. + Weight::from_parts(70_714_615, 10706) + // Standard Error: 14_905 + .saturating_add(Weight::from_parts(63_828, 0).saturating_mul(o.into())) + // Standard Error: 14_905 + .saturating_add(Weight::from_parts(40_198, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -805,7 +797,6 @@ impl WeightInfoZeitgeist for WeightInfo { .saturating_add(Weight::from_parts(0, 7884).saturating_mul(n.into())) } /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) /// Storage: Timestamp Now (r:1 w:0) /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) diff --git a/zrml/simple-disputes/src/lib.rs b/zrml/simple-disputes/src/lib.rs index ba02d764b..2a3401e5c 100644 --- a/zrml/simple-disputes/src/lib.rs +++ b/zrml/simple-disputes/src/lib.rs @@ -33,7 +33,7 @@ pub use simple_disputes_pallet_api::SimpleDisputesPalletApi; use zeitgeist_primitives::{ traits::{DisputeApi, DisputeMaxWeightApi, DisputeResolutionApi}, types::{ - BaseAsset, GlobalDisputeItem, Market, MarketDispute, MarketDisputeMechanism, MarketStatus, + GlobalDisputeItem, Market, MarketDispute, MarketDisputeMechanism, MarketStatus, OutcomeReport, Report, ResultWithWeightInfo, }, }; @@ -115,7 +115,6 @@ mod pallet { BalanceOf, ::BlockNumber, MomentOf, - BaseAsset, MarketIdOf, >; pub(crate) type DisputesOf = BoundedVec< @@ -554,11 +553,11 @@ where { use frame_support::traits::Get; use sp_runtime::{traits::AccountIdConversion, SaturatedConversion}; - use zeitgeist_primitives::types::{MarketBonds, ScoringRule}; + use zeitgeist_primitives::types::{Asset, MarketBonds, ScoringRule}; zeitgeist_primitives::types::Market { market_id: Default::default(), - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creation: zeitgeist_primitives::types::MarketCreation::Permissionless, creator_fee: sp_runtime::Perbill::zero(), creator: T::PalletId::get().into_account_truncating(), diff --git a/zrml/simple-disputes/src/mock.rs b/zrml/simple-disputes/src/mock.rs index b74e497f0..4d1d40cdb 100644 --- a/zrml/simple-disputes/src/mock.rs +++ b/zrml/simple-disputes/src/mock.rs @@ -30,13 +30,13 @@ use sp_runtime::{ }; use zeitgeist_primitives::{ constants::mock::{ - BlockHashCount, ExistentialDepositsAssets, GetNativeCurrencyId, MaxDisputes, MaxReserves, + BlockHashCount, ExistentialDeposits, GetNativeCurrencyId, MaxDisputes, MaxReserves, MinimumPeriod, OutcomeBond, OutcomeFactor, SimpleDisputesPalletId, BASE, }, traits::{DisputeResolutionApi, MarketOfDisputeResolutionApi}, types::{ - AccountIdTest, Amount, Assets, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, Hash, - Index, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, + Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, }, }; @@ -165,10 +165,10 @@ impl orml_currencies::Config for Runtime { impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; - type CurrencyId = Assets; + type CurrencyId = CurrencyId; type DustRemovalWhitelist = Everything; type RuntimeEvent = (); - type ExistentialDeposits = ExistentialDepositsAssets; + type ExistentialDeposits = ExistentialDeposits; type MaxLocks = (); type MaxReserves = MaxReserves; type CurrencyHooks = (); diff --git a/zrml/simple-disputes/src/tests.rs b/zrml/simple-disputes/src/tests.rs index d8d51098c..fe0b7cfe0 100644 --- a/zrml/simple-disputes/src/tests.rs +++ b/zrml/simple-disputes/src/tests.rs @@ -27,14 +27,14 @@ use zeitgeist_primitives::{ constants::mock::{OutcomeBond, OutcomeFactor}, traits::DisputeApi, types::{ - BaseAsset, Deadlines, Market, MarketBonds, MarketCreation, MarketDispute, + Asset, Deadlines, Market, MarketBonds, MarketCreation, MarketDispute, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, OutcomeReport, ScoringRule, }, }; const DEFAULT_MARKET: MarketOf = Market { market_id: 0, - base_asset: BaseAsset::Ztg, + base_asset: Asset::Ztg, creation: MarketCreation::Permissionless, creator_fee: sp_runtime::Perbill::zero(), creator: 0, diff --git a/zrml/swaps/Cargo.toml b/zrml/swaps/Cargo.toml index 2437f503c..a999bf4e6 100644 --- a/zrml/swaps/Cargo.toml +++ b/zrml/swaps/Cargo.toml @@ -2,7 +2,6 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } -orml-tokens = { workspace = true } orml-traits = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } @@ -15,6 +14,7 @@ zeitgeist-primitives = { workspace = true } env_logger = { workspace = true, optional = true } orml-currencies = { workspace = true, optional = true } +orml-tokens = { workspace = true, optional = true } pallet-balances = { workspace = true, optional = true } pallet-timestamp = { workspace = true, optional = true } sp-api = { workspace = true, optional = true } @@ -32,6 +32,7 @@ zrml-swaps = { workspace = true, features = ["mock"] } default = ["std"] mock = [ "orml-currencies/default", + "orml-tokens/default", "pallet-balances/default", "pallet-timestamp/default", "sp-api/default", @@ -51,7 +52,6 @@ std = [ "frame-benchmarking?/std", "frame-support/std", "frame-system/std", - "orml-tokens/default", "orml-traits/std", "parity-scale-codec/std", "sp-runtime/std", diff --git a/zrml/swaps/fuzz/create_pool.rs b/zrml/swaps/fuzz/create_pool.rs index 932212420..4e7470e87 100644 --- a/zrml/swaps/fuzz/create_pool.rs +++ b/zrml/swaps/fuzz/create_pool.rs @@ -18,14 +18,13 @@ #![no_main] +mod utils; + use libfuzzer_sys::fuzz_target; +use utils::{construct_asset, PoolCreationData}; use zeitgeist_primitives::traits::Swaps as SwapsTrait; - use zrml_swaps::mock::{ExtBuilder, Swaps}; -mod utils; -use utils::{construct_asset, PoolCreationData}; - fuzz_target!(|data: PoolCreationData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { diff --git a/zrml/swaps/fuzz/pool_exit.rs b/zrml/swaps/fuzz/pool_exit.rs index 7f595412b..0645a4750 100644 --- a/zrml/swaps/fuzz/pool_exit.rs +++ b/zrml/swaps/fuzz/pool_exit.rs @@ -1,4 +1,4 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -18,22 +18,20 @@ #![no_main] -use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; - mod utils; + +use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; use utils::{construct_asset, GeneralPoolData}; -use zeitgeist_primitives::types::Asset; -use zrml_swaps::mock::AssetManager; +use zeitgeist_primitives::types::{Asset, SerdeWrapper}; +use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: GeneralPoolData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { // ensure that the account origin has a sufficient balance - // use orml_traits::MultiCurrency; required for this for a in &data.pool_creation.assets { - let _ = AssetManager::deposit( + let _ = Currencies::deposit( construct_asset(*a), &data.pool_creation.origin, data.pool_creation.amount, @@ -42,7 +40,11 @@ fuzz_target!(|data: GeneralPoolData| { let pool_creator = data.pool_creation.origin; let pool_id = data.pool_creation.create_pool(); // to exit a pool, origin also needs to have the pool tokens of the pool that they're exiting - let _ = AssetManager::deposit(Asset::PoolShare(pool_id), &pool_creator, data.pool_amount); + let _ = Currencies::deposit( + Asset::PoolShare(SerdeWrapper(pool_id)), + &pool_creator, + data.pool_amount, + ); let _ = Swaps::pool_exit( RuntimeOrigin::signed(data.origin), pool_id, diff --git a/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs b/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs index 11f3c60f9..e86ed4dec 100644 --- a/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs +++ b/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs @@ -1,4 +1,4 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -18,23 +18,20 @@ #![no_main] -use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; - mod utils; + +use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; use utils::{construct_asset, ExactAssetAmountData}; -use zrml_swaps::mock::AssetManager; - -use zeitgeist_primitives::types::Asset; +use zeitgeist_primitives::types::{Asset, SerdeWrapper}; +use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: ExactAssetAmountData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { // ensure that the account origin has a sufficient balance - // use orml_traits::MultiCurrency; required for this for a in &data.pool_creation.assets { - let _ = AssetManager::deposit( + let _ = Currencies::deposit( construct_asset(*a), &data.pool_creation.origin, data.pool_creation.amount, @@ -44,7 +41,11 @@ fuzz_target!(|data: ExactAssetAmountData| { let pool_creator = data.pool_creation.origin; let pool_id = data.pool_creation.create_pool(); // to exit a pool, origin also needs to have the pool tokens of the pool that they're exiting - let _ = AssetManager::deposit(Asset::PoolShare(pool_id), &pool_creator, data.pool_amount); + let _ = Currencies::deposit( + Asset::PoolShare(SerdeWrapper(pool_id)), + &pool_creator, + data.pool_amount, + ); let _ = Swaps::pool_exit_with_exact_asset_amount( RuntimeOrigin::signed(data.origin), pool_id, diff --git a/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs b/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs index 072fd3a42..2fd939c78 100644 --- a/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs +++ b/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs @@ -1,4 +1,4 @@ -// Copyright 2023-2024 Forecasting Technologies LTD. +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -18,22 +18,20 @@ #![no_main] -use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; - mod utils; + +use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; use utils::{construct_asset, ExactAmountData}; -use zeitgeist_primitives::types::Asset; -use zrml_swaps::mock::AssetManager; +use zeitgeist_primitives::types::{Asset, SerdeWrapper}; +use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: ExactAmountData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { // ensure that the account origin has a sufficient balance - // use orml_traits::MultiCurrency; required for this for a in &data.pool_creation.assets { - let _ = AssetManager::deposit( + let _ = Currencies::deposit( construct_asset(*a), &data.pool_creation.origin, data.pool_creation.amount, @@ -43,7 +41,11 @@ fuzz_target!(|data: ExactAmountData| { let pool_creator = data.pool_creation.origin; let pool_id = data.pool_creation.create_pool(); // to exit a pool, origin also needs to have the pool tokens of the pool that they're exiting - let _ = AssetManager::deposit(Asset::PoolShare(pool_id), &pool_creator, data.pool_amount); + let _ = Currencies::deposit( + Asset::PoolShare(SerdeWrapper(pool_id)), + &pool_creator, + data.pool_amount, + ); let _ = Swaps::pool_exit_with_exact_pool_amount( RuntimeOrigin::signed(data.origin), pool_id, diff --git a/zrml/swaps/fuzz/pool_join.rs b/zrml/swaps/fuzz/pool_join.rs index 76a1bf87c..27023affa 100644 --- a/zrml/swaps/fuzz/pool_join.rs +++ b/zrml/swaps/fuzz/pool_join.rs @@ -17,22 +17,19 @@ #![no_main] +mod utils; + use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; - -use utils::GeneralPoolData; -use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; -mod utils; -use utils::construct_asset; -use zrml_swaps::mock::AssetManager; +use utils::{construct_asset, GeneralPoolData}; +use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: GeneralPoolData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { // ensure that the account origin has a sufficient balance - // use orml_traits::MultiCurrency; required for this for a in &data.pool_creation.assets { - let _ = AssetManager::deposit( + let _ = Currencies::deposit( construct_asset(*a), &data.pool_creation.origin, data.pool_creation.amount, diff --git a/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs b/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs index 91f1808d6..677b5a5a6 100644 --- a/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs +++ b/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs @@ -17,22 +17,19 @@ #![no_main] -use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; - -use utils::ExactAssetAmountData; mod utils; + +use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; -use utils::construct_asset; -use zrml_swaps::mock::AssetManager; +use utils::{construct_asset, ExactAssetAmountData}; +use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: ExactAssetAmountData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { // ensure that the account origin has a sufficient balance - // use orml_traits::MultiCurrency; required for this for a in &data.pool_creation.assets { - let _ = AssetManager::deposit( + let _ = Currencies::deposit( construct_asset(*a), &data.pool_creation.origin, // In order to successfully join the pool, data.asset_amount more tokens needed diff --git a/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs b/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs index f480592dd..a1574b749 100644 --- a/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs +++ b/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs @@ -17,22 +17,19 @@ #![no_main] -use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{ExtBuilder, RuntimeOrigin, Swaps}; - -use utils::ExactAmountData; mod utils; + +use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; -use utils::construct_asset; -use zrml_swaps::mock::AssetManager; +use utils::{construct_asset, ExactAmountData}; +use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: ExactAmountData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { // ensure that the account origin has a sufficient balance - // use orml_traits::MultiCurrency; required for this for a in &data.pool_creation.assets { - let _ = AssetManager::deposit( + let _ = Currencies::deposit( construct_asset(*a), &data.pool_creation.origin, // In order to successfully join the pool, data.asset_amount more tokens needed diff --git a/zrml/swaps/fuzz/swap_exact_amount_in.rs b/zrml/swaps/fuzz/swap_exact_amount_in.rs index 4aba80d2f..60a594cc4 100644 --- a/zrml/swaps/fuzz/swap_exact_amount_in.rs +++ b/zrml/swaps/fuzz/swap_exact_amount_in.rs @@ -17,32 +17,27 @@ #![no_main] -use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{AssetManager, ExtBuilder, RuntimeOrigin, Swaps}; - -use utils::SwapExactAmountInData; mod utils; + +use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; -use utils::construct_asset; +use utils::{construct_asset, SwapExactAmountInData}; +use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: SwapExactAmountInData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { // ensure that the account origin has a sufficient balance - // use orml_traits::MultiCurrency; required for this for a in &data.pool_creation.assets { - let _ = AssetManager::deposit( + let _ = Currencies::deposit( construct_asset(*a), &data.pool_creation.origin, data.pool_creation.amount, ); } let pool_id = data.pool_creation.create_pool(); - let _ = AssetManager::deposit( - construct_asset(data.asset_in), - &data.origin, - data.asset_amount_in, - ); + let _ = + Currencies::deposit(construct_asset(data.asset_in), &data.origin, data.asset_amount_in); let _ = Swaps::swap_exact_amount_in( RuntimeOrigin::signed(data.origin), pool_id, diff --git a/zrml/swaps/fuzz/swap_exact_amount_out.rs b/zrml/swaps/fuzz/swap_exact_amount_out.rs index 93eab4325..05ca45474 100644 --- a/zrml/swaps/fuzz/swap_exact_amount_out.rs +++ b/zrml/swaps/fuzz/swap_exact_amount_out.rs @@ -17,20 +17,19 @@ #![no_main] -use libfuzzer_sys::fuzz_target; -use zrml_swaps::mock::{AssetManager, ExtBuilder, RuntimeOrigin, Swaps}; - mod utils; + +use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; use utils::{construct_asset, SwapExactAmountOutData}; +use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: SwapExactAmountOutData| { let mut ext = ExtBuilder::default().build(); ext.execute_with(|| { // ensure that the account origin has a sufficient balance - // use orml_traits::MultiCurrency; required for this for a in &data.pool_creation.assets { - let _ = AssetManager::deposit( + let _ = Currencies::deposit( construct_asset(*a), &data.pool_creation.origin, data.pool_creation.amount, @@ -39,7 +38,7 @@ fuzz_target!(|data: SwapExactAmountOutData| { let pool_id = data.pool_creation.create_pool(); if let Some(amount) = data.asset_amount_in { - let _ = AssetManager::deposit(construct_asset(data.asset_in), &data.origin, amount); + let _ = Currencies::deposit(construct_asset(data.asset_in), &data.origin, amount); } let _ = Swaps::swap_exact_amount_out( diff --git a/zrml/swaps/fuzz/utils.rs b/zrml/swaps/fuzz/utils.rs index c3e1084f9..eaf3f17fe 100644 --- a/zrml/swaps/fuzz/utils.rs +++ b/zrml/swaps/fuzz/utils.rs @@ -29,7 +29,7 @@ use zeitgeist_primitives::{ MaxAssets, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinWeight, BASE, CENT, }, traits::Swaps as SwapsTrait, - types::{Asset, PoolId, ScalarPosition}, + types::{Asset, PoolId, ScalarPosition, SerdeWrapper}, }; use zrml_swaps::mock::Swaps; @@ -43,7 +43,7 @@ pub fn construct_asset(seed: (u8, u128, u16)) -> Asset { if seed1 % 2 == 0 { ScalarPosition::Long } else { ScalarPosition::Short }; Asset::ScalarOutcome(seed0, scalar_position) } - 2 => Asset::PoolShare(seed0), + 2 => Asset::PoolShare(SerdeWrapper(seed0)), _ => Asset::Ztg, } } diff --git a/zrml/swaps/rpc/src/lib.rs b/zrml/swaps/rpc/src/lib.rs index 5591fb2f9..4cad2388f 100644 --- a/zrml/swaps/rpc/src/lib.rs +++ b/zrml/swaps/rpc/src/lib.rs @@ -27,14 +27,14 @@ use jsonrpsee::{ proc_macros::rpc, types::error::{CallError, ErrorObject}, }; -use parity_scale_codec::{Codec, HasCompact, MaxEncodedLen}; +use parity_scale_codec::{Codec, MaxEncodedLen}; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_runtime::{ generic::BlockId, traits::{Block as BlockT, MaybeDisplay, MaybeFromStr, NumberFor}, }; -use zeitgeist_primitives::types::Asset; +use zeitgeist_primitives::types::{Asset, SerdeWrapper}; pub use zrml_swaps_runtime_api::SwapsApi as SwapsRuntimeApi; @@ -42,7 +42,7 @@ pub use zrml_swaps_runtime_api::SwapsApi as SwapsRuntimeApi; pub trait SwapsApi where Balance: FromStr + Display + parity_scale_codec::MaxEncodedLen, - MarketId: FromStr + Display + HasCompact + MaxEncodedLen + Ord, + MarketId: FromStr + Display + parity_scale_codec::MaxEncodedLen + Ord, PoolId: FromStr + Display, BlockNumber: Ord + parity_scale_codec::MaxEncodedLen + Display + FromStr, { @@ -51,7 +51,7 @@ where &self, pool_id: PoolId, at: Option, - ) -> RpcResult>; + ) -> RpcResult>>; #[method(name = "swaps_poolAccountId", aliases = ["swaps_poolAccountIdAt"])] async fn pool_account_id(&self, pool_id: PoolId, at: Option) @@ -65,7 +65,7 @@ where asset_out: Asset, with_fees: bool, at: Option, - ) -> RpcResult; + ) -> RpcResult>; #[method(name = "swaps_getSpotPrices")] async fn get_spot_prices( @@ -75,7 +75,7 @@ where asset_out: Asset, with_fees: bool, blocks: Vec, - ) -> RpcResult>; + ) -> RpcResult>>; } /// A struct that implements the [`SwapsApi`]. @@ -116,22 +116,14 @@ where C::Api: SwapsRuntimeApi, PoolId: Clone + Codec + MaybeDisplay + MaybeFromStr + Send + 'static, AccountId: Clone + Display + Codec + Send + 'static, - Balance: Codec + HasCompact + MaybeDisplay + MaybeFromStr + MaxEncodedLen + Send + 'static, - MarketId: Clone - + Codec - + HasCompact - + MaybeDisplay - + MaybeFromStr - + MaxEncodedLen - + Ord - + Send - + 'static, + Balance: Codec + MaybeDisplay + MaybeFromStr + MaxEncodedLen + Send + 'static, + MarketId: Clone + Codec + MaybeDisplay + MaybeFromStr + MaxEncodedLen + Ord + Send + 'static, { async fn pool_shares_id( &self, pool_id: PoolId, at: Option<::Hash>, - ) -> RpcResult> { + ) -> RpcResult>> { let api = self.client.runtime_api(); let at = BlockId::hash(at.unwrap_or_else(|| //if the block hash is not supplied assume the best block @@ -175,7 +167,7 @@ where asset_out: Asset, with_fees: bool, at: Option<::Hash>, - ) -> RpcResult { + ) -> RpcResult> { let api = self.client.runtime_api(); let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash)); let res = @@ -196,7 +188,7 @@ where asset_out: Asset, with_fees: bool, blocks: Vec>, - ) -> RpcResult> { + ) -> RpcResult>> { let api = self.client.runtime_api(); blocks .into_iter() diff --git a/zrml/swaps/runtime-api/src/lib.rs b/zrml/swaps/runtime-api/src/lib.rs index 2045560a2..b76ca8038 100644 --- a/zrml/swaps/runtime-api/src/lib.rs +++ b/zrml/swaps/runtime-api/src/lib.rs @@ -19,24 +19,26 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] -use parity_scale_codec::{Codec, HasCompact, MaxEncodedLen}; +use parity_scale_codec::{Codec, MaxEncodedLen}; use sp_runtime::traits::{MaybeDisplay, MaybeFromStr}; -use zeitgeist_primitives::types::Asset; +use zeitgeist_primitives::types::{Asset, SerdeWrapper}; sp_api::decl_runtime_apis! { pub trait SwapsApi where PoolId: Codec, AccountId: Codec, - Balance: Codec + MaybeDisplay + MaybeFromStr + HasCompact + MaxEncodedLen, - MarketId: Codec + HasCompact + MaxEncodedLen, + Balance: Codec + MaybeDisplay + MaybeFromStr + MaxEncodedLen, + MarketId: Codec + MaxEncodedLen, { - fn pool_shares_id(pool_id: PoolId) -> Asset; + fn pool_shares_id(pool_id: PoolId) -> Asset>; + fn pool_account_id(pool_id: &PoolId) -> AccountId; + fn get_spot_price( pool_id: &PoolId, asset_in: &Asset, asset_out: &Asset, with_fees: bool, - ) -> Balance; + ) -> SerdeWrapper; } } diff --git a/zrml/swaps/src/benchmarks.rs b/zrml/swaps/src/benchmarks.rs index c7442491a..55f125067 100644 --- a/zrml/swaps/src/benchmarks.rs +++ b/zrml/swaps/src/benchmarks.rs @@ -61,7 +61,7 @@ where for i in 0..asset_count { let asset = T::Asset::create_asset_id(i as u128); assets.push(asset); - T::AssetManager::deposit(asset, owner, asset_amount).unwrap() + T::MultiCurrency::deposit(asset, owner, asset_amount).unwrap() } (assets, asset_amount) } @@ -181,7 +181,7 @@ benchmarks! { true, ); let asset_in = assets[0]; - T::AssetManager::deposit(asset_in, &caller, u64::MAX.saturated_into()).unwrap(); + T::MultiCurrency::deposit(asset_in, &caller, u64::MAX.saturated_into()).unwrap(); let asset_out = assets[asset_count as usize - 1]; let min_asset_amount_out: Option> = Some(0u128.saturated_into()); let max_price = Some(u128::MAX.saturated_into()); @@ -217,7 +217,7 @@ benchmarks! { true, ); let asset_in = assets[0]; - T::AssetManager::deposit(asset_in, &caller, u64::MAX.saturated_into()).unwrap(); + T::MultiCurrency::deposit(asset_in, &caller, u64::MAX.saturated_into()).unwrap(); let asset_out = assets[asset_count as usize - 1]; let max_asset_amount_in: Option> = Some(u128::MAX.saturated_into()); let max_price = Some(u128::MAX.saturated_into()); diff --git a/zrml/swaps/src/lib.rs b/zrml/swaps/src/lib.rs index 17e2e0132..af2880d61 100644 --- a/zrml/swaps/src/lib.rs +++ b/zrml/swaps/src/lib.rs @@ -81,7 +81,7 @@ mod pallet { fixed::FixedMul, }, traits::{PoolSharesId, Swaps}, - types::PoolId, + types::{PoolId, SerdeWrapper}, }; /// The current storage version. @@ -89,9 +89,9 @@ mod pallet { pub(crate) type AccountIdOf = ::AccountId; pub(crate) type AssetOf = - <::AssetManager as MultiCurrency>>::CurrencyId; + <::MultiCurrency as MultiCurrency>>::CurrencyId; pub(crate) type BalanceOf = - <::AssetManager as MultiCurrency>>::Balance; + <::MultiCurrency as MultiCurrency>>::Balance; pub(crate) type PoolOf = Pool, BalanceOf>; const MIN_BALANCE: u128 = CENT; @@ -359,8 +359,6 @@ mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type AssetManager: MultiCurrency; - type Asset: Parameter + Member + Copy @@ -368,7 +366,9 @@ mod pallet { + MaybeSerializeDeserialize + Ord + TypeInfo - + PoolSharesId; + + PoolSharesId>; + + type MultiCurrency: MultiCurrency; type RuntimeEvent: From> + IsType<::RuntimeEvent>; @@ -602,13 +602,13 @@ mod pallet { // If transferring to `who` triggers the existential deposit, burn the tokens // instead. let new_balance = - T::AssetManager::free_balance(asset, &who).checked_add_res(&amount)?; - if new_balance >= T::AssetManager::minimum_balance(asset) { + T::MultiCurrency::free_balance(asset, &who).checked_add_res(&amount)?; + if new_balance >= T::MultiCurrency::minimum_balance(asset) { ensure!(amount >= amount_bound, Error::::LimitOut); - T::AssetManager::transfer(asset, &pool_account_id, &who, amount)?; + T::MultiCurrency::transfer(asset, &pool_account_id, &who, amount)?; } else { ensure!(amount_bound.is_zero(), Error::::LimitOut); - T::AssetManager::withdraw(asset, &pool_account_id, amount)?; + T::MultiCurrency::withdraw(asset, &pool_account_id, amount)?; } Ok(()) }, @@ -696,7 +696,7 @@ mod pallet { pool: &pool, transfer_asset: |amount, amount_bound, asset| { ensure!(amount <= amount_bound, Error::::LimitIn); - T::AssetManager::transfer(asset, &who, &pool_account_id, amount)?; + T::MultiCurrency::transfer(asset, &who, &pool_account_id, amount)?; Ok(()) }, transfer_pool: || Self::mint_pool_shares(pool_id, &who, pool_amount), @@ -860,15 +860,15 @@ mod pallet { let pool = Pallet::::pool_by_id(pool_id)?; let pool_account_id = Pallet::::pool_account_id(&pool_id); ensure!( - T::AssetManager::free_balance(asset_in, &who) >= asset_amount_in, + T::MultiCurrency::free_balance(asset_in, &who) >= asset_amount_in, Error::::InsufficientBalance ); let params = SwapExactAmountParams { // TODO(#1215): This probably doesn't need to be a closure. asset_amounts: || { - let balance_out = T::AssetManager::free_balance(asset_out, &pool_account_id); - let balance_in = T::AssetManager::free_balance(asset_in, &pool_account_id); + let balance_out = T::MultiCurrency::free_balance(asset_out, &pool_account_id); + let balance_in = T::MultiCurrency::free_balance(asset_in, &pool_account_id); ensure!( asset_amount_in <= balance_in.bmul(MAX_IN_RATIO.saturated_into())?, Error::::MaxInRatio @@ -922,13 +922,13 @@ mod pallet { let params = SwapExactAmountParams { asset_amounts: || { - let balance_out = T::AssetManager::free_balance(asset_out, &pool_account_id); + let balance_out = T::MultiCurrency::free_balance(asset_out, &pool_account_id); ensure!( asset_amount_out <= balance_out.bmul(MAX_OUT_RATIO.saturated_into())?, Error::::MaxOutRatio, ); - let balance_in = T::AssetManager::free_balance(asset_in, &pool_account_id); + let balance_in = T::MultiCurrency::free_balance(asset_in, &pool_account_id); let asset_amount_in: BalanceOf = crate::math::calc_in_given_out( balance_in.saturated_into(), Self::pool_weight_rslt(&pool, &asset_in)?.saturated_into(), @@ -969,8 +969,8 @@ mod pallet { ensure!(pool.assets.binary_search(asset_in).is_ok(), Error::::AssetNotInPool); ensure!(pool.assets.binary_search(asset_out).is_ok(), Error::::AssetNotInPool); let pool_account = Self::pool_account_id(pool_id); - let balance_in = T::AssetManager::free_balance(*asset_in, &pool_account); - let balance_out = T::AssetManager::free_balance(*asset_out, &pool_account); + let balance_in = T::MultiCurrency::free_balance(*asset_in, &pool_account); + let balance_out = T::MultiCurrency::free_balance(*asset_out, &pool_account); let in_weight = Self::pool_weight_rslt(&pool, asset_in)?; let out_weight = Self::pool_weight_rslt(&pool, asset_out)?; @@ -993,7 +993,7 @@ mod pallet { /// The minimum allowed balance of `asset` in a liquidity pool. pub(crate) fn min_balance(asset: AssetOf) -> BalanceOf { - T::AssetManager::minimum_balance(asset).max(MIN_BALANCE.saturated_into()) + T::MultiCurrency::minimum_balance(asset).max(MIN_BALANCE.saturated_into()) } /// Returns the minimum allowed balance allowed for a pool with id `pool_id` containing @@ -1023,7 +1023,7 @@ mod pallet { return Ok(()); } let pool_shares_id = Self::pool_shares_id(pool_id); - let total_issuance = T::AssetManager::total_issuance(pool_shares_id); + let total_issuance = T::MultiCurrency::total_issuance(pool_shares_id); let max_withdraw = total_issuance.saturating_sub(Self::min_balance(pool_shares_id).saturated_into()); ensure!(amount <= max_withdraw, Error::::PoolDrain); @@ -1041,7 +1041,7 @@ mod pallet { return Ok(()); } let pool_account = Self::pool_account_id(&pool_id); - let balance = T::AssetManager::free_balance(asset, &pool_account); + let balance = T::MultiCurrency::free_balance(asset, &pool_account); let max_withdraw = balance.saturating_sub(Self::min_balance(asset).saturated_into()); ensure!(amount <= max_withdraw, Error::::PoolDrain); Ok(()) @@ -1054,9 +1054,9 @@ mod pallet { ) -> DispatchResult { let shares_id = Self::pool_shares_id(pool_id); // Check that the account has at least as many free shares as we wish to burn! - T::AssetManager::ensure_can_withdraw(shares_id, from, amount) + T::MultiCurrency::ensure_can_withdraw(shares_id, from, amount) .map_err(|_| Error::::InsufficientBalance)?; - T::AssetManager::withdraw(shares_id, from, amount)?; + T::MultiCurrency::withdraw(shares_id, from, amount)?; Ok(()) } @@ -1088,11 +1088,11 @@ mod pallet { amount: BalanceOf, ) -> DispatchResult { let shares_id = Self::pool_shares_id(pool_id); - T::AssetManager::deposit(shares_id, to, amount) + T::MultiCurrency::deposit(shares_id, to, amount) } pub(crate) fn pool_shares_id(pool_id: PoolId) -> AssetOf { - T::Asset::pool_shares_id(pool_id) + T::Asset::pool_shares_id(SerdeWrapper(pool_id)) } pub fn pool_by_id(pool_id: PoolId) -> Result, DispatchError> @@ -1186,17 +1186,17 @@ mod pallet { Self::check_provided_values_len_must_equal_assets_len(&assets, &weights)?; for (asset, weight) in assets.iter().copied().zip(weights) { - let free_balance = T::AssetManager::free_balance(asset, &who); + let free_balance = T::MultiCurrency::free_balance(asset, &who); ensure!(free_balance >= amount, Error::::InsufficientBalance); ensure!(weight >= T::MinWeight::get(), Error::::BelowMinimumWeight); ensure!(weight <= T::MaxWeight::get(), Error::::AboveMaximumWeight); map.insert(asset, weight); total_weight = total_weight.checked_add_res(&weight)?; - T::AssetManager::transfer(asset, &who, &pool_account, amount)?; + T::MultiCurrency::transfer(asset, &who, &pool_account, amount)?; } ensure!(total_weight <= T::MaxTotalWeight::get(), Error::::MaxTotalWeight); - T::AssetManager::deposit(pool_shares_id, &who, amount)?; + T::MultiCurrency::deposit(pool_shares_id, &who, amount)?; let pool = Pool { assets: sorted_assets @@ -1239,8 +1239,8 @@ mod pallet { let pool_account = Self::pool_account_id(&pool_id); let asset_len = pool.assets.len() as u32; for asset in pool.assets.into_iter() { - let amount = T::AssetManager::free_balance(asset, &pool_account); - T::AssetManager::withdraw(asset, &pool_account, amount)?; + let amount = T::MultiCurrency::free_balance(asset, &pool_account); + T::MultiCurrency::withdraw(asset, &pool_account, amount)?; } // NOTE: Currently we don't clean up accounts with pool_share_id. // TODO(#792): Remove pool_share_id asset for accounts! It may require storage migration. diff --git a/zrml/swaps/src/mock.rs b/zrml/swaps/src/mock.rs index de0c3fa27..324d4b7da 100644 --- a/zrml/swaps/src/mock.rs +++ b/zrml/swaps/src/mock.rs @@ -45,8 +45,8 @@ use zeitgeist_primitives::{ BASE, }, types::{ - AccountIdTest, Amount, Asset, Assets, Balance, BasicCurrencyAdapter, BlockNumber, - BlockTest, Hash, Index, MarketId, Moment, PoolId, UncheckedExtrinsicTest, + AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, + CurrencyId, Hash, Index, MarketId, Moment, PoolId, SerdeWrapper, UncheckedExtrinsicTest, }, }; @@ -92,10 +92,9 @@ construct_runtime!( } ); -pub type AssetManager = Currencies; - impl crate::Config for Runtime { type Asset = Asset; + type MultiCurrency = Currencies; type RuntimeEvent = RuntimeEvent; type ExitFee = ExitFeeMock; type MaxAssets = MaxAssets; @@ -105,7 +104,6 @@ impl crate::Config for Runtime { type MinAssets = MinAssets; type MinWeight = MinWeight; type PalletId = SwapsPalletId; - type AssetManager = AssetManager; type WeightInfo = zrml_swaps::weights::WeightInfo; } @@ -144,7 +142,7 @@ impl orml_currencies::Config for Runtime { } parameter_type_with_key! { - pub ExistentialDeposits: |currency_id: Assets| -> Balance { + pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { &BASE_ASSET => ExistentialDeposit::get(), Asset::Ztg => ExistentialDeposit::get(), @@ -181,7 +179,7 @@ where impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; - type CurrencyId = Assets; + type CurrencyId = CurrencyId; type DustRemovalWhitelist = DustRemovalWhitelist; type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; @@ -254,16 +252,16 @@ sp_api::mock_impl_runtime_apis! { asset_in: &Asset, asset_out: &Asset, with_fees: bool, - ) -> Balance { - Swaps::get_spot_price(pool_id, asset_in, asset_out, with_fees).ok().unwrap_or(0) + ) -> SerdeWrapper { + SerdeWrapper(Swaps::get_spot_price(pool_id, asset_in, asset_out, with_fees).ok().unwrap_or(0)) } fn pool_account_id(pool_id: &PoolId) -> AccountIdTest { Swaps::pool_account_id(pool_id) } - fn pool_shares_id(pool_id: PoolId) -> Asset { - Asset::PoolShare(pool_id) + fn pool_shares_id(pool_id: PoolId) -> Asset> { + Asset::PoolShare(SerdeWrapper(pool_id)) } } } diff --git a/zrml/swaps/src/utils.rs b/zrml/swaps/src/utils.rs index 7e746b808..041f8fc37 100644 --- a/zrml/swaps/src/utils.rs +++ b/zrml/swaps/src/utils.rs @@ -53,17 +53,17 @@ where ensure!(p.pool.bound(&p.asset), Error::::AssetNotInPool); let pool_account = Pallet::::pool_account_id(&p.pool_id); - let asset_balance = T::AssetManager::free_balance(p.asset, &pool_account); + let asset_balance = T::MultiCurrency::free_balance(p.asset, &pool_account); (p.ensure_balance)(asset_balance)?; let pool_shares_id = Pallet::::pool_shares_id(p.pool_id); - let total_issuance = T::AssetManager::total_issuance(pool_shares_id); + let total_issuance = T::MultiCurrency::total_issuance(pool_shares_id); let asset_amount = (p.asset_amount)(asset_balance, total_issuance)?; let pool_amount = (p.pool_amount)(asset_balance, total_issuance)?; Pallet::::burn_pool_shares(p.pool_id, &p.who, pool_amount)?; - T::AssetManager::transfer(p.asset, &pool_account, &p.who, asset_amount)?; + T::MultiCurrency::transfer(p.asset, &pool_account, &p.who, asset_amount)?; (p.event)(PoolAssetEvent { asset: p.asset, @@ -89,16 +89,16 @@ where Pallet::::ensure_pool_is_active(p.pool)?; let pool_shares_id = Pallet::::pool_shares_id(p.pool_id); let pool_account_id = Pallet::::pool_account_id(&p.pool_id); - let total_issuance = T::AssetManager::total_issuance(pool_shares_id); + let total_issuance = T::MultiCurrency::total_issuance(pool_shares_id); ensure!(p.pool.bound(&p.asset), Error::::AssetNotInPool); - let asset_balance = T::AssetManager::free_balance(p.asset, p.pool_account_id); + let asset_balance = T::MultiCurrency::free_balance(p.asset, p.pool_account_id); let asset_amount = (p.asset_amount)(asset_balance, total_issuance)?; let pool_amount = (p.pool_amount)(asset_balance, total_issuance)?; Pallet::::mint_pool_shares(p.pool_id, &p.who, pool_amount)?; - T::AssetManager::transfer(p.asset, &p.who, &pool_account_id, asset_amount)?; + T::MultiCurrency::transfer(p.asset, &p.who, &pool_account_id, asset_amount)?; (p.event)(PoolAssetEvent { asset: p.asset, @@ -121,7 +121,7 @@ where T: Config, { let pool_shares_id = Pallet::::pool_shares_id(p.pool_id); - let total_issuance = T::AssetManager::total_issuance(pool_shares_id); + let total_issuance = T::MultiCurrency::total_issuance(pool_shares_id); let ratio = p.pool_amount.bdiv(total_issuance)?; Pallet::::check_provided_values_len_must_equal_assets_len(&p.pool.assets, &p.asset_bounds)?; @@ -130,7 +130,7 @@ where let mut transferred = Vec::with_capacity(p.asset_bounds.len()); for (asset, amount_bound) in p.pool.assets.iter().cloned().zip(p.asset_bounds.iter().cloned()) { - let balance = T::AssetManager::free_balance(asset, p.pool_account_id); + let balance = T::MultiCurrency::free_balance(asset, p.pool_account_id); // Dusting may result in zero balances in the pool; just ignore these. if balance.is_zero() { continue; @@ -183,8 +183,8 @@ where let [asset_amount_in, asset_amount_out] = (p.asset_amounts)()?; - T::AssetManager::transfer(p.asset_in, &p.who, p.pool_account_id, asset_amount_in)?; - T::AssetManager::transfer(p.asset_out, p.pool_account_id, &p.who, asset_amount_out)?; + T::MultiCurrency::transfer(p.asset_in, &p.who, p.pool_account_id, asset_amount_in)?; + T::MultiCurrency::transfer(p.asset_out, p.pool_account_id, &p.who, asset_amount_out)?; let spot_price_after = Pallet::::get_spot_price(&p.pool_id, &p.asset_in, &p.asset_out, true)?; diff --git a/zrml/swaps/src/weights.rs b/zrml/swaps/src/weights.rs index 4e923b1d0..554d3505d 100644 --- a/zrml/swaps/src/weights.rs +++ b/zrml/swaps/src/weights.rs @@ -67,8 +67,6 @@ pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { /// Storage: Swaps Pools (r:1 w:0) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:66 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:131 w:131) @@ -92,8 +90,6 @@ impl WeightInfoZeitgeist for WeightInfo { } /// Storage: Swaps Pools (r:1 w:0) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:3 w:3) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) @@ -111,8 +107,6 @@ impl WeightInfoZeitgeist for WeightInfo { } /// Storage: Swaps Pools (r:1 w:0) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:3 w:3) @@ -130,8 +124,6 @@ impl WeightInfoZeitgeist for WeightInfo { } /// Storage: Swaps Pools (r:1 w:0) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:66 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:131 w:131) @@ -153,8 +145,6 @@ impl WeightInfoZeitgeist for WeightInfo { } /// Storage: Swaps Pools (r:1 w:0) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:3 w:3) @@ -170,8 +160,6 @@ impl WeightInfoZeitgeist for WeightInfo { } /// Storage: Swaps Pools (r:1 w:0) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:1 w:1) /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:3 w:3) @@ -187,8 +175,6 @@ impl WeightInfoZeitgeist for WeightInfo { } /// Storage: Swaps Pools (r:1 w:0) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:4 w:4) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:0) @@ -204,8 +190,6 @@ impl WeightInfoZeitgeist for WeightInfo { } /// Storage: Swaps Pools (r:1 w:0) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:4 w:4) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:0) @@ -249,8 +233,6 @@ impl WeightInfoZeitgeist for WeightInfo { } /// Storage: Swaps Pools (r:1 w:1) /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:65 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) /// Storage: Tokens Accounts (r:65 w:65) /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) /// Storage: Tokens TotalIssuance (r:65 w:65) From 19a35345b8bf6fcbbcf016c909b1c668b452f1c8 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 8 Jul 2024 16:57:55 +0200 Subject: [PATCH 2/7] Merge `main` into `develop` (#1345) * Update dependencies to Polkadot v1.1.0 (#1331) * Update dependencies (#1319) * Update dependencies to polkadot-v1.1.0 * Format code * Remove duplicate dependencies * Update zrml-asset-router (#1321) * Update zrml-primitives * Partially update asset-router * Finalize logic adjustments in asset-router * Make asset-router tests compilable * Correct Inspect routing for market assets in Currencies * Directly invoke Inspect API for Currencies * Add tests for remaining Unbalances functions * Update remaining Zeitgeist pallets (#1322) * Update zrml-asset-router (#1321) * Upgrade zrml-market-commons * Upgrade zrml-authorized && use MockBlock instead of MockBlockU32 * Upgrade zrml-court * Upgrade zrml-global-disputes * Upgrade liquidity mining * Upgrade zrml-rikiddo * Upgrade zrml-simple-disputes * Upgrade zrml-styx * Upgrade zrml-orderbook * Upgrade zrml-parimutuel * Upgrade zrml-swaps * Upgrade zrml-prediction-markets * Upgrade zrml-neo-swaps * Upgrade zrml-hybrid-router * Update license headers * Update runtime (#1323) * Update weight files & Runtime enum * Use workspace metadata * Always use serde serialization for asset types * Make battery station standalone runtime compilable * Make benchmark and try-runtime feature compilable * Make BS build with all features * Make parachain tests compile * Partially fix xcm tests * Use safe xcm version 2 * Update Zeitgeist runtime (except xcm tests) * Format code * Remove deprecated comment * Integrate new xcm-emulator (#1324) * Integrate new xcm-emulator environment * Utilize new xcm-emulator interfaces * Spawn relay-para network using patched xcm-emulator * Use proper collator genesis config * Fix Rococo tests * Finalize Battery Station XCM tests * Finalize Zeitgeist XCM tests * Update client (#1327) * Fix rpc and work on client update * Finalize standalone client * Update parachain client * Use same try-runtime subcommand in every case * Update node/src/cli.rs Co-authored-by: Malte Kliemann * Update try-runtime* Makefile targets --------- Co-authored-by: Malte Kliemann * Make CI succeed and add migrations (#1329) * Fix rpc and work on client update * Finalize standalone client * Update parachain client * Use same try-runtime subcommand in every case * Satisfy Clippy * Fix benchmarks * Add migrations * Satisfy Clippy * Update moonkit depedencies * Free disk space more aggressively --------- Co-authored-by: Malte Kliemann * Update spec version, try-runtime Makefile * Fix copyright notices * Fix broken chain state (#1336) * Add `StorageVersion` fix and contrats fix migrations * Don't set pallet-balances' storage version * Remove migrations from pallet-contracts config * Clear storage tries of contracts * Fix migration and info logs in try-runtime * Fix licenses and comments * Fix formatting --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --------- Co-authored-by: Harald Heckmann Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> * Merge * Fix benchmark * Fix compiler error * Fix tests and imports * Fix imports (again...) * Fix orderbook benchmarks * Fix fuzz tests * Fix formatting * Fix orderbook fuzz --------- Co-authored-by: Harald Heckmann Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .github/workflows/coverage.yml | 2 +- .github/workflows/rust.yml | 10 +- Cargo.lock | 8306 +++++++++-------- Cargo.toml | 353 +- Makefile | 39 +- macros/Cargo.toml | 2 +- node/Cargo.toml | 19 +- node/src/chain_spec/additional_chain_spec.rs | 4 +- node/src/chain_spec/battery_station.rs | 6 +- node/src/chain_spec/dev.rs | 6 +- node/src/chain_spec/mod.rs | 17 +- node/src/chain_spec/zeitgeist.rs | 10 +- node/src/cli.rs | 189 +- node/src/cli/cli_parachain.rs | 44 +- node/src/command.rs | 103 +- node/src/rpc.rs | 4 +- node/src/service.rs | 67 +- node/src/service/service_parachain.rs | 131 +- node/src/service/service_standalone.rs | 155 +- primitives/Cargo.toml | 6 +- primitives/src/asset.rs | 39 +- primitives/src/constants/mock.rs | 4 +- primitives/src/math/checked_ops_res.rs | 2 +- primitives/src/math/fixed.rs | 6 +- primitives/src/math/root.rs | 3 + .../src/traits/hybrid_router_amm_api.rs | 2 +- .../src/traits/hybrid_router_orderbook_api.rs | 2 +- .../src/traits/market_commons_pallet_api.rs | 8 +- primitives/src/traits/swaps.rs | 4 +- primitives/src/types.rs | 4 +- runtime/battery-station/Cargo.toml | 26 +- .../xcm/genesis/battery_station.rs | 77 + .../src/integration_tests/xcm/genesis/mod.rs | 19 + .../integration_tests/xcm/genesis/rococo.rs | 150 + .../src/integration_tests/xcm/mod.rs | 3 +- .../src/integration_tests/xcm/setup.rs | 140 +- .../src/integration_tests/xcm/test_net.rs | 181 +- .../xcm/tests/currency_id_convert.rs | 142 +- .../integration_tests/xcm/tests/transfers.rs | 405 +- runtime/battery-station/src/lib.rs | 10 +- .../battery-station/src/parachain_params.rs | 17 +- runtime/battery-station/src/parameters.rs | 20 +- .../src/xcm_config/asset_registry.rs | 15 +- .../battery-station/src/xcm_config/config.rs | 82 +- runtime/common/Cargo.toml | 6 +- runtime/common/src/fees.rs | 205 +- runtime/common/src/lib.rs | 485 +- runtime/common/src/weights/frame_system.rs | 13 + runtime/common/src/weights/pallet_assets.rs | 491 + runtime/common/src/weights/pallet_balances.rs | 133 +- .../common/src/weights/pallet_contracts.rs | 3555 ++++--- .../common/src/weights/pallet_democracy.rs | 442 +- .../src/weights/pallet_parachain_staking.rs | 843 +- runtime/zeitgeist/Cargo.toml | 27 +- .../src/integration_tests/xcm/genesis/mod.rs | 19 + .../integration_tests/xcm/genesis/polkadot.rs | 135 + .../xcm/genesis/zeitgeist.rs | 81 + .../src/integration_tests/xcm/mod.rs | 3 +- .../src/integration_tests/xcm/setup.rs | 146 +- .../src/integration_tests/xcm/test_net.rs | 178 +- .../xcm/tests/currency_id_convert.rs | 132 +- .../integration_tests/xcm/tests/transfers.rs | 487 +- runtime/zeitgeist/src/lib.rs | 15 +- runtime/zeitgeist/src/parachain_params.rs | 17 +- runtime/zeitgeist/src/parameters.rs | 20 +- .../src/xcm_config/asset_registry.rs | 15 +- runtime/zeitgeist/src/xcm_config/config.rs | 78 +- rust-toolchain | 2 +- zrml/authorized/Cargo.toml | 2 +- zrml/authorized/src/benchmarks.rs | 7 +- zrml/authorized/src/lib.rs | 18 +- zrml/authorized/src/mock.rs | 58 +- zrml/authorized/src/mock_storage.rs | 5 +- zrml/authorized/src/tests.rs | 5 +- zrml/court/Cargo.toml | 5 +- zrml/court/src/benchmarks.rs | 43 +- zrml/court/src/lib.rs | 53 +- zrml/court/src/mock.rs | 51 +- zrml/court/src/mock_storage.rs | 10 +- zrml/court/src/tests.rs | 42 +- zrml/global-disputes/Cargo.toml | 5 +- zrml/global-disputes/src/lib.rs | 33 +- zrml/global-disputes/src/mock.rs | 42 +- zrml/global-disputes/src/tests.rs | 8 +- zrml/global-disputes/src/utils.rs | 3 +- zrml/hybrid-router/Cargo.toml | 9 +- zrml/hybrid-router/src/benchmarking.rs | 12 +- zrml/hybrid-router/src/lib.rs | 13 +- zrml/hybrid-router/src/mock.rs | 132 +- zrml/hybrid-router/src/tests/buy.rs | 2 +- zrml/hybrid-router/src/tests/mod.rs | 2 +- zrml/hybrid-router/src/tests/sell.rs | 2 +- zrml/hybrid-router/src/types.rs | 2 +- zrml/liquidity-mining/Cargo.toml | 3 +- zrml/liquidity-mining/src/lib.rs | 26 +- zrml/liquidity-mining/src/mock.rs | 49 +- zrml/liquidity-mining/src/tests.rs | 2 +- ...track_incentives_based_on_bought_shares.rs | 15 +- .../track_incentives_based_on_sold_shares.rs | 4 +- zrml/liquidity-mining/src/utils.rs | 4 +- zrml/market-commons/Cargo.toml | 3 +- zrml/market-commons/src/lib.rs | 16 +- zrml/market-commons/src/mock.rs | 44 +- .../src/types/market_builder.rs | 7 +- zrml/neo-swaps/Cargo.toml | 7 +- zrml/neo-swaps/src/benchmarking.rs | 39 +- zrml/neo-swaps/src/lib.rs | 12 +- .../traits/liquidity_tree_helper.rs | 7 +- .../liquidity_tree/types/liquidity_tree.rs | 14 +- .../types/liquidity_tree_child_indices.rs | 20 +- zrml/neo-swaps/src/math.rs | 4 + zrml/neo-swaps/src/migration.rs | 20 +- zrml/neo-swaps/src/mock.rs | 125 +- zrml/neo-swaps/src/tests/buy.rs | 4 +- zrml/orderbook/Cargo.toml | 2 +- zrml/orderbook/fuzz/Cargo.toml | 2 +- .../fuzz/orderbook_v1_full_workflow.rs | 4 +- zrml/orderbook/src/benchmarks.rs | 4 +- zrml/orderbook/src/lib.rs | 16 +- zrml/orderbook/src/mock.rs | 46 +- zrml/orderbook/src/utils.rs | 3 +- zrml/parimutuel/Cargo.toml | 5 +- zrml/parimutuel/src/benchmarking.rs | 14 +- zrml/parimutuel/src/lib.rs | 12 +- zrml/parimutuel/src/mock.rs | 45 +- zrml/prediction-markets/Cargo.toml | 13 +- zrml/prediction-markets/fuzz/Cargo.toml | 2 +- .../prediction-markets/runtime-api/Cargo.toml | 2 +- zrml/prediction-markets/src/benchmarks.rs | 34 +- zrml/prediction-markets/src/lib.rs | 68 +- zrml/prediction-markets/src/mock.rs | 217 +- .../src/orml_asset_registry.rs | 257 - zrml/prediction-markets/src/tests/mod.rs | 5 +- zrml/rikiddo/Cargo.toml | 2 +- zrml/rikiddo/fuzz/Cargo.toml | 2 +- zrml/rikiddo/src/lib.rs | 4 +- zrml/rikiddo/src/mock.rs | 44 +- zrml/rikiddo/src/types.rs | 4 +- zrml/rikiddo/src/types/ema_market_volume.rs | 4 +- zrml/rikiddo/src/types/rikiddo_sigmoid_mv.rs | 4 +- zrml/rikiddo/src/types/sigmoid_fee.rs | 4 +- zrml/simple-disputes/Cargo.toml | 4 +- zrml/simple-disputes/src/benchmarks.rs | 5 +- zrml/simple-disputes/src/lib.rs | 31 +- zrml/simple-disputes/src/mock.rs | 53 +- zrml/simple-disputes/src/weights.rs | 36 +- zrml/styx/Cargo.toml | 4 +- zrml/styx/src/benchmarks.rs | 5 +- zrml/styx/src/lib.rs | 3 +- zrml/styx/src/mock.rs | 36 +- zrml/styx/src/tests.rs | 5 +- zrml/swaps/Cargo.toml | 2 +- zrml/swaps/fuzz/Cargo.toml | 2 +- zrml/swaps/fuzz/pool_exit.rs | 8 +- .../fuzz/pool_exit_with_exact_asset_amount.rs | 8 +- .../fuzz/pool_exit_with_exact_pool_amount.rs | 8 +- zrml/swaps/fuzz/utils.rs | 4 +- zrml/swaps/rpc/Cargo.toml | 2 +- zrml/swaps/rpc/src/lib.rs | 33 +- zrml/swaps/runtime-api/Cargo.toml | 2 +- zrml/swaps/src/benchmarks.rs | 3 +- zrml/swaps/src/fixed.rs | 5 +- zrml/swaps/src/lib.rs | 12 +- zrml/swaps/src/math.rs | 2 +- zrml/swaps/src/mock.rs | 45 +- zrml/swaps/src/tests.rs | 2 + 166 files changed, 11060 insertions(+), 9430 deletions(-) create mode 100644 runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.rs create mode 100644 runtime/battery-station/src/integration_tests/xcm/genesis/mod.rs create mode 100644 runtime/battery-station/src/integration_tests/xcm/genesis/rococo.rs create mode 100644 runtime/common/src/weights/pallet_assets.rs create mode 100644 runtime/zeitgeist/src/integration_tests/xcm/genesis/mod.rs create mode 100644 runtime/zeitgeist/src/integration_tests/xcm/genesis/polkadot.rs create mode 100644 runtime/zeitgeist/src/integration_tests/xcm/genesis/zeitgeist.rs delete mode 100644 zrml/prediction-markets/src/orml_asset_registry.rs diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8affb0d66..6e034f9e7 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install rust toolchain run: rustup show diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a814b4d88..c8fe30515 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -58,7 +58,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh @@ -84,7 +84,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh @@ -106,7 +106,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh @@ -132,7 +132,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh @@ -158,7 +158,7 @@ jobs: - name: Free up disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false + tool-cache: true - name: Install build tools run: ./scripts/init.sh diff --git a/Cargo.lock b/Cargo.lock index 50d882012..a0970a374 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,20 +14,20 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.26.2", + "gimli 0.27.3", ] [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.27.3", + "gimli 0.28.1", ] [[package]] @@ -36,25 +36,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", -] - [[package]] name = "aead" version = "0.5.2" @@ -67,118 +48,68 @@ dependencies = [ [[package]] name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", - "cipher 0.4.4", + "cipher", "cpufeatures", ] [[package]] name = "aes-gcm" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "cipher 0.3.0", - "ctr 0.8.0", - "ghash 0.4.4", - "subtle", -] - -[[package]] -name = "aes-gcm" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.5.2", - "aes 0.8.3", - "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", + "aead", + "aes", + "cipher", + "ctr", + "ghash", "subtle", ] -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.14", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.10", + "getrandom 0.2.14", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "always-assert" version = "0.1.3" @@ -211,58 +142,57 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "approx" @@ -273,32 +203,219 @@ dependencies = [ "num-traits", ] +[[package]] +name = "aquamarine" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "arbitrary" -version = "1.3.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d098ff73c1ca148721f37baad5ea6a465a13f9573aba8641fbbbae8164a54e" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" dependencies = [ "derive_arbitrary", ] [[package]] -name = "arc-swap" -version = "1.6.0" +name = "ark-bls12-381" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] [[package]] -name = "array-bytes" -version = "4.2.0" +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-scale" +version = "0.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +checksum = "49b08346a3e38e2be792ef53ee168623c9244d968ff00cd70fb9932f6fe36393" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", +] + +[[package]] +name = "ark-scale" +version = "0.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f69c00b3b529be29528a6f2fd5fa7b1790f8bed81b9cdca17e326538545a179" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ark-secret-scalar" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-transcript" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] [[package]] name = "array-bytes" -version = "6.1.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" +checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" [[package]] name = "arrayref" @@ -306,6 +423,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + [[package]] name = "arrayvec" version = "0.5.2" @@ -318,48 +444,20 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time 0.3.24", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", "num-traits", "rusticata-macros", "thiserror", - "time 0.3.24", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", + "time", ] [[package]] @@ -385,56 +483,192 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "asn1_der" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" - [[package]] name = "assert_matches" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +dependencies = [ + "concurrent-queue", + "event-listener 5.3.0", + "event-listener-strategy 0.5.2", + "futures-core", + "pin-project-lite 0.2.14", +] + +[[package]] +name = "async-executor" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand 2.1.0", + "futures-lite 2.3.0", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + [[package]] name = "async-io" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", - "rustix 0.37.23", + "polling 2.8.0", + "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.3.0", + "parking", + "polling 3.7.0", + "rustix 0.38.34", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" -version = "2.7.0" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite 0.2.14", +] + +[[package]] +name = "async-net" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" dependencies = [ - "event-listener", + "async-io 1.13.0", + "blocking", + "futures-lite 1.13.0", ] +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.34", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "async-signal" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +dependencies = [ + "async-io 2.3.2", + "async-lock 3.3.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.34", + "signal-hook-registry", + "slab", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] @@ -447,14 +681,20 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", ] +[[package]] +name = "atomic-take" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" + [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" @@ -469,9 +709,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "az" @@ -481,19 +721,41 @@ checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ - "addr2line 0.20.0", + "addr2line 0.21.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.31.1", + "object 0.32.2", "rustc-demangle", ] +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.1" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-scale 0.0.12", + "ark-serialize", + "ark-std", + "dleq_vrf", + "fflonk", + "merlin 3.0.0", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "ring 0.1.0", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "base-x" version = "0.2.11" @@ -502,15 +764,9 @@ checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" [[package]] name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - -[[package]] -name = "base58" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" @@ -520,9 +776,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -543,6 +799,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-timestamp", "cumulus-primitives-utility", + "env_logger 0.10.2", "frame-benchmarking", "frame-executive", "frame-support", @@ -574,12 +831,14 @@ dependencies = [ "pallet-democracy", "pallet-grandpa", "pallet-identity", + "pallet-im-online", + "pallet-insecure-randomness-collective-flip", "pallet-membership", + "pallet-message-queue", "pallet-multisig", "pallet-parachain-staking", "pallet-preimage", "pallet-proxy", - "pallet-randomness-collective-flip", "pallet-scheduler", "pallet-sudo", "pallet-timestamp", @@ -591,121 +850,70 @@ dependencies = [ "pallet-xcm", "parachain-info", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-parachains", "rococo-runtime", "scale-info", "session-keys-primitives", "sp-api", + "sp-authority-discovery", "sp-block-builder", "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", "sp-debug-derive", - "sp-finality-grandpa", "sp-inherents", "sp-io", "sp-offchain", "sp-runtime", "sp-session", - "sp-std", - "sp-transaction-pool", - "sp-version", - "substrate-fixed", - "substrate-wasm-builder", - "test-case", - "xcm", - "xcm-builder", - "xcm-emulator", - "xcm-executor", - "zeitgeist-primitives", - "zrml-authorized", - "zrml-court", - "zrml-global-disputes", - "zrml-hybrid-router", - "zrml-liquidity-mining", - "zrml-market-commons", - "zrml-neo-swaps", - "zrml-orderbook", - "zrml-parimutuel", - "zrml-prediction-markets", - "zrml-rikiddo", - "zrml-simple-disputes", - "zrml-styx", - "zrml-swaps", - "zrml-swaps-runtime-api", -] - -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - -[[package]] -name = "beefy-gadget" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ - "array-bytes 4.2.0", - "async-trait", - "fnv", - "futures 0.3.28", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "sc-client-api", - "sc-consensus", - "sc-keystore", - "sc-network", - "sc-network-common", - "sc-network-gossip", - "sc-utils", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-beefy", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-keystore", - "sp-mmr-primitives", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", - "wasm-timer", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-fixed", + "substrate-wasm-builder", + "test-case", + "xcm-emulator", + "zeitgeist-primitives", + "zrml-authorized", + "zrml-court", + "zrml-global-disputes", + "zrml-hybrid-router", + "zrml-liquidity-mining", + "zrml-market-commons", + "zrml-neo-swaps", + "zrml-orderbook", + "zrml-parimutuel", + "zrml-prediction-markets", + "zrml-rikiddo", + "zrml-simple-disputes", + "zrml-styx", + "zrml-swaps", + "zrml-swaps-runtime-api", ] [[package]] -name = "beefy-gadget-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" dependencies = [ - "beefy-gadget", - "futures 0.3.28", - "jsonrpsee", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "sc-rpc", "serde", - "sp-beefy", - "sp-core", - "sp-runtime", - "thiserror", ] [[package]] -name = "beefy-merkle-tree" +name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "sp-api", - "sp-beefy", - "sp-runtime", + "hash-db", + "log", ] [[package]] @@ -719,9 +927,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.64.0" +version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ "bitflags 1.3.2", "cexpr", @@ -729,14 +937,30 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", + "prettyplease 0.2.19", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 1.0.109", + "syn 2.0.60", +] + +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", ] +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" @@ -745,9 +969,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -770,40 +994,49 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq 0.1.5", +] + [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake2s_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq 0.3.0", ] [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", "cfg-if", "constant_time_eq 0.3.0", - "digest 0.10.7", ] [[package]] @@ -812,7 +1045,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -837,35 +1070,45 @@ dependencies = [ ] [[package]] -name = "block-modes" -version = "0.7.0" +name = "block-padding" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", + "byte-tools", ] [[package]] -name = "block-padding" -version = "0.1.5" +name = "blocking" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" dependencies = [ - "byte-tools", + "async-channel 2.2.1", + "async-lock 3.3.0", + "async-task", + "futures-io", + "futures-lite 2.3.0", + "piper", ] [[package]] -name = "block-padding" -version = "0.2.1" +name = "bounded-collections" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" +checksum = "ca548b6163b872067dc5eb82fd130c56881435e30367d2073594a3d9744120dd" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] [[package]] name = "bounded-vec" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3372be4090bf9d4da36bd8ba7ce6ca1669503d0cf6e667236c6df7f053153eb6" +checksum = "68534a48cbf63a4b1323c433cf21238c9ec23711e0df13b08c33e5c2082663ce" dependencies = [ "thiserror", ] @@ -876,11 +1119,20 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + [[package]] name = "bstr" -version = "1.6.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -897,9 +1149,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -915,21 +1167,21 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "bzip2-sys" @@ -953,45 +1205,36 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" -version = "0.14.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.22", "serde", "serde_json", + "thiserror", ] [[package]] name = "cc" -version = "1.0.80" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f1226cd9da55587234753d1245dd5b132343ea240f26b6a9003d68706141ba" +checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" dependencies = [ "jobserver", "libc", -] - -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle", + "once_cell", ] [[package]] @@ -1005,9 +1248,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.10.3" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", ] @@ -1026,75 +1269,55 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chacha20" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher", "cpufeatures", - "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.4.3", + "aead", "chacha20", - "cipher 0.3.0", + "cipher", "poly1305", "zeroize", ] [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time 0.1.45", "wasm-bindgen", - "winapi", + "windows-targets 0.52.5", ] [[package]] name = "cid" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" +checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" dependencies = [ "core2", "multibase", - "multihash 0.16.3", + "multihash", "serde", "unsigned-varint", ] -[[package]] -name = "cipher" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "cipher" version = "0.4.4" @@ -1103,6 +1326,7 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] @@ -1116,9 +1340,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -1127,20 +1351,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.19" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.19" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -1150,31 +1373,30 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "coarsetime" -version = "0.1.23" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90d114103adbc625300f346d4d09dfb4ab1c4a8df6868435dd903392ecf4354" +checksum = "13b3839cf01bb7960114be3ccf2340f541b6d0c81f8690b007b2b39f750f7e5d" dependencies = [ "libc", - "once_cell", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasix", "wasm-bindgen", ] @@ -1196,15 +1418,35 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "comfy-table" -version = "6.2.0" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" +checksum = "b34115915337defe99b2aff5c2ce6771e5fbc4079f4b506301f5cf394c8452f7" dependencies = [ - "strum", - "strum_macros", + "strum 0.26.2", + "strum_macros 0.26.2", "unicode-width", ] +[[package]] +name = "common" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "merlin 3.0.0", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "common-runtime" version = "0.5.2" @@ -1226,12 +1468,12 @@ dependencies = [ "pallet-contracts-primitives", "pallet-democracy", "pallet-identity", + "pallet-insecure-randomness-collective-flip", "pallet-membership", "pallet-multisig", "pallet-parachain-staking", "pallet-preimage", "pallet-proxy", - "pallet-randomness-collective-flip", "pallet-scheduler", "pallet-timestamp", "pallet-transaction-payment", @@ -1244,24 +1486,57 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + [[package]] name = "const-oid" -version = "0.9.4" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.14", + "once_cell", + "tiny-keccak", +] [[package]] name = "constant_time_eq" -version = "0.2.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "constant_time_eq" @@ -1277,9 +1552,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -1287,9 +1562,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core2" @@ -1321,36 +1596,36 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "cranelift-bforest" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52056f6d0584484b57fa6c1a65c1fcb15f3780d8b6a758426d9e3084169b2ddd" +checksum = "1277fbfa94bc82c8ec4af2ded3e639d49ca5f7f3c7eeab2c66accd135ece4e70" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fed94c8770dc25d01154c3ffa64ed0b3ba9d583736f305fed7beebe5d9cf74" +checksum = "c6e8c31ad3b2270e9aeec38723888fe1b0ace3bea2b06b3f749ccf46661d3220" dependencies = [ - "arrayvec 0.7.4", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", "cranelift-isle", - "gimli 0.26.2", + "gimli 0.27.3", + "hashbrown 0.13.2", "log", "regalloc2", "smallvec", @@ -1359,33 +1634,33 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c451b81faf237d11c7e4f3165eeb6bac61112762c5cfe7b4c0fb7241474358f" +checksum = "c8ac5ac30d62b2d66f12651f6b606dbdfd9c2cfd0908de6b387560a277c5c9da" dependencies = [ "cranelift-codegen-shared", ] [[package]] name = "cranelift-codegen-shared" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c940133198426d26128f08be2b40b0bd117b84771fd36798969c4d712d81fc" +checksum = "dd82b8b376247834b59ed9bdc0ddeb50f517452827d4a11bccf5937b213748b8" [[package]] name = "cranelift-entity" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87a0f1b2fdc18776956370cf8d9b009ded3f855350c480c1c52142510961f352" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34897538b36b216cc8dd324e73263596d51b8cf610da6498322838b2546baf8a" +checksum = "64a25d9d0a0ae3079c463c34115ec59507b4707175454f0eee0891e83e30e82d" dependencies = [ "cranelift-codegen", "log", @@ -1395,15 +1670,15 @@ dependencies = [ [[package]] name = "cranelift-isle" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b2629a569fae540f16a76b70afcc87ad7decb38dc28fa6c648ac73b51e78470" +checksum = "80de6a7d0486e4acbd5f9f87ec49912bf4c8fb6aea00087b989685460d4469ba" [[package]] name = "cranelift-native" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20937dab4e14d3e225c5adfc9c7106bafd4ac669bdb43027b911ff794c6fb318" +checksum = "bb6b03e0e03801c4b3fd8ce0758a94750c07a44e7944cc0ffbf0d3f2e7c79b00" dependencies = [ "cranelift-codegen", "libc", @@ -1412,96 +1687,62 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80fc2288957a94fd342a015811479de1837850924166d1f1856d8406e6f3609b" +checksum = "ff3220489a3d928ad91e59dd7aeaa8b3de18afb554a6211213673a71c90737ac" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", "wasmparser", "wasmtime-types", ] -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" - [[package]] name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", - "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -1511,9 +1752,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.4.9" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1529,7 +1770,7 @@ checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum", ] [[package]] @@ -1552,33 +1793,25 @@ dependencies = [ "subtle", ] -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher 0.3.0", -] - [[package]] name = "ctr" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher 0.4.4", + "cipher", ] [[package]] name = "cumulus-client-cli" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "clap", "parity-scale-codec", "sc-chain-spec", "sc-cli", + "sc-client-api", "sc-service", "sp-core", "sp-runtime", @@ -1588,14 +1821,14 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", - "futures 0.3.28", + "futures 0.3.30", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -1611,37 +1844,43 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-client-pov-recovery", "cumulus-primitives-core", "cumulus-relay-chain-interface", "dyn-clone", - "futures 0.3.28", + "futures 0.3.30", "log", "parity-scale-codec", "polkadot-primitives", "sc-client-api", "sc-consensus", + "sc-consensus-babe", + "schnellru", "sp-blockchain", "sp-consensus", + "sp-consensus-slots", + "sp-core", "sp-runtime", + "sp-timestamp", "sp-trie", + "substrate-prometheus-endpoint", "tracing", ] [[package]] name = "cumulus-client-consensus-relay-chain" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.28", - "parking_lot 0.12.1", + "futures 0.3.30", + "parking_lot 0.12.2", "sc-consensus", "sp-api", "sp-block-builder", @@ -1657,16 +1896,16 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-relay-chain-interface", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "sc-client-api", "sp-blockchain", @@ -1680,11 +1919,12 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "parity-scale-codec", "polkadot-node-primitives", @@ -1703,35 +1943,42 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-common", + "cumulus-client-network", "cumulus-client-pov-recovery", "cumulus-primitives-core", "cumulus-relay-chain-inprocess-interface", "cumulus-relay-chain-interface", "cumulus-relay-chain-minimal-node", - "futures 0.3.28", - "parking_lot 0.12.1", + "futures 0.3.30", "polkadot-primitives", "sc-client-api", "sc-consensus", + "sc-network", + "sc-network-sync", + "sc-network-transactions", + "sc-rpc", "sc-service", "sc-sysinfo", "sc-telemetry", + "sc-transaction-pool", + "sc-utils", "sp-api", "sp-blockchain", "sp-consensus", "sp-core", "sp-runtime", + "sp-transaction-pool", ] [[package]] name = "cumulus-pallet-dmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1741,14 +1988,14 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", - "xcm", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", ] [[package]] name = "cumulus-pallet-parachain-system" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1760,7 +2007,7 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "scale-info", "sp-core", "sp-externalities", @@ -1768,27 +2015,28 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-trie", "sp-version", - "xcm", + "staging-xcm", + "trie-db", ] [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "cumulus-pallet-xcm" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1797,14 +2045,14 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", - "xcm", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", ] [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -1817,31 +2065,32 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "cumulus-primitives-core" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", + "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-trie", - "xcm", + "staging-xcm", ] [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -1855,7 +2104,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-storage", "sp-trie", "tracing", @@ -1864,20 +2113,20 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", - "futures 0.3.28", + "futures 0.3.30", "parity-scale-codec", "sp-inherents", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-timestamp", ] [[package]] name = "cumulus-primitives-utility" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -1886,24 +2135,23 @@ dependencies = [ "polkadot-runtime-common", "sp-io", "sp-runtime", - "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "polkadot-cli", - "polkadot-client", "polkadot-service", "sc-cli", "sc-client-api", @@ -1920,11 +2168,11 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", - "futures 0.3.28", + "futures 0.3.30", "jsonrpsee-core", "parity-scale-codec", "polkadot-overseer", @@ -1933,74 +2181,77 @@ dependencies = [ "sp-blockchain", "sp-state-machine", "thiserror", - "tokio", ] [[package]] name = "cumulus-relay-chain-minimal-node" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 6.1.0", + "array-bytes", "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", - "futures 0.3.28", - "lru 0.9.0", + "futures 0.3.30", + "polkadot-availability-recovery", + "polkadot-collator-protocol", "polkadot-core-primitives", - "polkadot-network-bridge 0.9.38 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.38)", + "polkadot-network-bridge", + "polkadot-node-collation-generation", + "polkadot-node-core-runtime-api", "polkadot-node-network-protocol", "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", - "polkadot-service", "sc-authority-discovery", - "sc-client-api", - "sc-consensus", - "sc-keystore", "sc-network", "sc-network-common", "sc-service", - "sc-telemetry", "sc-tracing", - "sc-transaction-pool", - "sc-transaction-pool-api", + "sc-utils", + "schnellru", "sp-api", - "sp-blockchain", "sp-consensus", "sp-consensus-babe", "sp-runtime", - "tokio", "tracing", - "url", ] [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.28", + "either", + "futures 0.3.30", "futures-timer", "jsonrpsee", - "lru 0.9.0", "parity-scale-codec", - "polkadot-service", + "pin-project", + "polkadot-overseer", + "rand 0.8.5", "sc-client-api", "sc-rpc-api", + "sc-service", + "schnellru", "serde", "serde_json", + "smoldot", + "smoldot-light", "sp-api", "sp-authority-discovery", "sp-consensus-babe", "sp-core", + "sp-runtime", "sp-state-machine", "sp-storage", + "thiserror", "tokio", + "tokio-util", "tracing", "url", ] @@ -2008,14 +2259,15 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", "polkadot-primitives", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-trie", ] [[package]] @@ -2046,23 +2298,50 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0-rc.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", "fiat-crypto", - "packed_simd_2", - "platforms 3.0.2", + "platforms", + "rustc_version 0.4.0", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "curve25519-dalek-ng" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.6.4", + "subtle-ng", + "zeroize", +] + [[package]] name = "cxx" -version = "1.0.102" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f68e12e817cb19eaab81aaec582b4052d07debd3c3c6b083b9d361db47c7dc9d" +checksum = "21db378d04296a84d8b7d047c36bb3954f0b46529db725d7e62fb02f9ba53ccc" dependencies = [ "cc", "cxxbridge-flags", @@ -2072,9 +2351,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.102" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e789217e4ab7cf8cc9ce82253180a9fe331f35f5d339f0ccfe0270b39433f397" +checksum = "3e5262a7fa3f0bae2a55b767c223ba98032d7c328f5c13fa5cdc980b77fc0658" dependencies = [ "cc", "codespan-reporting", @@ -2082,72 +2361,37 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] name = "cxxbridge-flags" -version = "1.0.102" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78a19f4c80fd9ab6c882286fa865e92e07688f4387370a209508014ead8751d0" +checksum = "be8dcadd2e2fb4a501e1d9e93d6e88e6ea494306d8272069c92d5a9edf8855c0" [[package]] name = "cxxbridge-macro" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcfa71f66c8563c4fa9dd2bb68368d50267856f831ac5d85367e0805f9606c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.28", -] - -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.14.4" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +checksum = "ad08a837629ad949b73d032c637653d069e909cffe4ee7870b02301939ce39cc" dependencies = [ - "fnv", - "ident_case", "proc-macro2", "quote", - "strsim", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core", - "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "data-encoding-macro" -version = "0.1.13" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2155,9 +2399,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" dependencies = [ "data-encoding", "syn 1.0.109", @@ -2165,36 +2409,21 @@ dependencies = [ [[package]] name = "der" -version = "0.6.1" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", - "pem-rfc7468", "zeroize", ] -[[package]] -name = "der-parser" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" -dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -2204,9 +2433,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.6" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8810e7e2cf385b1e9b50d68264908ec367ba642c96d02edfe61c39e88e2a3c01" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "derivative" @@ -2231,45 +2463,25 @@ dependencies = [ ] [[package]] -name = "derive_arbitrary" -version = "1.3.1" +name = "derive-syn-parse" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e0efad4403bfc52dc201159c4b842a246a14b98c64b55dfd0f2d89729dfeb8" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", -] - -[[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro", + "syn 2.0.60", ] [[package]] -name = "derive_builder_core" -version = "0.11.2" +name = "derive_arbitrary" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ - "darling", "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] @@ -2316,6 +2528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] @@ -2369,7 +2582,51 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", +] + +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-scale 0.0.10", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.4", + "rand_core 0.6.4", + "zeroize", +] + +[[package]] +name = "docify" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" +dependencies = [ + "common-path", + "derive-syn-parse 0.2.0", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.60", + "termcolor", + "toml 0.8.2", + "walkdir", ] [[package]] @@ -2380,9 +2637,9 @@ checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dtoa" @@ -2413,42 +2670,46 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.12" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.14.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", + "spki", ] [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ + "pkcs8", "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.2", "ed25519", - "rand 0.7.3", + "rand_core 0.6.4", "serde", - "sha2 0.9.9", + "sha2 0.10.8", + "subtle", "zeroize", ] @@ -2466,27 +2727,39 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek 4.1.2", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core 0.6.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "either" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "elliptic-curve" -version = "0.12.3" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "der", "digest 0.10.7", "ff", "generic-array 0.14.7", "group", - "hkdf", - "pem-rfc7468", "pkcs8", "rand_core 0.6.4", "sec1", @@ -2494,13 +2767,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "enum-as-inner" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", @@ -2508,33 +2787,33 @@ dependencies = [ [[package]] name = "enumflags2" -version = "0.7.7" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.7" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] name = "enumn" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b893c4eb2dc092c811165f84dc7447fae16fb66521717968c34c509b39b1a5c5" +checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] @@ -2552,9 +2831,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -2577,41 +2856,72 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.2.8" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "errno-dragonfly", "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] -name = "errno" -version = "0.3.2" +name = "event-listener" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", + "concurrent-queue", + "parking", + "pin-project-lite 0.2.14", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "event-listener" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ - "cc", - "libc", + "concurrent-queue", + "parking", + "pin-project-lite 0.2.14", ] [[package]] name = "event-listener" -version = "2.5.3" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.14", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite 0.2.14", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.0", + "pin-project-lite 0.2.14", +] [[package]] name = "exit-future" @@ -2619,7 +2929,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", ] [[package]] @@ -2644,7 +2954,20 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 1.0.109", +] + +[[package]] +name = "expander" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e83c02035136f1592a47964ea60c05a50e4ed8b5892cfac197063850898d4d" +dependencies = [ + "blake2", + "fs-err", + "prettier-please", + "proc-macro2", + "quote", + "syn 2.0.60", ] [[package]] @@ -2670,9 +2993,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fatality" @@ -2692,7 +3015,7 @@ checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" dependencies = [ "expander 0.0.4", "indexmap 1.9.3", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -2710,19 +3033,32 @@ dependencies = [ [[package]] name = "ff" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", "subtle", ] +[[package]] +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#1e854f35e9a65d08b11a86291405cdc95baa0a35" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin 3.0.0", +] + [[package]] name = "fiat-crypto" -version = "0.1.20" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" +checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" [[package]] name = "file-per-thread-logger" @@ -2730,20 +3066,20 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "log", ] [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -2753,12 +3089,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36530797b9bf31cd4ff126dcfee8170f86b00cfdcea3269d73133cc0415945c3" dependencies = [ "either", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "scale-info", ] @@ -2772,7 +3108,7 @@ dependencies = [ "bytemuck", "half", "num-traits", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum", ] [[package]] @@ -2795,9 +3131,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "libz-sys", @@ -2822,16 +3158,16 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", ] [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -2845,7 +3181,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-support-procedural", @@ -2862,7 +3198,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-storage", "static_assertions", ] @@ -2870,10 +3206,10 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", - "array-bytes 4.2.0", + "array-bytes", "chrono", "clap", "comfy-table", @@ -2882,7 +3218,7 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "itertools", + "itertools 0.10.5", "lazy_static", "linked-hash-map", "log", @@ -2904,12 +3240,13 @@ dependencies = [ "sp-database", "sp-externalities", "sp-inherents", + "sp-io", "sp-keystore", "sp-runtime", "sp-state-machine", - "sp-std", "sp-storage", "sp-trie", + "sp-wasm-interface", "thiserror", "thousands", ] @@ -2917,53 +3254,54 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-election-provider-solution-type", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", "frame-try-runtime", + "log", "parity-scale-codec", "scale-info", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-tracing", ] [[package]] name = "frame-metadata" -version = "15.1.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ "cfg-if", "parity-scale-codec", @@ -2974,93 +3312,111 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "async-recursion", + "futures 0.3.30", + "indicatif", + "jsonrpsee", "log", "parity-scale-codec", "serde", "sp-core", "sp-io", "sp-runtime", + "sp-state-machine", + "spinners", "substrate-rpc-client", "tokio", + "tokio-retry", ] [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "aquamarine", "bitflags 1.3.2", + "docify", + "environmental", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", "log", - "once_cell", + "macro_magic", "parity-scale-codec", "paste", "scale-info", "serde", + "serde_json", "smallvec", "sp-api", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-core-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-metadata-ir", "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-tracing", "sp-weights", + "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse", + "derive-syn-parse 0.1.5", + "expander 2.1.0", "frame-support-procedural-tools", - "itertools", + "itertools 0.10.5", + "macro_magic", + "proc-macro-warning", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "cfg-if", "frame-support", "log", "parity-scale-codec", @@ -3069,7 +3425,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-version", "sp-weights", ] @@ -3077,7 +3433,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -3086,13 +3442,13 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "sp-api", @@ -3101,20 +3457,23 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "parity-scale-codec", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "fs-err" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] [[package]] name = "fs2" @@ -3126,6 +3485,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs4" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" +dependencies = [ + "rustix 0.38.34", + "windows-sys 0.48.0", +] + [[package]] name = "funty" version = "2.0.0" @@ -3140,9 +3509,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -3155,9 +3524,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -3165,15 +3534,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -3183,9 +3552,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -3198,19 +3567,32 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand 2.1.0", + "futures-core", + "futures-io", + "parking", + "pin-project-lite 0.2.14", +] + [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] @@ -3220,33 +3602,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.8", - "webpki 0.22.0", + "rustls 0.20.9", + "webpki", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures 0.1.31", "futures-channel", @@ -3256,7 +3638,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", "pin-utils", "slab", ] @@ -3276,7 +3658,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum", ] [[package]] @@ -3285,8 +3667,9 @@ version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum", "version_check", + "zeroize", ] [[package]] @@ -3312,9 +3695,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -3322,30 +3705,29 @@ dependencies = [ ] [[package]] -name = "ghash" -version = "0.4.4" +name = "getrandom_or_panic" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "opaque-debug 0.3.0", - "polyval 0.5.3", + "rand_core 0.6.4", ] [[package]] name = "ghash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ - "opaque-debug 0.3.0", - "polyval 0.6.1", + "opaque-debug 0.3.1", + "polyval", ] [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", "indexmap 1.9.3", @@ -3354,9 +3736,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -3366,22 +3748,22 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aca8bbd8e0707c1887a8bbb7e6b40e228f251ff5d62c8220a4a7a53c73aff006" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] name = "group" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", @@ -3390,9 +3772,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -3400,7 +3782,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -3409,15 +3791,15 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "handlebars" -version = "4.3.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" dependencies = [ "log", "pest", @@ -3429,9 +3811,9 @@ dependencies = [ [[package]] name = "hash-db" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" [[package]] name = "hash256-std-hasher" @@ -3448,7 +3830,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", ] [[package]] @@ -3457,14 +3839,19 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.11", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", + "serde", +] [[package]] name = "heck" @@ -3472,6 +3859,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -3483,9 +3876,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -3495,15 +3888,15 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac 0.12.1", ] @@ -3548,6 +3941,15 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -3561,9 +3963,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -3572,13 +3974,13 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", ] [[package]] @@ -3595,9 +3997,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -3607,23 +4009,24 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hydra-dx-math" -version = "7.7.0" -source = "git+https://github.com/galacticcouncil/HydraDX-node?tag=v21.1.1#564553c30caa1eccfa1b6504ec8d5130201c8765" +version = "8.0.1" +source = "git+https://github.com/galacticcouncil/HydraDX-node?tag=v25.0.0#8abf856afa839b798c4e39e38af2b2901f55739b" dependencies = [ "fixed", "num-traits", "parity-scale-codec", "primitive-types", "scale-info", - "sp-arithmetic", - "sp-std", + "serde", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=c8d2251cafadc108ba2f1f8a3208dc547ff38901)", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=c8d2251cafadc108ba2f1f8a3208dc547ff38901)", ] [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -3635,8 +4038,8 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.10", - "socket2 0.4.9", + "pin-project-lite 0.2.14", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -3645,31 +4048,33 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ + "futures-util", "http", "hyper", "log", - "rustls 0.20.8", + "rustls 0.21.12", "rustls-native-certs", "tokio", "tokio-rustls", + "webpki-roots 0.25.4", ] [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.48.0", + "windows-core 0.52.0", ] [[package]] @@ -3681,12 +4086,6 @@ dependencies = [ "cc", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "0.2.3" @@ -3700,9 +4099,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3710,31 +4109,31 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.7.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" dependencies = [ "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "if-watch" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" +checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io", + "async-io 2.3.2", "core-foundation", "fnv", - "futures 0.3.28", + "futures 0.3.30", "if-addrs", "ipnet", "log", "rtnetlink", "system-configuration", "tokio", - "windows 0.34.0", + "windows", ] [[package]] @@ -3766,6 +4165,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -3779,12 +4197,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.5", ] [[package]] @@ -3793,6 +4211,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" +[[package]] +name = "indicatif" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + [[package]] name = "inout" version = "0.1.3" @@ -3826,38 +4257,13 @@ dependencies = [ "num-traits", ] -[[package]] -name = "interceptor" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" -dependencies = [ - "async-trait", - "bytes", - "log", - "rand 0.8.5", - "rtcp", - "rtp", - "thiserror", - "tokio", - "waitgroup", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "io-lifetimes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" - [[package]] name = "io-lifetimes" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -3874,7 +4280,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.3", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -3882,19 +4288,28 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.4", - "windows-sys 0.48.0", + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "is_executable" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9acdc6d67b75e626ad644734e8bc6df893d9cd2a834129065d3dd6158ea9c8" +dependencies = [ + "winapi", ] [[package]] @@ -3906,37 +4321,47 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonrpsee" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d291e3a5818a2384645fd9756362e6d89cf0541b0b916fa7702ea4a9833608e" +checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ "jsonrpsee-core", + "jsonrpsee-http-client", "jsonrpsee-proc-macros", "jsonrpsee-server", "jsonrpsee-types", @@ -3946,9 +4371,9 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965de52763f2004bc91ac5bcec504192440f0b568a5d621c59d9dbd6f886c3fb" +checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" dependencies = [ "futures-util", "http", @@ -3962,18 +4387,18 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots", + "webpki-roots 0.25.4", ] [[package]] name = "jsonrpsee-core" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e70b4439a751a5de7dd5ed55eacff78ebf4ffe0fc009cb1ebb11417f5b536b" +checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", - "async-lock", + "async-lock 2.8.0", "async-trait", "beef", "futures-channel", @@ -3982,7 +4407,7 @@ dependencies = [ "globset", "hyper", "jsonrpsee-types", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "rustc-hash", "serde", @@ -3994,188 +4419,111 @@ dependencies = [ ] [[package]] -name = "jsonrpsee-proc-macros" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa6da1e4199c10d7b1d0a6e5e8bd8e55f351163b6f4b3cbb044672a69bd4c1c" -dependencies = [ - "heck", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "jsonrpsee-server" -version = "0.16.2" +name = "jsonrpsee-http-client" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb69dad85df79527c019659a992498d03f8495390496da2f07e6c24c2b356fc" +checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" dependencies = [ - "futures-channel", - "futures-util", - "http", + "async-trait", "hyper", + "hyper-rustls", "jsonrpsee-core", "jsonrpsee-types", + "rustc-hash", "serde", "serde_json", - "soketto", + "thiserror", "tokio", - "tokio-stream", - "tokio-util", - "tower", "tracing", ] [[package]] -name = "jsonrpsee-types" -version = "0.16.2" +name = "jsonrpsee-proc-macros" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd522fe1ce3702fd94812965d7bb7a3364b1c9aba743944c5a00529aae80f8c" +checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", - "tracing", + "heck 0.4.1", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "jsonrpsee-ws-client" -version = "0.16.2" +name = "jsonrpsee-server" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b83daeecfc6517cfe210df24e570fb06213533dfb990318fae781f4c7119dd9" +checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" dependencies = [ + "futures-channel", + "futures-util", "http", - "jsonrpsee-client-transport", + "hyper", "jsonrpsee-core", "jsonrpsee-types", -] - -[[package]] -name = "k256" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.7", -] - -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "kusama-runtime" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" -dependencies = [ - "bitvec", - "frame-benchmarking", - "frame-election-provider-support", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "hex-literal", - "kusama-runtime-constants", - "log", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-bags-list", - "pallet-balances", - "pallet-bounties", - "pallet-child-bounties", - "pallet-collective", - "pallet-conviction-voting", - "pallet-democracy", - "pallet-election-provider-multi-phase", - "pallet-election-provider-support-benchmarking", - "pallet-elections-phragmen", - "pallet-fast-unstake", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-membership", - "pallet-multisig", - "pallet-nis", - "pallet-nomination-pools", - "pallet-nomination-pools-benchmarking", - "pallet-nomination-pools-runtime-api", - "pallet-offences", - "pallet-offences-benchmarking", - "pallet-preimage", - "pallet-proxy", - "pallet-ranked-collective", - "pallet-recovery", - "pallet-referenda", - "pallet-scheduler", - "pallet-session", - "pallet-session-benchmarking", - "pallet-society", - "pallet-staking", - "pallet-timestamp", - "pallet-tips", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-treasury", - "pallet-utility", - "pallet-vesting", - "pallet-whitelist", - "pallet-xcm", - "pallet-xcm-benchmarks", - "parity-scale-codec", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "rustc-hex", - "scale-info", "serde", - "serde_derive", - "smallvec", - "sp-api", - "sp-arithmetic", - "sp-authority-discovery", - "sp-beefy", - "sp-block-builder", - "sp-consensus-babe", - "sp-core", - "sp-inherents", - "sp-io", - "sp-mmr-primitives", - "sp-npos-elections", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-staking", - "sp-std", - "sp-transaction-pool", - "sp-version", - "static_assertions", - "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", + "serde_json", + "soketto", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" +dependencies = [ + "http", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2 0.10.8", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", ] [[package]] name = "kusama-runtime-constants" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -4202,23 +4550,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" dependencies = [ "kvdb", - "parking_lot 0.12.1", + "parking_lot 0.12.2", ] [[package]] name = "kvdb-rocksdb" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2182b8219fee6bd83aacaab7344e840179ae079d5216aa4e249b4d704646a844" +checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "regex", "rocksdb", "smallvec", ] +[[package]] +name = "landlock" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520baa32708c4e957d2fc3a186bc5bd8d26637c33137f399ddfc202adb240068" +dependencies = [ + "enumflags2", + "libc", + "thiserror", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -4233,9 +4592,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libfuzzer-sys" @@ -4250,44 +4609,40 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "winapi", + "windows-targets 0.52.5", ] [[package]] name = "libm" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" - -[[package]] -name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.50.1" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7b0104790be871edcf97db9bd2356604984e623a08d825c3f27852290266b8" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ "bytes", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", - "getrandom 0.2.10", + "getrandom 0.2.14", "instant", - "libp2p-core 0.38.0", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", "libp2p-dns", "libp2p-identify", + "libp2p-identity", "libp2p-kad", "libp2p-mdns", "libp2p-metrics", - "libp2p-mplex", "libp2p-noise", "libp2p-ping", "libp2p-quic", @@ -4295,47 +4650,34 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", - "multiaddr 0.16.0", - "parking_lot 0.12.1", + "multiaddr", "pin-project", - "smallvec", ] [[package]] -name = "libp2p-core" -version = "0.38.0" +name = "libp2p-allow-block-list" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a8fcd392ff67af6cc3f03b1426c41f7f26b6b9aff2dc632c1c56dd649e571f" +checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" dependencies = [ - "asn1_der", - "bs58", - "ed25519-dalek", - "either", - "fnv", - "futures 0.3.28", - "futures-timer", - "instant", - "log", - "multiaddr 0.16.0", - "multihash 0.16.3", - "multistream-select", - "once_cell", - "parking_lot 0.12.1", - "pin-project", - "prost", - "prost-build", - "rand 0.8.5", - "rw-stream-sink", - "sec1", - "sha2 0.10.7", - "smallvec", - "thiserror", - "unsigned-varint", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", "void", - "zeroize", ] [[package]] @@ -4346,16 +4688,16 @@ checksum = "3c1df63c0b582aa434fb09b2d86897fa2b419ffeccf934b36f87fcedc8e835c2" dependencies = [ "either", "fnv", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "instant", "libp2p-identity", "log", - "multiaddr 0.17.1", - "multihash 0.17.0", + "multiaddr", + "multihash", "multistream-select", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "quick-protobuf", "rand 0.8.5", @@ -4368,34 +4710,35 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e42a271c1b49f789b92f7fc87749fa79ce5c7bdc88cbdfacb818a4bca47fec5" +checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" dependencies = [ - "futures 0.3.28", - "libp2p-core 0.38.0", + "futures 0.3.30", + "libp2p-core", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "smallvec", "trust-dns-resolver", ] [[package]] name = "libp2p-identify" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" +checksum = "5455f472243e63b9c497ff320ded0314254a9eb751799a39c283c6f20b793f3c" dependencies = [ "asynchronous-codec", - "futures 0.3.28", + "either", + "futures 0.3.30", "futures-timer", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "lru 0.8.1", - "prost", - "prost-build", - "prost-codec", + "lru 0.10.1", + "quick-protobuf", + "quick-protobuf-codec", "smallvec", "thiserror", "void", @@ -4403,43 +4746,43 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e2d584751cecb2aabaa56106be6be91338a60a0f4e420cf2af639204f596fc1" +checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ - "bs58", + "bs58 0.4.0", "ed25519-dalek", "log", - "multiaddr 0.17.1", - "multihash 0.17.0", + "multiaddr", + "multihash", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", "zeroize", ] [[package]] name = "libp2p-kad" -version = "0.42.1" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2766dcd2be8c87d5e1f35487deb22d765f49c6ae1251b3633efe3b25698bd3d2" +checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", "bytes", "either", "fnv", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "smallvec", "thiserror", "uint", @@ -4449,19 +4792,20 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f378264aade9872d6ccd315c0accc18be3a35d15fc1b9c36e5b6f983b62b5b" +checksum = "19983e1f949f979a928f2c603de1cf180cc0dc23e4ac93a62651ccb18341460b" dependencies = [ "data-encoding", - "futures 0.3.28", + "futures 0.3.30", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", "log", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "trust-dns-proto", "void", @@ -4469,11 +4813,11 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad8a64f29da86005c86a4d2728b8a0719e9b192f4092b609fd8790acb9dec55" +checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" dependencies = [ - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-identify", "libp2p-kad", "libp2p-ping", @@ -4481,40 +4825,22 @@ dependencies = [ "prometheus-client", ] -[[package]] -name = "libp2p-mplex" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03805b44107aa013e7cbbfa5627b31c36cbedfdfb00603c0311998882bc4bace" -dependencies = [ - "asynchronous-codec", - "bytes", - "futures 0.3.28", - "libp2p-core 0.38.0", - "log", - "nohash-hasher", - "parking_lot 0.12.1", - "rand 0.8.5", - "smallvec", - "unsigned-varint", -] - [[package]] name = "libp2p-noise" -version = "0.41.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978cb57efe82e892ec6f348a536bfbd9fee677adbe5689d7a93ad3a9bffbf2e" +checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ "bytes", "curve25519-dalek 3.2.0", - "futures 0.3.28", - "libp2p-core 0.38.0", + "futures 0.3.30", + "libp2p-core", + "libp2p-identity", "log", "once_cell", - "prost", - "prost-build", + "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "snow", "static_assertions", "thiserror", @@ -4524,14 +4850,15 @@ dependencies = [ [[package]] name = "libp2p-ping" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "929fcace45a112536e22b3dcfd4db538723ef9c3cb79f672b98be2cc8e25f37f" +checksum = "3e57759c19c28a73ef1eb3585ca410cefb72c1a709fcf6de1612a378e4219202" dependencies = [ - "futures 0.3.28", + "either", + "futures 0.3.30", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", "libp2p-swarm", "log", "rand 0.8.5", @@ -4540,89 +4867,87 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.7.0-alpha" +version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e7c867e95c8130667b24409d236d37598270e6da69b3baf54213ba31ffca59" +checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ "bytes", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "if-watch", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-tls", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "quinn-proto", "rand 0.8.5", - "rustls 0.20.8", + "rustls 0.20.9", "thiserror", "tokio", ] [[package]] name = "libp2p-request-response" -version = "0.23.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3236168796727bfcf4927f766393415361e2c644b08bedb6a6b13d957c9a4884" +checksum = "7ffdb374267d42dc5ed5bc53f6e601d4a64ac5964779c6e40bb9e4f14c1e30d5" dependencies = [ "async-trait", - "bytes", - "futures 0.3.28", + "futures 0.3.30", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm", - "log", "rand 0.8.5", "smallvec", - "unsigned-varint", ] [[package]] name = "libp2p-swarm" -version = "0.41.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a35472fe3276b3855c00f1c032ea8413615e030256429ad5349cdf67c6e1a0" +checksum = "903b3d592d7694e56204d211f29d31bc004be99386644ba8731fc3e3ef27b296" dependencies = [ "either", "fnv", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "instant", - "libp2p-core 0.38.0", + "libp2p-core", + "libp2p-identity", "libp2p-swarm-derive", "log", - "pin-project", "rand 0.8.5", "smallvec", - "thiserror", "tokio", "void", ] [[package]] name = "libp2p-swarm-derive" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" +checksum = "0fba456131824ab6acd4c7bf61e9c0f0a3014b5fc9868ccb8e10d344594cdc4f" dependencies = [ - "heck", + "heck 0.4.1", "quote", "syn 1.0.109", ] [[package]] name = "libp2p-tcp" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b257baf6df8f2df39678b86c578961d48cc8b68642a12f0f763f56c8e5858d" +checksum = "33d33698596d7722d85d3ab0c86c2c322254fce1241e91208e3679b4eb3026cf" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "if-watch", "libc", - "libp2p-core 0.38.0", + "libp2p-core", "log", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", ] @@ -4632,102 +4957,80 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "futures-rustls", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", - "ring", - "rustls 0.20.8", + "rcgen", + "ring 0.16.20", + "rustls 0.20.9", "thiserror", - "webpki 0.22.0", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] [[package]] name = "libp2p-wasm-ext" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb1a35299860e0d4b3c02a3e74e3b293ad35ae0cee8a056363b0c862d082069" +checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "js-sys", - "libp2p-core 0.38.0", + "libp2p-core", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb6cd86dd68cba72308ea05de1cebf3ba0ae6e187c40548167955d4e3970f6a" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes", - "futures 0.3.28", - "futures-timer", - "hex", - "if-watch", - "libp2p-core 0.38.0", - "libp2p-noise", - "log", - "multihash 0.16.3", - "prost", - "prost-build", - "prost-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", - "tokio", - "tokio-util", - "webrtc", -] - [[package]] name = "libp2p-websocket" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d705506030d5c0aaf2882437c70dab437605f21c5f9811978f694e6917a3b54" +checksum = "111273f7b3d3510524c752e8b7a5314b7f7a1fee7e68161c01a7d72cbb06db9f" dependencies = [ "either", - "futures 0.3.28", + "futures 0.3.30", "futures-rustls", - "libp2p-core 0.38.0", + "libp2p-core", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "quicksink", "rw-stream-sink", "soketto", "url", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] name = "libp2p-yamux" -version = "0.42.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f63594a0aa818642d9d4915c791945053877253f08a3626f13416b5cd928a29" +checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" dependencies = [ - "futures 0.3.28", - "libp2p-core 0.38.0", + "futures 0.3.30", + "libp2p-core", "log", - "parking_lot 0.12.1", "thiserror", "yamux", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + [[package]] name = "librocksdb-sys" -version = "0.8.3+7.4.4" +version = "0.11.0+8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557b255ff04123fcc176162f56ed0c9cd42d8f357cf55b3fabeb60f7413741b3" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" dependencies = [ "bindgen", "bzip2-sys", @@ -4754,7 +5057,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.9.9", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum", ] [[package]] @@ -4788,9 +5091,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" dependencies = [ "cc", "pkg-config", @@ -4823,19 +5126,18 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c601a85f5ecd1aba625247bca0031585fb1c446461b142878a16f8245ddeb8" +checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" dependencies = [ "nalgebra", - "statrs", ] [[package]] name = "linux-raw-sys" -version = "0.0.46" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" @@ -4845,15 +5147,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -4861,27 +5163,24 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" dependencies = [ - "hashbrown 0.12.3", + "hashbrown 0.13.2", ] [[package]] name = "lru" -version = "0.9.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" -dependencies = [ - "hashbrown 0.13.2", -] +checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" [[package]] name = "lru-cache" @@ -4889,37 +5188,91 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" dependencies = [ - "linked-hash-map", + "linked-hash-map", +] + +[[package]] +name = "lz4" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + +[[package]] +name = "macro_magic" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.60", +] + +[[package]] +name = "macro_magic_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +dependencies = [ + "const-random", + "derive-syn-parse 0.1.5", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.60", ] [[package]] -name = "lz4" -version = "1.24.0" +name = "macro_magic_core_macros" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "d710e1214dffbab3b5dacb21475dde7d6ed84c69ff722b3a47a782668d44fbac" dependencies = [ - "libc", - "lz4-sys", + "proc-macro2", + "quote", + "syn 2.0.60", ] [[package]] -name = "lz4-sys" -version = "1.9.4" +name = "macro_magic_macros" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" dependencies = [ - "cc", - "libc", + "macro_magic_core", + "quote", + "syn 2.0.60", ] [[package]] -name = "mach" -version = "0.3.2" +name = "maplit" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "match_cfg" @@ -4944,36 +5297,27 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" dependencies = [ "autocfg", "rawpointer", ] -[[package]] -name = "md-5" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" -dependencies = [ - "digest 0.10.7", -] - [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memfd" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.23", + "rustix 0.38.34", ] [[package]] @@ -4987,47 +5331,22 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.9.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ "hash-db", - "hashbrown 0.12.3", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "merlin" version = "2.0.1" @@ -5040,13 +5359,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "mick-jaeger" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "rand 0.8.5", "thrift", ] @@ -5059,18 +5390,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -5080,17 +5411,17 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "log", "parity-scale-codec", "sc-client-api", "sc-offchain", "sp-api", - "sp-beefy", "sp-blockchain", "sp-consensus", + "sp-consensus-beefy", "sp-core", "sp-mmr-primitives", "sp-runtime", @@ -5099,7 +5430,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "anyhow", "jsonrpsee", @@ -5142,15 +5473,15 @@ dependencies = [ [[package]] name = "moonbeam-vrf" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?branch=polkadot-v0.9.38-use-paritytech-dependencies#095ddae0ea44d8385453091e5e11d475b3dbda1e" +source = "git+https://github.com/zeitgeistpm/moonbeam?branch=zeitgeist-polkadot-v1.1.0#1d73d545275971d360e98524a4ff72f71cd91596" dependencies = [ "nimbus-primitives", "parity-scale-codec", "polkadot-primitives", + "schnorrkel 0.9.1", "session-keys-primitives", "sp-api", "sp-application-crypto", - "sp-consensus-vrf", "sp-core", "sp-keystore", "sp-runtime", @@ -5162,24 +5493,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" -[[package]] -name = "multiaddr" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aebdb21e90f81d13ed01dc84123320838e53963c2ca94b60b305d3fa64f31e" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "multibase", - "multihash 0.16.3", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint", - "url", -] - [[package]] name = "multiaddr" version = "0.17.1" @@ -5191,7 +5504,7 @@ dependencies = [ "data-encoding", "log", "multibase", - "multihash 0.17.0", + "multihash", "percent-encoding", "serde", "static_assertions", @@ -5212,9 +5525,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.16.3" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" +checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" dependencies = [ "blake2b_simd", "blake2s_simd", @@ -5222,29 +5535,18 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "unsigned-varint", ] -[[package]] -name = "multihash" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40" -dependencies = [ - "core2", - "multihash-derive", - "unsigned-varint", -] - [[package]] name = "multihash-derive" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", @@ -5265,7 +5567,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ "bytes", - "futures 0.3.28", + "futures 0.3.30", "log", "pin-project", "smallvec", @@ -5274,9 +5576,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.27.1" +version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" +checksum = "3ea4908d4f23254adda3daa60ffef0f1ac7b8c3e9a864cf3cc154b251908a2ef" dependencies = [ "approx", "matrixmultiply", @@ -5284,17 +5586,15 @@ dependencies = [ "num-complex", "num-rational", "num-traits", - "rand 0.8.5", - "rand_distr", "simba", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum", ] [[package]] name = "nalgebra-macros" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" +checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" dependencies = [ "proc-macro2", "quote", @@ -5361,7 +5661,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ "bytes", - "futures 0.3.28", + "futures 0.3.30", "log", "netlink-packet-core", "netlink-sys", @@ -5371,12 +5671,12 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ "bytes", - "futures 0.3.28", + "futures 0.3.30", "libc", "log", "tokio", @@ -5385,18 +5685,17 @@ dependencies = [ [[package]] name = "nimbus-consensus" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=polkadot-v0.9.38-use-paritytech-dependencies#1c8ba39b656ec708bf7153a79987eba6e72ef9d6" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", - "futures 0.3.28", + "futures 0.3.30", "log", "nimbus-primitives", "parity-scale-codec", - "parking_lot 0.12.1", - "polkadot-client", + "parking_lot 0.12.2", "sc-client-api", "sc-consensus", "sc-consensus-manual-seal", @@ -5416,7 +5715,7 @@ dependencies = [ [[package]] name = "nimbus-primitives" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=polkadot-v0.9.38-use-paritytech-dependencies#1c8ba39b656ec708bf7153a79987eba6e72ef9d6" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "async-trait", "frame-benchmarking", @@ -5428,7 +5727,7 @@ dependencies = [ "sp-application-crypto", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] @@ -5440,22 +5739,19 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", ] [[package]] -name = "nix" -version = "0.26.2" +name = "no-std-net" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", - "static_assertions", -] +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "nohash-hasher" @@ -5481,9 +5777,9 @@ checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -5492,13 +5788,19 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-format" version = "0.4.4" @@ -5511,11 +5813,10 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] @@ -5533,12 +5834,11 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", - "libm 0.2.7", ] [[package]] @@ -5547,54 +5847,51 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "object" -version = "0.29.0" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "indexmap 1.9.3", "memchr", ] [[package]] name = "object" -version = "0.31.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] -[[package]] -name = "oid-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" -dependencies = [ - "asn1-rs 0.3.1", -] - [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -5604,9 +5901,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl-probe" @@ -5616,13 +5913,13 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "orchestra" -version = "0.0.4" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17e7d5b6bb115db09390bed8842c94180893dd83df3dfce7354f2a2aa090a4ee" +checksum = "227585216d05ba65c7ab0a0450a3cf2cbd81a98862a54c4df8e14d5ac6adb015" dependencies = [ "async-trait", "dyn-clonable", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "orchestra-proc-macro", "pin-project", @@ -5633,14 +5930,14 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.0.4" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2af4dabb2286b0be0e9711d2d24e25f6217048b71210cffd3daddc3b5c84e1f" +checksum = "2871aadd82a2c216ee68a69837a526dfe788ecbe74c4c5038a6acdbff6653066" dependencies = [ "expander 0.0.6", - "itertools", + "itertools 0.10.5", "petgraph", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -5658,26 +5955,28 @@ dependencies = [ [[package]] name = "orml-asset-registry" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", + "log", "orml-traits", "pallet-xcm", "parity-scale-codec", "scale-info", "serde", + "sp-io", "sp-runtime", - "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "orml-benchmarking" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-benchmarking", "frame-support", @@ -5690,14 +5989,14 @@ dependencies = [ "sp-io", "sp-runtime", "sp-runtime-interface", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-storage", ] [[package]] name = "orml-currencies" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", @@ -5708,47 +6007,50 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", + "log", "orml-traits", "parity-scale-codec", "scale-info", "serde", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "impl-trait-for-tuples", "num-traits", "orml-utilities", "parity-scale-codec", + "paste", "scale-info", "serde", "sp-core", "sp-io", "sp-runtime", - "sp-std", - "xcm", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", ] [[package]] name = "orml-unknown-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "frame-system", @@ -5756,46 +6058,48 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", - "xcm", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", ] [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "orml-xcm-support" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "frame-support", "orml-traits", "parity-scale-codec", "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "orml-xtokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.38#241d5cdc98cca53b8cf990853943c9ae1193a70e" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v1.1.0#b3694e631df7f1ca16b1973122937753fcdee9d4" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", + "log", "orml-traits", "orml-xcm-support", "pallet-xcm", @@ -5804,47 +6108,15 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2 0.10.7", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2 0.10.7", -] - -[[package]] -name = "packed_simd_2" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" -dependencies = [ - "cfg-if", - "libm 0.1.4", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -5856,29 +6128,46 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", +] + +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#39482e78cc1580c9f16a8f8d8261baf914ab5559" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", + "log", "pallet-timestamp", "parity-scale-codec", "scale-info", "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-author-inherent" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=polkadot-v0.9.38-use-paritytech-dependencies#1c8ba39b656ec708bf7153a79987eba6e72ef9d6" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "frame-benchmarking", "frame-support", @@ -5891,13 +6180,13 @@ dependencies = [ "sp-application-crypto", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-author-mapping" version = "2.0.5" -source = "git+https://github.com/zeitgeistpm/moonbeam?branch=polkadot-v0.9.38-use-paritytech-dependencies#095ddae0ea44d8385453091e5e11d475b3dbda1e" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "frame-benchmarking", "frame-support", @@ -5909,13 +6198,13 @@ dependencies = [ "serde", "session-keys-primitives", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-author-slot-filter" version = "0.9.0" -source = "git+https://github.com/zeitgeistpm/nimbus?branch=polkadot-v0.9.38-use-paritytech-dependencies#1c8ba39b656ec708bf7153a79987eba6e72ef9d6" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "frame-benchmarking", "frame-support", @@ -5927,13 +6216,13 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -5943,13 +6232,13 @@ dependencies = [ "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -5957,13 +6246,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -5976,19 +6265,21 @@ dependencies = [ "scale-info", "sp-application-crypto", "sp-consensus-babe", - "sp-consensus-vrf", + "sp-core", "sp-io", "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "aquamarine", + "docify", "frame-benchmarking", "frame-election-provider-support", "frame-support", @@ -6000,14 +6291,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-tracing", ] [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6016,32 +6307,36 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", + "log", + "pallet-authorship", "pallet-session", "parity-scale-codec", "scale-info", "serde", - "sp-beefy", + "sp-consensus-beefy", "sp-runtime", - "sp-std", + "sp-session", + "sp-staking", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", - "beefy-merkle-tree", + "array-bytes", + "binary-merkle-tree", "frame-support", "frame-system", "log", @@ -6051,17 +6346,19 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-beefy", + "sp-api", + "sp-consensus-beefy", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-state-machine", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6073,13 +6370,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6092,13 +6389,32 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", +] + +[[package]] +name = "pallet-collator-selection" +version = "3.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sp-runtime", + "sp-staking", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6109,20 +6425,22 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitflags 1.3.2", + "environmental", "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", "log", + "pallet-balances", "pallet-contracts-primitives", "pallet-contracts-proc-macro", "parity-scale-codec", @@ -6135,38 +6453,38 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "wasm-instrument 0.4.0", - "wasmi 0.20.0", - "wasmparser-nostd", + "wasmi", ] [[package]] name = "pallet-contracts-primitives" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", + "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-weights", ] [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6177,13 +6495,13 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6195,13 +6513,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6212,19 +6530,19 @@ dependencies = [ "parity-scale-codec", "rand 0.8.5", "scale-info", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std", - "strum", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "strum 0.24.1", ] [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6232,12 +6550,13 @@ dependencies = [ "parity-scale-codec", "sp-npos-elections", "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6249,14 +6568,16 @@ dependencies = [ "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-staking", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "docify", "frame-benchmarking", "frame-election-provider-support", "frame-support", @@ -6267,89 +6588,120 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-grandpa", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", +] + +[[package]] +name = "pallet-identity" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", +] + +[[package]] +name = "pallet-im-online" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "pallet-authorship", - "pallet-session", "parity-scale-codec", "scale-info", "sp-application-crypto", "sp-core", - "sp-finality-grandpa", "sp-io", "sp-runtime", - "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] -name = "pallet-identity" +name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "enumflags2", "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", + "sp-core", "sp-io", + "sp-keyring", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] -name = "pallet-im-online" +name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "frame-benchmarking", "frame-support", "frame-system", - "log", - "pallet-authorship", "parity-scale-codec", + "safe-mix", "scale-info", - "sp-application-crypto", - "sp-core", - "sp-io", "sp-runtime", - "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] -name = "pallet-indices" +name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", "sp-io", - "sp-keyring", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] -name = "pallet-membership" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +name = "pallet-message-queue" +version = "7.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6357,33 +6709,36 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-weights", ] [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", "sp-io", "sp-mmr-primitives", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6393,46 +6748,48 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", "log", + "pallet-balances", "parity-scale-codec", "scale-info", "sp-core", "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-tracing", ] [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6446,23 +6803,24 @@ dependencies = [ "sp-runtime", "sp-runtime-interface", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "pallet-nomination-pools", "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -6473,13 +6831,13 @@ dependencies = [ "serde", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6497,13 +6855,13 @@ dependencies = [ "scale-info", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-parachain-staking" version = "3.0.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?branch=polkadot-v0.9.38-use-paritytech-dependencies#095ddae0ea44d8385453091e5e11d475b3dbda1e" +source = "git+https://github.com/zeitgeistpm/moonbeam?branch=zeitgeist-polkadot-v1.1.0#1d73d545275971d360e98524a4ff72f71cd91596" dependencies = [ "frame-benchmarking", "frame-support", @@ -6514,14 +6872,14 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "substrate-fixed", ] [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6532,13 +6890,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6547,27 +6905,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-randomness-collective-flip" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "safe-mix", - "scale-info", - "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6575,17 +6919,17 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6594,13 +6938,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6610,17 +6954,18 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -6629,14 +6974,14 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-weights", ] [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -6650,44 +6995,50 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-state-machine", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-trie", ] [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "pallet-session", "pallet-staking", + "parity-scale-codec", "rand 0.8.5", "sp-runtime", "sp-session", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "rand_chacha 0.2.2", "scale-info", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6704,33 +7055,42 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "log", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", +] + +[[package]] +name = "pallet-staking-runtime-api" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "parity-scale-codec", + "sp-api", ] [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6741,27 +7101,28 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6772,14 +7133,15 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-storage", "sp-timestamp", ] [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6792,13 +7154,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "frame-system", @@ -6808,13 +7170,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6830,7 +7192,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6842,7 +7204,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6853,13 +7215,13 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6869,13 +7231,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6884,13 +7246,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6899,14 +7261,15 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "pallet-xcm" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "bounded-collections", "frame-benchmarking", "frame-support", "frame-system", @@ -6917,15 +7280,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "pallet-xcm-benchmarks" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-benchmarking", "frame-support", @@ -6935,29 +7298,67 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", - "xcm", - "xcm-builder", - "xcm-executor", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "parachain-info" version = "0.1.0" -source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.38#9b4e0247137f158d1a35118197d34adfa58858b7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", +] + +[[package]] +name = "parachains-common" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "cumulus-primitives-core", + "cumulus-primitives-utility", "frame-support", "frame-system", + "kusama-runtime-constants", + "log", + "num-traits", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-primitives", + "polkadot-runtime-constants", + "rococo-runtime-constants", "scale-info", + "smallvec", + "sp-consensus-aura", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", + "westend-runtime-constants", ] [[package]] name = "parity-db" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f19d20a0d2cc52327a88d131fa1c4ea81ea4a04714aedcfeca2dd410049cf8" +checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" dependencies = [ "blake2", "crc32fast", @@ -6967,17 +7368,18 @@ dependencies = [ "log", "lz4", "memmap2", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "siphasher", "snap", + "winapi", ] [[package]] name = "parity-scale-codec" -version = "3.6.4" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -6990,11 +7392,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.4" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", "syn 1.0.109", @@ -7014,9 +7416,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -7031,12 +7433,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.10", ] [[package]] @@ -7055,17 +7457,23 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.5.1", "smallvec", - "windows-targets", + "windows-targets 0.52.5", ] +[[package]] +name = "partial_sort" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" + [[package]] name = "paste" version = "1.0.14" @@ -7090,6 +7498,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -7105,36 +7522,28 @@ dependencies = [ "base64 0.13.1", ] -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.2" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.2" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" dependencies = [ "pest", "pest_generator", @@ -7142,56 +7551,56 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.2" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] name = "pest_meta" -version = "2.7.2" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" dependencies = [ "once_cell", "pest", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] name = "petgraph" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 1.9.3", + "indexmap 2.2.6", ] [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] @@ -7202,9 +7611,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -7212,11 +7621,22 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.1.0", + "futures-io", +] + [[package]] name = "pkcs8" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", @@ -7224,60 +7644,58 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "platforms" -version = "2.0.0" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d0eef3571242013a0d5dc84861c3ae4a652e56e12adf8bdc26ff5f8cb34c94" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platforms" -version = "3.0.2" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "polkadot-approval-distribution" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "futures 0.3.30", + "futures-timer", + "polkadot-node-jaeger", + "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", + "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.5", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-availability-bitfield-distribution" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "always-assert", + "futures 0.3.30", + "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.5", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-availability-distribution" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "derive_more", "fatality", - "futures 0.3.28", - "lru 0.9.0", + "futures 0.3.30", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -7286,20 +7704,20 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "rand 0.8.5", + "schnellru", "sp-core", "sp-keystore", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-availability-recovery" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "fatality", - "futures 0.3.28", - "lru 0.9.0", + "futures 0.3.30", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -7309,22 +7727,21 @@ dependencies = [ "polkadot-primitives", "rand 0.8.5", "sc-network", + "schnellru", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-cli" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "clap", "frame-benchmarking-cli", - "futures 0.3.28", + "futures 0.3.30", "log", - "polkadot-client", - "polkadot-node-core-pvf", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "polkadot-node-metrics", "polkadot-performance-test", "polkadot-service", "sc-cli", @@ -7336,62 +7753,20 @@ dependencies = [ "sp-core", "sp-io", "sp-keyring", + "sp-maybe-compressed-blob", "substrate-build-script-utils", "thiserror", "try-runtime-cli", ] -[[package]] -name = "polkadot-client" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" -dependencies = [ - "async-trait", - "frame-benchmarking", - "frame-benchmarking-cli", - "frame-system", - "frame-system-rpc-runtime-api", - "futures 0.3.28", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "polkadot-core-primitives", - "polkadot-node-core-parachains-inherent", - "polkadot-primitives", - "polkadot-runtime", - "polkadot-runtime-common", - "sc-client-api", - "sc-consensus", - "sc-executor", - "sc-service", - "sp-api", - "sp-authority-discovery", - "sp-beefy", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-consensus-babe", - "sp-core", - "sp-finality-grandpa", - "sp-inherents", - "sp-keyring", - "sp-mmr-primitives", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-storage", - "sp-timestamp", - "sp-transaction-pool", -] - [[package]] name = "polkadot-collator-protocol" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "always-assert", "bitvec", "fatality", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7402,32 +7777,32 @@ dependencies = [ "sp-keystore", "sp-runtime", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tokio-util", + "tracing-gum", ] [[package]] name = "polkadot-core-primitives" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "polkadot-dispute-distribution" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "derive_more", "fatality", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "indexmap 1.9.3", - "lru 0.9.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -7436,16 +7811,17 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sc-network", + "schnellru", "sp-application-crypto", "sp-keystore", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-erasure-coding" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -7458,10 +7834,10 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -7470,66 +7846,42 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", + "sc-network-common", "sp-application-crypto", "sp-core", "sp-keystore", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", -] - -[[package]] -name = "polkadot-network-bridge" -version = "0.9.38" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.38#097ffd245c42aeff28cf80f8a3568e1bee2e7da7" -dependencies = [ - "always-assert", - "async-trait", - "bytes", - "fatality", - "futures 0.3.28", - "parity-scale-codec", - "parking_lot 0.12.1", - "polkadot-node-metrics 0.9.38 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.38)", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-overseer", - "polkadot-primitives", - "sc-network", - "sc-network-common", - "sp-consensus", - "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.38)", + "tracing-gum", ] [[package]] name = "polkadot-network-bridge" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "always-assert", "async-trait", "bytes", "fatality", - "futures 0.3.28", + "futures 0.3.30", "parity-scale-codec", - "parking_lot 0.12.1", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "parking_lot 0.12.2", + "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-overseer", "polkadot-primitives", "sc-network", - "sc-network-common", "sp-consensus", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-collation-generation" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -7539,66 +7891,68 @@ dependencies = [ "sp-core", "sp-maybe-compressed-blob", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-approval-voting" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "derive_more", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "kvdb", - "lru 0.9.0", - "merlin", + "merlin 2.0.1", "parity-scale-codec", - "polkadot-node-jaeger 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", "sc-keystore", - "schnorrkel", + "schnellru", + "schnorrkel 0.9.1", "sp-application-crypto", "sp-consensus", "sp-consensus-slots", "sp-runtime", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-av-store" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "kvdb", "parity-scale-codec", "polkadot-erasure-coding", + "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", + "sp-consensus", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-backing" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "fatality", - "futures 0.3.28", + "futures 0.3.30", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7607,64 +7961,66 @@ dependencies = [ "polkadot-statement-table", "sp-keystore", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-bitfield-signing" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "sp-keystore", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", "wasm-timer", ] [[package]] name = "polkadot-node-core-candidate-validation" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "parity-scale-codec", "polkadot-node-core-pvf", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "polkadot-node-metrics", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-parachain", + "polkadot-node-subsystem-util", + "polkadot-overseer", + "polkadot-parachain-primitives", "polkadot-primitives", "sp-maybe-compressed-blob", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-chain-api" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "futures 0.3.30", + "polkadot-node-metrics", "polkadot-node-subsystem", "polkadot-primitives", "sc-client-api", "sc-consensus-babe", "sp-blockchain", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-chain-selection" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "kvdb", "parity-scale-codec", @@ -7673,35 +8029,35 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "fatality", - "futures 0.3.28", + "futures 0.3.30", "kvdb", - "lru 0.9.0", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "sc-keystore", + "schnellru", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-parachains-inherent" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "polkadot-node-subsystem", "polkadot-overseer", @@ -7709,65 +8065,77 @@ dependencies = [ "sp-blockchain", "sp-inherents", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-prospective-parachains" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "bitvec", + "fatality", + "futures 0.3.30", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing-gum", ] [[package]] name = "polkadot-node-core-provisioner" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "fatality", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand 0.8.5", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "always-assert", - "assert_matches", - "cpu-time", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", + "libc", "parity-scale-codec", "pin-project", "polkadot-core-primitives", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", - "polkadot-parachain", + "polkadot-node-core-pvf-common", + "polkadot-node-metrics", + "polkadot-node-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", "rand 0.8.5", - "rayon", - "sc-executor", - "sc-executor-common", - "sc-executor-wasmtime", "slotmap", "sp-core", - "sp-externalities", - "sp-io", "sp-maybe-compressed-blob", - "sp-tracing", "sp-wasm-interface", + "substrate-build-script-utils", "tempfile", "tokio", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf-checker" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7775,52 +8143,80 @@ dependencies = [ "polkadot-primitives", "sp-keystore", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] -name = "polkadot-node-core-runtime-api" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +name = "polkadot-node-core-pvf-common" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", - "lru 0.9.0", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", - "polkadot-node-subsystem", - "polkadot-node-subsystem-types", + "cpu-time", + "futures 0.3.30", + "landlock", + "libc", + "parity-scale-codec", + "polkadot-parachain-primitives", "polkadot-primitives", - "sp-consensus-babe", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "sp-core", + "sp-externalities", + "sp-io", + "sp-tracing", + "tokio", + "tracing-gum", ] [[package]] -name = "polkadot-node-jaeger" -version = "0.9.38" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.38#097ffd245c42aeff28cf80f8a3568e1bee2e7da7" +name = "polkadot-node-core-pvf-prepare-worker" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "lazy_static", - "log", - "mick-jaeger", + "futures 0.3.30", + "libc", "parity-scale-codec", - "parking_lot 0.12.1", - "polkadot-node-primitives", + "polkadot-node-core-pvf-common", + "polkadot-parachain-primitives", "polkadot-primitives", - "sc-network", - "sp-core", - "thiserror", + "rayon", + "sc-executor", + "sc-executor-common", + "sc-executor-wasmtime", + "sp-io", + "sp-maybe-compressed-blob", + "sp-tracing", + "tikv-jemalloc-ctl", "tokio", + "tracing-gum", +] + +[[package]] +name = "polkadot-node-core-runtime-api" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "futures 0.3.30", + "polkadot-node-metrics", + "polkadot-node-subsystem", + "polkadot-node-subsystem-types", + "polkadot-primitives", + "schnellru", + "sp-consensus-babe", + "tracing-gum", ] [[package]] name = "polkadot-node-jaeger" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "lazy_static", "log", "mick-jaeger", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "polkadot-node-primitives", "polkadot-primitives", "sc-network", @@ -7831,30 +8227,11 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "0.9.38" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.38#097ffd245c42aeff28cf80f8a3568e1bee2e7da7" -dependencies = [ - "bs58", - "futures 0.3.28", - "futures-timer", - "log", - "parity-scale-codec", - "polkadot-primitives", - "prioritized-metered-channel", - "sc-cli", - "sc-service", - "sc-tracing", - "substrate-prometheus-endpoint", - "tracing-gum 0.9.38 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.38)", -] - -[[package]] -name = "polkadot-node-metrics" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "bs58", - "futures 0.3.28", + "bs58 0.5.1", + "futures 0.3.30", "futures-timer", "log", "parity-scale-codec", @@ -7864,79 +8241,81 @@ dependencies = [ "sc-service", "sc-tracing", "substrate-prometheus-endpoint", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-network-protocol" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "async-channel 1.9.0", "async-trait", + "bitvec", "derive_more", "fatality", - "futures 0.3.28", + "futures 0.3.30", "hex", "parity-scale-codec", - "polkadot-node-jaeger 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-primitives", "rand 0.8.5", "sc-authority-discovery", "sc-network", - "sc-network-common", - "strum", + "strum 0.24.1", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-node-primitives" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bounded-vec", - "futures 0.3.28", + "futures 0.3.30", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", - "schnorrkel", + "schnorrkel 0.9.1", "serde", "sp-application-crypto", "sp-consensus-babe", - "sp-consensus-vrf", "sp-core", "sp-keystore", "sp-maybe-compressed-blob", + "sp-runtime", "thiserror", - "zstd", + "zstd 0.12.4", ] [[package]] name = "polkadot-node-subsystem" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "polkadot-node-jaeger 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "polkadot-node-jaeger", "polkadot-node-subsystem-types", "polkadot-overseer", ] [[package]] name = "polkadot-node-subsystem-types" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "derive_more", - "futures 0.3.28", + "futures 0.3.30", "orchestra", - "polkadot-node-jaeger 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "polkadot-node-jaeger", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-primitives", "polkadot-statement-table", "sc-network", + "sc-transaction-pool-api", "smallvec", "sp-api", "sp-authority-discovery", @@ -7947,23 +8326,22 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "derive_more", "fatality", - "futures 0.3.28", + "futures 0.3.30", "futures-channel", - "itertools", + "itertools 0.10.5", "kvdb", - "lru 0.9.0", "parity-db", "parity-scale-codec", "parking_lot 0.11.2", "pin-project", - "polkadot-node-jaeger 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "polkadot-node-jaeger", + "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7971,41 +8349,43 @@ dependencies = [ "polkadot-primitives", "prioritized-metered-channel", "rand 0.8.5", + "schnellru", "sp-application-crypto", "sp-core", "sp-keystore", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-overseer" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", - "lru 0.9.0", "orchestra", - "parking_lot 0.12.1", - "polkadot-node-metrics 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "parking_lot 0.12.2", + "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem-types", "polkadot-primitives", "sc-client-api", + "schnellru", "sp-api", "sp-core", "tikv-jemalloc-ctl", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] -name = "polkadot-parachain" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +name = "polkadot-parachain-primitives" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "bounded-collections", "derive_more", "frame-support", "parity-scale-codec", @@ -8014,39 +8394,42 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "polkadot-performance-test" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "env_logger 0.9.3", - "kusama-runtime", "log", "polkadot-erasure-coding", - "polkadot-node-core-pvf", + "polkadot-node-core-pvf-prepare-worker", "polkadot-node-primitives", + "polkadot-primitives", "quote", + "sc-executor-common", + "sp-maybe-compressed-blob", + "staging-kusama-runtime", "thiserror", ] [[package]] name = "polkadot-primitives" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "hex-literal", "parity-scale-codec", "polkadot-core-primitives", - "polkadot-parachain", + "polkadot-parachain-primitives", "scale-info", "serde", "sp-api", "sp-application-crypto", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-authority-discovery", "sp-consensus-slots", "sp-core", @@ -8055,16 +8438,14 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "polkadot-rpc" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "beefy-gadget", - "beefy-gadget-rpc", "jsonrpsee", "mmr-rpc", "pallet-transaction-payment-rpc", @@ -8073,9 +8454,11 @@ dependencies = [ "sc-client-api", "sc-consensus-babe", "sc-consensus-babe-rpc", + "sc-consensus-beefy", + "sc-consensus-beefy-rpc", "sc-consensus-epochs", - "sc-finality-grandpa", - "sc-finality-grandpa-rpc", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", "sc-rpc", "sc-sync-state-rpc", "sc-transaction-pool-api", @@ -8092,8 +8475,8 @@ dependencies = [ [[package]] name = "polkadot-runtime" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "frame-benchmarking", @@ -8114,6 +8497,7 @@ dependencies = [ "pallet-bounties", "pallet-child-bounties", "pallet-collective", + "pallet-conviction-voting", "pallet-democracy", "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", @@ -8124,6 +8508,7 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-message-queue", "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", @@ -8132,11 +8517,13 @@ dependencies = [ "pallet-offences-benchmarking", "pallet-preimage", "pallet-proxy", + "pallet-referenda", "pallet-scheduler", "pallet-session", "pallet-session-benchmarking", "pallet-staking", "pallet-staking-reward-curve", + "pallet-staking-runtime-api", "pallet-timestamp", "pallet-tips", "pallet-transaction-payment", @@ -8144,7 +8531,9 @@ dependencies = [ "pallet-treasury", "pallet-utility", "pallet-vesting", + "pallet-whitelist", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-primitives", "polkadot-runtime-common", @@ -8156,10 +8545,11 @@ dependencies = [ "serde_derive", "smallvec", "sp-api", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", "sp-io", @@ -8169,20 +8559,21 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] name = "polkadot-runtime-common" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "frame-benchmarking", @@ -8194,9 +8585,7 @@ dependencies = [ "log", "pallet-authorship", "pallet-babe", - "pallet-bags-list", "pallet-balances", - "pallet-beefy-mmr", "pallet-election-provider-multi-phase", "pallet-fast-unstake", "pallet-session", @@ -8215,7 +8604,6 @@ dependencies = [ "serde_derive", "slot-range-helper", "sp-api", - "sp-beefy", "sp-core", "sp-inherents", "sp-io", @@ -8223,15 +8611,15 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", "static_assertions", - "xcm", ] [[package]] name = "polkadot-runtime-constants" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -8244,20 +8632,21 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "bs58", + "bs58 0.5.1", + "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-tracing", ] [[package]] name = "polkadot-runtime-parachains" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -8265,16 +8654,19 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "impl-trait-for-tuples", "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", "pallet-balances", + "pallet-message-queue", "pallet-session", "pallet-staking", "pallet-timestamp", "pallet-vesting", "parity-scale-codec", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-metrics", "rand 0.8.5", @@ -8291,44 +8683,46 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "staging-xcm", + "staging-xcm-executor", "static_assertions", - "xcm", - "xcm-executor", ] [[package]] name = "polkadot-service" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "beefy-gadget", + "frame-benchmarking", "frame-benchmarking-cli", "frame-support", + "frame-system", "frame-system-rpc-runtime-api", - "futures 0.3.28", + "futures 0.3.30", "hex-literal", - "kusama-runtime", + "is_executable", "kvdb", "kvdb-rocksdb", "log", - "lru 0.9.0", "mmr-gadget", "pallet-babe", "pallet-im-online", "pallet-staking", + "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "parity-db", + "parity-scale-codec", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", "polkadot-availability-recovery", - "polkadot-client", "polkadot-collator-protocol", + "polkadot-core-primitives", "polkadot-dispute-distribution", "polkadot-gossip-support", - "polkadot-network-bridge 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "polkadot-network-bridge", "polkadot-node-collation-generation", "polkadot-node-core-approval-voting", "polkadot-node-core-av-store", @@ -8339,7 +8733,9 @@ dependencies = [ "polkadot-node-core-chain-selection", "polkadot-node-core-dispute-coordinator", "polkadot-node-core-parachains-inherent", + "polkadot-node-core-prospective-parachains", "polkadot-node-core-provisioner", + "polkadot-node-core-pvf", "polkadot-node-core-pvf-checker", "polkadot-node-core-runtime-api", "polkadot-node-network-protocol", @@ -8348,11 +8744,11 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime", - "polkadot-runtime-constants", + "polkadot-runtime-common", "polkadot-runtime-parachains", "polkadot-statement-distribution", "rococo-runtime", @@ -8364,31 +8760,36 @@ dependencies = [ "sc-client-db", "sc-consensus", "sc-consensus-babe", + "sc-consensus-beefy", + "sc-consensus-grandpa", "sc-consensus-slots", "sc-executor", - "sc-finality-grandpa", "sc-keystore", "sc-network", "sc-network-common", + "sc-network-sync", "sc-offchain", "sc-service", "sc-sync-state-rpc", "sc-sysinfo", "sc-telemetry", "sc-transaction-pool", + "sc-transaction-pool-api", + "schnellru", "serde", "serde_json", "sp-api", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-inherents", "sp-io", + "sp-keyring", "sp-keystore", "sp-mmr-primitives", "sp-offchain", @@ -8398,38 +8799,43 @@ dependencies = [ "sp-storage", "sp-timestamp", "sp-transaction-pool", - "sp-trie", + "sp-version", + "sp-weights", + "staging-kusama-runtime", "substrate-prometheus-endpoint", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", "westend-runtime", ] [[package]] name = "polkadot-statement-distribution" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "arrayvec 0.5.2", + "arrayvec 0.7.4", + "bitvec", "fatality", - "futures 0.3.28", + "futures 0.3.30", + "futures-timer", "indexmap 1.9.3", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", + "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-primitives", "sp-keystore", "sp-staking", "thiserror", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] name = "polkadot-statement-table" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -8438,8 +8844,8 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bitvec", "frame-election-provider-support", @@ -8465,7 +8871,7 @@ dependencies = [ "pallet-vesting", "pallet-xcm", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -8476,9 +8882,9 @@ dependencies = [ "smallvec", "sp-api", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", "sp-io", @@ -8487,24 +8893,23 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", "test-runtime-constants", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] name = "polkadot-test-service" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "frame-benchmarking", "frame-system", - "futures 0.3.28", + "futures 0.3.30", "hex", "pallet-balances", "pallet-staking", @@ -8512,7 +8917,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime-common", @@ -8526,20 +8931,18 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-consensus-babe", - "sc-executor", - "sc-finality-grandpa", + "sc-consensus-grandpa", "sc-network", - "sc-network-common", "sc-service", "sc-tracing", "sc-transaction-pool", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-authority-discovery", "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-inherents", "sp-keyring", "sp-runtime", @@ -8548,7 +8951,7 @@ dependencies = [ "tempfile", "test-runtime-constants", "tokio", - "tracing-gum 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "tracing-gum", ] [[package]] @@ -8563,45 +8966,60 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", "windows-sys 0.48.0", ] [[package]] -name = "poly1305" -version = "0.7.2" +name = "polling" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" dependencies = [ - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "cfg-if", + "concurrent-queue", + "hermit-abi 0.3.9", + "pin-project-lite 0.2.14", + "rustix 0.38.34", + "tracing", + "windows-sys 0.52.0", ] [[package]] -name = "polyval" -version = "0.5.3" +name = "poly1305" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ - "cfg-if", "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "opaque-debug 0.3.1", + "universal-hash", ] [[package]] name = "polyval" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.5.1", + "opaque-debug 0.3.1", + "universal-hash", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -8616,7 +9034,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -8638,21 +9056,41 @@ dependencies = [ "termtree", ] +[[package]] +name = "prettier-please" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" +dependencies = [ + "proc-macro2", + "syn 2.0.60", +] + [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "f28f53e8b192565862cf99343194579a022eb9c7dd3a8d03134734803c7b3125" dependencies = [ "proc-macro2", "syn 1.0.109", ] +[[package]] +name = "prettyplease" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" +dependencies = [ + "proc-macro2", + "syn 2.0.60", +] + [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -8670,7 +9108,7 @@ dependencies = [ "coarsetime", "crossbeam-queue", "derive_more", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "nanorand", "thiserror", @@ -8684,7 +9122,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] @@ -8711,11 +9159,22 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-warning" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -8730,31 +9189,31 @@ dependencies = [ "fnv", "lazy_static", "memchr", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "thiserror", ] [[package]] name = "prometheus-client" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.1", - "prometheus-client-derive-text-encode", + "parking_lot 0.12.2", + "prometheus-client-derive-encode", ] [[package]] -name = "prometheus-client-derive-text-encode" -version = "0.3.0" +name = "prometheus-client-derive-encode" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] @@ -8774,13 +9233,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", - "heck", - "itertools", + "heck 0.4.1", + "itertools 0.10.5", "lazy_static", "log", "multimap", "petgraph", - "prettyplease", + "prettyplease 0.1.11", "prost", "prost-types", "regex", @@ -8789,19 +9248,6 @@ dependencies = [ "which", ] -[[package]] -name = "prost-codec" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" -dependencies = [ - "asynchronous-codec", - "bytes", - "prost", - "thiserror", - "unsigned-varint", -] - [[package]] name = "prost-derive" version = "0.11.9" @@ -8809,7 +9255,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -8848,6 +9294,19 @@ dependencies = [ "byteorder", ] +[[package]] +name = "quick-protobuf-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint", +] + [[package]] name = "quicksink" version = "0.1.2" @@ -8861,27 +9320,27 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", "rand 0.8.5", - "ring", + "ring 0.16.20", "rustc-hash", - "rustls 0.20.8", + "rustls 0.20.9", "slab", "thiserror", "tinyvec", "tracing", - "webpki 0.22.0", + "webpki", ] [[package]] name = "quote" -version = "1.0.32" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -8951,17 +9410,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", -] - -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", + "getrandom 0.2.14", ] [[package]] @@ -8990,9 +9439,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -9000,27 +9449,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", -] - -[[package]] -name = "rcgen" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" -dependencies = [ - "pem", - "ring", - "time 0.3.24", - "x509-parser 0.13.2", - "yasna", ] [[package]] @@ -9030,8 +9464,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", - "ring", - "time 0.3.24", + "ring 0.16.20", + "time", "yasna", ] @@ -9046,62 +9480,71 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.14", + "libredox", "thiserror", ] [[package]] name = "reed-solomon-novelpoly" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" +checksum = "58130877ca403ab42c864fbac74bb319a0746c07a634a92a5cfc7f54af272582" dependencies = [ "derive_more", "fs-err", - "itertools", - "static_init 0.5.2", + "itertools 0.11.0", + "static_init", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ef7e18e8841942ddb1cf845054f8008410030a3997875d9e49b7a363063df1" +checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfaf0c85b766276c797f3791f5bc6d5bd116b41d53049af2789666b0c0bc9fa" +checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] name = "regalloc2" -version = "0.3.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43a209257d978ef079f3d446331d0f1794f5e0fc19b306a199983857833a779" +checksum = "80535183cae11b149d618fbd3c37e38d7cda589d82d7769e196ca9a9042d7621" dependencies = [ "fxhash", "log", @@ -9111,14 +9554,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.1" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.4", - "regex-syntax 0.7.4", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -9132,13 +9575,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.8.3", ] [[package]] @@ -9149,9 +9592,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "resolv-conf" @@ -9165,13 +9608,27 @@ dependencies = [ [[package]] name = "rfc6979" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213" dependencies = [ - "crypto-bigint", - "hmac 0.12.1", - "zeroize", + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "common", + "fflonk", + "merlin 3.0.0", ] [[package]] @@ -9184,16 +9641,31 @@ dependencies = [ "libc", "once_cell", "spin 0.5.2", - "untrusted", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.14", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + [[package]] name = "rocksdb" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" dependencies = [ "libc", "librocksdb-sys", @@ -9201,10 +9673,10 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "beefy-merkle-tree", + "binary-merkle-tree", "frame-benchmarking", "frame-executive", "frame-support", @@ -9230,6 +9702,7 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-message-queue", "pallet-mmr", "pallet-multisig", "pallet-nis", @@ -9253,7 +9726,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -9264,9 +9737,9 @@ dependencies = [ "smallvec", "sp-api", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", "sp-io", @@ -9275,20 +9748,21 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] name = "rococo-runtime-constants" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -9301,24 +9775,13 @@ dependencies = [ [[package]] name = "rpassword" -version = "7.2.0" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", "rtoolbox", - "winapi", -] - -[[package]] -name = "rtcp" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" -dependencies = [ - "bytes", - "thiserror", - "webrtc-util", + "windows-sys 0.48.0", ] [[package]] @@ -9327,37 +9790,23 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "log", "netlink-packet-route", "netlink-proto", - "nix 0.24.3", + "nix", "thiserror", "tokio", ] [[package]] name = "rtoolbox" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" dependencies = [ "libc", - "winapi", -] - -[[package]] -name = "rtp" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" -dependencies = [ - "async-trait", - "bytes", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", + "windows-sys 0.48.0", ] [[package]] @@ -9393,7 +9842,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.18", + "semver 1.0.22", ] [[package]] @@ -9407,27 +9856,27 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.14" +version = "0.36.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6380889b07a03b5ecf1d44dc9ede6fd2145d84b502a2a9ca0b03c48e0cc3220f" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" dependencies = [ "bitflags 1.3.2", - "errno 0.2.8", - "io-lifetimes 0.7.5", + "errno", + "io-lifetimes", "libc", - "linux-raw-sys 0.0.46", - "windows-sys 0.42.0", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", ] [[package]] name = "rustix" -version = "0.37.23" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", - "errno 0.3.2", - "io-lifetimes 1.0.11", + "errno", + "io-lifetimes", "libc", "linux-raw-sys 0.3.8", "windows-sys 0.48.0", @@ -9435,40 +9884,39 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.3.3", - "errno 0.3.2", + "bitflags 2.5.0", + "errno", "libc", - "linux-raw-sys 0.4.5", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ - "base64 0.13.1", "log", - "ring", - "sct 0.6.1", - "webpki 0.21.4", + "ring 0.16.20", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring", - "sct 0.7.0", - "webpki 0.22.0", + "ring 0.17.8", + "rustls-webpki", + "sct", ] [[package]] @@ -9485,18 +9933,39 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "base64 0.21.2", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" + +[[package]] +name = "ruzstd" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +dependencies = [ + "byteorder", + "thiserror-core", + "twox-hash", +] [[package]] name = "rw-stream-sink" @@ -9504,16 +9973,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "pin-project", "static_assertions", ] [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "safe-mix" @@ -9524,6 +9993,15 @@ dependencies = [ "rustc_version 0.2.3", ] +[[package]] +name = "safe_arch" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +dependencies = [ + "bytemuck", +] + [[package]] name = "same-file" version = "1.0.6" @@ -9536,7 +10014,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "log", "sp-core", @@ -9547,20 +10025,21 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "ip_network", "libp2p", "log", + "multihash", "parity-scale-codec", "prost", "prost-build", "rand 0.8.5", "sc-client-api", - "sc-network-common", + "sc-network", "sp-api", "sp-authority-discovery", "sp-blockchain", @@ -9574,9 +10053,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "log", "parity-scale-codec", @@ -9597,7 +10076,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -9607,46 +10086,49 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-state-machine", ] [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "memmap2", "sc-chain-spec-derive", - "sc-network-common", + "sc-client-api", + "sc-executor", + "sc-network", "sc-telemetry", "serde", "serde_json", + "sp-blockchain", "sp-core", "sp-runtime", + "sp-state-machine", ] [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "chrono", "clap", "fdlimit", - "futures 0.3.28", - "libp2p", + "futures 0.3.30", + "libp2p-identity", "log", "names", "parity-scale-codec", @@ -9657,7 +10139,6 @@ dependencies = [ "sc-client-db", "sc-keystore", "sc-network", - "sc-network-common", "sc-service", "sc-telemetry", "sc-tracing", @@ -9679,13 +10160,13 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "fnv", - "futures 0.3.28", + "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -9695,9 +10176,9 @@ dependencies = [ "sp-core", "sp-database", "sp-externalities", - "sp-keystore", "sp-runtime", "sp-state-machine", + "sp-statement-store", "sp-storage", "substrate-prometheus-endpoint", ] @@ -9705,7 +10186,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hash-db", "kvdb", @@ -9715,11 +10196,11 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-state-db", "schnellru", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-blockchain", "sp-core", "sp-database", @@ -9731,15 +10212,15 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", - "libp2p", + "libp2p-identity", "log", "mockall", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-utils", "serde", @@ -9756,10 +10237,10 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "log", "parity-scale-codec", "sc-block-builder", @@ -9785,25 +10266,24 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "fork-tree", - "futures 0.3.28", + "futures 0.3.30", "log", - "merlin", "num-bigint", "num-rational", "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-consensus", "sc-consensus-epochs", "sc-consensus-slots", - "sc-keystore", "sc-telemetry", - "schnorrkel", + "sc-transaction-pool-api", + "scale-info", "sp-api", "sp-application-crypto", "sp-block-builder", @@ -9811,7 +10291,6 @@ dependencies = [ "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", - "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-keystore", @@ -9823,9 +10302,9 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "jsonrpsee", "sc-consensus-babe", "sc-consensus-epochs", @@ -9842,27 +10321,142 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "array-bytes", + "async-channel 1.9.0", + "async-trait", + "fnv", + "futures 0.3.30", + "log", + "parity-scale-codec", + "parking_lot 0.12.2", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-gossip", + "sc-network-sync", + "sc-utils", + "sp-api", + "sp-application-crypto", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-blockchain", + "sp-consensus", + "sp-consensus-beefy", + "sp-core", + "sp-keystore", + "sp-mmr-primitives", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", + "wasm-timer", +] + +[[package]] +name = "sc-consensus-beefy-rpc" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "futures 0.3.30", + "jsonrpsee", + "log", + "parity-scale-codec", + "parking_lot 0.12.2", + "sc-consensus-beefy", + "sc-rpc", + "serde", + "sp-consensus-beefy", + "sp-core", + "sp-runtime", + "thiserror", +] + [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "fork-tree", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "ahash 0.8.11", + "array-bytes", + "async-trait", + "dyn-clone", + "finality-grandpa", "fork-tree", + "futures 0.3.30", + "futures-timer", + "log", "parity-scale-codec", + "parking_lot 0.12.2", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", "sc-client-api", "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-transaction-pool-api", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-keystore", + "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-grandpa-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "finality-grandpa", + "futures 0.3.30", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus-grandpa", + "sc-rpc", + "serde", "sp-blockchain", + "sp-core", "sp-runtime", + "thiserror", ] [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "assert_matches", "async-trait", - "futures 0.3.28", + "futures 0.3.30", + "futures-timer", "jsonrpsee", "log", "parity-scale-codec", @@ -9892,17 +10486,17 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "log", "parity-scale-codec", "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-blockchain", "sp-consensus", "sp-consensus-slots", @@ -9915,14 +10509,13 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "lru 0.8.1", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-executor-common", - "sc-executor-wasmi", "sc-executor-wasmtime", + "schnellru", "sp-api", "sp-core", "sp-externalities", @@ -9933,45 +10526,30 @@ dependencies = [ "sp-version", "sp-wasm-interface", "tracing", - "wasmi 0.13.2", ] [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", "thiserror", "wasm-instrument 0.3.0", - "wasmi 0.13.2", -] - -[[package]] -name = "sc-executor-wasmi" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ - "log", - "sc-allocator", - "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", - "wasmi 0.13.2", ] [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "anyhow", "cfg-if", "libc", "log", - "once_cell", - "rustix 0.35.14", + "rustix 0.36.17", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -9979,76 +10557,17 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "sc-finality-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ - "ahash 0.8.3", - "array-bytes 4.2.0", - "async-trait", - "dyn-clone", - "finality-grandpa", - "fork-tree", - "futures 0.3.28", - "futures-timer", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "rand 0.8.5", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-consensus", - "sc-network", - "sc-network-common", - "sc-network-gossip", - "sc-telemetry", - "sc-utils", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "sc-finality-grandpa-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ - "finality-grandpa", - "futures 0.3.28", - "jsonrpsee", - "log", - "parity-scale-codec", - "sc-client-api", - "sc-finality-grandpa", - "sc-rpc", - "serde", - "sp-blockchain", - "sp-core", - "sp-runtime", - "thiserror", -] - [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "ansi_term", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "log", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -10057,11 +10576,10 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", - "async-trait", - "parking_lot 0.12.1", + "array-bytes", + "parking_lot 0.12.2", "serde_json", "sp-application-crypto", "sp-core", @@ -10072,58 +10590,58 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", + "async-channel 1.9.0", "async-trait", "asynchronous-codec", - "backtrace", "bytes", "either", "fnv", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "ip_network", "libp2p", + "linked_hash_set", "log", - "lru 0.8.1", + "mockall", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", + "partial_sort", "pin-project", "rand 0.8.5", - "sc-block-builder", "sc-client-api", - "sc-consensus", "sc-network-common", - "sc-peerset", "sc-utils", "serde", "serde_json", "smallvec", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-blockchain", - "sp-consensus", "sp-core", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", + "wasm-timer", "zeroize", ] [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "async-channel 1.9.0", "cid", - "futures 0.3.28", - "libp2p", + "futures 0.3.30", + "libp2p-identity", "log", "prost", "prost-build", "sc-client-api", - "sc-network-common", + "sc-network", "sp-blockchain", "sp-runtime", "thiserror", @@ -10133,42 +10651,33 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "bitflags 1.3.2", - "bytes", - "futures 0.3.28", - "futures-timer", - "libp2p", - "linked_hash_set", + "bitflags 1.3.2", + "futures 0.3.30", + "libp2p-identity", "parity-scale-codec", "prost-build", "sc-consensus", - "sc-peerset", - "serde", - "smallvec", - "sp-blockchain", "sp-consensus", - "sp-finality-grandpa", + "sp-consensus-grandpa", "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "ahash 0.8.3", - "futures 0.3.28", + "ahash 0.8.11", + "futures 0.3.30", "futures-timer", "libp2p", "log", - "lru 0.8.1", + "sc-network", "sc-network-common", - "sc-peerset", + "schnellru", "sp-runtime", "substrate-prometheus-endpoint", "tracing", @@ -10177,51 +10686,71 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", - "futures 0.3.28", - "libp2p", + "array-bytes", + "async-channel 1.9.0", + "futures 0.3.30", + "libp2p-identity", "log", "parity-scale-codec", "prost", "prost-build", "sc-client-api", - "sc-network-common", - "sc-peerset", + "sc-network", "sp-blockchain", "sp-core", "sp-runtime", "thiserror", ] +[[package]] +name = "sc-network-statement" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "array-bytes", + "async-channel 1.9.0", + "futures 0.3.30", + "libp2p", + "log", + "parity-scale-codec", + "sc-network", + "sc-network-common", + "sp-consensus", + "sp-statement-store", + "substrate-prometheus-endpoint", +] + [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", + "async-channel 1.9.0", "async-trait", "fork-tree", - "futures 0.3.28", + "futures 0.3.30", + "futures-timer", "libp2p", "log", - "lru 0.8.1", "mockall", "parity-scale-codec", "prost", "prost-build", "sc-client-api", "sc-consensus", + "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", + "schnellru", "smallvec", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-blockchain", "sp-consensus", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -10230,16 +10759,15 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", - "futures 0.3.28", + "array-bytes", + "futures 0.3.30", "libp2p", "log", "parity-scale-codec", - "pin-project", + "sc-network", "sc-network-common", - "sc-peerset", "sc-utils", "sp-consensus", "sp-runtime", @@ -10249,50 +10777,41 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "bytes", "fnv", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "hyper", "hyper-rustls", "libp2p", + "log", "num_cpus", "once_cell", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "sc-client-api", + "sc-network", "sc-network-common", - "sc-peerset", + "sc-transaction-pool-api", "sc-utils", "sp-api", "sp-core", + "sp-externalities", + "sp-keystore", "sp-offchain", "sp-runtime", "threadpool", "tracing", ] -[[package]] -name = "sc-peerset" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ - "futures 0.3.28", - "libp2p", - "log", - "sc-utils", - "serde_json", - "wasm-timer", -] - [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10301,13 +10820,13 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -10324,6 +10843,7 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-session", + "sp-statement-store", "sp-version", "tokio", ] @@ -10331,7 +10851,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10350,7 +10870,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "http", "jsonrpsee", @@ -10365,19 +10885,20 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", - "futures 0.3.28", + "array-bytes", + "futures 0.3.30", "futures-util", "hex", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-chain-spec", "sc-client-api", "sc-transaction-pool-api", + "sc-utils", "serde", "sp-api", "sp-blockchain", @@ -10385,23 +10906,24 @@ dependencies = [ "sp-runtime", "sp-version", "thiserror", + "tokio", "tokio-stream", ] [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand 0.8.5", "sc-block-builder", @@ -10418,11 +10940,9 @@ dependencies = [ "sc-network-light", "sc-network-sync", "sc-network-transactions", - "sc-offchain", "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", - "sc-storage-monitor", "sc-sysinfo", "sc-telemetry", "sc-tracing", @@ -10445,7 +10965,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-trie", "sp-version", - "static_init 1.0.3", + "static_init", "substrate-prometheus-endpoint", "tempfile", "thiserror", @@ -10457,25 +10977,23 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sp-core", ] [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "clap", - "futures 0.3.28", + "fs4", "log", - "nix 0.26.2", "sc-client-db", - "sc-utils", "sp-core", "thiserror", "tokio", @@ -10484,7 +11002,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10492,7 +11010,7 @@ dependencies = [ "sc-client-api", "sc-consensus-babe", "sc-consensus-epochs", - "sc-finality-grandpa", + "sc-consensus-grandpa", "serde", "serde_json", "sp-blockchain", @@ -10503,9 +11021,9 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "libc", "log", "rand 0.8.5", @@ -10516,19 +11034,19 @@ dependencies = [ "serde_json", "sp-core", "sp-io", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "chrono", - "futures 0.3.28", + "futures 0.3.30", "libp2p", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project", "rand 0.8.5", "sc-utils", @@ -10541,7 +11059,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "ansi_term", "atty", @@ -10549,12 +11067,10 @@ dependencies = [ "lazy_static", "libc", "log", - "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "regex", "rustc-hash", "sc-client-api", - "sc-rpc-server", "sc-tracing-proc-macro", "serde", "sp-api", @@ -10572,27 +11088,26 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "linked-hash-map", "log", - "num-traits", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -10610,13 +11125,15 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "log", + "parity-scale-codec", "serde", "sp-blockchain", + "sp-core", "sp-runtime", "thiserror", ] @@ -10624,22 +11141,23 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "backtrace", - "futures 0.3.28", + "async-channel 1.9.0", + "futures 0.3.30", "futures-timer", "lazy_static", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "prometheus", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "scale-info" -version = "2.9.0" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" dependencies = [ "bitvec", "cfg-if", @@ -10651,11 +11169,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.9.0" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -10663,11 +11181,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -10676,7 +11194,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.11", "cfg-if", "hashbrown 0.13.2", ] @@ -10691,7 +11209,7 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.3", "getrandom 0.1.16", - "merlin", + "merlin 2.0.1", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", @@ -10699,6 +11217,39 @@ dependencies = [ "zeroize", ] +[[package]] +name = "schnorrkel" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "844b7645371e6ecdf61ff246ba1958c29e802881a749ae3fb1993675d210d28d" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek-ng", + "merlin 3.0.0", + "rand_core 0.6.4", + "sha2 0.9.9", + "subtle-ng", + "zeroize", +] + +[[package]] +name = "schnorrkel" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek 4.1.2", + "getrandom_or_panic", + "merlin 3.0.0", + "rand_core 0.6.4", + "sha2 0.10.8", + "subtle", + "zeroize", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -10713,41 +11264,19 @@ checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "sdp" -version = "0.5.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "rand 0.8.5", - "substring", - "thiserror", - "url", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] name = "sec1" -version = "0.3.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", @@ -10786,9 +11315,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -10799,9 +11328,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -10827,9 +11356,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] @@ -10842,39 +11371,48 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.180" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed" +checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.180" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036" +checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + [[package]] name = "session-keys-primitives" version = "0.1.0" -source = "git+https://github.com/zeitgeistpm/moonbeam?branch=polkadot-v0.9.38-use-paritytech-dependencies#095ddae0ea44d8385453091e5e11d475b3dbda1e" +source = "git+https://github.com/zeitgeistpm/moonkit?branch=zeitgeist-polkadot-v1.1.0#34c21d6e4df607f80bf77eacc105bf83ea0b76b6" dependencies = [ "async-trait", "frame-support", @@ -10884,12 +11422,11 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-consensus-babe", - "sp-consensus-vrf", "sp-core", "sp-inherents", "sp-keystore", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] @@ -10902,18 +11439,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", + "opaque-debug 0.3.1", ] [[package]] @@ -10938,14 +11464,14 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", ] [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -10964,33 +11490,33 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "shlex" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "signature" -version = "1.6.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core 0.6.4", @@ -10998,27 +11524,28 @@ dependencies = [ [[package]] name = "simba" -version = "0.5.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" +checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" dependencies = [ "approx", "num-complex", "num-traits", "paste", + "wide", ] [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -11031,59 +11558,166 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "enumn", "parity-scale-codec", "paste", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "slotmap" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ "version_check", ] [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "smol" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" +dependencies = [ + "async-channel 1.9.0", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-net", + "async-process", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "smoldot" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0bb30cf57b7b5f6109ce17c3164445e2d6f270af2cb48f6e4d31c2967c9a9f5" +dependencies = [ + "arrayvec 0.7.4", + "async-lock 2.8.0", + "atomic-take", + "base64 0.21.7", + "bip39", + "blake2-rfc", + "bs58 0.5.1", + "chacha20", + "crossbeam-queue", + "derive_more", + "ed25519-zebra 4.0.3", + "either", + "event-listener 2.5.3", + "fnv", + "futures-lite 1.13.0", + "futures-util", + "hashbrown 0.14.5", + "hex", + "hmac 0.12.1", + "itertools 0.11.0", + "libsecp256k1", + "merlin 3.0.0", + "no-std-net", + "nom", + "num-bigint", + "num-rational", + "num-traits", + "pbkdf2 0.12.2", + "pin-project", + "poly1305", + "rand 0.8.5", + "rand_chacha 0.3.1", + "ruzstd", + "schnorrkel 0.10.2", + "serde", + "serde_json", + "sha2 0.10.8", + "sha3", + "siphasher", + "slab", + "smallvec", + "soketto", + "twox-hash", + "wasmi", + "x25519-dalek 2.0.1", + "zeroize", +] + +[[package]] +name = "smoldot-light" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "256b5bad1d6b49045e95fe87492ce73d5af81545d8b4d8318a872d2007024c33" +dependencies = [ + "async-channel 1.9.0", + "async-lock 2.8.0", + "base64 0.21.7", + "blake2-rfc", + "derive_more", + "either", + "event-listener 2.5.3", + "fnv", + "futures-channel", + "futures-lite 1.13.0", + "futures-util", + "hashbrown 0.14.5", + "hex", + "itertools 0.11.0", + "log", + "lru 0.11.1", + "no-std-net", + "parking_lot 0.12.2", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "serde_json", + "siphasher", + "slab", + "smol", + "smoldot", + "zeroize", +] [[package]] name = "snap" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "snow" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ - "aes-gcm 0.9.4", + "aes-gcm", "blake2", "chacha20poly1305", - "curve25519-dalek 4.0.0-rc.1", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", - "ring", + "ring 0.17.8", "rustc_version 0.4.0", - "sha2 0.10.7", + "sha2 0.10.8", "subtle", ] [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -11091,12 +11725,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -11108,7 +11742,7 @@ dependencies = [ "base64 0.13.1", "bytes", "flate2", - "futures 0.3.28", + "futures 0.3.30", "http", "httparse", "log", @@ -11119,16 +11753,19 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hash-db", "log", "parity-scale-codec", + "scale-info", "sp-api-proc-macro", "sp-core", + "sp-externalities", + "sp-metadata-ir", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-trie", "sp-version", "thiserror", @@ -11137,94 +11774,91 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "Inflector", "blake2", - "proc-macro-crate", + "expander 2.1.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "sp-application-crypto" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", "serde", "sp-core", "sp-io", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-arithmetic" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "static_assertions", ] [[package]] -name = "sp-authority-discovery" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +name = "sp-arithmetic" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=c8d2251cafadc108ba2f1f8a3208dc547ff38901#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "integer-sqrt", + "num-traits", "parity-scale-codec", "scale-info", - "sp-api", - "sp-application-crypto", - "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?rev=c8d2251cafadc108ba2f1f8a3208dc547ff38901)", + "static_assertions", ] [[package]] -name = "sp-beefy" +name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", - "serde", "sp-api", "sp-application-crypto", - "sp-core", - "sp-io", - "sp-mmr-primitives", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "parity-scale-codec", "sp-api", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "log", - "lru 0.8.1", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", + "schnellru", "sp-api", "sp-consensus", "sp-database", @@ -11236,113 +11870,133 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures 0.3.28", + "futures 0.3.30", "log", - "parity-scale-codec", "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-version", "thiserror", ] [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", - "sp-consensus", "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-babe" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "async-trait", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-timestamp", +] + +[[package]] +name = "sp-consensus-beefy" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "lazy_static", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "strum 0.24.1", ] [[package]] -name = "sp-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "async-trait", - "merlin", + "finality-grandpa", + "log", "parity-scale-codec", "scale-info", "serde", "sp-api", "sp-application-crypto", - "sp-consensus", - "sp-consensus-slots", - "sp-consensus-vrf", "sp-core", - "sp-inherents", "sp-keystore", "sp-runtime", - "sp-std", - "sp-timestamp", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-timestamp", ] -[[package]] -name = "sp-consensus-vrf" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ - "parity-scale-codec", - "scale-info", - "schnorrkel", - "sp-core", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-core" -version = "7.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "21.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", - "base58", + "array-bytes", + "arrayvec 0.7.4", + "bandersnatch_vrfs", "bitflags 1.3.2", "blake2", + "bounded-collections", + "bs58 0.5.1", "dyn-clonable", - "ed25519-zebra", - "futures 0.3.28", + "ed25519-zebra 3.1.0", + "futures 0.3.30", "hash-db", "hash256-std-hasher", "impl-serde", "lazy_static", "libsecp256k1", "log", - "merlin", + "merlin 2.0.1", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", + "paste", "primitive-types", "rand 0.8.5", "regex", "scale-info", - "schnorrkel", + "schnorrkel 0.9.1", "secp256k1", "secrecy", "serde", @@ -11350,121 +12004,112 @@ dependencies = [ "sp-debug-derive", "sp-externalities", "sp-runtime-interface", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-storage", "ss58-registry", "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", "zeroize", ] [[package]] name = "sp-core-hashing" -version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "blake2", + "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", - "sp-std", "twox-hash", ] [[package]] name = "sp-core-hashing-proc-macro" -version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "proc-macro2", "quote", "sp-core-hashing", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "kvdb", - "parking_lot 0.12.1", + "parking_lot 0.12.2", ] [[package]] name = "sp-debug-derive" -version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "sp-externalities" -version = "0.13.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "environmental", "parity-scale-codec", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-storage", ] [[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +name = "sp-genesis-builder" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "serde", + "serde_json", "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", - "sp-core", + "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "thiserror", ] [[package]] name = "sp-io" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bytes", - "ed25519", "ed25519-dalek", - "futures 0.3.28", "libsecp256k1", "log", "parity-scale-codec", + "rustversion", "secp256k1", "sp-core", "sp-externalities", "sp-keystore", "sp-runtime-interface", "sp-state-machine", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-tracing", "sp-trie", "tracing", @@ -11473,27 +12118,22 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "lazy_static", "sp-core", "sp-runtime", - "strum", + "strum 0.24.1", ] [[package]] name = "sp-keystore" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "0.27.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "async-trait", - "futures 0.3.28", - "merlin", "parity-scale-codec", - "parking_lot 0.12.1", - "schnorrkel", - "serde", + "parking_lot 0.12.2", "sp-core", "sp-externalities", "thiserror", @@ -11502,16 +12142,27 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "thiserror", - "zstd", + "zstd 0.12.4", +] + +[[package]] +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -11522,28 +12173,28 @@ dependencies = [ "sp-core", "sp-debug-derive", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "thiserror", ] [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "sp-api", "sp-core", @@ -11552,8 +12203,8 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "backtrace", "lazy_static", @@ -11563,7 +12214,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "rustc-hash", "serde", @@ -11572,8 +12223,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "either", "hash256-std-hasher", @@ -11585,17 +12236,17 @@ dependencies = [ "scale-info", "serde", "sp-application-crypto", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-io", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-weights", ] [[package]] name = "sp-runtime-interface" -version = "7.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -11603,7 +12254,7 @@ dependencies = [ "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-storage", "sp-tracing", "sp-wasm-interface", @@ -11612,102 +12263,133 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-core", + "sp-keystore", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", + "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-state-machine" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "0.28.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "smallvec", "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-trie", "thiserror", "tracing", + "trie-db", +] + +[[package]] +name = "sp-statement-store" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "aes-gcm", + "curve25519-dalek 4.1.2", + "ed25519-dalek", + "hkdf", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "sha2 0.10.8", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-externalities", + "sp-runtime", + "sp-runtime-interface", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "thiserror", + "x25519-dalek 2.0.1", ] [[package]] name = "sp-std" -version = "5.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" + +[[package]] +name = "sp-std" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?rev=c8d2251cafadc108ba2f1f8a3208dc547ff38901#c8d2251cafadc108ba2f1f8a3208dc547ff38901" [[package]] name = "sp-storage" -version = "7.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", ] [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "futures-timer", - "log", "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "thiserror", ] [[package]] name = "sp-tracing" -version = "6.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "tracing", "tracing-core", "tracing-subscriber", @@ -11716,7 +12398,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "sp-api", "sp-runtime", @@ -11725,36 +12407,35 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", - "log", "parity-scale-codec", "scale-info", "sp-core", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-trie", ] [[package]] name = "sp-trie" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.11", "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "scale-info", "schnellru", "sp-core", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "thiserror", "tracing", "trie-db", @@ -11763,8 +12444,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "22.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "impl-serde", "parity-scale-codec", @@ -11773,111 +12454,275 @@ dependencies = [ "serde", "sp-core-hashing-proc-macro", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-version-proc-macro", "thiserror", ] [[package]] name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", +] + +[[package]] +name = "sp-wasm-interface" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "wasmtime", +] + +[[package]] +name = "sp-weights" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-core", + "sp-debug-derive", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spinners" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" +dependencies = [ + "lazy_static", + "maplit", + "strum 0.24.1", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "ss58-registry" +version = "1.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4743ce898933fbff7bbf414f497c459a782d496269644b3d650a398ae6a487ba" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "staging-kusama-runtime" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" +dependencies = [ + "binary-merkle-tree", + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "kusama-runtime-constants", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", + "pallet-collective", + "pallet-conviction-voting", + "pallet-democracy", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", + "pallet-elections-phragmen", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-im-online", + "pallet-indices", + "pallet-membership", + "pallet-message-queue", + "pallet-mmr", + "pallet-multisig", + "pallet-nis", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-preimage", + "pallet-proxy", + "pallet-ranked-collective", + "pallet-recovery", + "pallet-referenda", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", + "pallet-society", + "pallet-staking", + "pallet-staking-runtime-api", + "pallet-state-trie-migration", + "pallet-timestamp", + "pallet-tips", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "smallvec", + "sp-api", + "sp-application-crypto", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-core", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-storage", + "sp-transaction-pool", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "static_assertions", + "substrate-wasm-builder", ] [[package]] -name = "sp-wasm-interface" -version = "7.0.0" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +name = "staging-xcm" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "bounded-collections", + "derivative", + "environmental", "impl-trait-for-tuples", "log", - "parity-scale-codec", - "sp-std", - "wasmi 0.13.2", - "wasmtime", -] - -[[package]] -name = "sp-weights" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ "parity-scale-codec", "scale-info", "serde", - "smallvec", - "sp-arithmetic", - "sp-core", - "sp-debug-derive", - "sp-std", + "sp-weights", + "xcm-procedural", ] [[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +name = "staging-xcm-builder" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "base64ct", - "der", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-transaction-payment", + "parity-scale-codec", + "polkadot-parachain-primitives", + "scale-info", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-io", + "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", ] [[package]] -name = "ss58-registry" -version = "1.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc443bad666016e012538782d9e3006213a7db43e9fb1dda91657dc06a6fa08" +name = "staging-xcm-executor" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "Inflector", - "num-format", - "proc-macro2", - "quote", - "serde", - "serde_json", - "unicode-xid", + "environmental", + "frame-benchmarking", + "frame-support", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-weights", + "staging-xcm", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "static_init" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" -dependencies = [ - "cfg_aliases", - "libc", - "parking_lot 0.11.2", - "static_init_macro 0.5.0", -] - [[package]] name = "static_init" version = "1.0.3" @@ -11889,23 +12734,10 @@ dependencies = [ "libc", "parking_lot 0.11.2", "parking_lot_core 0.8.6", - "static_init_macro 1.0.2", + "static_init_macro", "winapi", ] -[[package]] -name = "static_init_macro" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" -dependencies = [ - "cfg_aliases", - "memchr", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "static_init_macro" version = "1.0.2" @@ -11919,24 +12751,11 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "statrs" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05bdbb8e4e78216a85785a85d3ec3183144f98d0097b9281802c019bb07a6f05" -dependencies = [ - "approx", - "lazy_static", - "nalgebra", - "num-traits", - "rand 0.8.5", -] - [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -11944,16 +12763,22 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros", + "strum_macros 0.24.3", ] +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" + [[package]] name = "strum_macros" version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -11961,33 +12786,27 @@ dependencies = [ ] [[package]] -name = "stun" -version = "0.4.4" +name = "strum_macros" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ - "base64 0.13.1", - "crc", - "lazy_static", - "md-5", - "rand 0.8.5", - "ring", - "subtle", - "thiserror", - "tokio", - "url", - "webrtc-util", + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.60", ] [[package]] name = "substrate-bip39" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" dependencies = [ "hmac 0.11.0", "pbkdf2 0.8.0", - "schnorrkel", + "schnorrkel 0.11.4", "sha2 0.9.9", "zeroize", ] @@ -11995,29 +12814,26 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" -dependencies = [ - "platforms 2.0.0", -] +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" [[package]] name = "substrate-fixed" version = "0.5.9" -source = "git+https://github.com/encointer/substrate-fixed#df67f97a6db9b40215f105613b381ca82f1e2ff4" +source = "git+https://github.com/encointer/substrate-fixed#879c58bcc6fd676a74315dcd38b598f28708b0b5" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.16.0 (git+https://github.com/encointer/typenum?tag=polkadot-v1.0.0)", + "substrate-typenum", ] [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.28", + "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", @@ -12033,7 +12849,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "hyper", "log", @@ -12045,7 +12861,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "async-trait", "jsonrpsee", @@ -12058,14 +12874,12 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "jsonrpsee", - "log", "parity-scale-codec", "sc-client-api", "sc-rpc-api", - "scale-info", "serde", "sp-core", "sp-runtime", @@ -12077,11 +12891,11 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "async-trait", - "futures 0.3.28", + "futures 0.3.30", "parity-scale-codec", "sc-client-api", "sc-client-db", @@ -12100,38 +12914,46 @@ dependencies = [ "sp-state-machine", ] +[[package]] +name = "substrate-typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f0091e93c2c75b233ae39424c52cb8a662c0811fb68add149e20e5d7e8a788" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/zeitgeistpm/substrate.git?branch=polkadot-v0.9.38-zeitgeist-adjustments#bd498817bb4479836a47231b4fc36831a19806ae" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "ansi_term", "build-helper", "cargo_metadata", "filetime", + "parity-wasm", "sp-maybe-compressed-blob", - "strum", + "strum 0.24.1", "tempfile", - "toml", + "toml 0.7.8", "walkdir", "wasm-opt", ] -[[package]] -name = "substring" -version = "1.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" -dependencies = [ - "autocfg", -] - [[package]] name = "subtle" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + [[package]] name = "syn" version = "1.0.109" @@ -12145,9 +12967,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -12195,28 +13017,27 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.7.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.0", - "redox_syscall 0.3.5", - "rustix 0.38.4", - "windows-sys 0.48.0", + "fastrand 2.1.0", + "rustix 0.38.34", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -12229,43 +13050,41 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test-case" -version = "3.1.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1d6e7bde536b0412f20765b76e921028059adfd1b90d8974d33fd3c91b25df" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" dependencies = [ "test-case-macros", ] [[package]] name = "test-case-core" -version = "3.1.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10394d5d1e27794f772b6fc854c7e91a2dc26e2cbf807ad523370c2a59c0cee" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" dependencies = [ "cfg-if", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "test-case-macros" -version = "3.1.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb9a44b1c6a54c1ba58b152797739dba2a83ca74e18168a68c980eb142f9404" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", "test-case-core", ] [[package]] name = "test-runtime-constants" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -12278,22 +13097,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] +[[package]] +name = "thiserror-core" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" +dependencies = [ + "thiserror-core-impl", +] + +[[package]] +name = "thiserror-core-impl" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] @@ -12304,9 +13143,9 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -12357,23 +13196,14 @@ dependencies = [ [[package]] name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.24" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79eabcd964882a646b3584543ccabeae7869e9ac32a46f6f22b7a5bd405308b" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -12381,16 +13211,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -12406,7 +13237,7 @@ dependencies = [ "pbkdf2 0.11.0", "rand 0.8.5", "rustc-hash", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", "unicode-normalization", "wasm-bindgen", @@ -12414,13 +13245,12 @@ dependencies = [ ] [[package]] -name = "tinytemplate" -version = "1.2.1" +name = "tiny-keccak" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" dependencies = [ - "serde", - "serde_json", + "crunchy", ] [[package]] @@ -12440,69 +13270,78 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.1", - "pin-project-lite 0.2.10", + "parking_lot 0.12.2", + "pin-project-lite 0.2.14", "signal-hook-registry", - "socket2 0.4.9", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", +] + +[[package]] +name = "tokio-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand 0.8.5", + "tokio", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.8", + "rustls 0.21.12", "tokio", - "webpki 0.22.0", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", "tokio", "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", "tokio", "tracing", ] @@ -12516,19 +13355,61 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.20.2", +] + [[package]] name = "toml_datetime" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.2.6", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] @@ -12546,18 +13427,18 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.3.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "bytes", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", "tower-layer", "tower-service", ] @@ -12576,33 +13457,32 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", - "pin-project-lite 0.2.10", + "pin-project-lite 0.2.14", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -12620,58 +13500,36 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "0.9.38" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.38#097ffd245c42aeff28cf80f8a3568e1bee2e7da7" -dependencies = [ - "polkadot-node-jaeger 0.9.38 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.38)", - "polkadot-primitives", - "tracing", - "tracing-gum-proc-macro 0.9.38 (git+https://github.com/paritytech/polkadot?branch=release-v0.9.38)", -] - -[[package]] -name = "tracing-gum" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "polkadot-node-jaeger 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", + "coarsetime", + "polkadot-node-jaeger", "polkadot-primitives", "tracing", - "tracing-gum-proc-macro 0.9.38 (git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes)", -] - -[[package]] -name = "tracing-gum-proc-macro" -version = "0.9.38" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.38#097ffd245c42aeff28cf80f8a3568e1bee2e7da7" -dependencies = [ - "expander 0.0.6", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", + "tracing-gum-proc-macro", ] [[package]] name = "tracing-gum-proc-macro" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ - "expander 0.0.6", - "proc-macro-crate", + "expander 2.1.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -12710,12 +13568,12 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.24.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -12723,9 +13581,9 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ "hash-db", ] @@ -12748,7 +13606,7 @@ dependencies = [ "lazy_static", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.4.10", "thiserror", "tinyvec", "tokio", @@ -12767,7 +13625,7 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "resolv-conf", "smallvec", "thiserror", @@ -12778,15 +13636,16 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.38#bcff60a227d455d95b4712b6cb356ce56b1ff672" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "async-trait", "clap", "frame-remote-externalities", "frame-try-runtime", @@ -12795,22 +13654,26 @@ dependencies = [ "parity-scale-codec", "sc-cli", "sc-executor", - "sc-service", "serde", "serde_json", "sp-api", + "sp-consensus-aura", + "sp-consensus-babe", "sp-core", "sp-debug-derive", "sp-externalities", + "sp-inherents", "sp-io", "sp-keystore", "sp-rpc", "sp-runtime", "sp-state-machine", + "sp-timestamp", + "sp-transaction-storage-proof", "sp-version", "sp-weights", "substrate-rpc-client", - "zstd", + "zstd 0.12.4", ] [[package]] @@ -12819,25 +13682,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" -[[package]] -name = "turn" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" -dependencies = [ - "async-trait", - "base64 0.13.1", - "futures 0.3.28", - "log", - "md-5", - "rand 0.8.5", - "ring", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -12852,18 +13696,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "typenum" -version = "1.16.0" -source = "git+https://github.com/encointer/typenum?tag=polkadot-v1.0.0#4cba9a73f7e94ba38c824616efab93f177c9a556" -dependencies = [ - "parity-scale-codec", - "scale-info", -] +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -12885,30 +13720,30 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" @@ -12916,16 +13751,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -12938,9 +13763,9 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ "asynchronous-codec", "bytes", @@ -12954,14 +13779,20 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 0.5.0", "percent-encoding", ] @@ -12971,15 +13802,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "uuid" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" -dependencies = [ - "getrandom 0.2.10", -] - [[package]] name = "valuable" version = "0.1.0" @@ -13004,26 +13826,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "waitgroup" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" -dependencies = [ - "atomic-waker", -] - [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -13046,21 +13859,24 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "wasix" +version = "0.12.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "c1fbb4ef9bbca0c1170e0b00dd28abc9e3b68669821600cad1caaed606583c6d" +dependencies = [ + "wasi 0.11.0+wasi-snapshot-preview1", +] [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -13068,24 +13884,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -13095,9 +13911,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -13105,22 +13921,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-instrument" @@ -13142,14 +13958,14 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a303793cbc01fb96551badfc7367db6007396bba6bac97936b3c8b6f7fdb41" +checksum = "effbef3bd1dde18acb401f73e740a6f3d4a1bc651e9773bddc512fe4d8d68f67" dependencies = [ "anyhow", "libc", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "tempfile", "thiserror", "wasm-opt-cxx-sys", @@ -13158,9 +13974,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c9deb56f8a9f2ec177b3bd642a8205621835944ed5da55f2388ef216aca5a4" +checksum = "c09e24eb283919ace2ed5733bda4842a59ce4c8de110ef5c6d98859513d17047" dependencies = [ "anyhow", "cxx", @@ -13170,15 +13986,14 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.111.0" +version = "0.114.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4432e28b542738a9776cedf92e8a99d8991c7b4667ee2c7ccddfb479dd2856a7" +checksum = "36f2f817bed2e8d65eb779fa37317e74de15585751f903c9118342d1970703a4" dependencies = [ "anyhow", "cc", "cxx", "cxx-build", - "regex", ] [[package]] @@ -13187,7 +14002,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -13198,89 +14013,59 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" -dependencies = [ - "parity-wasm", - "wasmi-validation", - "wasmi_core 0.2.1", -] - -[[package]] -name = "wasmi" -version = "0.20.0" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01bf50edb2ea9d922aa75a7bf3c15e26a6c9e2d18c56e862b49737a582901729" +checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" dependencies = [ + "smallvec", "spin 0.9.8", "wasmi_arena", - "wasmi_core 0.5.0", + "wasmi_core", "wasmparser-nostd", ] -[[package]] -name = "wasmi-validation" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] - [[package]] name = "wasmi_arena" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ea379cbb0b41f3a9f0bf7b47036d036aae7f43383d8cc487d4deccf40dee0a" - -[[package]] -name = "wasmi_core" -version = "0.2.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" -dependencies = [ - "downcast-rs", - "libm 0.2.7", - "memory_units", - "num-rational", - "num-traits", -] +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" [[package]] name = "wasmi_core" -version = "0.5.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5bf998ab792be85e20e771fe14182b4295571ad1d4f89d3da521c1bef5f597a" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" dependencies = [ "downcast-rs", - "libm 0.2.7", + "libm", "num-traits", + "paste", ] [[package]] name = "wasmparser" -version = "0.89.1" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap 1.9.3", + "url", ] [[package]] name = "wasmparser-nostd" -version = "0.91.0" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c37f310b5a62bfd5ae7c0f1d8e6f98af16a5d6d84ba764e9c36439ec14e318b" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] [[package]] name = "wasmtime" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad5af6ba38311282f2a21670d96e78266e8c8e2f38cbcd52c254df6ccbc7731" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", @@ -13288,7 +14073,7 @@ dependencies = [ "indexmap 1.9.3", "libc", "log", - "object 0.29.0", + "object 0.30.4", "once_cell", "paste", "psm", @@ -13301,43 +14086,43 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.36.1", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-asm-macros" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45de63ddfc8b9223d1adc8f7b2ee5f35d1f6d112833934ad7ea66e4f4339e597" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-cache" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcd849399d17d2270141cfe47fa0d91ee52d5f8ea9b98cf7ddde0d53e5f79882" +checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.21.7", "bincode", "directories-next", "file-per-thread-logger", "log", - "rustix 0.35.14", + "rustix 0.36.17", "serde", - "sha2 0.9.9", - "toml", - "windows-sys 0.36.1", - "zstd", + "sha2 0.10.8", + "toml 0.5.11", + "windows-sys 0.45.0", + "zstd 0.11.2+zstd.1.5.2", ] [[package]] name = "wasmtime-cranelift" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd91339b742ff20bfed4532a27b73c86b5bcbfedd6bea2dcdf2d64471e1b5c6" +checksum = "b1cefde0cce8cb700b1b21b6298a3837dba46521affd7b8c38a9ee2c869eee04" dependencies = [ "anyhow", "cranelift-codegen", @@ -13345,27 +14130,43 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.26.2", + "gimli 0.27.3", "log", - "object 0.29.0", + "object 0.30.4", "target-lexicon", "thiserror", "wasmparser", + "wasmtime-cranelift-shared", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-cranelift-shared" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd041e382ef5aea1b9fc78442394f1a4f6d676ce457e7076ca4cb3f397882f8b" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-native", + "gimli 0.27.3", + "object 0.30.4", + "target-lexicon", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb881c61f4f627b5d45c54e629724974f8a8890d455bcbe634330cc27309644" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.26.2", + "gimli 0.27.3", "indexmap 1.9.3", "log", - "object 0.29.0", + "object 0.30.4", "serde", "target-lexicon", "thiserror", @@ -13375,330 +14176,127 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1985c628011fe26adf5e23a5301bdc79b245e0e338f14bb58b39e4e25e4d8681" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.26.2", + "gimli 0.27.3", "log", - "object 0.29.0", + "object 0.30.4", "rustc-demangle", - "rustix 0.35.14", "serde", "target-lexicon", - "thiserror", "wasmtime-environ", "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.36.1", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-jit-debug" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ - "object 0.29.0", + "object 0.30.4", "once_cell", - "rustix 0.35.14", + "rustix 0.36.17", ] [[package]] -name = "wasmtime-runtime" -version = "1.0.2" +name = "wasmtime-jit-icache-coherence" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8f92ad4b61736339c29361da85769ebc200f184361959d1792832e592a1afd" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ - "anyhow", - "cc", "cfg-if", - "indexmap 1.9.3", "libc", - "log", - "mach", - "memfd", - "memoffset 0.6.5", - "paste", - "rand 0.8.5", - "rustix 0.35.14", - "thiserror", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.36.1", -] - -[[package]] -name = "wasmtime-types" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23d61cb4c46e837b431196dd06abb11731541021916d03476a178b54dc07aeb" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser", -] - -[[package]] -name = "web-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki 0.22.0", -] - -[[package]] -name = "webrtc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "hex", - "interceptor", - "lazy_static", - "log", - "rand 0.8.5", - "rcgen 0.9.3", - "regex", - "ring", - "rtcp", - "rtp", - "rustls 0.19.1", - "sdp", - "serde", - "serde_json", - "sha2 0.10.7", - "stun", - "thiserror", - "time 0.3.24", - "tokio", - "turn", - "url", - "waitgroup", - "webrtc-data", - "webrtc-dtls", - "webrtc-ice", - "webrtc-mdns", - "webrtc-media", - "webrtc-sctp", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "webrtc-data" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" -dependencies = [ - "bytes", - "derive_builder", - "log", - "thiserror", - "tokio", - "webrtc-sctp", - "webrtc-util", -] - -[[package]] -name = "webrtc-dtls" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942be5bd85f072c3128396f6e5a9bfb93ca8c1939ded735d177b7bcba9a13d05" -dependencies = [ - "aes 0.6.0", - "aes-gcm 0.10.2", - "async-trait", - "bincode", - "block-modes", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve", - "hkdf", - "hmac 0.12.1", - "log", - "oid-registry 0.6.1", - "p256", - "p384", - "rand 0.8.5", - "rand_core 0.6.4", - "rcgen 0.9.3", - "ring", - "rustls 0.19.1", - "sec1", - "serde", - "sha1", - "sha2 0.10.7", - "signature", - "subtle", - "thiserror", - "tokio", - "webpki 0.21.4", - "webrtc-util", - "x25519-dalek 2.0.0-pre.1", - "x509-parser 0.13.2", + "windows-sys 0.45.0", ] [[package]] -name = "webrtc-ice" -version = "0.9.1" +name = "wasmtime-runtime" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ - "arc-swap", - "async-trait", - "crc", + "anyhow", + "cc", + "cfg-if", + "indexmap 1.9.3", + "libc", "log", + "mach", + "memfd", + "memoffset", + "paste", "rand 0.8.5", - "serde", - "serde_json", - "stun", - "thiserror", - "tokio", - "turn", - "url", - "uuid", - "waitgroup", - "webrtc-mdns", - "webrtc-util", + "rustix 0.36.17", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", + "windows-sys 0.45.0", ] [[package]] -name = "webrtc-mdns" -version = "0.5.2" +name = "wasmtime-types" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ - "log", - "socket2 0.4.9", + "cranelift-entity", + "serde", "thiserror", - "tokio", - "webrtc-util", + "wasmparser", ] [[package]] -name = "webrtc-media" -version = "0.5.1" +name = "web-sys" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ - "byteorder", - "bytes", - "rand 0.8.5", - "rtp", - "thiserror", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "webrtc-sctp" -version = "0.7.0" +name = "webpki" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "crc", - "log", - "rand 0.8.5", - "thiserror", - "tokio", - "webrtc-util", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] -name = "webrtc-srtp" -version = "0.9.1" +name = "webpki-roots" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.4", - "async-trait", - "byteorder", - "bytes", - "ctr 0.8.0", - "hmac 0.11.0", - "log", - "rtcp", - "rtp", - "sha-1", - "subtle", - "thiserror", - "tokio", - "webrtc-util", + "webpki", ] [[package]] -name = "webrtc-util" -version = "0.7.0" +name = "webpki-roots" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix 0.24.3", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi", -] +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "westend-runtime" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ + "binary-merkle-tree", "bitvec", "frame-benchmarking", "frame-election-provider-support", @@ -13715,6 +14313,8 @@ dependencies = [ "pallet-babe", "pallet-bags-list", "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", "pallet-collective", "pallet-democracy", "pallet-election-provider-multi-phase", @@ -13726,6 +14326,8 @@ dependencies = [ "pallet-im-online", "pallet-indices", "pallet-membership", + "pallet-message-queue", + "pallet-mmr", "pallet-multisig", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", @@ -13741,6 +14343,7 @@ dependencies = [ "pallet-society", "pallet-staking", "pallet-staking-reward-curve", + "pallet-staking-runtime-api", "pallet-state-trie-migration", "pallet-sudo", "pallet-timestamp", @@ -13752,7 +14355,7 @@ dependencies = [ "pallet-xcm", "pallet-xcm-benchmarks", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", @@ -13762,10 +14365,11 @@ dependencies = [ "serde_derive", "smallvec", "sp-api", + "sp-application-crypto", "sp-authority-discovery", - "sp-beefy", "sp-block-builder", "sp-consensus-babe", + "sp-consensus-beefy", "sp-core", "sp-inherents", "sp-io", @@ -13775,20 +14379,21 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-storage", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", "westend-runtime-constants", - "xcm", - "xcm-builder", - "xcm-executor", ] [[package]] name = "westend-runtime-constants" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "frame-support", "polkadot-primitives", @@ -13801,20 +14406,31 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.34", +] + +[[package]] +name = "wide" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0e39d2c603fdc0504b12b458cf1f34e0b937ed2f4f2dc20796e3e86f34e11f" +dependencies = [ + "bytemuck", + "safe_arch", ] [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -13834,11 +14450,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -13849,44 +14465,64 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.34.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows_aarch64_msvc 0.34.0", - "windows_i686_gnu 0.34.0", - "windows_i686_msvc 0.34.0", - "windows_x86_64_gnu 0.34.0", - "windows_x86_64_msvc 0.34.0", + "windows-core 0.51.1", + "windows-targets 0.48.5", ] [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets", + "windows-targets 0.52.5", ] [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.42.2", ] [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm 0.42.2", "windows_aarch64_msvc 0.42.2", @@ -13898,27 +14534,34 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-targets" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows-targets", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -13929,21 +14572,15 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" +name = "windows_aarch64_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -13953,21 +14590,15 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.34.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] -name = "windows_i686_gnu" -version = "0.36.1" +name = "windows_aarch64_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -13977,21 +14608,21 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] -name = "windows_i686_msvc" -version = "0.34.0" +name = "windows_i686_gnu" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" [[package]] -name = "windows_i686_msvc" -version = "0.36.1" +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -14001,33 +14632,33 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] -name = "windows_x86_64_gnu" -version = "0.34.0" +name = "windows_i686_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -14037,39 +14668,39 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_msvc" -version = "0.34.0" +name = "windows_x86_64_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.36.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.5.3" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46aab759304e4d7b2075a9aecba26228bb073ee8c50db796b2c72c676b5d807" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -14106,144 +14737,75 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0-pre.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5da623d8af10a62342bcbbb230e33e58a63255a58012f8653c578e54bab48df" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek 3.2.0", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", + "serde", "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" -dependencies = [ - "asn1-rs 0.3.1", - "base64 0.13.1", - "data-encoding", - "der-parser 7.0.0", - "lazy_static", - "nom", - "oid-registry 0.4.0", - "ring", - "rusticata-macros", - "thiserror", - "time 0.3.24", -] - [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", - "time 0.3.24", -] - -[[package]] -name = "xcm" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" -dependencies = [ - "derivative", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-weights", - "xcm-procedural", -] - -[[package]] -name = "xcm-builder" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-transaction-payment", - "parity-scale-codec", - "polkadot-parachain", - "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", - "xcm-executor", + "time", ] [[package]] name = "xcm-emulator" version = "0.1.0" -source = "git+https://github.com/shaunxw/xcm-simulator?rev=92d371839f6d5c52dd35b7e3d61cbdefc792cc42#92d371839f6d5c52dd35b7e3d61cbdefc792cc42" +source = "git+https://github.com/zeitgeistpm/polkadot-sdk?branch=release-polkadot-v1.1.0-xcm-emulator-type-fix#84163279ce450f608de56b9d5151e65fe4bec51a" dependencies = [ - "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-test-relay-sproof-builder", "frame-support", "frame-system", - "parachain-info", + "impl-trait-for-tuples", + "lazy_static", + "log", + "pallet-balances", + "pallet-message-queue", + "parachains-common", "parity-scale-codec", "paste", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-parachains", - "quote", - "sp-arithmetic", - "sp-io", - "sp-std", - "xcm", - "xcm-executor", -] - -[[package]] -name = "xcm-executor" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" -dependencies = [ - "environmental", - "frame-benchmarking", - "frame-support", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-io", "sp-runtime", - "sp-std", - "sp-weights", - "xcm", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", + "sp-tracing", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "xcm-procedural" -version = "0.9.38" -source = "git+https://github.com/zeitgeistpm/polkadot.git?branch=v0.9.38-recent-bootnodes#20fcf6d7f070911b441925cb6f418b3d346af3a0" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0#c8d2251cafadc108ba2f1f8a3208dc547ff38901" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] @@ -14252,10 +14814,10 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d9ba232399af1783a58d8eb26f6b5006fbefe2dc9ef36bd283324792d03ea5" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "log", "nohash-hasher", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rand 0.8.5", "static_assertions", ] @@ -14266,7 +14828,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ - "time 0.3.24", + "time", ] [[package]] @@ -14294,7 +14856,7 @@ dependencies = [ "cumulus-relay-chain-rpc-interface", "frame-benchmarking", "frame-benchmarking-cli", - "futures 0.3.28", + "futures 0.3.30", "hex-literal", "jsonrpsee", "log", @@ -14309,7 +14871,7 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "polkadot-cli", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-service", "polkadot-test-service", @@ -14320,11 +14882,13 @@ dependencies = [ "sc-client-db", "sc-consensus", "sc-consensus-aura", + "sc-consensus-grandpa", "sc-executor", - "sc-finality-grandpa", "sc-keystore", "sc-network", - "sc-network-common", + "sc-network-statement", + "sc-network-sync", + "sc-offchain", "sc-rpc", "sc-rpc-api", "sc-service", @@ -14341,8 +14905,8 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-aura", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-inherents", "sp-io", "sp-keyring", @@ -14381,11 +14945,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-core", "sp-runtime", "test-case", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typenum", ] [[package]] @@ -14401,6 +14965,7 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-timestamp", "cumulus-primitives-utility", + "env_logger 0.10.2", "frame-benchmarking", "frame-executive", "frame-support", @@ -14432,12 +14997,14 @@ dependencies = [ "pallet-democracy", "pallet-grandpa", "pallet-identity", + "pallet-im-online", + "pallet-insecure-randomness-collective-flip", "pallet-membership", + "pallet-message-queue", "pallet-multisig", "pallet-parachain-staking", "pallet-preimage", "pallet-proxy", - "pallet-randomness-collective-flip", "pallet-scheduler", "pallet-timestamp", "pallet-transaction-payment", @@ -14448,33 +15015,35 @@ dependencies = [ "pallet-xcm", "parachain-info", "parity-scale-codec", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime", "polkadot-runtime-parachains", "scale-info", "session-keys-primitives", "sp-api", + "sp-authority-discovery", "sp-block-builder", "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-grandpa", "sp-core", "sp-debug-derive", - "sp-finality-grandpa", "sp-inherents", "sp-io", "sp-offchain", "sp-runtime", "sp-session", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-transaction-pool", "sp-version", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-fixed", "substrate-wasm-builder", "test-case", - "xcm", - "xcm-builder", "xcm-emulator", - "xcm-executor", "zeitgeist-primitives", "zrml-authorized", "zrml-court", @@ -14493,11 +15062,31 @@ dependencies = [ "zrml-swaps-runtime-api", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -14510,14 +15099,14 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.60", ] [[package]] name = "zrml-authorized" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", @@ -14536,19 +15125,20 @@ name = "zrml-court" version = "0.5.2" dependencies = [ "arrayvec 0.7.4", - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", + "log", "pallet-balances", - "pallet-randomness-collective-flip", + "pallet-insecure-randomness-collective-flip", "pallet-timestamp", "pallet-treasury", "parity-scale-codec", "rand 0.8.5", "rand_chacha 0.3.1", "scale-info", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-io", "sp-runtime", "test-case", @@ -14561,10 +15151,11 @@ dependencies = [ name = "zrml-global-disputes" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", + "log", "num-traits", "pallet-balances", "pallet-timestamp", @@ -14572,7 +15163,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "test-case", "zeitgeist-primitives", "zrml-market-commons", @@ -14582,7 +15173,8 @@ dependencies = [ name = "zrml-hybrid-router" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "cfg-if", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", @@ -14591,7 +15183,7 @@ dependencies = [ "orml-tokens", "orml-traits", "pallet-balances", - "pallet-randomness-collective-flip", + "pallet-insecure-randomness-collective-flip", "pallet-timestamp", "pallet-treasury", "pallet-xcm", @@ -14600,9 +15192,9 @@ dependencies = [ "serde", "sp-io", "sp-runtime", + "staging-xcm", + "staging-xcm-builder", "test-case", - "xcm", - "xcm-builder", "zeitgeist-primitives", "zrml-authorized", "zrml-court", @@ -14620,10 +15212,11 @@ dependencies = [ name = "zrml-liquidity-mining" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", + "log", "pallet-balances", "pallet-timestamp", "parity-scale-codec", @@ -14639,14 +15232,15 @@ dependencies = [ name = "zrml-market-commons" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-support", "frame-system", + "log", "pallet-balances", "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-io", "sp-runtime", "test-case", @@ -14658,19 +15252,20 @@ name = "zrml-neo-swaps" version = "0.5.2" dependencies = [ "cfg-if", - "env_logger 0.10.1", + "env_logger 0.10.2", "fixed", "frame-benchmarking", "frame-support", "frame-system", "hydra-dx-math", + "log", "more-asserts", "orml-asset-registry", "orml-currencies", "orml-tokens", "orml-traits", "pallet-balances", - "pallet-randomness-collective-flip", + "pallet-insecure-randomness-collective-flip", "pallet-timestamp", "pallet-treasury", "pallet-xcm", @@ -14680,10 +15275,10 @@ dependencies = [ "sp-api", "sp-io", "sp-runtime", + "staging-xcm", + "staging-xcm-builder", "test-case", - "typenum 1.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "xcm", - "xcm-builder", + "typenum", "zeitgeist-primitives", "zrml-authorized", "zrml-court", @@ -14700,7 +15295,7 @@ dependencies = [ name = "zrml-orderbook" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", @@ -14735,10 +15330,11 @@ dependencies = [ name = "zrml-parimutuel" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", + "log", "orml-currencies", "orml-tokens", "orml-traits", @@ -14757,28 +15353,30 @@ dependencies = [ name = "zrml-prediction-markets" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "cfg-if", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", + "log", "more-asserts", "orml-asset-registry", "orml-currencies", "orml-tokens", "orml-traits", "pallet-balances", - "pallet-randomness-collective-flip", + "pallet-insecure-randomness-collective-flip", "pallet-timestamp", "pallet-treasury", "parity-scale-codec", "scale-info", "serde", "sp-api", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-io", "sp-runtime", + "staging-xcm", "test-case", - "xcm", "zeitgeist-primitives", "zrml-authorized", "zrml-court", @@ -14797,7 +15395,7 @@ dependencies = [ "arbitrary", "frame-support", "libfuzzer-sys", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "zeitgeist-primitives", "zrml-prediction-markets", "zrml-simple-disputes", @@ -14818,10 +15416,10 @@ version = "0.5.2" dependencies = [ "arbitrary", "cfg-if", - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-support", "frame-system", - "hashbrown 0.12.3", + "hashbrown 0.14.5", "pallet-balances", "pallet-timestamp", "parity-scale-codec", @@ -14850,7 +15448,7 @@ dependencies = [ name = "zrml-simple-disputes" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", @@ -14871,7 +15469,7 @@ dependencies = [ name = "zrml-styx" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", @@ -14888,7 +15486,7 @@ dependencies = [ name = "zrml-swaps" version = "0.5.2" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "frame-benchmarking", "frame-support", "frame-system", @@ -14902,7 +15500,7 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-arithmetic", + "sp-arithmetic 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "sp-io", "sp-runtime", "test-case", @@ -14947,7 +15545,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.1.0)", "zeitgeist-primitives", ] @@ -14957,7 +15555,16 @@ version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ - "zstd-safe", + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe 6.0.6", ] [[package]] @@ -14970,13 +15577,22 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 4485139ff..784f637e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,10 @@ +[workspace.package] +authors = ["Zeitgeist PM "] +edition = "2021" +homepage = "https://zeitgeist.pm/" +license = "GPL-3.0" +repository = "https://github.com/zeitgeistpm/zeitgeist" + [workspace] default-members = [ "macros", @@ -73,154 +80,165 @@ resolver = "2" # - "client" dependencies are only used in the client, and thus don't need to be no_std compatible. # Cumulus / Nimbus (client) -cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38" } -nimbus-consensus = { git = "https://github.com/zeitgeistpm/nimbus", branch = "polkadot-v0.9.38-use-paritytech-dependencies" } +cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +nimbus-consensus = { git = "https://github.com/zeitgeistpm/moonkit", branch = "zeitgeist-polkadot-v1.1.0" } # Cumulus / Nimbus (wasm) -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38", default-features = false } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38", default-features = false } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38", default-features = false } -cumulus-primitives-timestamp = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38", default-features = false } -cumulus-primitives-utility = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38", default-features = false } -nimbus-primitives = { git = "https://github.com/zeitgeistpm/nimbus", branch = "polkadot-v0.9.38-use-paritytech-dependencies", default-features = false } -pallet-author-inherent = { git = "https://github.com/zeitgeistpm/nimbus", branch = "polkadot-v0.9.38-use-paritytech-dependencies", default-features = false } -pallet-author-slot-filter = { git = "https://github.com/zeitgeistpm/nimbus", branch = "polkadot-v0.9.38-use-paritytech-dependencies", default-features = false } -parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.38", default-features = false } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +nimbus-primitives = { git = "https://github.com/zeitgeistpm/moonkit", branch = "zeitgeist-polkadot-v1.1.0", default-features = false } +pallet-author-inherent = { git = "https://github.com/zeitgeistpm/moonkit", branch = "zeitgeist-polkadot-v1.1.0", default-features = false } +pallet-author-mapping = { git = "https://github.com/zeitgeistpm/moonkit", branch = "zeitgeist-polkadot-v1.1.0", default-features = false } +pallet-author-slot-filter = { git = "https://github.com/zeitgeistpm/moonkit", branch = "zeitgeist-polkadot-v1.1.0", default-features = false } +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +session-keys-primitives = { git = "https://github.com/zeitgeistpm/moonkit", branch = "zeitgeist-polkadot-v1.1.0", default-features = false } + +# HydraDX (wasm) +hydra-dx-math = { git = "https://github.com/galacticcouncil/HydraDX-node", package = "hydra-dx-math", tag = "v25.0.0", default-features = false } # Moonbeam (client) -moonbeam-vrf = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "polkadot-v0.9.38-use-paritytech-dependencies" } +moonbeam-vrf = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "zeitgeist-polkadot-v1.1.0" } # Moonbeam (wasm) -pallet-author-mapping = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "polkadot-v0.9.38-use-paritytech-dependencies", default-features = false } -pallet-parachain-staking = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "polkadot-v0.9.38-use-paritytech-dependencies", default-features = false } -session-keys-primitives = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "polkadot-v0.9.38-use-paritytech-dependencies", default-features = false } +pallet-parachain-staking = { git = "https://github.com/zeitgeistpm/moonbeam", branch = "zeitgeist-polkadot-v1.1.0", default-features = false } # ORML (wasm) -orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.38", default-features = false } -orml-benchmarking = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.38", default-features = false } -orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.38", default-features = false } -orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.38", default-features = false } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.38", default-features = false } -orml-unknown-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.38", default-features = false } -orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.38", default-features = false } -orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.38", default-features = false } +orml-asset-registry = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-benchmarking = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-unknown-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } +orml-xtokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v1.1.0", default-features = false } # Substrate (client) -frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -futures = { version = "0.3.21" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-storage-monitor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-storage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38" } -xcm-emulator = { rev = "92d371839f6d5c52dd35b7e3d61cbdefc792cc42", git = "https://github.com/shaunxw/xcm-simulator" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-client-db = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-statement = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-storage-monitor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +try-runtime-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Substrate (wasm) -frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-executive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-asset-tx-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-bounties = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-contracts = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-identity = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-membership = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-multisig = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-proxy = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -parity-scale-codec = { version = "3.2.2", default-features = false } -scale-info = { version = "2.3.1", default-features = false } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-debug-derive = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } -sp-version = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.38", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-asset-tx-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-contracts = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-contracts-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-insecure-randomness-collective-flip = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-vesting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +parity-scale-codec = { version = "3.6.9", default-features = false } +scale-info = { version = "2.11.1", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-beefy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-debug-derive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } # Polkadot / XCM (client) -polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" } -polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" } -polkadot-test-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38" } +polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +polkadot-test-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } # Polkadot / XCM (wasm) -pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } -polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } -polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } -rococo-runtime = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } -xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } -xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } -xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.38", default-features = false } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +rococo-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false } # Zeitgeist (client) battery-station-runtime = { path = "runtime/battery-station" } @@ -252,30 +270,29 @@ zrml-swaps = { path = "zrml/swaps", default-features = false } zrml-swaps-runtime-api = { path = "zrml/swaps/runtime-api", default-features = false } # Other (client) -clap = "4.0.32" +clap = "4.5.4" env_logger = "0.10.1" -jsonrpsee = "0.16.2" +futures = "0.3.30" +jsonrpsee = "0.16.3" libfuzzer-sys = "0.4.7" more-asserts = "0.3.1" -test-case = "3.1.0" -url = "2.2.2" +test-case = "3.3.1" +url = "2.5.0" # Other (wasm) -arbitrary = { version = "1.3.0", default-features = false } +arbitrary = { version = "1.3.2", default-features = false } arrayvec = { version = "0.7.4", default-features = false } cfg-if = { version = "1.0.0" } fixed = { version = "=1.15.0", default-features = false, features = ["num-traits"] } -# Using math code directly from the HydraDX node repository as https://github.com/galacticcouncil/hydradx-math is outdated and has been archived in May 2023. -hydra-dx-math = { git = "https://github.com/galacticcouncil/HydraDX-node", package = "hydra-dx-math", tag = "v21.1.1", default-features = false } # Hashbrown works in no_std by default and default features are used in Rikiddo -hashbrown = { version = "0.12.3", default-features = true } -hex-literal = { version = "0.3.4", default-features = false } -log = { version = "0.4.17", default-features = false } -num-traits = { version = "0.2.15", default-features = false } +hashbrown = { version = "0.14.3", default-features = true } +hex-literal = { version = "0.4.1", default-features = false } +log = { version = "0.4.21", default-features = false } +num-traits = { version = "0.2.18", default-features = false } rand = { version = "0.8.5", default-features = false } rand_chacha = { version = "0.3.1", default-features = false } -serde = { version = "1.0.152", default-features = false } -typenum = { version = "1.15.0", default-features = false } +serde = { version = "1.0.198", default-features = false } +typenum = { version = "1.17.0", default-features = false } [profile.dev.package] blake2 = { opt-level = 3 } @@ -333,44 +350,14 @@ opt-level = 3 # Zeitgeist runtime requires unwinding. panic = "unwind" -[patch."https://github.com/paritytech/substrate"] -# fix that allow to build with recent rustc -substrate-wasm-builder = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -# increase wasm instance limit (otherwise benchmarks fail) -sc-allocator = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sc-executor-common = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sc-executor-wasmtime = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-core = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-core-hashing-proc-macro = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-debug-derive = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-externalities = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-maybe-compressed-blob = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-runtime-interface = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-std = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-storage = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-tracing = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } -sp-wasm-interface = { git = "https://github.com/zeitgeistpm/substrate.git", branch = "polkadot-v0.9.38-zeitgeist-adjustments" } +# xcm-emulator incompatible block number type fixed +# Commits: +# - +[patch."https://github.com/paritytech/polkadot-sdk"] +xcm-emulator = { git = "https://github.com/zeitgeistpm/polkadot-sdk", branch = "release-polkadot-v1.1.0-xcm-emulator-type-fix" } -[patch."https://github.com/paritytech/polkadot"] -pallet-xcm = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-cli = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-client = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-core-primitives = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-node-core-av-store = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-node-network-protocol = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-node-primitives = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-node-subsystem = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-node-subsystem-util = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-overseer = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-parachain = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-primitives = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-runtime = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-runtime-common = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-runtime-parachains = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-service = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -polkadot-test-service = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -rococo-runtime = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -xcm = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -xcm-builder = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } -xcm-executor = { git = "https://github.com/zeitgeistpm/polkadot.git", branch = "v0.9.38-recent-bootnodes" } +[patch."https://github.com/galacticcouncil/HydraDX-node"] +# Ensure same Substrate dependencies are used everywhere +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" } diff --git a/Makefile b/Makefile index 537b0b49c..feb781af6 100644 --- a/Makefile +++ b/Makefile @@ -16,32 +16,27 @@ check-dummy: BUILD_DUMMY_WASM_BINARY= cargo check # Pseudo private target is invoked by public targets for different chains ---try-runtime: - RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=trace \ - cargo run \ - --bin=zeitgeist \ - --features=parachain,try-runtime \ - try-runtime \ - --chain=${TRYRUNTIME_CHAIN} \ - --runtime=${RUNTIME_PATH} \ - on-runtime-upgrade \ - --checks=all \ - live \ - --uri=${TRYRUNTIME_URL} +--execute-try-runtime: + RUST_LOG=runtime=trace,try-runtime::cli=trace,executor=info \ + cargo build --release --features=parachain,try-runtime,force-debug + try-runtime \ + --runtime=${RUNTIME_PATH} \ + on-runtime-upgrade \ + --checks=all \ + live \ + --uri=${TRYRUNTIME_URL} try-runtime-upgrade-battery-station: - @$(MAKE) TRYRUNTIME_CHAIN="battery_station_staging" \ - TRYRUNTIME_URL="wss://bsr.zeitgeist.pm:443" \ - RUNTIME_PATH="./target/debug/wbuild/battery-station-runtime/battery_station_runtime.compact.compressed.wasm" \ - -- \ - --try-runtime + @$(MAKE) TRYRUNTIME_URL="wss://bsr.zeitgeist.pm:443" \ + RUNTIME_PATH="./target/release/wbuild/battery-station-runtime/battery_station_runtime.compact.compressed.wasm" \ + -- \ + --execute-try-runtime try-runtime-upgrade-zeitgeist: - @$(MAKE) TRYRUNTIME_CHAIN="zeitgeist_staging" \ - TRYRUNTIME_URL="wss://zeitgeist-rpc.dwellir.com:443" \ - RUNTIME_PATH="./target/debug/wbuild/zeitgeist-runtime/zeitgeist_runtime.compact.compressed.wasm" \ - -- \ - --try-runtime + @$(MAKE) TRYRUNTIME_URL="wss://zeitgeist-rpc.dwellir.com:443" \ + RUNTIME_PATH="./target/release/wbuild/zeitgeist-runtime/zeitgeist_runtime.compact.compressed.wasm" \ + -- \ + -execute--try-runtime build: SKIP_WASM_BUILD= cargo build diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 39397744a..903bd3b33 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,5 +1,5 @@ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zeitgeist-macros" version = "0.5.2" diff --git a/node/Cargo.toml b/node/Cargo.toml index 1b81fe5ef..22907791d 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -17,6 +17,9 @@ sc-client-db = { workspace = true } sc-consensus = { workspace = true } sc-executor = { workspace = true } sc-keystore = { workspace = true } +sc-network = { workspace = true } +sc-network-statement = { workspace = true } +sc-offchain = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sc-service = { workspace = true } @@ -75,8 +78,7 @@ pallet-author-inherent = { workspace = true, features = ["default"], optional = pallet-parachain-staking = { workspace = true, features = ["default"], optional = true } parity-scale-codec = { workspace = true, features = ["default"], optional = true } sc-chain-spec = { workspace = true, optional = true } -sc-network = { workspace = true, optional = true } -sc-network-common = { workspace = true, optional = true } +sc-network-sync = { workspace = true, optional = true } sc-tracing = { workspace = true, optional = true } serde = { workspace = true, features = ["default"], optional = true } session-keys-primitives = { workspace = true, features = ["default"], optional = true } @@ -86,7 +88,7 @@ substrate-prometheus-endpoint = { workspace = true, optional = true } # Polkadot polkadot-cli = { workspace = true, optional = true } -polkadot-parachain = { workspace = true, features = ["default"], optional = true } +polkadot-parachain-primitives = { workspace = true, features = ["default"], optional = true } polkadot-primitives = { workspace = true, features = ["default"], optional = true } polkadot-service = { workspace = true, optional = true } polkadot-test-service = { workspace = true, optional = true } @@ -94,9 +96,9 @@ polkadot-test-service = { workspace = true, optional = true } # Standalone sc-consensus-aura = { workspace = true } -sc-finality-grandpa = { workspace = true } +sc-consensus-grandpa = { workspace = true } sp-consensus-aura = { workspace = true } -sp-finality-grandpa = { workspace = true, features = ["default"] } +sp-consensus-grandpa = { workspace = true, features = ["default"] } # Utility cfg-if = { workspace = true } @@ -148,8 +150,7 @@ parachain = [ "parity-scale-codec", "session-keys-primitives", "sc-chain-spec", - "sc-network", - "sc-network-common", + "sc-network-sync", "sc-tracing", "serde", "sp-keystore", @@ -158,7 +159,7 @@ parachain = [ # Polkadot "polkadot-cli", - "polkadot-parachain", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-service", "polkadot-test-service", @@ -184,7 +185,7 @@ with-zeitgeist-runtime = ["zeitgeist-runtime"] authors = ["Zeitgeist PM "] build = "build.rs" description = "An evolving blockchain for prediction markets and futarchy." -edition = "2021" +edition.workspace = true homepage = "https://zeitgeist.pm" name = "zeitgeist-node" version = "0.5.2" diff --git a/node/src/chain_spec/additional_chain_spec.rs b/node/src/chain_spec/additional_chain_spec.rs index b7d39e7ae..002e94dd8 100644 --- a/node/src/chain_spec/additional_chain_spec.rs +++ b/node/src/chain_spec/additional_chain_spec.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -40,5 +40,5 @@ pub struct AdditionalChainSpec { #[cfg(not(feature = "parachain"))] pub struct AdditionalChainSpec { pub initial_authorities: - Vec<(sp_consensus_aura::sr25519::AuthorityId, sp_finality_grandpa::AuthorityId)>, + Vec<(sp_consensus_aura::sr25519::AuthorityId, sp_consensus_grandpa::AuthorityId)>, } diff --git a/node/src/chain_spec/battery_station.rs b/node/src/chain_spec/battery_station.rs index 058222791..9d8a2e8f1 100644 --- a/node/src/chain_spec/battery_station.rs +++ b/node/src/chain_spec/battery_station.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -48,10 +48,10 @@ cfg_if::cfg_if! { pub(super) const DEFAULT_STAKING_AMOUNT_BATTERY_STATION: u128 = 2_000 * BASE; const DEFAULT_COLLATOR_BALANCE_BATTERY_STATION: Option = DEFAULT_STAKING_AMOUNT_BATTERY_STATION.checked_add(CollatorDeposit::get()); - pub type BatteryStationChainSpec = sc_service::GenericChainSpec; + pub type BatteryStationChainSpec = sc_service::GenericChainSpec; const NUM_SELECTED_CANDIDATES: u32 = 8; } else { - pub type BatteryStationChainSpec = sc_service::GenericChainSpec; + pub type BatteryStationChainSpec = sc_service::GenericChainSpec; } } diff --git a/node/src/chain_spec/dev.rs b/node/src/chain_spec/dev.rs index 75782f73b..4acb1d5eb 100644 --- a/node/src/chain_spec/dev.rs +++ b/node/src/chain_spec/dev.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -49,10 +49,10 @@ const INITIAL_BALANCE: Balance = Balance::MAX >> 4; #[cfg(not(feature = "parachain"))] fn authority_keys_from_seed( s: &str, -) -> (sp_consensus_aura::sr25519::AuthorityId, sp_finality_grandpa::AuthorityId) { +) -> (sp_consensus_aura::sr25519::AuthorityId, sp_consensus_grandpa::AuthorityId) { ( get_from_seed::(s), - get_from_seed::(s), + get_from_seed::(s), ) } diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 4d9849948..28a40c705 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -108,8 +108,8 @@ macro_rules! generate_generic_genesis_function { acs: AdditionalChainSpec, endowed_accounts: Vec, wasm_binary: &[u8], - ) -> $runtime::GenesisConfig { - $runtime::GenesisConfig { + ) -> $runtime::RuntimeGenesisConfig { + $runtime::RuntimeGenesisConfig { // Common genesis advisory_committee: Default::default(), advisory_committee_membership: $runtime::AdvisoryCommitteeMembershipConfig { @@ -125,6 +125,7 @@ macro_rules! generate_generic_genesis_function { #[cfg(feature = "parachain")] author_filter: $runtime::AuthorFilterConfig { eligible_count: EligibilityValue::new_unchecked(1), + ..Default::default() }, #[cfg(feature = "parachain")] author_mapping: $runtime::AuthorMappingConfig { @@ -147,13 +148,17 @@ macro_rules! generate_generic_genesis_function { #[cfg(not(feature = "parachain"))] grandpa: $runtime::GrandpaConfig { authorities: acs.initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), + ..Default::default() }, liquidity_mining: $runtime::LiquidityMiningConfig { initial_balance: LIQUIDITY_MINING, per_block_distribution: LIQUIDITY_MINING_PTD.mul_ceil(LIQUIDITY_MINING), }, #[cfg(feature = "parachain")] - parachain_info: $runtime::ParachainInfoConfig { parachain_id: acs.parachain_id }, + parachain_info: $runtime::ParachainInfoConfig { + parachain_id: acs.parachain_id, + ..Default::default() + }, #[cfg(feature = "parachain")] parachain_staking: $runtime::ParachainStakingConfig { blocks_per_round: acs.blocks_per_round, @@ -174,7 +179,7 @@ macro_rules! generate_generic_genesis_function { #[cfg(feature = "parachain")] // Default should use the pallet configuration polkadot_xcm: PolkadotXcmConfig::default(), - system: $runtime::SystemConfig { code: wasm_binary.to_vec() }, + system: $runtime::SystemConfig { code: wasm_binary.to_vec(), ..Default::default() }, technical_committee: Default::default(), technical_committee_membership: $runtime::TechnicalCommitteeMembershipConfig { members: vec![].try_into().unwrap(), @@ -230,7 +235,7 @@ pub struct Extensions { /// The relay chain of the Parachain. pub relay_chain: String, /// Known bad block hashes. - pub bad_blocks: sc_client_api::BadBlocks, + pub bad_blocks: sc_client_api::BadBlocks, } #[cfg(feature = "parachain")] diff --git a/node/src/chain_spec/zeitgeist.rs b/node/src/chain_spec/zeitgeist.rs index c98d38a26..6d056113b 100644 --- a/node/src/chain_spec/zeitgeist.rs +++ b/node/src/chain_spec/zeitgeist.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -36,19 +36,19 @@ use { zeitgeist_primitives::constants::ztg::{STAKING_PTD, TOTAL_INITIAL_ZTG}, zeitgeist_runtime::{ CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission, - DefaultParachainBondReservePercent, EligibilityValue, MinCollatorStk, PolkadotXcmConfig, + DefaultParachainBondReservePercent, EligibilityValue, MinCandidateStk, PolkadotXcmConfig, }, }; cfg_if::cfg_if! { if #[cfg(feature = "parachain")] { - const DEFAULT_STAKING_AMOUNT_ZEITGEIST: u128 = MinCollatorStk::get(); + const DEFAULT_STAKING_AMOUNT_ZEITGEIST: u128 = MinCandidateStk::get(); const DEFAULT_COLLATOR_BALANCE_ZEITGEIST: Option = DEFAULT_STAKING_AMOUNT_ZEITGEIST.checked_add(CollatorDeposit::get()); const NUM_SELECTED_CANDIDATES: u32 = 8; - pub type ZeitgeistChainSpec = sc_service::GenericChainSpec; + pub type ZeitgeistChainSpec = sc_service::GenericChainSpec; } else { - pub type ZeitgeistChainSpec = sc_service::GenericChainSpec; + pub type ZeitgeistChainSpec = sc_service::GenericChainSpec; } } diff --git a/node/src/cli.rs b/node/src/cli.rs index 31c9dffda..299e80c21 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -20,22 +20,15 @@ #[cfg(feature = "parachain")] mod cli_parachain; -use super::service::{ - AdditionalRuntimeApiCollection, FullBackend, FullClient, IdentifyVariant, RuntimeApiCollection, -}; +use super::service::{FullBackend, FullClient, IdentifyVariant}; use clap::Parser; #[cfg(feature = "parachain")] pub use cli_parachain::RelayChainCli; -use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; -use sc_client_api::{Backend as BackendT, BlockchainEvents, KeyIterator}; -use sp_api::{CallApiAt, NumberFor, ProvideRuntimeApi}; -use sp_blockchain::HeaderBackend; +use sc_cli::{ChainSpec, SubstrateCli}; +use sc_client_api::{KeysIter, PairsIter}; +use sp_api::NumberFor; use sp_consensus::BlockStatus; -use sp_runtime::{ - generic::SignedBlock, - traits::{BlakeTwo256, Block as BlockT}, - Justifications, -}; +use sp_runtime::{generic::SignedBlock, traits::Block as BlockT, Justifications}; use sp_storage::{ChildInfo, StorageData, StorageKey}; use std::sync::Arc; use zeitgeist_primitives::types::{Block, Header}; @@ -115,6 +108,7 @@ pub fn load_spec(id: &str) -> Result, String> { } #[derive(Debug, clap::Subcommand)] +#[allow(clippy::large_enum_variant)] pub enum Subcommand { /// The custom benchmark subcommmand benchmarking runtime pallets. #[clap(subcommand)] @@ -166,11 +160,6 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// Try some command against runtime state. - #[cfg(feature = "try-runtime")] - TryRuntime(try_runtime_cli::TryRuntimeCmd), - - /// Try some command against runtime state. Note: `try-runtime` feature must be enabled. - #[cfg(not(feature = "try-runtime"))] TryRuntime, } @@ -212,6 +201,21 @@ pub struct Cli { pub storage_monitor: sc_storage_monitor::StorageMonitorParams, } +#[cfg(feature = "parachain")] +impl Cli { + #[allow(clippy::borrowed_box)] + pub(crate) fn runtime_version(spec: &Box) -> sc_cli::RuntimeVersion { + match spec { + #[cfg(feature = "with-zeitgeist-runtime")] + spec if spec.is_zeitgeist() => zeitgeist_runtime::VERSION, + #[cfg(feature = "with-battery-station-runtime")] + _ => battery_station_runtime::VERSION, + #[cfg(not(feature = "with-battery-station-runtime"))] + _ => panic!("{}", crate::BATTERY_STATION_RUNTIME_NOT_AVAILABLE), + } + } +} + impl SubstrateCli for Cli { fn author() -> String { env!("CARGO_PKG_AUTHORS").into() @@ -237,105 +241,11 @@ impl SubstrateCli for Cli { load_spec(id) } - fn native_runtime_version(spec: &Box) -> &'static RuntimeVersion { - match spec { - spec if spec.is_zeitgeist() => { - #[cfg(feature = "with-zeitgeist-runtime")] - return &zeitgeist_runtime::VERSION; - #[cfg(not(feature = "with-zeitgeist-runtime"))] - panic!("{}", crate::ZEITGEIST_RUNTIME_NOT_AVAILABLE); - } - _spec => { - #[cfg(feature = "with-battery-station-runtime")] - return &battery_station_runtime::VERSION; - #[cfg(not(feature = "with-battery-station-runtime"))] - panic!("{}", crate::BATTERY_STATION_RUNTIME_NOT_AVAILABLE); - } - } - } - fn support_url() -> String { SUPPORT_URL.into() } } -/// Config that abstracts over all available client implementations. -/// -/// For a concrete type there exists [`Client`]. -pub trait AbstractClient: - BlockchainEvents - + Sized - + Send - + Sync - + ProvideRuntimeApi - + HeaderBackend - + CallApiAt -where - Block: BlockT, - Backend: BackendT, - Backend::State: sp_api::StateBackend, - Self::Api: RuntimeApiCollection - + AdditionalRuntimeApiCollection, -{ -} - -impl AbstractClient for Client -where - Block: BlockT, - Backend: BackendT, - Backend::State: sp_api::StateBackend, - Client: BlockchainEvents - + ProvideRuntimeApi - + HeaderBackend - + Sized - + Send - + Sync - + CallApiAt, - Client::Api: RuntimeApiCollection - + AdditionalRuntimeApiCollection, -{ -} - -/// Execute something with the client instance. -/// -/// As there exist multiple chains inside Zeitgeist, like Zeitgeist itself, -/// Battery Station etc., there can exist different kinds of client types. As these -/// client types differ in the generics that are being used, we can not easily -/// return them from a function. For returning them from a function there exists -/// [`Client`]. However, the problem on how to use this client instance still -/// exists. This trait "solves" it in a dirty way. It requires a type to -/// implement this trait and than the [`execute_with_client`](ExecuteWithClient::execute_with_client) -/// function can be called with any possible client -/// instance. -/// -/// In a perfect world, we could make a closure work in this way. -pub trait ExecuteWithClient { - /// The return type when calling this instance. - type Output; - - /// Execute whatever should be executed with the given client instance. - fn execute_with_client(self, client: Arc) -> Self::Output - where - >::StateBackend: sp_api::StateBackend, - Backend: sc_client_api::Backend, - Backend::State: sp_api::StateBackend, - Api: RuntimeApiCollection - + AdditionalRuntimeApiCollection, - Client: AbstractClient + 'static; -} - -/// A handle to a Zeitgeist client instance. -/// -/// The Zeitgeist service supports multiple different runtimes (Zeitgeist, Battery -/// Station, etc.). As each runtime has a specialized client, we need to hide them -/// behind a trait. This is this trait. -/// -/// When wanting to work with the inner client, you need to use `execute_with`. -pub trait ClientHandle { - /// Execute the given something with the client. - fn execute_with(&self, t: T) -> T::Output; -} - /// A client instance of Zeitgeist. #[derive(Clone)] pub enum Client { @@ -359,21 +269,6 @@ impl From>> for Client { } } -impl ClientHandle for Client { - fn execute_with(&self, t: T) -> T::Output { - match self { - #[cfg(feature = "with-battery-station-runtime")] - Self::BatteryStation(client) => { - T::execute_with_client::<_, _, FullBackend>(t, client.clone()) - } - #[cfg(feature = "with-zeitgeist-runtime")] - Self::Zeitgeist(client) => { - T::execute_with_client::<_, _, FullBackend>(t, client.clone()) - } - } - } -} - macro_rules! match_client { ($self:ident, $method:ident($($param:ident),*)) => { match $self { @@ -459,14 +354,6 @@ impl sc_client_api::StorageProvider for Client { match_client!(self, storage(hash, key)) } - fn storage_keys( - &self, - hash: ::Hash, - key_prefix: &StorageKey, - ) -> sp_blockchain::Result> { - match_client!(self, storage_keys(hash, key_prefix)) - } - fn storage_hash( &self, hash: ::Hash, @@ -475,23 +362,25 @@ impl sc_client_api::StorageProvider for Client { match_client!(self, storage_hash(hash, key)) } - fn storage_pairs( + fn storage_keys( &self, hash: ::Hash, - key_prefix: &StorageKey, - ) -> sp_blockchain::Result> { - match_client!(self, storage_pairs(hash, key_prefix)) + prefix: Option<&StorageKey>, + start_key: Option<&StorageKey>, + ) -> sp_blockchain::Result>::State, Block>> + { + match_client!(self, storage_keys(hash, prefix, start_key)) } - fn storage_keys_iter( + fn storage_pairs( &self, hash: ::Hash, - prefix: Option<&StorageKey>, + key_prefix: Option<&StorageKey>, start_key: Option<&StorageKey>, ) -> sp_blockchain::Result< - KeyIterator<>::State, Block>, + PairsIter<>::State, Block>, > { - match_client!(self, storage_keys_iter(hash, prefix, start_key)) + match_client!(self, storage_pairs(hash, key_prefix, start_key)) } fn child_storage( @@ -504,24 +393,14 @@ impl sc_client_api::StorageProvider for Client { } fn child_storage_keys( - &self, - hash: ::Hash, - child_info: &ChildInfo, - key_prefix: &StorageKey, - ) -> sp_blockchain::Result> { - match_client!(self, child_storage_keys(hash, child_info, key_prefix)) - } - - fn child_storage_keys_iter( &self, hash: ::Hash, child_info: ChildInfo, prefix: Option<&StorageKey>, start_key: Option<&StorageKey>, - ) -> sp_blockchain::Result< - KeyIterator<>::State, Block>, - > { - match_client!(self, child_storage_keys_iter(hash, child_info, prefix, start_key)) + ) -> sp_blockchain::Result>::State, Block>> + { + match_client!(self, child_storage_keys(hash, child_info, prefix, start_key)) } fn child_storage_hash( diff --git a/node/src/cli/cli_parachain.rs b/node/src/cli/cli_parachain.rs index 9b7810f18..b28fb6862 100644 --- a/node/src/cli/cli_parachain.rs +++ b/node/src/cli/cli_parachain.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -18,11 +18,10 @@ use clap::Parser; use sc_cli::{ - self, ChainSpec, ImportParams, KeystoreParams, NetworkParams, RuntimeVersion, SharedParams, - SubstrateCli, + self, ChainSpec, ImportParams, KeystoreParams, NetworkParams, SharedParams, SubstrateCli, }; use sc_service::config::{BasePath, PrometheusConfig}; -use std::{net::SocketAddr, path::PathBuf}; +use std::path::PathBuf; const BATTERY_STATION_RELAY_ID: &str = "battery_station_relay_v3"; @@ -46,12 +45,13 @@ impl RelayChainCli { ) -> Self { let extension = crate::chain_spec::Extensions::try_get(&*para_config.chain_spec); let chain_id = extension.map(|e| e.relay_chain.clone()); - let base_path = para_config - .base_path - .as_ref() - .map(|x| x.path().join(chain_id.clone().unwrap_or_else(|| "polkadot".into()))); + let base_path = para_config.base_path.path().join("polkadot"); - Self { base_path, chain_id, base: clap::Parser::parse_from(relay_chain_args) } + Self { + base_path: Some(base_path), + chain_id, + base: polkadot_cli::RunCmd::parse_from(relay_chain_args), + } } } @@ -127,24 +127,12 @@ impl sc_cli::CliConfiguration for RelayChainCli { self.base.base.rpc_cors(is_dev) } - fn rpc_http(&self, default_listen_port: u16) -> sc_cli::Result> { - self.base.base.rpc_http(default_listen_port) - } - - fn rpc_ipc(&self) -> sc_cli::Result> { - self.base.base.rpc_ipc() - } - fn rpc_methods(&self) -> sc_cli::Result { self.base.base.rpc_methods() } - fn rpc_ws(&self, default_listen_port: u16) -> sc_cli::Result> { - self.base.base.rpc_ws(default_listen_port) - } - - fn rpc_ws_max_connections(&self) -> sc_cli::Result> { - self.base.base.rpc_ws_max_connections() + fn rpc_max_connections(&self) -> sc_cli::Result { + self.base.base.rpc_max_connections() } fn shared_params(&self) -> &SharedParams { @@ -168,11 +156,7 @@ impl sc_cli::DefaultConfigurationValues for RelayChainCli { 9616 } - fn rpc_http_listen_port() -> u16 { - 9934 - } - - fn rpc_ws_listen_port() -> u16 { + fn rpc_listen_port() -> u16 { 9945 } } @@ -211,10 +195,6 @@ impl sc_cli::SubstrateCli for RelayChainCli { } } - fn native_runtime_version(chain_spec: &Box) -> &'static RuntimeVersion { - polkadot_cli::Cli::native_runtime_version(chain_spec) - } - fn support_url() -> String { crate::cli::SUPPORT_URL.into() } diff --git a/node/src/command.rs b/node/src/command.rs index 2491aa822..b0fb1a1a7 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // Copyright 2019-2022 PureStake Inc. // @@ -20,7 +20,7 @@ use super::{ benchmarking::{inherent_benchmark_data, RemarksExtrinsicBuilder, TransferKeepAliveBuilder}, cli::{Cli, Subcommand}, - service::{new_chain_ops, new_full, IdentifyVariant}, + service::{new_chain_ops, new_full, HostFunctions, IdentifyVariant}, }; use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE}; use sc_cli::SubstrateCli; @@ -68,25 +68,23 @@ pub fn run() -> sc_cli::Result<()> { // This switch needs to be in the client, since the client decides // which sub-commands it wants to support. BenchmarkCmd::Pallet(cmd) => { - if !cfg!(feature = "runtime-benchmarks") { - return Err("Runtime benchmarking wasn't enabled when building the node. \ - You can enable it with `--features runtime-benchmarks`." - .into()); - } - - match chain_spec { - #[cfg(feature = "with-zeitgeist-runtime")] - spec if spec.is_zeitgeist() => runner.sync_run(|config| { - cmd.run::(config) - }), - #[cfg(feature = "with-battery-station-runtime")] - _ => runner.sync_run(|config| { - cmd.run::( - config, - ) - }), - #[cfg(not(feature = "with-battery-station-runtime"))] - _ => panic!("{}", crate::BATTERY_STATION_RUNTIME_NOT_AVAILABLE), + if cfg!(feature = "runtime-benchmarks") { + match chain_spec { + #[cfg(feature = "with-zeitgeist-runtime")] + spec if spec.is_zeitgeist() => runner.sync_run(|config| { + cmd.run::(config) + }), + #[cfg(feature = "with-battery-station-runtime")] + _ => runner.sync_run(|config| { + cmd.run::(config) + }), + #[cfg(not(feature = "with-battery-station-runtime"))] + _ => panic!("{}", crate::BATTERY_STATION_RUNTIME_NOT_AVAILABLE), + } + } else { + Err("Runtime benchmarking wasn't enabled when building the node. \ + You can enable it with `--features runtime-benchmarks`." + .into()) } } BenchmarkCmd::Block(cmd) => match chain_spec { @@ -320,7 +318,7 @@ pub fn run() -> sc_cli::Result<()> { let _ = builder.init(); let chain_spec = &crate::cli::load_spec(¶ms.shared_params.chain.clone().unwrap_or_default())?; - let state_version = Cli::native_runtime_version(chain_spec).state_version(); + let state_version = Cli::runtime_version(chain_spec).state_version(); let buf = match chain_spec { #[cfg(feature = "with-zeitgeist-runtime")] @@ -432,57 +430,10 @@ pub fn run() -> sc_cli::Result<()> { Ok((cmd.run(client, backend, None), task_manager)) }) } - #[cfg(feature = "try-runtime")] - Some(Subcommand::TryRuntime(cmd)) => { - use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; - - let runner = cli.create_runner(cmd)?; - let chain_spec = &runner.config().chain_spec; - - match chain_spec { - #[cfg(feature = "with-zeitgeist-runtime")] - spec if spec.is_zeitgeist() => { - runner.async_run(|config| { - // we don't need any of the components of new_partial, just a runtime, or a task - // manager to do `async_run`. - let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry); - let task_manager = - sc_service::TaskManager::new(config.tokio_handle.clone(), registry) - .map_err(|e| { - sc_cli::Error::Service(sc_service::Error::Prometheus(e)) - })?; - return Ok(( - cmd.run::::ExtendHostFunctions, - >>(), - task_manager, - )); - }) - } - #[cfg(feature = "with-battery-station-runtime")] - _ => runner.async_run(|config| { - let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry); - let task_manager = - sc_service::TaskManager::new(config.tokio_handle.clone(), registry) - .map_err(|e| { - sc_cli::Error::Service(sc_service::Error::Prometheus(e)) - })?; - return Ok(( - cmd.run::::ExtendHostFunctions, - >>(), - task_manager, - )); - }), - #[cfg(not(feature = "with-battery-station-runtime"))] - _ => Err("Invalid chain spec"), - } - } - #[cfg(not(feature = "try-runtime"))] - Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \ - You can enable it with `--features try-runtime`." + Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a \ + standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer \ + being maintained here and will be removed entirely some time after January 2024. \ + Please remove this subcommand from your runtime and use the standalone CLI." .into()), None => none_command(cli), } @@ -515,10 +466,10 @@ fn none_command(cli: Cli) -> sc_cli::Result<()> { cli.parachain_id.or(parachain_id_extension).unwrap_or(super::POLKADOT_PARACHAIN_ID), ); let parachain_account = - AccountIdConversion::::into_account_truncating( + AccountIdConversion::::into_account_truncating( ¶chain_id, ); - let state_version = Cli::native_runtime_version(chain_spec).state_version(); + let state_version = Cli::runtime_version(chain_spec).state_version(); let block: zeitgeist_runtime::Block = cumulus_client_cli::generate_genesis_block(&**chain_spec, state_version) .map_err(|e| format!("{:?}", e))?; @@ -545,7 +496,7 @@ fn none_command(cli: Cli) -> sc_cli::Result<()> { if parachain_config.role.is_authority() { "yes" } else { "no" } ); - if !collator_options.relay_chain_rpc_urls.is_empty() && !cli.relaychain_args.is_empty() { + if !cli.run.relay_chain_rpc_urls.is_empty() && !cli.relaychain_args.is_empty() { log::warn!( "Detected relay chain node arguments together with --relay-chain-rpc-url. This \ command starts a minimal Polkadot node that only uses a network-related subset \ diff --git a/node/src/rpc.rs b/node/src/rpc.rs index ffa85bead..b880a6ae0 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022, 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -29,7 +29,7 @@ use sp_api::ProvideRuntimeApi; use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; use std::sync::Arc; -use zeitgeist_primitives::types::{AccountId, Balance, Block, Index as Nonce, MarketId, PoolId}; +use zeitgeist_primitives::types::{AccountId, Balance, Block, MarketId, Nonce, PoolId}; /// Full client dependencies. pub struct FullDeps { diff --git a/node/src/service.rs b/node/src/service.rs index dd9f57b4b..6e832325f 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -21,8 +21,7 @@ mod service_parachain; #[cfg(not(feature = "parachain"))] mod service_standalone; -use sp_runtime::traits::BlakeTwo256; -use zeitgeist_primitives::types::{AccountId, Balance, Block, Index, MarketId, PoolId}; +use zeitgeist_primitives::types::{AccountId, Balance, Block, MarketId, Nonce, PoolId}; use super::cli::Client; use sc_executor::NativeExecutionDispatch; @@ -34,18 +33,20 @@ pub use service_parachain::{new_full, new_partial, FullBackend, FullClient}; #[cfg(not(feature = "parachain"))] pub use service_standalone::{new_full, new_partial, FullBackend, FullClient}; use sp_api::ConstructRuntimeApi; -use sp_trie::PrefixedMemoryDB; use std::sync::Arc; +#[cfg(feature = "runtime-benchmarks")] +pub type HostFunctions = + (frame_benchmarking::benchmarking::HostFunctions, sp_io::SubstrateHostFunctions); +#[cfg(not(feature = "runtime-benchmarks"))] +pub type HostFunctions = (sp_io::SubstrateHostFunctions,); + #[cfg(feature = "with-battery-station-runtime")] pub struct BatteryStationExecutor; #[cfg(feature = "with-battery-station-runtime")] impl sc_executor::NativeExecutionDispatch for BatteryStationExecutor { - #[cfg(feature = "runtime-benchmarks")] - type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; - #[cfg(not(feature = "runtime-benchmarks"))] - type ExtendHostFunctions = (); + type ExtendHostFunctions = HostFunctions; fn dispatch(method: &str, data: &[u8]) -> Option> { battery_station_runtime::api::dispatch(method, data) @@ -61,10 +62,7 @@ pub struct ZeitgeistExecutor; #[cfg(feature = "with-zeitgeist-runtime")] impl sc_executor::NativeExecutionDispatch for ZeitgeistExecutor { - #[cfg(feature = "runtime-benchmarks")] - type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; - #[cfg(not(feature = "runtime-benchmarks"))] - type ExtendHostFunctions = (); + type ExtendHostFunctions = HostFunctions; fn dispatch(method: &str, data: &[u8]) -> Option> { zeitgeist_runtime::api::dispatch(method, data) @@ -78,18 +76,11 @@ impl sc_executor::NativeExecutionDispatch for ZeitgeistExecutor { /// Can be called for a `Configuration` to check if it is a configuration for /// the `Zeitgeist` network. pub trait IdentifyVariant { - /// Returns `true` if this is a configuration for the `Battery Station` network. - fn is_battery_station(&self) -> bool; - /// Returns `true` if this is a configuration for the `Zeitgeist` network. fn is_zeitgeist(&self) -> bool; } impl IdentifyVariant for Box { - fn is_battery_station(&self) -> bool { - self.id().starts_with("battery_station") - } - fn is_zeitgeist(&self) -> bool { self.id().starts_with("zeitgeist") } @@ -100,29 +91,25 @@ pub trait RuntimeApiCollection: sp_transaction_pool::runtime_api::TaggedTransactionQueue + sp_api::ApiExt + sp_block_builder::BlockBuilder - + substrate_frame_rpc_system::AccountNonceApi + + substrate_frame_rpc_system::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::Metadata + sp_offchain::OffchainWorkerApi + sp_session::SessionKeys + zrml_swaps_rpc::SwapsRuntimeApi -where - >::StateBackend: sp_api::StateBackend, { } -impl RuntimeApiCollection for Api -where +impl RuntimeApiCollection for Api where Api: sp_transaction_pool::runtime_api::TaggedTransactionQueue + sp_api::ApiExt + sp_block_builder::BlockBuilder - + substrate_frame_rpc_system::AccountNonceApi + + substrate_frame_rpc_system::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + sp_api::Metadata + sp_offchain::OffchainWorkerApi + sp_session::SessionKeys - + zrml_swaps_rpc::SwapsRuntimeApi, - >::StateBackend: sp_api::StateBackend, + + zrml_swaps_rpc::SwapsRuntimeApi { } @@ -134,8 +121,6 @@ cfg_if::cfg_if! { + nimbus_primitives::NimbusApi + cumulus_primitives_core::CollectCollationInfo + session_keys_primitives::VrfApi - where - >::StateBackend: sp_api::StateBackend, { } @@ -145,26 +130,23 @@ cfg_if::cfg_if! { + nimbus_primitives::NimbusApi + cumulus_primitives_core::CollectCollationInfo + session_keys_primitives::VrfApi, - >::StateBackend: sp_api::StateBackend, { } } else { /// Additional APIs for standalone runtimes pub trait AdditionalRuntimeApiCollection: sp_api::ApiExt - + sp_finality_grandpa::GrandpaApi + + sp_consensus_grandpa::GrandpaApi + sp_consensus_aura::AuraApi where - >::StateBackend: sp_api::StateBackend, { } impl AdditionalRuntimeApiCollection for Api where Api: sp_api::ApiExt - + sp_finality_grandpa::GrandpaApi + + sp_consensus_grandpa::GrandpaApi + sp_consensus_aura::AuraApi, - >::StateBackend: sp_api::StateBackend, { } } @@ -175,12 +157,7 @@ cfg_if::cfg_if! { pub fn new_chain_ops( config: &mut Configuration, ) -> Result< - ( - Arc, - Arc, - sc_consensus::BasicQueue>, - TaskManager, - ), + (Arc, Arc, sc_consensus::BasicQueue, TaskManager), ServiceError, > { match &config.chain_spec { @@ -201,22 +178,14 @@ pub fn new_chain_ops( fn new_chain_ops_inner( config: &mut Configuration, ) -> Result< - ( - Arc, - Arc, - sc_consensus::BasicQueue>, - TaskManager, - ), + (Arc, Arc, sc_consensus::BasicQueue, TaskManager), ServiceError, > where Client: From>>, RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, - RuntimeApi::RuntimeApi: RuntimeApiCollection> - + AdditionalRuntimeApiCollection< - StateBackend = sc_client_api::StateBackendFor, - >, + RuntimeApi::RuntimeApi: RuntimeApiCollection + AdditionalRuntimeApiCollection, Executor: NativeExecutionDispatch + 'static, { config.keystore = sc_service::config::KeystoreConfig::InMemory; diff --git a/node/src/service/service_parachain.rs b/node/src/service/service_parachain.rs index 2a3db0ca2..0a86b6cac 100644 --- a/node/src/service/service_parachain.rs +++ b/node/src/service/service_parachain.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -24,26 +24,34 @@ use cumulus_client_cli::CollatorOptions; use cumulus_client_consensus_common::{ ParachainBlockImport as TParachainBlockImport, ParachainConsensus, }; -use cumulus_client_network::BlockAnnounceValidator; +use cumulus_client_service::{build_network, BuildNetworkParams, CollatorSybilResistance}; +#[allow(deprecated)] +// TODO(#1326): Resolve deprecation after upgrade to polkadot-v1.3.0 use cumulus_client_service::{ build_relay_chain_interface, prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams, }; use cumulus_primitives_core::ParaId; use cumulus_relay_chain_interface::RelayChainInterface; +use futures::FutureExt; use nimbus_consensus::{BuildNimbusConsensusParams, NimbusConsensus}; use nimbus_primitives::NimbusId; +use sc_client_api::Backend; use sc_consensus::ImportQueue; -use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; -use sc_network::NetworkService; -use sc_network_common::service::NetworkBlock; +use sc_executor::{ + HeapAllocStrategy, NativeElseWasmExecutor, NativeExecutionDispatch, WasmExecutor, + DEFAULT_HEAP_ALLOC_STRATEGY, +}; +use sc_network::{config::FullNetworkConfiguration, NetworkBlock}; +use sc_network_sync::SyncingService; use sc_service::{ error::{Error as ServiceError, Result as ServiceResult}, Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager, }; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_api::ConstructRuntimeApi; -use sp_keystore::SyncCryptoStorePtr; +use sp_keystore::KeystorePtr; use std::sync::Arc; use substrate_prometheus_endpoint::Registry; use zeitgeist_primitives::types::{Block, Hash}; @@ -55,7 +63,7 @@ pub type ParachainPartialComponents = PartialComponents< FullClient, FullBackend, (), - sc_consensus::DefaultImportQueue>, + sc_consensus::DefaultImportQueue, sc_transaction_pool::FullPool>, (ParachainBlockImport, Option, Option), >; @@ -73,10 +81,7 @@ pub async fn new_full( where RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, - RuntimeApi::RuntimeApi: RuntimeApiCollection> - + AdditionalRuntimeApiCollection< - StateBackend = sc_client_api::StateBackendFor, - >, + RuntimeApi::RuntimeApi: RuntimeApiCollection + AdditionalRuntimeApiCollection, Executor: NativeExecutionDispatch + 'static, { do_new_full( @@ -172,10 +177,7 @@ pub fn new_partial( where RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, - RuntimeApi::RuntimeApi: RuntimeApiCollection> - + AdditionalRuntimeApiCollection< - StateBackend = sc_client_api::StateBackendFor, - >, + RuntimeApi::RuntimeApi: RuntimeApiCollection + AdditionalRuntimeApiCollection, Executor: NativeExecutionDispatch + 'static, { let telemetry = config @@ -189,29 +191,32 @@ where }) .transpose()?; - let executor = NativeElseWasmExecutor::::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, - ); + let heap_pages = config + .default_heap_pages + .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); + + let wasm_builder = WasmExecutor::builder() + .with_execution_method(config.wasm_method) + .with_onchain_heap_alloc_strategy(heap_pages) + .with_offchain_heap_alloc_strategy(heap_pages) + .with_ignore_onchain_heap_pages(true) + .with_max_runtime_instances(config.max_runtime_instances) + .with_runtime_cache_size(config.runtime_cache_size); + let wasm_executor = wasm_builder.build(); + let executor = NativeElseWasmExecutor::::new_with_wasm_executor(wasm_executor); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), executor, )?; - let client = Arc::new(client); - let telemetry_worker_handle = telemetry.as_ref().map(|(worker, _)| worker.handle()); - let telemetry = telemetry.map(|(worker, telemetry)| { task_manager.spawn_handle().spawn("telemetry", None, worker.run()); telemetry }); - let transaction_pool = sc_transaction_pool::BasicPool::new_full( config.transaction_pool.clone(), config.role.is_authority().into(), @@ -219,7 +224,6 @@ where task_manager.spawn_essential_handle(), client.clone(), ); - let block_import = ParachainBlockImport::::new(client.clone(), backend.clone()); let import_queue = nimbus_consensus::import_queue( @@ -253,7 +257,7 @@ where async fn do_new_full( parachain_config: Configuration, polkadot_config: Configuration, - id: polkadot_primitives::v2::Id, + id: polkadot_primitives::Id, build_consensus: BIC, hwbench: Option, collator_options: CollatorOptions, @@ -261,10 +265,7 @@ async fn do_new_full( where RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, - RuntimeApi::RuntimeApi: RuntimeApiCollection> - + AdditionalRuntimeApiCollection< - StateBackend = sc_client_api::StateBackendFor, - >, + RuntimeApi::RuntimeApi: RuntimeApiCollection + AdditionalRuntimeApiCollection, Executor: NativeExecutionDispatch + 'static, BIC: FnOnce( Arc>, @@ -274,8 +275,8 @@ where &TaskManager, Arc, Arc>>, - Arc>, - SyncCryptoStorePtr, + Arc>, + KeystorePtr, bool, ) -> Result>, ServiceError>, { @@ -299,31 +300,44 @@ where .await .map_err(|e| ServiceError::Application(Box::new(e) as Box<_>))?; - let block_announce_validator = BlockAnnounceValidator::new(relay_chain_interface.clone(), id); let force_authoring = parachain_config.force_authoring; let collator = parachain_config.role.is_authority(); let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue_service = params.import_queue.service(); - let (network, system_rpc_tx, tx_handler_controller, start_network) = - sc_service::build_network(sc_service::BuildNetworkParams { - config: ¶chain_config, + let net_config = FullNetworkConfiguration::new(¶chain_config.network); + let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = + build_network(BuildNetworkParams { + parachain_config: ¶chain_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), import_queue: params.import_queue, - block_announce_validator_builder: Some(Box::new(|_| { - Box::new(block_announce_validator) - })), - warp_sync: None, - })?; + para_id: id, + relay_chain_interface: relay_chain_interface.clone(), + net_config, + sybil_resistance_level: CollatorSybilResistance::Resistant, + }) + .await?; if parachain_config.offchain_worker.enabled { - sc_service::build_offchain_workers( - ¶chain_config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-work", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + keystore: Some(params.keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + is_validator: parachain_config.role.is_authority(), + enable_http_requests: false, + custom_extensions: move |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } @@ -343,10 +357,11 @@ where backend: backend.clone(), client: client.clone(), config: parachain_config, - keystore: params.keystore_container.sync_keystore(), + keystore: params.keystore_container.keystore(), network: network.clone(), rpc_builder, tx_handler_controller, + sync_service: sync_service.clone(), system_rpc_tx, task_manager: &mut task_manager, telemetry: telemetry.as_mut(), @@ -367,11 +382,13 @@ where } let announce_block = { - let network = network.clone(); - Arc::new(move |hash, data| network.announce_block(hash, data)) + let sync_service = sync_service.clone(); + Arc::new(move |hash, data| sync_service.announce_block(hash, data)) }; - let relay_chain_slot_duration = POLKADOT_BLOCK_DURATION; + let overseer_handle = relay_chain_interface + .overseer_handle() + .map_err(|e| sc_service::Error::Application(Box::new(e)))?; if collator { let parachain_consensus = build_consensus( @@ -382,8 +399,8 @@ where &task_manager, relay_chain_interface.clone(), transaction_pool, - network, - params.keystore_container.sync_keystore(), + sync_service.clone(), + params.keystore_container.keystore(), force_authoring, )?; @@ -399,11 +416,15 @@ where spawner, parachain_consensus, import_queue: import_queue_service, + recovery_handle: Box::new(overseer_handle), collator_key: collator_key .ok_or_else(|| ServiceError::Other("Collator Key is None".to_string()))?, relay_chain_slot_duration, + sync_service, }; + #[allow(deprecated)] + // TODO(#1326): Resolve deprecation after upgrade to polkadot-v1.3.0 start_collator(params).await?; } else { let params = StartFullNodeParams { @@ -411,11 +432,15 @@ where announce_block, task_manager: &mut task_manager, para_id: id, + recovery_handle: Box::new(overseer_handle), relay_chain_interface, relay_chain_slot_duration, import_queue: import_queue_service, + sync_service, }; + #[allow(deprecated)] + // TODO(#1326): Resolve deprecation after upgrade to polkadot-v1.3.0 start_full_node(params)?; } diff --git a/node/src/service/service_standalone.rs b/node/src/service/service_standalone.rs index 28b8dc043..4f8ba0508 100644 --- a/node/src/service/service_standalone.rs +++ b/node/src/service/service_standalone.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -22,15 +22,16 @@ use crate::{ cli::Cli, service::{AdditionalRuntimeApiCollection, RuntimeApiCollection}, }; -use sc_client_api::BlockBackend; +use futures::FutureExt; +use sc_client_api::{Backend, BlockBackend}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; +use sc_consensus_grandpa::{protocol_standard_name, SharedVoterState}; use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch}; -use sc_finality_grandpa::{grandpa_peers_set_config, protocol_standard_name, SharedVoterState}; -use sc_keystore::LocalKeystore; use sc_service::{ error::Error as ServiceError, Configuration, TFullBackend, TFullClient, TaskManager, }; use sc_telemetry::{Telemetry, TelemetryWorker}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_api::ConstructRuntimeApi; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use std::{sync::Arc, time::Duration}; @@ -41,18 +42,19 @@ pub type FullClient = pub type FullBackend = TFullBackend; type FullSelectChain = sc_consensus::LongestChain; +/// The minimum period of blocks on which justifications will be +/// imported and generated. +const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512; + /// Builds a new service for a full client. pub fn new_full( - mut config: Configuration, + config: Configuration, cli: Cli, ) -> Result where RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, - RuntimeApi::RuntimeApi: RuntimeApiCollection> - + AdditionalRuntimeApiCollection< - StateBackend = sc_client_api::StateBackendFor, - >, + RuntimeApi::RuntimeApi: RuntimeApiCollection + AdditionalRuntimeApiCollection, Executor: NativeExecutionDispatch + 'static, { let hwbench = (cli.no_hardware_benchmarks) @@ -67,56 +69,47 @@ where backend, mut task_manager, import_queue, - mut keystore_container, + keystore_container, select_chain, transaction_pool, other: (block_import, grandpa_link, mut telemetry), } = new_partial::(&config)?; - if let Some(url) = &config.keystore_remote { - match remote_keystore(url) { - Ok(k) => keystore_container.set_remote_keystore(k), - Err(e) => { - return Err(ServiceError::Other(format!( - "Error hooking up remote keystore for {}: {}", - url, e - ))); - } - }; - } + let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); let grandpa_protocol_name = protocol_standard_name( &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), &config.chain_spec, ); - config.network.extra_sets.push(grandpa_peers_set_config(grandpa_protocol_name.clone())); - let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( + net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config( + grandpa_protocol_name.clone(), + )); + + let statement_handler_proto = sc_network_statement::StatementHandlerPrototype::new( + client.block_hash(0u32.into()).ok().flatten().expect("Genesis block exists; qed"), + config.chain_spec.fork_id(), + ); + net_config.add_notification_protocol(statement_handler_proto.set_config()); + + let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), grandpa_link.shared_authority_set().clone(), Vec::default(), )); - let (network, system_rpc_tx, tx_handler_controller, network_starter) = + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), import_queue, block_announce_validator_builder: None, - warp_sync: Some(warp_sync), + warp_sync_params: Some(sc_service::WarpSyncParams::WithProvider(warp_sync)), })?; - if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), - ); - } - let role = config.role.clone(); let force_authoring = config.force_authoring; let backoff_authoring_blocks: Option<()> = None; @@ -124,6 +117,7 @@ where let enable_grandpa = !config.disable_grandpa; let prometheus_registry = config.prometheus_registry().cloned(); let database = config.database.clone(); + let enable_offchain_worker = config.offchain_worker.enabled; let rpc_builder = { let client = client.clone(); @@ -140,14 +134,15 @@ where let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { network: network.clone(), client: client.clone(), - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), task_manager: &mut task_manager, transaction_pool: transaction_pool.clone(), rpc_builder: rpc_builder, tx_handler_controller: tx_handler_controller, - backend, + backend: backend.clone(), system_rpc_tx, config: config, + sync_service: sync_service.clone(), telemetry: telemetry.as_mut(), })?; @@ -168,7 +163,7 @@ where let proposer_factory = sc_basic_authorship::ProposerFactory::new( task_manager.spawn_handle(), client.clone(), - transaction_pool, + transaction_pool.clone(), prometheus_registry.as_ref(), telemetry.as_ref().map(|x| x.handle()), ); @@ -178,7 +173,7 @@ where let aura = sc_consensus_aura::start_aura::( StartAuraParams { slot_duration, - client, + client: client.clone(), select_chain, block_import, proposer_factory, @@ -195,9 +190,9 @@ where }, force_authoring, backoff_authoring_blocks, - keystore: keystore_container.sync_keystore(), - sync_oracle: network.clone(), - justification_sync_link: network.clone(), + keystore: keystore_container.keystore(), + sync_oracle: sync_service.clone(), + justification_sync_link: sync_service.clone(), block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32), max_block_proposal_slot_portion: None, telemetry: telemetry.as_ref().map(|x| x.handle()), @@ -209,7 +204,8 @@ where cli.storage_monitor, database, &task_manager.spawn_essential_handle(), - )?; + ) + .map_err(|e| ServiceError::Application(e.into()))?; // the AURA authoring task is considered essential, i.e. if it // fails we take down the service with it. @@ -218,16 +214,15 @@ where // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. - let keystore = - if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None }; + let keystore = if role.is_authority() { Some(keystore_container.keystore()) } else { None }; - let grandpa_config = sc_finality_grandpa::Config { + let grandpa_config = sc_consensus_grandpa::Config { gossip_duration: Duration::from_millis(333), - justification_period: 512, + justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD, name: Some(name), observer_enabled: false, keystore, - local_role: role, + local_role: role.clone(), telemetry: telemetry.as_ref().map(|x| x.handle()), protocol_name: grandpa_protocol_name, }; @@ -239,14 +234,16 @@ where // and vote data availability than the observer. The observer has not // been tested extensively yet and having most nodes in a network run it // could lead to finality stalls. - let grandpa_config = sc_finality_grandpa::GrandpaParams { + let grandpa_config = sc_consensus_grandpa::GrandpaParams { config: grandpa_config, link: grandpa_link, - network, - voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), + network: network.clone(), + sync: Arc::new(sync_service), + voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(), prometheus_registry, shared_voter_state: SharedVoterState::empty(), telemetry: telemetry.as_ref().map(|x| x.handle()), + offchain_tx_pool_factory: OffchainTransactionPoolFactory::new(transaction_pool.clone()), }; // the GRANDPA voter task is considered infallible, i.e. @@ -254,7 +251,26 @@ where task_manager.spawn_essential_handle().spawn_blocking( "grandpa-voter", None, - sc_finality_grandpa::run_grandpa_voter(grandpa_config)?, + sc_consensus_grandpa::run_grandpa_voter(grandpa_config)?, + ); + } + + if enable_offchain_worker { + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-work", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + keystore: Some(keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new(transaction_pool)), + network_provider: network.clone(), + is_validator: role.is_authority(), + enable_http_requests: true, + custom_extensions: move |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } @@ -269,16 +285,20 @@ pub fn new_partial( FullClient, FullBackend, FullSelectChain, - sc_consensus::DefaultImportQueue>, + sc_consensus::DefaultImportQueue, sc_transaction_pool::FullPool>, ( - sc_finality_grandpa::GrandpaBlockImport< + sc_consensus_grandpa::GrandpaBlockImport< FullBackend, Block, FullClient, FullSelectChain, >, - sc_finality_grandpa::LinkHalf, FullSelectChain>, + sc_consensus_grandpa::LinkHalf< + Block, + FullClient, + FullSelectChain, + >, Option, ), >, @@ -287,16 +307,9 @@ pub fn new_partial( where RuntimeApi: ConstructRuntimeApi> + Send + Sync + 'static, - RuntimeApi::RuntimeApi: RuntimeApiCollection> - + AdditionalRuntimeApiCollection< - StateBackend = sc_client_api::StateBackendFor, - >, + RuntimeApi::RuntimeApi: RuntimeApiCollection + AdditionalRuntimeApiCollection, Executor: NativeExecutionDispatch + 'static, { - if config.keystore_remote.is_some() { - return Err(ServiceError::Other(format!("Remote Keystores are not supported."))); - } - let telemetry = config .telemetry_endpoints .clone() @@ -308,12 +321,7 @@ where }) .transpose()?; - let executor = NativeElseWasmExecutor::::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - config.runtime_cache_size, - ); + let executor = sc_service::new_native_or_wasm_executor(&config); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( @@ -338,15 +346,15 @@ where client.clone(), ); - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( + let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( client.clone(), + GRANDPA_JUSTIFICATION_PERIOD, &(client.clone() as Arc<_>), select_chain.clone(), telemetry.as_ref().map(|x| x.handle()), )?; let slot_duration = sc_consensus_aura::slot_duration(&*client)?; - let import_queue = sc_consensus_aura::import_queue::( ImportQueueParams { block_import: grandpa_block_import.clone(), @@ -382,10 +390,3 @@ where other: (grandpa_block_import, grandpa_link, telemetry), }) } - -fn remote_keystore(_url: &String) -> Result, &'static str> { - // FIXME: here would the concrete keystore be built, - // must return a concrete type (NOT `LocalKeystore`) that - // implements `CryptoStore` and `SyncCryptoStore` - Err("Remote Keystore not supported.") -} diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index e8007e1ce..1b9efa03f 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -8,8 +8,8 @@ orml-currencies = { workspace = true } orml-tokens = { workspace = true } orml-traits = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } -scale-info = { workspace = true, features = ["derive"] } -serde = { workspace = true, features = ["derive"], optional = true } +scale-info = { workspace = true, features = ["derive", "serde"] } +serde = { workspace = true, features = ["alloc", "derive", "rc"] } sp-arithmetic = { workspace = true } sp-core = { workspace = true } sp-runtime = { workspace = true } @@ -37,6 +37,6 @@ std = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zeitgeist-primitives" version = "0.5.2" diff --git a/primitives/src/asset.rs b/primitives/src/asset.rs index 513ba1203..d5c923537 100644 --- a/primitives/src/asset.rs +++ b/primitives/src/asset.rs @@ -20,46 +20,42 @@ use crate::traits::ZeitgeistAssetEnumerator; use crate::{ traits::PoolSharesId, - types::{CategoryIndex, PoolId, SerdeWrapper}, + types::{CategoryIndex, PoolId}, }; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; /// The `Asset` enum represents all types of assets available in the Zeitgeist /// system. -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[derive( Clone, Copy, Debug, Decode, Default, + Deserialize, Eq, Encode, MaxEncodedLen, Ord, PartialEq, PartialOrd, + Serialize, TypeInfo, )] +#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] pub enum Asset { CategoricalOutcome(MarketId, CategoryIndex), ScalarOutcome(MarketId, ScalarPosition), CombinatorialOutcome, - PoolShare(SerdeWrapper), + PoolShare(PoolId), #[default] Ztg, ForeignAsset(u32), ParimutuelShare(MarketId, CategoryIndex), } -impl PoolSharesId> for Asset { - fn pool_shares_id(pool_id: SerdeWrapper) -> Self { - Self::PoolShare(pool_id) - } -} - #[cfg(feature = "runtime-benchmarks")] impl ZeitgeistAssetEnumerator for Asset { fn create_asset_id(t: MarketId) -> Self { @@ -67,15 +63,32 @@ impl ZeitgeistAssetEnumerator for Asset PoolSharesId for Asset { + fn pool_shares_id(pool_id: PoolId) -> Self { + Self::PoolShare(pool_id) + } +} + /// In a scalar market, users can either choose a `Long` position, /// meaning that they think the outcome will be closer to the upper bound /// or a `Short` position meaning that they think the outcome will be closer /// to the lower bound. -#[cfg_attr(feature = "std", derive(serde::Deserialize, serde::Serialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] #[derive( - Clone, Copy, Debug, Decode, Eq, Encode, MaxEncodedLen, Ord, PartialEq, PartialOrd, TypeInfo, + Clone, + Copy, + Debug, + Decode, + Deserialize, + Eq, + Encode, + MaxEncodedLen, + Ord, + PartialEq, + PartialOrd, + Serialize, + TypeInfo, )] +#[serde(rename_all = "camelCase")] pub enum ScalarPosition { Long, Short, diff --git a/primitives/src/constants/mock.rs b/primitives/src/constants/mock.rs index 0e25aa429..4f2b16655 100644 --- a/primitives/src/constants/mock.rs +++ b/primitives/src/constants/mock.rs @@ -147,7 +147,7 @@ parameter_types! { // Shared within tests // Balance parameter_types! { - pub const ExistentialDeposit: u128 = CENT; + pub const ExistentialDeposit: u128 = 2; pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; } @@ -175,7 +175,7 @@ parameter_type_with_key! { // System parameter_types! { - pub const BlockHashCount: u64 = 250; + pub const BlockHashCount: u32 = 250; } // Time diff --git a/primitives/src/math/checked_ops_res.rs b/primitives/src/math/checked_ops_res.rs index 1265a6b2b..13cd420a6 100644 --- a/primitives/src/math/checked_ops_res.rs +++ b/primitives/src/math/checked_ops_res.rs @@ -15,12 +15,12 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use frame_support::dispatch::DispatchError; use num_traits::{checked_pow, One}; use sp_arithmetic::{ traits::{CheckedAdd, CheckedDiv, CheckedMul, CheckedRem, CheckedSub}, ArithmeticError, }; +use sp_runtime::DispatchError; pub trait CheckedAddRes where diff --git a/primitives/src/math/fixed.rs b/primitives/src/math/fixed.rs index cf9f5e942..930a26b43 100644 --- a/primitives/src/math/fixed.rs +++ b/primitives/src/math/fixed.rs @@ -31,11 +31,12 @@ use alloc::{ }; use core::{cmp::Ordering, convert::TryFrom, marker::PhantomData}; use fixed::{traits::Fixed, ParseFixedError}; -use frame_support::{dispatch::DispatchError, ensure}; +use frame_support::ensure; use sp_arithmetic::{ traits::{AtLeast32BitUnsigned, Zero}, ArithmeticError, }; +use sp_runtime::DispatchError; /// Trait for safely obtaining constants converted to generic types in a Substrate context. pub trait BaseProvider { @@ -329,6 +330,9 @@ where #[cfg(test)] mod tests { + // TODO(#1328): Remove after rustc nightly-2024-04-22 + #![allow(clippy::duplicated_attributes)] + use super::*; use crate::assert_approx; use fixed::{traits::ToFixed, FixedU128}; diff --git a/primitives/src/math/root.rs b/primitives/src/math/root.rs index 2479e1ab4..22de3a7f5 100644 --- a/primitives/src/math/root.rs +++ b/primitives/src/math/root.rs @@ -156,6 +156,9 @@ fn dist(x: T, y: T) -> T { #[cfg(test)] mod tests { + // TODO(#1328): Remove after rustc nightly-2024-04-22 + #![allow(clippy::duplicated_attributes)] + use super::*; use crate::{constants::BASE, math::fixed::FixedMul}; use test_case::test_case; diff --git a/primitives/src/traits/hybrid_router_amm_api.rs b/primitives/src/traits/hybrid_router_amm_api.rs index 50e6a7b05..677278e57 100644 --- a/primitives/src/traits/hybrid_router_amm_api.rs +++ b/primitives/src/traits/hybrid_router_amm_api.rs @@ -16,7 +16,7 @@ // along with Zeitgeist. If not, see . use crate::hybrid_router_api_types::{AmmSoftFail, AmmTrade, ApiError}; -use frame_support::dispatch::DispatchError; +use sp_runtime::DispatchError; /// A type alias for the return struct of AMM buy and sell. type AmmTradeOf = AmmTrade<::Balance>; diff --git a/primitives/src/traits/hybrid_router_orderbook_api.rs b/primitives/src/traits/hybrid_router_orderbook_api.rs index 9af727631..968dcd31c 100644 --- a/primitives/src/traits/hybrid_router_orderbook_api.rs +++ b/primitives/src/traits/hybrid_router_orderbook_api.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use frame_support::dispatch::DispatchError; +use sp_runtime::DispatchError; use crate::hybrid_router_api_types::{ApiError, OrderbookSoftFail, OrderbookTrade}; diff --git a/primitives/src/traits/market_commons_pallet_api.rs b/primitives/src/traits/market_commons_pallet_api.rs index c75725295..a24eecefa 100644 --- a/primitives/src/traits/market_commons_pallet_api.rs +++ b/primitives/src/traits/market_commons_pallet_api.rs @@ -22,14 +22,18 @@ use crate::{ traits::MarketBuilderTrait, types::{Market, PoolId}, }; +use alloc::fmt::Debug; use frame_support::{ - dispatch::{fmt::Debug, DispatchError, DispatchResult}, + dispatch::DispatchResult, pallet_prelude::{MaybeSerializeDeserialize, Member}, storage::PrefixIterator, Parameter, }; use parity_scale_codec::{FullCodec, MaxEncodedLen}; -use sp_runtime::traits::{AtLeast32Bit, AtLeast32BitUnsigned}; +use sp_runtime::{ + traits::{AtLeast32Bit, AtLeast32BitUnsigned}, + DispatchError, +}; // Abstraction of the market type, which is not a part of `MarketCommonsPalletApi` because Rust // doesn't support type aliases in traits. diff --git a/primitives/src/traits/swaps.rs b/primitives/src/traits/swaps.rs index cff467ac9..a46d873ef 100644 --- a/primitives/src/traits/swaps.rs +++ b/primitives/src/traits/swaps.rs @@ -18,8 +18,8 @@ use crate::types::PoolId; use alloc::vec::Vec; -use frame_support::dispatch::{DispatchError, Weight}; -use sp_runtime::DispatchResult; +use frame_support::weights::Weight; +use sp_runtime::{DispatchError, DispatchResult}; pub trait Swaps { type Asset; diff --git a/primitives/src/types.rs b/primitives/src/types.rs index 417a71cc5..411197330 100644 --- a/primitives/src/types.rs +++ b/primitives/src/types.rs @@ -22,7 +22,7 @@ pub use crate::{ }; #[cfg(feature = "arbitrary")] use arbitrary::{Arbitrary, Result, Unstructured}; -use frame_support::dispatch::Weight; +use frame_support::weights::Weight; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::{ @@ -90,7 +90,7 @@ pub type CurrencyId = Asset; pub type TxPaymentAssetId = u32; /// Index of a transaction in the chain. -pub type Index = u64; +pub type Nonce = u64; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index c8cef23a1..6db5c534f 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -18,11 +18,11 @@ pallet-contracts = { workspace = true } pallet-contracts-primitives = { workspace = true } pallet-democracy = { workspace = true } pallet-identity = { workspace = true } +pallet-insecure-randomness-collective-flip = { workspace = true } pallet-membership = { workspace = true } pallet-multisig = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } -pallet-randomness-collective-flip = { workspace = true } pallet-scheduler = { workspace = true } pallet-sudo = { workspace = true } pallet-timestamp = { workspace = true } @@ -78,14 +78,14 @@ session-keys-primitives = { workspace = true, optional = true } # Polkadot -polkadot-parachain = { workspace = true, optional = true } +polkadot-parachain-primitives = { workspace = true, optional = true } # Standalone pallet-aura = { workspace = true } pallet-grandpa = { workspace = true } sp-consensus-aura = { workspace = true } -sp-finality-grandpa = { workspace = true } +sp-consensus-grandpa = { workspace = true } # Utility cfg-if = { workspace = true } @@ -97,6 +97,7 @@ orml-asset-registry = { workspace = true, optional = true } orml-unknown-tokens = { workspace = true, optional = true } orml-xcm-support = { workspace = true, optional = true } orml-xtokens = { workspace = true, optional = true } +pallet-message-queue = { workspace = true, optional = true } pallet-xcm = { workspace = true, optional = true } polkadot-runtime-parachains = { workspace = true, optional = true } rococo-runtime = { workspace = true, optional = true } @@ -125,6 +126,11 @@ zrml-swaps = { workspace = true } zrml-swaps-runtime-api = { workspace = true } [dev-dependencies] +env_logger = { workspace = true } +pallet-im-online = { workspace = true, features = ["default"] } +sp-authority-discovery = { workspace = true, features = ["default"] } +sp-consensus-babe = { workspace = true, features = ["default"] } +sp-consensus-beefy = { workspace = true, features = ["default"] } sp-io = { workspace = true, features = ["default"] } test-case = { workspace = true } xcm-emulator = { workspace = true } @@ -151,7 +157,7 @@ parachain = [ "pallet-author-mapping", "pallet-author-slot-filter", "pallet-parachain-staking", - "polkadot-parachain", + "polkadot-parachain-primitives", "session-keys-primitives", # XCM @@ -160,6 +166,7 @@ parachain = [ "orml-unknown-tokens", "orml-xcm-support", "orml-xtokens", + "pallet-message-queue", "pallet-xcm", "polkadot-runtime-parachains", "rococo-runtime", @@ -246,7 +253,7 @@ std = [ "pallet-multisig/std", "pallet-preimage/std", "pallet-proxy/std", - "pallet-randomness-collective-flip/std", + "pallet-insecure-randomness-collective-flip/std", "pallet-scheduler/std", "pallet-sudo/std", "pallet-timestamp/std", @@ -300,14 +307,14 @@ std = [ # Polkadot "pallet-xcm?/std", - "polkadot-parachain?/std", + "polkadot-parachain-primitives?/std", # Standalone "pallet-aura/std", "pallet-grandpa/std", "sp-consensus-aura/std", - "sp-finality-grandpa/std", + "sp-consensus-grandpa/std", # XCM @@ -315,6 +322,7 @@ std = [ "orml-unknown-tokens?/std", "orml-xcm-support?/std", "orml-xtokens?/std", + "pallet-message-queue?/std", "pallet-xcm?/std", "polkadot-runtime-parachains?/std", "rococo-runtime?/std", @@ -351,7 +359,7 @@ try-runtime = [ "frame-system/try-runtime", "frame-support/try-runtime", "pallet-timestamp/try-runtime", - "pallet-randomness-collective-flip/try-runtime", + "pallet-insecure-randomness-collective-flip/try-runtime", "pallet-scheduler/try-runtime", "pallet-preimage/try-runtime", @@ -422,7 +430,7 @@ force-debug = ["sp-debug-derive/force-debug"] [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "battery-station-runtime" version = "0.5.2" diff --git a/runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.rs b/runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.rs new file mode 100644 index 000000000..0e7d6afa1 --- /dev/null +++ b/runtime/battery-station/src/integration_tests/xcm/genesis/battery_station.rs @@ -0,0 +1,77 @@ +// Copyright 2024 Forecasting Technologies LTD. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +use crate::{ + integration_tests::xcm::setup::{ + accounts, ztg, BTC_ID, FOREIGN_PARENT_ID, FOREIGN_SIBLING_ID, FOREIGN_ZTG_ID, + }, + parachain_params::MinCandidateStk, + parameters::ZeitgeistTreasuryAccount, +}; +use nimbus_primitives::NimbusId; +use sp_core::storage::Storage; +use sp_runtime::BuildStorage; + +const ENDOWMENT: u128 = ztg(1_000_000); +const SAFE_XCM_VERSION: u32 = 2; + +pub(crate) fn genesis(parachain_id: u32) -> Storage { + let genesis_config = crate::RuntimeGenesisConfig { + author_mapping: crate::AuthorMappingConfig { + mappings: vec![( + accounts::get_from_seed::(accounts::ALICE), + accounts::alice(), + )], + }, + balances: crate::BalancesConfig { + balances: accounts::init_balances().iter().map(|k| (k.clone(), ENDOWMENT)).collect(), + }, + parachain_info: crate::ParachainInfoConfig { + parachain_id: parachain_id.into(), + ..Default::default() + }, + parachain_staking: crate::ParachainStakingConfig { + candidates: vec![(accounts::alice(), MinCandidateStk::get())], + ..Default::default() + }, + polkadot_xcm: crate::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + system: crate::SystemConfig { + code: crate::WASM_BINARY.unwrap().to_vec(), + ..Default::default() + }, + tokens: crate::TokensConfig { + balances: accounts::init_balances() + .iter() + .chain([(ZeitgeistTreasuryAccount::get())].iter()) + .flat_map(|k| { + vec![ + (k.clone(), FOREIGN_PARENT_ID, ENDOWMENT), + (k.clone(), FOREIGN_SIBLING_ID, ENDOWMENT), + (k.clone(), FOREIGN_ZTG_ID, ENDOWMENT), + (k.clone(), BTC_ID, ENDOWMENT), + ] + }) + .collect::>(), + }, + ..Default::default() + }; + + genesis_config.build_storage().unwrap() +} diff --git a/runtime/battery-station/src/integration_tests/xcm/genesis/mod.rs b/runtime/battery-station/src/integration_tests/xcm/genesis/mod.rs new file mode 100644 index 000000000..1f5a5cdbe --- /dev/null +++ b/runtime/battery-station/src/integration_tests/xcm/genesis/mod.rs @@ -0,0 +1,19 @@ +// Copyright 2024 Forecasting Technologies LTD. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +pub(super) mod battery_station; +pub(super) mod rococo; diff --git a/runtime/battery-station/src/integration_tests/xcm/genesis/rococo.rs b/runtime/battery-station/src/integration_tests/xcm/genesis/rococo.rs new file mode 100644 index 000000000..5c7330213 --- /dev/null +++ b/runtime/battery-station/src/integration_tests/xcm/genesis/rococo.rs @@ -0,0 +1,150 @@ +// Copyright 2024 Forecasting Technologies LTD. +// +// Copyright (C) Parity Technologies (UK) Ltd. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +// TODO(#1325): Replace with crate "rococo-emulated-chain" from Cumulus starting from polkadot-v1.4.0 + +use crate::integration_tests::xcm::setup::{accounts, accounts::get_from_seed, roc}; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; +use polkadot_primitives::{AccountId, AssignmentId, BlockNumber, ValidatorId}; +use polkadot_runtime_parachains::configuration::HostConfiguration; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; +use sp_consensus_babe::AuthorityId as BabeId; +use sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId; +use sp_consensus_grandpa::AuthorityId as GrandpaId; +use sp_core::{sr25519, storage::Storage}; +use sp_runtime::BuildStorage; +use xcm_emulator::helpers::get_account_id_from_seed; + +const ENDOWMENT: u128 = roc(1_000_000); + +fn session_keys( + grandpa: GrandpaId, + babe: BabeId, + im_online: ImOnlineId, + para_validator: ValidatorId, + para_assignment: AssignmentId, + authority_discovery: AuthorityDiscoveryId, + beefy: BeefyId, +) -> rococo_runtime::SessionKeys { + rococo_runtime::SessionKeys { + grandpa, + babe, + im_online, + para_validator, + para_assignment, + authority_discovery, + beefy, + } +} + +fn get_host_config() -> HostConfiguration { + HostConfiguration { + max_upward_queue_count: 10, + max_upward_queue_size: 51200, + max_upward_message_size: 51200, + max_upward_message_num_per_candidate: 10, + max_downward_message_size: 51200, + hrmp_sender_deposit: 0, + hrmp_recipient_deposit: 0, + hrmp_channel_max_capacity: 1000, + hrmp_channel_max_message_size: 102400, + hrmp_channel_max_total_size: 102400, + hrmp_max_parachain_outbound_channels: 30, + hrmp_max_parachain_inbound_channels: 30, + ..Default::default() + } +} + +mod validators { + use super::*; + + #[allow(clippy::type_complexity)] + pub fn initial_authorities() -> Vec<( + AccountId, + AccountId, + GrandpaId, + BabeId, + ImOnlineId, + ValidatorId, + AssignmentId, + AuthorityDiscoveryId, + BeefyId, + )> { + let seed = "Alice"; + vec![( + get_account_id_from_seed::(&format!("{}//stash", seed)), + get_account_id_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + )] + } +} + +pub(crate) fn genesis() -> Storage { + let genesis_config = rococo_runtime::RuntimeGenesisConfig { + system: rococo_runtime::SystemConfig { + code: rococo_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::default() + }, + balances: rococo_runtime::BalancesConfig { + balances: accounts::init_balances().iter().map(|k| (k.clone(), ENDOWMENT)).collect(), + }, + session: rococo_runtime::SessionConfig { + keys: validators::initial_authorities() + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + x.8.clone(), + ), + ) + }) + .collect::>(), + }, + babe: rococo_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() + }, + sudo: rococo_runtime::SudoConfig { + key: Some(get_account_id_from_seed::("Alice")), + }, + configuration: rococo_runtime::ConfigurationConfig { config: get_host_config() }, + registrar: rococo_runtime::RegistrarConfig { + next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID, + ..Default::default() + }, + ..Default::default() + }; + + genesis_config.build_storage().unwrap() +} diff --git a/runtime/battery-station/src/integration_tests/xcm/mod.rs b/runtime/battery-station/src/integration_tests/xcm/mod.rs index d37a62036..9ba9a1de3 100644 --- a/runtime/battery-station/src/integration_tests/xcm/mod.rs +++ b/runtime/battery-station/src/integration_tests/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -17,6 +17,7 @@ #![cfg(all(feature = "parachain", test))] +mod genesis; mod setup; mod test_net; mod tests; diff --git a/runtime/battery-station/src/integration_tests/xcm/setup.rs b/runtime/battery-station/src/integration_tests/xcm/setup.rs index 2550140f3..7d2464f50 100644 --- a/runtime/battery-station/src/integration_tests/xcm/setup.rs +++ b/runtime/battery-station/src/integration_tests/xcm/setup.rs @@ -1,5 +1,4 @@ // Copyright 2022-2024 Forecasting Technologies LTD. -// Copyright 2021 Centrifuge Foundation (centrifuge.io). // // This file is part of Zeitgeist. // @@ -18,90 +17,71 @@ use crate::{ xcm_config::config::{battery_station, general_key}, - AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Runtime, RuntimeOrigin, - System, + AccountId, AssetRegistry, AssetRegistryStringLimit, Balance, CurrencyId, ExistentialDeposit, + RuntimeOrigin, }; -use frame_support::{assert_ok, traits::GenesisBuild}; +use frame_support::assert_ok; use orml_traits::asset_registry::AssetMetadata; -use sp_runtime::AccountId32; +use sp_core::{sr25519, Pair, Public}; use xcm::{ latest::{Junction::Parachain, Junctions::X2, MultiLocation}, VersionedMultiLocation, }; +use xcm_emulator::helpers::get_account_id_from_seed; use zeitgeist_primitives::types::{Asset, CustomMetadata}; -pub(super) struct ExtBuilder { - balances: Vec<(AccountId, CurrencyId, Balance)>, - parachain_id: u32, -} - -impl Default for ExtBuilder { - fn default() -> Self { - Self { balances: vec![], parachain_id: battery_station::ID } +pub(super) mod accounts { + use super::*; + pub const ALICE: &str = "Alice"; + pub const BOB: &str = "Bob"; + pub const CHARLIE: &str = "Charlie"; + pub const DAVE: &str = "Dave"; + pub const EVE: &str = "Eve"; + pub const FERDIE: &str = "Ferdie"; + pub const ALICE_STASH: &str = "Alice//stash"; + pub const BOB_STASH: &str = "Bob//stash"; + pub const CHARLIE_STASH: &str = "Charlie//stash"; + pub const DAVE_STASH: &str = "Dave//stash"; + pub const EVE_STASH: &str = "Eve//stash"; + pub const FERDIE_STASH: &str = "Ferdie//stash"; + + pub fn init_balances() -> Vec { + vec![ + get_account_id_from_seed::(ALICE), + get_account_id_from_seed::(BOB), + get_account_id_from_seed::(CHARLIE), + get_account_id_from_seed::(DAVE), + get_account_id_from_seed::(EVE), + get_account_id_from_seed::(FERDIE), + get_account_id_from_seed::(ALICE_STASH), + get_account_id_from_seed::(BOB_STASH), + get_account_id_from_seed::(CHARLIE_STASH), + get_account_id_from_seed::(DAVE_STASH), + get_account_id_from_seed::(EVE_STASH), + get_account_id_from_seed::(FERDIE_STASH), + ] } -} -impl ExtBuilder { - pub fn set_balances(mut self, balances: Vec<(AccountId, CurrencyId, Balance)>) -> Self { - self.balances = balances; - self + pub fn alice() -> AccountId { + get_account_id_from_seed::(ALICE) } - pub fn set_parachain_id(mut self, parachain_id: u32) -> Self { - self.parachain_id = parachain_id; - self + pub fn bob() -> AccountId { + get_account_id_from_seed::(BOB) } - pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - let native_currency_id = CurrencyId::Ztg; - pallet_balances::GenesisConfig:: { - balances: self - .balances - .clone() - .into_iter() - .filter(|(_, currency_id, _)| *currency_id == native_currency_id) - .map(|(account_id, _, initial_balance)| (account_id, initial_balance)) - .collect::>(), - } - .assimilate_storage(&mut t) - .unwrap(); - - orml_tokens::GenesisConfig:: { - balances: self - .balances - .into_iter() - .filter(|(_, currency_id, _)| *currency_id != native_currency_id) - .collect::>(), - } - .assimilate_storage(&mut t) - .unwrap(); - - >::assimilate_storage( - ¶chain_info::GenesisConfig { parachain_id: self.parachain_id.into() }, - &mut t, - ) - .unwrap(); - - >::assimilate_storage( - &pallet_xcm::GenesisConfig { safe_xcm_version: Some(2) }, - &mut t, - ) - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); - ext + /// Helper function to generate a crypto pair from seed + pub fn get_from_seed(seed: &str) -> ::Public { + TPublic::Pair::from_string(&format!("//{}", seed), None) + .expect("static values are valid; qed") + .public() } } -/// Accounts -pub const ALICE: AccountId32 = AccountId32::new([0u8; 32]); -pub const BOB: AccountId32 = AccountId32::new([1u8; 32]); - /// A PARA ID used for a sibling parachain. /// It must be one that doesn't collide with any other in use. pub const PARA_ID_SIBLING: u32 = 3000; +pub const PARA_ID_BATTERY_STATION: u32 = battery_station::ID; /// IDs that are used to represent tokens from other chains pub const FOREIGN_ZTG_ID: Asset = CurrencyId::ForeignAsset(0); @@ -146,7 +126,7 @@ pub(super) const fn adjusted_balance(foreign_base: Balance, amount: Balance) -> // Multilocations that are used to represent tokens from other chains #[inline] pub(super) fn foreign_ztg_multilocation() -> MultiLocation { - MultiLocation::new(1, X2(Parachain(battery_station::ID), general_key(battery_station::KEY))) + MultiLocation::new(1, X2(Parachain(PARA_ID_BATTERY_STATION), general_key(battery_station::KEY))) } #[inline] @@ -161,10 +141,10 @@ pub(super) fn foreign_parent_multilocation() -> MultiLocation { pub(super) fn register_foreign_ztg(additional_meta: Option) { // Register ZTG as foreign asset. - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 10, - name: "Zeitgeist".into(), - symbol: "ZTG".into(), + name: "Zeitgeist".as_bytes().to_vec().try_into().unwrap(), + symbol: "ZTG".as_bytes().to_vec().try_into().unwrap(), existential_deposit: ExistentialDeposit::get(), location: Some(VersionedMultiLocation::V3(foreign_ztg_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -174,10 +154,10 @@ pub(super) fn register_foreign_ztg(additional_meta: Option) { } pub(super) fn register_btc(additional_meta: Option) { - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 8, - name: "Bitcoin".into(), - symbol: "BTC".into(), + name: "Bitcoin".as_bytes().to_vec().try_into().unwrap(), + symbol: "BTC".as_bytes().to_vec().try_into().unwrap(), existential_deposit: ExistentialDeposit::get(), location: Some(VersionedMultiLocation::V3(foreign_sibling_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -188,10 +168,10 @@ pub(super) fn register_btc(additional_meta: Option) { pub(super) fn register_foreign_sibling(additional_meta: Option) { // Register native Sibling token as foreign asset. - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 10, - name: "Sibling".into(), - symbol: "SBL".into(), + name: "Sibling".as_bytes().to_vec().try_into().unwrap(), + symbol: "SBL".as_bytes().to_vec().try_into().unwrap(), existential_deposit: ExistentialDeposit::get(), location: Some(VersionedMultiLocation::V3(foreign_sibling_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -206,10 +186,10 @@ pub(super) fn register_foreign_sibling(additional_meta: Option) pub(super) fn register_foreign_parent(additional_meta: Option) { // Register roc as foreign asset in the sibling parachain - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 12, - name: "Rococo".into(), - symbol: "ROC".into(), + name: "Rococo".as_bytes().to_vec().try_into().unwrap(), + symbol: "ROC".as_bytes().to_vec().try_into().unwrap(), existential_deposit: 33_333_333, // 0.0033333333 location: Some(VersionedMultiLocation::V3(foreign_parent_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -225,12 +205,12 @@ pub(super) fn sibling_parachain_account() -> AccountId { #[inline] pub(super) fn zeitgeist_parachain_account() -> AccountId { - parachain_account(battery_station::ID) + parachain_account(PARA_ID_BATTERY_STATION) } #[inline] fn parachain_account(id: u32) -> AccountId { use sp_runtime::traits::AccountIdConversion; - polkadot_parachain::primitives::Sibling::from(id).into_account_truncating() + polkadot_parachain_primitives::primitives::Sibling::from(id).into_account_truncating() } diff --git a/runtime/battery-station/src/integration_tests/xcm/test_net.rs b/runtime/battery-station/src/integration_tests/xcm/test_net.rs index a847389d4..8b11bc5ef 100644 --- a/runtime/battery-station/src/integration_tests/xcm/test_net.rs +++ b/runtime/battery-station/src/integration_tests/xcm/test_net.rs @@ -1,5 +1,4 @@ // Copyright 2022-2024 Forecasting Technologies LTD. -// Copyright 2021-2022 Centrifuge GmbH (centrifuge.io). // // This file is part of Zeitgeist. // @@ -16,134 +15,80 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . +use super::{ + genesis::{battery_station, rococo}, + setup::{PARA_ID_BATTERY_STATION, PARA_ID_SIBLING}, +}; use crate::{ - parameters::ZeitgeistTreasuryAccount, xcm_config::config::battery_station, CurrencyId, - DmpQueue, Runtime, RuntimeOrigin, XcmpQueue, + xcm_config::config::LocationToAccountId, AssetManager, Balances, DmpQueue, ParachainInfo, + PolkadotXcm, XTokens, XcmpQueue, }; -use frame_support::{traits::GenesisBuild, weights::Weight}; -use polkadot_primitives::{ - runtime_api::runtime_decl_for_ParachainHost::ParachainHostV3, - v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}, +use xcm_emulator::{ + decl_test_networks, decl_test_parachains, decl_test_relay_chains, DefaultMessageProcessor, }; -use polkadot_runtime_parachains::configuration::HostConfiguration; -use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; - -use super::setup::{roc, ztg, ExtBuilder, ALICE, FOREIGN_PARENT_ID, PARA_ID_SIBLING}; - -decl_test_relay_chain! { - pub struct RococoNet { - Runtime = rococo_runtime::Runtime, - XcmConfig = rococo_runtime::xcm_config::XcmConfig, - new_ext = relay_ext(), - } -} -decl_test_parachain! { - pub struct Zeitgeist { - Runtime = Runtime, - RuntimeOrigin = RuntimeOrigin, - XcmpMessageHandler = XcmpQueue, - DmpMessageHandler = DmpQueue, - new_ext = para_ext(battery_station::ID), - } +decl_test_relay_chains! { + #[api_version(5)] + pub struct Rococo { + genesis = rococo::genesis(), + on_init = (), + runtime = rococo_runtime, + core = { + MessageProcessor: DefaultMessageProcessor, + SovereignAccountOf: rococo_runtime::xcm_config::LocationConverter, + }, + pallets = { + XcmPallet: rococo_runtime::XcmPallet, + Sudo: rococo_runtime::Sudo, + Balances: rococo_runtime::Balances, + } + }, } -decl_test_parachain! { +decl_test_parachains! { + pub struct BatteryStation { + genesis = battery_station::genesis(PARA_ID_BATTERY_STATION), + on_init = (), + runtime = crate, + core = { + XcmpMessageHandler: XcmpQueue, + DmpMessageHandler: DmpQueue, + LocationToAccountId: LocationToAccountId, + ParachainInfo: ParachainInfo, + }, + pallets = { + PolkadotXcm: PolkadotXcm, + AssetManager: AssetManager, + Balances: Balances, + XTokens: XTokens, + } + }, pub struct Sibling { - Runtime = Runtime, - RuntimeOrigin = RuntimeOrigin, - XcmpMessageHandler = XcmpQueue, - DmpMessageHandler = DmpQueue, - new_ext = para_ext(PARA_ID_SIBLING), - } + genesis = battery_station::genesis(PARA_ID_SIBLING), + on_init = (), + runtime = crate, + core = { + XcmpMessageHandler: XcmpQueue, + DmpMessageHandler: DmpQueue, + LocationToAccountId: LocationToAccountId, + ParachainInfo: ParachainInfo, + }, + pallets = { + PolkadotXcm: PolkadotXcm, + AssetManager: AssetManager, + Balances: Balances, + XTokens: XTokens, + } + }, } -decl_test_network! { +decl_test_networks! { pub struct TestNet { - relay_chain = RococoNet, + relay_chain = Rococo, parachains = vec![ - // N.B: Ideally, we could use the defined para id constants but doing so - // fails with: "error: arbitrary expressions aren't allowed in patterns" - - // Be sure to use `xcm_config::config::battery_station::ID` - (2101, Zeitgeist), - // Be sure to use `PARA_ID_SIBLING` - (3000, Sibling), + BatteryStation, + Sibling, ], - } -} - -pub(super) fn relay_ext() -> sp_io::TestExternalities { - use rococo_runtime::{Runtime, System}; - - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - pallet_balances::GenesisConfig:: { balances: vec![(ALICE, roc(2002))] } - .assimilate_storage(&mut t) - .unwrap(); - - polkadot_runtime_parachains::configuration::GenesisConfig:: { - config: default_parachains_host_configuration(), - } - .assimilate_storage(&mut t) - .unwrap(); - - >::assimilate_storage( - &pallet_xcm::GenesisConfig { safe_xcm_version: Some(2) }, - &mut t, - ) - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); - ext -} - -pub(super) fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { - ExtBuilder::default() - .set_balances(vec![ - (ALICE, CurrencyId::Ztg, ztg(10)), - (ALICE, FOREIGN_PARENT_ID, roc(10)), - (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, roc(1)), - ]) - .set_parachain_id(parachain_id) - .build() -} - -fn default_parachains_host_configuration() -> HostConfiguration { - HostConfiguration { - minimum_validation_upgrade_delay: 5, - validation_upgrade_cooldown: 5u32, - validation_upgrade_delay: 5, - code_retention_period: 1200, - max_code_size: MAX_CODE_SIZE, - max_pov_size: MAX_POV_SIZE, - max_head_data_size: 32 * 1024, - group_rotation_frequency: 20, - chain_availability_period: 4, - thread_availability_period: 4, - max_upward_queue_count: 8, - max_upward_queue_size: 1024 * 1024, - max_downward_message_size: 1024, - ump_service_total_weight: Weight::from_ref_time(4_u64 * 1_000_000_000_u64), - max_upward_message_size: 50 * 1024, - max_upward_message_num_per_candidate: 5, - hrmp_sender_deposit: 0, - hrmp_recipient_deposit: 0, - hrmp_channel_max_capacity: 8, - hrmp_channel_max_total_size: 8 * 1024, - hrmp_max_parachain_inbound_channels: 4, - hrmp_max_parathread_inbound_channels: 4, - hrmp_channel_max_message_size: 1024 * 1024, - hrmp_max_parachain_outbound_channels: 4, - hrmp_max_parathread_outbound_channels: 4, - hrmp_max_message_num_per_candidate: 5, - dispute_period: 6, - no_show_slots: 2, - n_delay_tranches: 25, - needed_approvals: 2, - relay_vrf_modulo_samples: 2, - zeroth_delay_tranche_width: 0, - ..Default::default() + bridge = () } } diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs b/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs index 97cbce60b..3efef4810 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/currency_id_convert.rs @@ -21,102 +21,130 @@ use crate::{ setup::{ foreign_parent_multilocation, foreign_sibling_multilocation, foreign_ztg_multilocation, register_foreign_parent, register_foreign_sibling, FOREIGN_PARENT_ID, - FOREIGN_SIBLING_ID, + FOREIGN_SIBLING_ID, PARA_ID_BATTERY_STATION, }, - test_net::Zeitgeist, + test_net::BatteryStation, }, xcm_config::config::{battery_station, general_key, AssetConvert}, CurrencyId, }; - -use frame_support::assert_err; -use sp_runtime::traits::Convert as C2; +use core::fmt::Debug; +use sp_runtime::traits::{Convert, MaybeEquivalence}; +use test_case::test_case; use xcm::latest::{Junction::*, Junctions::*, MultiLocation}; use xcm_emulator::TestExt; -use xcm_executor::traits::Convert as C1; +use zeitgeist_primitives::types::{Asset, CustomMetadata, ScalarPosition}; -#[test] -fn convert_native() { +fn convert_common_native(expected: T) +where + T: Copy + Debug + PartialEq, + AssetConvert: MaybeEquivalence + Convert>, +{ assert_eq!(battery_station::KEY.to_vec(), vec![0, 1]); - // The way Ztg is represented relative within the Zeitgeist runtime + // The way Ztg is represented relative within the Battery Station runtime let ztg_location_inner: MultiLocation = MultiLocation::new(0, X1(general_key(battery_station::KEY))); - assert_eq!(>::convert(ztg_location_inner), Ok(CurrencyId::Ztg)); + assert_eq!( + >::convert(&ztg_location_inner), + Some(expected) + ); // The canonical way Ztg is represented out in the wild - Zeitgeist::execute_with(|| { + BatteryStation::execute_with(|| { assert_eq!( - >::convert(CurrencyId::Ztg), + >::convert(expected), Some(foreign_ztg_multilocation()) ) }); } -#[test] -fn convert_any_registered_parent_multilocation() { - Zeitgeist::execute_with(|| { - assert_err!( - >::convert(foreign_parent_multilocation()), - foreign_parent_multilocation() - ); - - assert_eq!(>::convert(FOREIGN_PARENT_ID), None); - - // Register parent as foreign asset in the Zeitgeist parachain - register_foreign_parent(None); - +fn convert_common_non_native( + expected: T, + multilocation: MultiLocation, + register: fn(Option), +) where + T: Copy + Debug + PartialEq, + AssetConvert: MaybeEquivalence + Convert>, +{ + BatteryStation::execute_with(|| { + assert_eq!(>::convert(&multilocation), None); + assert_eq!(>::convert(expected), None); + // Register parent as foreign asset in the Battery Station parachain + register(None); assert_eq!( - >::convert(foreign_parent_multilocation()), - Ok(FOREIGN_PARENT_ID), - ); - - assert_eq!( - >::convert(FOREIGN_PARENT_ID), - Some(foreign_parent_multilocation()) + >::convert(&multilocation), + Some(expected) ); + assert_eq!(>::convert(expected), Some(multilocation)); }); } #[test] -fn convert_any_registered_sibling_multilocation() { - Zeitgeist::execute_with(|| { - assert_err!( - >::convert(foreign_sibling_multilocation()), - foreign_sibling_multilocation() - ); +fn convert_native_assets() { + convert_common_native(Asset::Ztg); +} - assert_eq!(>::convert(FOREIGN_SIBLING_ID), None); +#[test] +fn convert_any_registered_parent_multilocation_assets() { + convert_common_non_native( + FOREIGN_PARENT_ID, + foreign_parent_multilocation(), + register_foreign_parent, + ); +} - // Register sibling as foreign asset in the Zeitgeist parachain - register_foreign_sibling(None); +#[test] +fn convert_any_registered_parent_multilocation_xcm_assets() { + convert_common_non_native( + FOREIGN_PARENT_ID, + foreign_parent_multilocation(), + register_foreign_parent, + ); +} - assert_eq!( - >::convert(foreign_sibling_multilocation()), - Ok(FOREIGN_SIBLING_ID), - ); +#[test] +fn convert_any_registered_sibling_multilocation_assets() { + convert_common_non_native( + FOREIGN_SIBLING_ID, + foreign_sibling_multilocation(), + register_foreign_sibling, + ); +} - assert_eq!( - >::convert(FOREIGN_SIBLING_ID), - Some(foreign_sibling_multilocation()) - ); - }); +#[test] +fn convert_any_registered_sibling_multilocation_xcm_assets() { + convert_common_non_native( + FOREIGN_SIBLING_ID, + foreign_sibling_multilocation(), + register_foreign_sibling, + ); } #[test] fn convert_unkown_multilocation() { let unknown_location: MultiLocation = - MultiLocation::new(1, X2(Parachain(battery_station::ID), general_key(&[42]))); + MultiLocation::new(1, X2(Parachain(PARA_ID_BATTERY_STATION), general_key(&[42]))); - Zeitgeist::execute_with(|| { - assert!(>::convert(unknown_location).is_err()); + BatteryStation::execute_with(|| { + assert!( + >::convert(&unknown_location).is_none() + ); }); } -#[test] -fn convert_unsupported_currency() { - Zeitgeist::execute_with(|| { - assert_eq!(>::convert(CurrencyId::CombinatorialOutcome), None) +#[test_case(Asset::CategoricalOutcome(7, 8))] +#[test_case(Asset::ScalarOutcome(7, ScalarPosition::Long))] +#[test_case(Asset::PoolShare(7))] +#[test_case(Asset::ForeignAsset(7))] +#[test_case(Asset::ParimutuelShare(7, 8))] +fn convert_unsupported_asset(asset: T) +where + T: Copy + Debug + PartialEq, + AssetConvert: Convert>, +{ + BatteryStation::execute_with(|| { + assert_eq!(>::convert(asset), None) }); } diff --git a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs index 20d7350d3..ed5b786d5 100644 --- a/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/battery-station/src/integration_tests/xcm/tests/transfers.rs @@ -19,46 +19,46 @@ use crate::{ integration_tests::xcm::{ setup::{ + accounts::{alice, bob}, adjusted_balance, btc, register_btc, register_foreign_parent, register_foreign_ztg, - roc, sibling_parachain_account, zeitgeist_parachain_account, ztg, ALICE, BOB, BTC_ID, - FOREIGN_PARENT_ID, FOREIGN_ZTG_ID, PARA_ID_SIBLING, + roc, sibling_parachain_account, zeitgeist_parachain_account, ztg, BTC_ID, + FOREIGN_PARENT_ID, FOREIGN_ZTG_ID, PARA_ID_BATTERY_STATION, PARA_ID_SIBLING, }, - test_net::{RococoNet, Sibling, TestNet, Zeitgeist}, + test_net::{BatteryStation, Rococo, Sibling}, }, - xcm_config::{config::battery_station, fees::default_per_second}, - AssetRegistry, Balance, Balances, CurrencyId, RuntimeOrigin, Tokens, XTokens, + xcm_config::fees::default_per_second, + AssetManager, Balance, Balances, CurrencyId, RuntimeOrigin, Tokens, XTokens, ZeitgeistTreasuryAccount, }; -use frame_support::assert_ok; +use frame_support::{assert_ok, traits::tokens::fungible::Mutate}; use orml_traits::MultiCurrency; use xcm::latest::{Junction, Junction::*, Junctions::*, MultiLocation, WeightLimit}; -use xcm_emulator::TestExt; +use xcm_emulator::{RelayChain, TestExt}; use zeitgeist_primitives::{ constants::{BalanceFractionalDecimals, BASE}, - types::{CustomMetadata, XcmMetadata}, + types::{Asset, CustomMetadata, XcmMetadata}, }; #[test] fn transfer_ztg_to_sibling() { - TestNet::reset(); - - let alice_initial_balance = ztg(10); + let mut alice_initial_balance = 0; + let mut bob_initial_balance = 0; let transfer_amount = ztg(5); let mut treasury_initial_balance = 0; Sibling::execute_with(|| { treasury_initial_balance = - Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); + AssetManager::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); + bob_initial_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); register_foreign_ztg(None); }); - Zeitgeist::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); + BatteryStation::execute_with(|| { + alice_initial_balance = Balances::free_balance(alice()); assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(alice()), CurrencyId::Ztg, transfer_amount, Box::new( @@ -66,7 +66,7 @@ fn transfer_ztg_to_sibling() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: None, id: BOB.into() } + Junction::AccountId32 { network: None, id: bob().into() } ) ) .into() @@ -75,92 +75,137 @@ fn transfer_ztg_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance - transfer_amount); - + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); Sibling::execute_with(|| { - let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); + let current_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); + let bob_expected = bob_initial_balance + transfer_amount - ztg_fee(); + let treasury_expected = treasury_initial_balance + ztg_fee(); + assert_eq!(current_balance, bob_expected); + assert_eq!( + AssetManager::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), + treasury_expected + ) + }); +} + +#[test] +fn transfer_ztg_to_sibling_with_custom_fee() { + // 10x fee factor, so ZTG has 10x the worth of sibling currency. + let fee_factor = 100_000_000_000; + let transfer_amount = ztg(5); + let mut treasury_initial_balance = 0; + let mut bob_initial_balance = 0; + + Sibling::execute_with(|| { + treasury_initial_balance = + AssetManager::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); + bob_initial_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); + let custom_metadata = CustomMetadata { + xcm: XcmMetadata { fee_factor: Some(fee_factor) }, + ..Default::default() + }; + register_foreign_ztg(Some(custom_metadata)); + }); + + BatteryStation::execute_with(|| { + let alice_initial_balance = Balances::free_balance(alice()); + assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); + assert_ok!(XTokens::transfer( + RuntimeOrigin::signed(alice()), + Asset::Ztg, + transfer_amount, + Box::new( + MultiLocation::new( + 1, + X2( + Parachain(PARA_ID_SIBLING), + Junction::AccountId32 { network: None, id: bob().into() } + ) + ) + .into() + ), + WeightLimit::Limited(4_000_000_000.into()), + )); + // Confirm that Alice's balance is initial_balance - amount_transferred + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); + // Verify that the amount transferred is now part of the sibling account here + assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); + }); - // Verify that BOB now has (amount transferred - fee) - assert_eq!(current_balance, transfer_amount - ztg_fee()); + Sibling::execute_with(|| { + let current_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); + let custom_fee = ztg_fee() * fee_factor / BASE; + let bob_expected = bob_initial_balance + transfer_amount - custom_fee; + let treasury_expected = treasury_initial_balance + custom_fee; + // Verify that bob() now has (amount transferred - fee) + assert_eq!(current_balance, bob_expected); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), - treasury_initial_balance + ztg_fee() + AssetManager::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), + treasury_expected ) }); } #[test] fn transfer_ztg_sibling_to_zeitgeist() { - TestNet::reset(); - - // In order to be able to transfer ZTG from Sibling to Zeitgeist, we need to first send - // ZTG from Zeitgeist to Sibling, or else it fails since it'd be like Sibling had minted - // ZTG on their side. - transfer_ztg_to_sibling(); - - let alice_initial_balance = ztg(5); - let bob_initial_balance = ztg(5) - ztg_fee(); + let mut alice_initial_balance = 0; let mut treasury_initial_balance = 0; - let sibling_sovereign_initial_balance = ztg(5); let transfer_amount = ztg(1); - // Note: This asset was registered in `transfer_ztg_to_sibling` + let sibling_initial_balance = transfer_amount; - Zeitgeist::execute_with(|| { + BatteryStation::execute_with(|| { treasury_initial_balance = Balances::free_balance(ZeitgeistTreasuryAccount::get()); - - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); + alice_initial_balance = Balances::free_balance(alice()); assert_eq!( - Balances::free_balance(sibling_parachain_account()), - sibling_sovereign_initial_balance + Balances::set_balance(&sibling_parachain_account(), sibling_initial_balance), + sibling_initial_balance ); }); Sibling::execute_with(|| { - assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), 0); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance); + register_foreign_ztg(None); + let bob_initial_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); + assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(BOB), + RuntimeOrigin::signed(bob()), FOREIGN_ZTG_ID, transfer_amount, Box::new( MultiLocation::new( 1, X2( - Parachain(battery_station::ID), - Junction::AccountId32 { network: None, id: ALICE.into() } + Parachain(PARA_ID_BATTERY_STATION), + Junction::AccountId32 { network: None, id: alice().into() } ) ) .into() ), WeightLimit::Limited(4_000_000_000.into()), )); - // Confirm that Bobs's balance is initial balance - amount transferred assert_eq!( - Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), + AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()), bob_initial_balance - transfer_amount ); }); - Zeitgeist::execute_with(|| { - // Verify that ALICE now has initial balance + amount transferred - fee + BatteryStation::execute_with(|| { + // Verify that alice() now has initial balance + amount transferred - fee assert_eq!( - Balances::free_balance(&ALICE), + Balances::free_balance(alice()), alice_initial_balance + transfer_amount - ztg_fee(), ); - // Verify that the reserve has been adjusted properly assert_eq!( Balances::free_balance(sibling_parachain_account()), - sibling_sovereign_initial_balance - transfer_amount + sibling_initial_balance - transfer_amount ); - // Verify that fees (of native currency) have been put into treasury assert_eq!( Balances::free_balance(ZeitgeistTreasuryAccount::get()), @@ -171,50 +216,45 @@ fn transfer_ztg_sibling_to_zeitgeist() { #[test] fn transfer_btc_sibling_to_zeitgeist() { - TestNet::reset(); - - let sibling_alice_initial_balance = ztg(10); - let zeitgeist_alice_initial_balance = btc(0); - let initial_sovereign_balance = btc(100); + let mut zeitgeist_alice_initial_balance = 0; let transfer_amount = btc(100); let mut treasury_initial_balance = 0; - Zeitgeist::execute_with(|| { + BatteryStation::execute_with(|| { register_btc(None); - treasury_initial_balance = Tokens::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(BTC_ID, &ALICE), zeitgeist_alice_initial_balance,); + treasury_initial_balance = + AssetManager::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()); + zeitgeist_alice_initial_balance = AssetManager::free_balance(BTC_ID, &alice()); }); Sibling::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE), sibling_alice_initial_balance); + let alice_initial_balance = Balances::free_balance(alice()); + let initial_sovereign_balance = transfer_amount; + // Set the sovereign balance such that it is not subject to dust collection - assert_ok!(Balances::set_balance( - RuntimeOrigin::root(), - zeitgeist_parachain_account().into(), - initial_sovereign_balance, - 0 - )); + assert_eq!( + Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), + initial_sovereign_balance + ); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), - // Target chain will interpret CurrencyId::Ztg as BTC in this context. + RuntimeOrigin::signed(alice()), + // Target chain will interpret XcmAsset::Ztg as BTC in this context. CurrencyId::Ztg, transfer_amount, Box::new( MultiLocation::new( 1, X2( - Parachain(battery_station::ID), - Junction::AccountId32 { network: None, id: ALICE.into() } + Parachain(PARA_ID_BATTERY_STATION), + Junction::AccountId32 { network: None, id: alice().into() } ) ) .into() ), WeightLimit::Limited(4_000_000_000.into()), )); - // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE), sibling_alice_initial_balance - transfer_amount); - + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the zeitgeist account here assert_eq!( Balances::free_balance(zeitgeist_parachain_account()), @@ -222,42 +262,46 @@ fn transfer_btc_sibling_to_zeitgeist() { ); }); - Zeitgeist::execute_with(|| { + BatteryStation::execute_with(|| { let expected = transfer_amount - btc_fee(); let expected_adjusted = adjusted_balance(btc(1), expected); + let expected_treasury = treasury_initial_balance + adjusted_balance(btc(1), btc_fee()); // Verify that remote Alice now has initial balance + amount transferred - fee assert_eq!( - Tokens::free_balance(BTC_ID, &ALICE), + AssetManager::free_balance(BTC_ID, &alice()), zeitgeist_alice_initial_balance + expected_adjusted, ); - // Verify that fees (of foreign currency) have been put into treasury assert_eq!( Tokens::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()), // Align decimal fractional places - treasury_initial_balance + adjusted_balance(btc(1), btc_fee()) + expected_treasury ) }); } #[test] fn transfer_btc_zeitgeist_to_sibling() { - TestNet::reset(); - - let transfer_amount = btc(100) - btc_fee(); - let initial_sovereign_balance = 2 * btc(100); - let sibling_bob_initial_balance = btc(0); - - transfer_btc_sibling_to_zeitgeist(); + let transfer_amount = btc(100); + let initial_sovereign_balance = transfer_amount; + let mut bob_initial_balance = 0; Sibling::execute_with(|| { - assert_eq!(Tokens::free_balance(BTC_ID, &BOB), sibling_bob_initial_balance,); + bob_initial_balance = Balances::free_balance(bob()); + // Set the sovereign balance such that it is not subject to dust collection + assert_eq!( + Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), + initial_sovereign_balance + ); }); - Zeitgeist::execute_with(|| { + BatteryStation::execute_with(|| { + register_btc(None); + let alice_initial_balance = AssetManager::free_balance(BTC_ID, &alice()); + assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(alice()), BTC_ID, transfer_amount, Box::new( @@ -265,7 +309,7 @@ fn transfer_btc_zeitgeist_to_sibling() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: None, id: BOB.into() } + Junction::AccountId32 { network: None, id: bob().into() } ) ) .into() @@ -273,202 +317,141 @@ fn transfer_btc_zeitgeist_to_sibling() { WeightLimit::Limited(4_000_000_000.into()), )); - // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Tokens::free_balance(BTC_ID, &ALICE), 0); + let alice_balance = AssetManager::free_balance(BTC_ID, &alice()); + let alice_expected = alice_initial_balance - adjusted_balance(btc(1), transfer_amount); + assert_eq!(alice_balance, alice_expected); }); Sibling::execute_with(|| { - let fee_adjusted = adjusted_balance(btc(1), btc_fee()); - let expected = transfer_amount - fee_adjusted; + let expected = bob_initial_balance + transfer_amount - adjusted_balance(btc(1), btc_fee()); + let expected_sovereign = initial_sovereign_balance - transfer_amount; // Verify that Bob now has initial balance + amount transferred - fee - assert_eq!(Balances::free_balance(&BOB), sibling_bob_initial_balance + expected,); - + assert_eq!(Balances::free_balance(bob()), expected); // Verify that the amount transferred is now subtracted from the zeitgeist account at sibling - assert_eq!( - Balances::free_balance(zeitgeist_parachain_account()), - initial_sovereign_balance - transfer_amount - ); + assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), expected_sovereign); }); } #[test] fn transfer_roc_from_relay_chain() { - TestNet::reset(); - let transfer_amount: Balance = roc(1); let mut treasury_initial_balance = 0; + let mut bob_initial_balance = 0; - Zeitgeist::execute_with(|| { + BatteryStation::execute_with(|| { register_foreign_parent(None); treasury_initial_balance = - Tokens::free_balance(FOREIGN_PARENT_ID, &ZeitgeistTreasuryAccount::get()); + AssetManager::free_balance(FOREIGN_PARENT_ID, &ZeitgeistTreasuryAccount::get()); + bob_initial_balance = AssetManager::free_balance(FOREIGN_PARENT_ID, &bob()); }); - RococoNet::execute_with(|| { - let initial_balance = rococo_runtime::Balances::free_balance(&ALICE); + Rococo::execute_with(|| { + let initial_balance = rococo_runtime::Balances::free_balance(alice()); assert!(initial_balance >= transfer_amount); assert_ok!(rococo_runtime::XcmPallet::reserve_transfer_assets( - rococo_runtime::RuntimeOrigin::signed(ALICE), - Box::new(Parachain(battery_station::ID).into()), - Box::new(Junction::AccountId32 { network: None, id: BOB.into() }.into()), + rococo_runtime::RuntimeOrigin::signed(alice()), + Box::new(Parachain(PARA_ID_BATTERY_STATION).into()), + Box::new(Junction::AccountId32 { network: None, id: bob().into() }.into()), Box::new((Here, transfer_amount).into()), 0 )); }); - Zeitgeist::execute_with(|| { + BatteryStation::execute_with(|| { let expected = transfer_amount - roc_fee(); - let expected_adjusted = adjusted_balance(roc(1), expected); - assert_eq!(Tokens::free_balance(FOREIGN_PARENT_ID, &BOB), expected_adjusted); + let bob_expected = bob_initial_balance + adjusted_balance(roc(1), expected); + let treasury_expected = treasury_initial_balance + adjusted_balance(roc(1), roc_fee()); + + assert_eq!(AssetManager::free_balance(FOREIGN_PARENT_ID, &bob()), bob_expected); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - Tokens::free_balance(FOREIGN_PARENT_ID, &ZeitgeistTreasuryAccount::get()), - // Align decimal fractional places - treasury_initial_balance + adjusted_balance(roc(1), roc_fee()) + AssetManager::free_balance(FOREIGN_PARENT_ID, &ZeitgeistTreasuryAccount::get()), + treasury_expected ) }); } #[test] fn transfer_roc_to_relay_chain() { - TestNet::reset(); - let transfer_amount: Balance = roc(1); let transfer_amount_local: Balance = adjusted_balance(roc(1), transfer_amount); - transfer_roc_from_relay_chain(); - - Zeitgeist::execute_with(|| { - let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE); - assert!(initial_balance >= transfer_amount); - - assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), - FOREIGN_PARENT_ID, - transfer_amount, - Box::new( - MultiLocation::new(1, X1(Junction::AccountId32 { id: BOB.into(), network: None })) - .into() - ), - WeightLimit::Limited(4_000_000_000.into()) - )); + let mut initial_balance_bob = 0; + Rococo::execute_with(|| { + initial_balance_bob = rococo_runtime::Balances::free_balance(bob()); + let bs_acc = Rococo::sovereign_account_id_of_child_para(PARA_ID_BATTERY_STATION.into()); assert_eq!( - Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE), - initial_balance - transfer_amount_local - ) - }); - - RococoNet::execute_with(|| { - assert_eq!(rococo_runtime::Balances::free_balance(&BOB), 999_990_415_728); + rococo_runtime::Balances::set_balance(&bs_acc, transfer_amount), + transfer_amount + ); }); -} - -#[test] -fn transfer_ztg_to_sibling_with_custom_fee() { - TestNet::reset(); - - let alice_initial_balance = ztg(10); - // 10x fee factor, so ZTG has 10x the worth of sibling currency. - let fee_factor = 100_000_000_000; - let transfer_amount = ztg(5); - let mut treasury_initial_balance = 0; - Sibling::execute_with(|| { - treasury_initial_balance = - Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); - - register_foreign_ztg(None); - let custom_metadata = CustomMetadata { - xcm: XcmMetadata { fee_factor: Some(fee_factor) }, - ..Default::default() - }; - assert_ok!(AssetRegistry::do_update_asset( - FOREIGN_ZTG_ID, - None, - None, - None, - None, - None, - Some(custom_metadata) - )); - }); + BatteryStation::execute_with(|| { + register_foreign_parent(None); + let initial_balance = AssetManager::free_balance(FOREIGN_PARENT_ID, &alice()); + assert!(initial_balance >= transfer_amount_local); - Zeitgeist::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); - assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), - CurrencyId::Ztg, + RuntimeOrigin::signed(alice()), + FOREIGN_PARENT_ID, transfer_amount, Box::new( MultiLocation::new( 1, - X2( - Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: None, id: BOB.into() } - ) + X1(Junction::AccountId32 { id: bob().into(), network: None }) ) .into() ), - WeightLimit::Limited(4_000_000_000.into()), + WeightLimit::Limited(4_000_000_000.into()) )); - // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance - transfer_amount); - - // Verify that the amount transferred is now part of the sibling account here - assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); - }); - - Sibling::execute_with(|| { - let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); - let custom_fee = calc_fee(default_per_second(10) * 10); - - // Verify that BOB now has (amount transferred - fee) - assert_eq!(current_balance, transfer_amount - ztg_fee() * fee_factor / BASE); - - // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), - treasury_initial_balance + custom_fee + AssetManager::free_balance(FOREIGN_PARENT_ID, &alice()), + initial_balance - transfer_amount_local ) }); + + #[cfg(not(feature = "runtime-benchmarks"))] + // rococo-runtime does not process messages when runtime-benchmarks is enabled: + // https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.1.0/polkadot/runtime/rococo/src/lib.rs#L1078-L1080 + Rococo::execute_with(|| { + let expected_fee = 10_454_619; + let expected_balance_bob = initial_balance_bob + transfer_amount - expected_fee; + assert_eq!(rococo_runtime::Balances::free_balance(&bob()), expected_balance_bob); + }); } #[test] fn test_total_fee() { - assert_eq!(ztg_fee(), 80_128_000); - assert_eq!(roc_fee(), 8_012_800_000); + assert_eq!(btc_fee(), 642_960); + assert_eq!(roc_fee(), 8_037_000_000); + assert_eq!(ztg_fee(), 64_296_000); } #[inline] fn ztg_fee() -> Balance { - fee(BalanceFractionalDecimals::get().into()) + fee(BalanceFractionalDecimals::get().into(), 8) } #[inline] -fn fee(decimals: u32) -> Balance { - calc_fee(default_per_second(decimals)) +fn fee(decimals: u32, multiplier: Balance) -> Balance { + calc_fee(default_per_second(decimals), multiplier) } -// The fee associated with transferring roc tokens #[inline] fn roc_fee() -> Balance { - fee(12) + fee(12, 10) } #[inline] fn btc_fee() -> Balance { - fee(8) + fee(8, 8) } #[inline] -const fn calc_fee(fee_per_second: Balance) -> Balance { - // We divide the fee to align its unit and multiply by 8 as that seems to be the unit of - // time the tests take. - // NOTE: it is possible that in different machines this value may differ. We shall see. - fee_per_second / 10_000 * 8 +const fn calc_fee(fee_per_second: Balance, multiplier: Balance) -> Balance { + // Adjust fee per second to actual test execution time + fee_per_second / 10_000 * multiplier } diff --git a/runtime/battery-station/src/lib.rs b/runtime/battery-station/src/lib.rs index a57a93716..b1d287da2 100644 --- a/runtime/battery-station/src/lib.rs +++ b/runtime/battery-station/src/lib.rs @@ -17,7 +17,7 @@ // along with Zeitgeist. If not, see . #![cfg_attr(not(feature = "std"), no_std)] -#![recursion_limit = "512"] +#![recursion_limit = "1024"] extern crate alloc; @@ -74,11 +74,10 @@ use { use frame_support::construct_runtime; -use sp_api::impl_runtime_apis; +use sp_api::{impl_runtime_apis, BlockT}; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, - traits::Block as BlockT, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; @@ -100,8 +99,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("zeitgeist"), impl_name: create_runtime_str!("zeitgeist"), authoring_version: 1, - spec_version: 55, - impl_version: 1, + spec_version: 56, + impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 29, state_version: 1, @@ -199,6 +198,7 @@ create_runtime_with_additional_pallets!( impl pallet_sudo::Config for Runtime { type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); } impl_config_traits!(); diff --git a/runtime/battery-station/src/parachain_params.rs b/runtime/battery-station/src/parachain_params.rs index 3038cbd6d..7312994c4 100644 --- a/runtime/battery-station/src/parachain_params.rs +++ b/runtime/battery-station/src/parachain_params.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -38,6 +38,9 @@ use zeitgeist_primitives::{ }; parameter_types! { + // Asset registry + pub const AssetRegistryStringLimit: u32 = 1024; + // Author-Mapping /// The amount that should be taken as a security deposit when registering a NimbusId. pub const CollatorDeposit: Balance = 2 * BASE; @@ -66,16 +69,20 @@ parameter_types! { pub const LeaveDelegatorsDelay: u32 = 2; /// Maximum bottom delegations per candidate pub const MaxBottomDelegationsPerCandidate: u32 = 50; + /// Maximum number of collator candidates + pub const MaxCandidates: u32 = 200; /// Maximum delegations per delegator pub const MaxDelegationsPerDelegator: u32 = 100; /// Maximum top delegations per candidate pub const MaxTopDelegationsPerCandidate: u32 = 300; + /// Number of rounds until a collator not producing blocks is marked as inactive. + pub const MaxOfflineRounds: u32 = 1; /// Minimum round length is 2 minutes pub const MinBlocksPerRound: u32 = 2 * BLOCKS_PER_MINUTE as u32; /// Minimum stake required to become a collator - pub const MinCollatorStk: u128 = 64 * BASE; + pub const MinCandidateStk: u128 = 64 * BASE; /// Minimum stake required to be reserved to be a delegator - pub const MinDelegatorStk: u128 = BASE / 2; + pub const MinDelegation: u128 = BASE / 2; /// Minimum collators selected per round, default at genesis and minimum forever after pub const MinSelectedCandidates: u32 = 8; /// Rounds before the delegator revocation can be executed @@ -93,6 +100,10 @@ parameter_types! { pub const MaxAssetsIntoHolding: u32 = 64; /// Max instructions per XCM pub const MaxInstructions: u32 = 100; + /// The maximum number of local XCM locks that a single account may have. + pub const MaxLockers: u32 = 8; + /// The maximum number of consumers a single remote lock may have. + pub const MaxRemoteLockConsumers: u32 = 0; /// Relative self location pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::parachain_id().into()))); diff --git a/runtime/battery-station/src/parameters.rs b/runtime/battery-station/src/parameters.rs index 4e531ce4b..adb216b19 100644 --- a/runtime/battery-station/src/parameters.rs +++ b/runtime/battery-station/src/parameters.rs @@ -46,7 +46,7 @@ use zeitgeist_primitives::{constants::*, types::*}; pub(crate) const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); pub(crate) const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), - polkadot_primitives::v2::MAX_POV_SIZE as u64, + polkadot_primitives::MAX_POV_SIZE as u64, ); pub(crate) const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); pub(crate) const FEES_AND_TIPS_TREASURY_PERCENTAGE: u32 = 100; @@ -55,11 +55,12 @@ pub(crate) const FEES_AND_TIPS_BURN_PERCENTAGE: u32 = 0; #[cfg(not(feature = "parachain"))] parameter_types! { // Aura + pub const AllowMultipleBlocksPerSlot: bool = false; pub const MaxAuthorities: u32 = 32; // Grandpa - // Can be 0, as equivocation handling is not enabled (HandleEquivocation = ()) pub const MaxSetIdSessionEntries: u32 = 0; + pub const MaxNominators: u32 = 0; } parameter_types! { @@ -69,6 +70,8 @@ parameter_types! { // Balance pub const ExistentialDeposit: u128 = 5 * MILLI; + pub const MaxHolds: u32 = 1; + pub const MaxFreezes: u32 = 1; pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; @@ -81,22 +84,19 @@ parameter_types! { pub const CouncilMaxMembers: u32 = 100; pub const CouncilMaxProposals: u32 = 100; pub const CouncilMotionDuration: BlockNumber = 7 * BLOCKS_PER_DAY; + pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; pub const TechnicalCommitteeMaxMembers: u32 = 100; pub const TechnicalCommitteeMaxProposals: u32 = 64; pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * BLOCKS_PER_DAY; // Contracts - pub const ContractsDeletionQueueDepth: u32 = 128; - pub ContractsDeletionWeightLimit: Weight = Perbill::from_percent(10) - * RuntimeBlockWeights::get() - .per_class - .get(DispatchClass::Normal) - .max_total - .unwrap_or(RuntimeBlockWeights::get().max_block); + pub const ContractsCodeHashLockupDepositPercent: Perbill = Perbill::from_percent(10); + pub const ContractsDefaultDepositLimit: Balance = deposit(16, 16 * 1024 * 1024); pub const ContractsDepositPerByte: Balance = deposit(0,1); pub const ContractsDepositPerItem: Balance = deposit(1,0); pub const ContractsMaxCodeLen: u32 = 123 * 1024; pub const ContractsMaxDebugBufferLen: u32 = 2 * 1024 * 1024; + pub const ContractsMaxDelegateDependencies: u32 = 32; pub const ContractsMaxStorageKeyLen: u32 = 128; pub const ContractsUnsafeUnstableInterface: bool = true; pub ContractsSchedule: pallet_contracts::Schedule = Default::default(); @@ -386,7 +386,7 @@ parameter_types! { /// The maximum number of approvals that can wait in the spending queue. pub const MaxApprovals: u32 = 100; /// Maximum amount a verified origin can spend - pub const MaxTreasurySpend: Balance = Balance::max_value(); + pub const MaxTreasurySpend: Balance = Balance::MAX; /// Fraction of a proposal's value that should be bonded in order to place the proposal. /// An accepted proposal gets these back. A rejected proposal does not. pub const ProposalBond: Permill = Permill::from_percent(5); diff --git a/runtime/battery-station/src/xcm_config/asset_registry.rs b/runtime/battery-station/src/xcm_config/asset_registry.rs index 92746377d..4b3b044a6 100644 --- a/runtime/battery-station/src/xcm_config/asset_registry.rs +++ b/runtime/battery-station/src/xcm_config/asset_registry.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{Balance, CurrencyId}; +use crate::{AssetRegistryStringLimit, Balance, CurrencyId}; use orml_traits::asset_registry::{AssetMetadata, AssetProcessor}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -29,11 +29,16 @@ use zeitgeist_primitives::types::CustomMetadata; /// Only pre check is to ensure an asset id was passed. pub struct CustomAssetProcessor; -impl AssetProcessor> for CustomAssetProcessor { +impl AssetProcessor> + for CustomAssetProcessor +{ fn pre_register( id: Option, - metadata: AssetMetadata, - ) -> Result<(CurrencyId, AssetMetadata), DispatchError> { + metadata: AssetMetadata, + ) -> Result< + (CurrencyId, AssetMetadata), + DispatchError, + > { match id { Some(id) => Ok((id, metadata)), None => Err(DispatchError::Other("asset-registry: AssetId is required")), @@ -42,7 +47,7 @@ impl AssetProcessor> for Cust fn post_register( _id: CurrencyId, - _asset_metadata: AssetMetadata, + _asset_metadata: AssetMetadata, ) -> Result<(), DispatchError> { Ok(()) } diff --git a/runtime/battery-station/src/xcm_config/config.rs b/runtime/battery-station/src/xcm_config/config.rs index e472ce980..b30c2b92b 100644 --- a/runtime/battery-station/src/xcm_config/config.rs +++ b/runtime/battery-station/src/xcm_config/config.rs @@ -1,4 +1,5 @@ // Copyright 2022-2024 Forecasting Technologies LTD. +// Copyright 2023 Centrifuge Foundation (centrifuge.io). // // This file is part of Zeitgeist. // @@ -22,6 +23,7 @@ use crate::{ RuntimeCall, RuntimeOrigin, UnitWeightCost, UniversalLocation, UnknownTokens, XcmpQueue, ZeitgeistTreasuryAccount, }; + use alloc::vec::Vec; use core::{cmp::min, marker::PhantomData}; use frame_support::{ @@ -34,8 +36,8 @@ use orml_xcm_support::{ DepositToAlternative, IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset, }; use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use sp_runtime::traits::Convert; +use polkadot_parachain_primitives::primitives::Sibling; +use sp_runtime::traits::{ConstU32, Convert, MaybeEquivalence}; use xcm::{ latest::{ prelude::{AccountId32, AssetId, Concrete, GeneralKey, MultiAsset, XcmContext, X1, X2}, @@ -48,13 +50,13 @@ use xcm_builder::{ AllowTopLevelPaidExecutionFrom, FixedRateOfFungible, FixedWeightBounds, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, - TakeWeightCredit, + TakeWeightCredit, WithComputedOrigin, }; -use xcm_executor::{traits::TransactAsset, Assets, Config}; +use xcm_executor::{traits::TransactAsset, Assets}; use zeitgeist_primitives::{constants::BalanceFractionalDecimals, types::Asset}; pub mod battery_station { - #[cfg(test)] + #[cfg(any(test, feature = "runtime-benchmarks"))] pub const ID: u32 = 2101; pub const KEY: &[u8] = &[0, 1]; } @@ -64,7 +66,10 @@ pub struct XcmConfig; /// The main XCM config /// This is where we configure the core of our XCM integrations: how tokens are transferred, /// how fees are calculated, what barriers we impose on incoming XCM messages, etc. -impl Config for XcmConfig { +impl xcm_executor::Config for XcmConfig { + /// A list of (Origin, Target) pairs allowing a given Origin to be substituted with its + /// corresponding Target pair. + type Aliasers = Nothing; /// Handler for exchanging assets. type AssetExchanger = (); /// The handler for when there is an instruction to claim assets. @@ -122,12 +127,18 @@ impl Config for XcmConfig { pub type Barrier = ( // Execution barrier that just takes max_weight from weight_credit TakeWeightCredit, - // Ensures that execution time is bought with BuyExecution instruction - AllowTopLevelPaidExecutionFrom, // Expected responses are OK. AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, ); /// The means of purchasing weight credit for XCM execution. @@ -151,11 +162,10 @@ pub struct ToTreasury; impl TakeRevenue for ToTreasury { fn take_revenue(revenue: MultiAsset) { use orml_traits::MultiCurrency; - use xcm_executor::traits::Convert; if let MultiAsset { id: Concrete(location), fun: Fungible(_amount) } = revenue { - if let Ok(asset_id) = - >::convert(location) + if let Some(asset_id) = + >::convert(&location) { let adj_am = AlignedFractionalMultiAssetTransactor::adjust_fractional_places(&revenue).fun; @@ -180,7 +190,7 @@ parameter_types! { native_per_second(), 0, ); - /// The amount of canonical ZTG charged per second of execution. + /// The amount of ZTG charged per second of execution. pub ZtgPerSecond: (AssetId, u128, u128) = ( MultiLocation::new( 1, @@ -351,35 +361,45 @@ impl Convert> for AssetConvert { /// Convert an incoming `MultiLocation` into a `Asset` if possible. /// Here we need to know the canonical representation of all the tokens we handle in order to /// correctly convert their `MultiLocation` representation into our internal `Asset` type. -impl xcm_executor::traits::Convert for AssetConvert { - fn convert(location: MultiLocation) -> Result { +impl MaybeEquivalence for AssetConvert { + fn convert(location: &MultiLocation) -> Option { match location { MultiLocation { parents: 0, interior: X1(GeneralKey { data, length }) } => { - let key = &data[..data.len().min(length as usize)]; + let key = &data[..data.len().min(*length as usize)]; if key == battery_station::KEY { - return Ok(CurrencyId::Ztg); + return Some(CurrencyId::Ztg); } - Err(location) + None } MultiLocation { parents: 1, interior: X2(Junction::Parachain(para_id), GeneralKey { data, length }), } => { - let key = &data[..data.len().min(length as usize)]; + let key = &data[..data.len().min(*length as usize)]; - if para_id == u32::from(ParachainInfo::parachain_id()) { - if key == battery_station::KEY { - return Ok(CurrencyId::Ztg); - } - - return Err(location); + if *para_id == u32::from(ParachainInfo::parachain_id()) { + if key == battery_station::KEY { Some(CurrencyId::Ztg) } else { None } + } else { + AssetRegistry::location_to_asset_id(location) } - - AssetRegistry::location_to_asset_id(location).ok_or(location) } - _ => AssetRegistry::location_to_asset_id(location).ok_or(location), + _ => AssetRegistry::location_to_asset_id(location), + } + } + + fn convert_back(id: &CurrencyId) -> Option { + match id { + Asset::Ztg => Some(MultiLocation::new( + 1, + X2( + Junction::Parachain(ParachainInfo::parachain_id().into()), + general_key(battery_station::KEY), + ), + )), + Asset::ForeignAsset(_) => AssetRegistry::multilocation(id).ok()?, + _ => None, } } } @@ -387,7 +407,7 @@ impl xcm_executor::traits::Convert for AssetConvert { impl Convert> for AssetConvert { fn convert(asset: MultiAsset) -> Option { if let MultiAsset { id: Concrete(location), .. } = asset { - >::convert(location).ok() + >::convert(&location) } else { None } @@ -396,7 +416,7 @@ impl Convert> for AssetConvert { impl Convert> for AssetConvert { fn convert(location: MultiLocation) -> Option { - >::convert(location).ok() + >::convert(&location) } } diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 03afedb56..0f4fd47f0 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -16,12 +16,12 @@ pallet-contracts = { workspace = true } pallet-contracts-primitives = { workspace = true } pallet-democracy = { workspace = true } pallet-identity = { workspace = true } +pallet-insecure-randomness-collective-flip = { workspace = true } pallet-membership = { workspace = true } pallet-multisig = { workspace = true } pallet-parachain-staking = { workspace = true, optional = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } -pallet-randomness-collective-flip = { workspace = true } pallet-scheduler = { workspace = true } pallet-timestamp = { workspace = true } pallet-transaction-payment = { workspace = true } @@ -64,7 +64,7 @@ std = [ "pallet-multisig/std", "pallet-preimage/std", "pallet-proxy/std", - "pallet-randomness-collective-flip/std", + "pallet-insecure-randomness-collective-flip/std", "pallet-scheduler/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", @@ -78,7 +78,7 @@ std = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "common-runtime" version = "0.5.2" diff --git a/runtime/common/src/fees.rs b/runtime/common/src/fees.rs index 062b9925a..d9aa1c621 100644 --- a/runtime/common/src/fees.rs +++ b/runtime/common/src/fees.rs @@ -41,8 +41,8 @@ macro_rules! impl_fee_types { pub struct DealWithForeignFees; - impl OnUnbalanced> for DealWithForeignFees { - fn on_unbalanced(fees_and_tips: CreditOf) { + impl OnUnbalanced> for DealWithForeignFees { + fn on_unbalanced(fees_and_tips: Credit) { // We have to manage the mint / burn ratio on the Zeitgeist chain, // but we do not have the responsibility and necessary knowledge to // manage the mint / burn ratio for any other chain. @@ -67,9 +67,10 @@ macro_rules! impl_foreign_fees { use frame_support::{ pallet_prelude::InvalidTransaction, traits::{ - fungibles::{CreditOf, Inspect}, + fungibles::{Credit, Inspect}, tokens::{ - fungibles::Balanced, BalanceConversion, WithdrawConsequence, WithdrawReasons, + fungibles::Balanced, ConversionToAssetBalance, Fortitude, Precision, + Preservation, WithdrawConsequence, WithdrawReasons, }, ExistenceRequirement, }, @@ -139,7 +140,9 @@ macro_rules! impl_foreign_fees { } pub struct TTCBalanceToAssetBalance; - impl BalanceConversion for TTCBalanceToAssetBalance { + impl ConversionToAssetBalance + for TTCBalanceToAssetBalance + { type Error = TransactionValidityError; fn to_asset_balance( @@ -164,7 +167,7 @@ macro_rules! impl_foreign_fees { pub struct TTCHandleCredit; impl HandleCredit for TTCHandleCredit { - fn handle_credit(final_fee: CreditOf) { + fn handle_credit(final_fee: Credit) { // Handle the final fee and tip, e.g. by transferring to the treasury. DealWithForeignFees::on_unbalanced(final_fee); } @@ -174,7 +177,7 @@ macro_rules! impl_foreign_fees { impl pallet_asset_tx_payment::OnChargeAssetTransaction for TokensTxCharger { type AssetId = TxPaymentAssetId; type Balance = Balance; - type LiquidityInfo = CreditOf; + type LiquidityInfo = Credit; fn withdraw_fee( who: &AccountId, @@ -184,9 +187,9 @@ macro_rules! impl_foreign_fees { native_fee: Self::Balance, _tip: Self::Balance, ) -> Result { - // We don't know the precision of the underlying asset. Because the converted fee could be - // less than one (e.g. 0.5) but gets rounded down by integer division we introduce a minimum - // fee. + // We don't know the precision of the underlying asset. Because the converted fee + // could be less than one (e.g. 0.5) but gets rounded down by integer division we + // introduce a minimum fee. let min_converted_fee = if native_fee.is_zero() { Zero::zero() } else { One::one() }; let converted_fee = @@ -198,8 +201,15 @@ macro_rules! impl_foreign_fees { if can_withdraw != WithdrawConsequence::Success { return Err(InvalidTransaction::Payment.into()); } - >::withdraw(currency_id, who, converted_fee) - .map_err(|_| TransactionValidityError::from(InvalidTransaction::Payment)) + >::withdraw( + currency_id, + who, + converted_fee, + Precision::Exact, + Preservation::Expendable, + Fortitude::Force, + ) + .map_err(|_| TransactionValidityError::from(InvalidTransaction::Payment)) } fn correct_and_deposit_fee( @@ -209,7 +219,7 @@ macro_rules! impl_foreign_fees { corrected_native_fee: Self::Balance, tip: Self::Balance, paid: Self::LiquidityInfo, - ) -> Result<(), TransactionValidityError> { + ) -> Result<(Self::Balance, Self::Balance), TransactionValidityError> { let min_converted_fee = if corrected_native_fee.is_zero() { Zero::zero() } else { One::one() }; let asset_id = match paid.asset() { @@ -228,15 +238,16 @@ macro_rules! impl_foreign_fees { // Calculate how much refund we should return. let (final_fee, refund) = paid.split(converted_fee); - // Refund to the account that paid the fees. If this fails, the account might have dropped - // below the existential balance. In that case we don't refund anything. + // Refund to the account that paid the fees. If this fails, the account might have + // dropped below the existential balance. In that case we don't refund anything. let _ = >::resolve(who, refund); // Handle the final fee and tip, e.g. by transferring to the treasury. // Note: The `corrected_native_fee` already includes the `tip`. + let final_fee_peek = final_fee.peek(); TTCHandleCredit::handle_credit(final_fee); - Ok(()) + Ok((final_fee_peek, tip)) } } }; @@ -247,9 +258,9 @@ macro_rules! impl_market_creator_fees { () => { pub struct MarketCreatorFee; - /// Uses the `creator_fee` field defined by the specified market to deduct a fee for the market's - /// creator. Calling `distribute` is noop if the market doesn't exist or the transfer fails for any - /// reason. + /// Uses the `creator_fee` field defined by the specified market to deduct a fee for the + /// market's creator. Calling `distribute` is noop if the market doesn't exist or the + /// transfer fails for any reason. impl DistributeFees for MarketCreatorFee { type Asset = Asset; type AccountId = AccountId; @@ -300,13 +311,13 @@ macro_rules! impl_market_creator_fees { #[macro_export] macro_rules! fee_tests { - () => { + () => { use crate::*; use frame_support::{assert_noop, assert_ok, dispatch::DispatchClass, weights::Weight}; use orml_traits::MultiCurrency; use pallet_asset_tx_payment::OnChargeAssetTransaction; use sp_core::H256; - use sp_runtime::traits::Convert; + use sp_runtime::BuildStorage; use zeitgeist_primitives::constants::BASE; fn run_with_system_weight(w: Weight, mut assertions: F) @@ -314,7 +325,7 @@ macro_rules! fee_tests { F: FnMut(), { let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + frame_system::GenesisConfig::::default().build_storage().unwrap().into(); t.execute_with(|| { System::set_block_consumed_resources(w, 0); assertions() @@ -324,7 +335,7 @@ macro_rules! fee_tests { #[test] fn treasury_receives_correct_amount_of_native_fees_and_tips() { let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + frame_system::GenesisConfig::::default().build_storage().unwrap().into(); t.execute_with(|| { let fee_balance = 3 * ExistentialDeposit::get(); let fee_imbalance = Balances::issue(fee_balance); @@ -342,7 +353,7 @@ macro_rules! fee_tests { #[test] fn treasury_receives_correct_amount_of_foreign_fees_and_tips() { let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + frame_system::GenesisConfig::::default().build_storage().unwrap().into(); t.execute_with(|| { let fee_and_tip_balance = 10 * ExistentialDeposit::get(); let fees_and_tips = >::issue( @@ -380,10 +391,11 @@ macro_rules! fee_tests { #[test] fn correct_and_deposit_fee_dot_foreign_asset() { - let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into(); + let mut t: sp_io::TestExternalities = + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { { let alice = AccountId::from([0u8; 32]); @@ -392,10 +404,10 @@ macro_rules! fee_tests { xcm: XcmMetadata { fee_factor: Some(fee_factor) }, ..Default::default() }; - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 10, - name: "Polkadot".into(), - symbol: "DOT".into(), + name: "Polkadot".as_bytes().to_vec().try_into().unwrap(), + symbol: "DOT".as_bytes().to_vec().try_into().unwrap(), existential_deposit: ExistentialDeposit::get(), location: Some(xcm::VersionedMultiLocation::V3(xcm::latest::MultiLocation::parent())), additional: custom_metadata, @@ -409,12 +421,12 @@ macro_rules! fee_tests { let mock_call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); let mock_dispatch_info = frame_support::dispatch::DispatchInfo { - weight: frame_support::dispatch::Weight::zero(), + weight: frame_support::weights::Weight::zero(), class: DispatchClass::Normal, pays_fee: frame_support::dispatch::Pays::Yes, }; let mock_post_info = frame_support::dispatch::PostDispatchInfo { - actual_weight: Some(frame_support::dispatch::Weight::zero()), + actual_weight: Some(frame_support::weights::Weight::zero()), pays_fee: frame_support::dispatch::Pays::Yes, }; @@ -449,25 +461,27 @@ macro_rules! fee_tests { #[test] fn get_fee_factor_works() { - let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into(); + let mut t: sp_io::TestExternalities = + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { let custom_metadata = CustomMetadata { xcm: XcmMetadata { fee_factor: Some(143_120_520u128) }, ..Default::default() }; - let meta: AssetMetadata = AssetMetadata { - decimals: 10, - name: "Polkadot".into(), - symbol: "DOT".into(), - existential_deposit: ExistentialDeposit::get(), - location: Some(xcm::VersionedMultiLocation::V3( - xcm::latest::MultiLocation::parent(), - )), - additional: custom_metadata, - }; + let meta: AssetMetadata = + AssetMetadata { + decimals: 10, + name: "Polkadot".as_bytes().to_vec().try_into().unwrap(), + symbol: "DOT".as_bytes().to_vec().try_into().unwrap(), + existential_deposit: ExistentialDeposit::get(), + location: Some(xcm::VersionedMultiLocation::V3( + xcm::latest::MultiLocation::parent(), + )), + additional: custom_metadata, + }; let dot_asset_id = 0u32; let dot = Asset::ForeignAsset(dot_asset_id); @@ -483,10 +497,11 @@ macro_rules! fee_tests { #[test] fn get_fee_factor_metadata_not_found() { - let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into(); + let mut t: sp_io::TestExternalities = + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { { // no registering of dot @@ -500,25 +515,27 @@ macro_rules! fee_tests { #[test] fn get_fee_factor_fee_factor_not_found() { - let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into(); + let mut t: sp_io::TestExternalities = + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { let custom_metadata = CustomMetadata { xcm: XcmMetadata { fee_factor: None }, ..Default::default() }; - let meta: AssetMetadata = AssetMetadata { - decimals: 10, - name: "Polkadot".into(), - symbol: "DOT".into(), - existential_deposit: ExistentialDeposit::get(), - location: Some(xcm::VersionedMultiLocation::V3( - xcm::latest::MultiLocation::parent(), - )), - additional: custom_metadata, - }; + let meta: AssetMetadata = + AssetMetadata { + decimals: 10, + name: "Polkadot".as_bytes().to_vec().try_into().unwrap(), + symbol: "DOT".as_bytes().to_vec().try_into().unwrap(), + existential_deposit: ExistentialDeposit::get(), + location: Some(xcm::VersionedMultiLocation::V3( + xcm::latest::MultiLocation::parent(), + )), + additional: custom_metadata, + }; let dot_asset_id = 0u32; let dot = Asset::ForeignAsset(dot_asset_id); @@ -537,23 +554,25 @@ macro_rules! fee_tests { #[test] fn get_fee_factor_none_location() { - let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into(); + let mut t: sp_io::TestExternalities = + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { let custom_metadata = CustomMetadata { xcm: XcmMetadata { fee_factor: Some(10_393) }, ..Default::default() }; - let meta: AssetMetadata = AssetMetadata { - decimals: 10, - name: "NoneLocationToken".into(), - symbol: "NONE".into(), - existential_deposit: ExistentialDeposit::get(), - location: None, - additional: custom_metadata, - }; + let meta: AssetMetadata = + AssetMetadata { + decimals: 10, + name: "NoneLocationToken".as_bytes().to_vec().try_into().unwrap(), + symbol: "NONE".as_bytes().to_vec().try_into().unwrap(), + existential_deposit: ExistentialDeposit::get(), + location: None, + additional: custom_metadata, + }; let non_location_token = Asset::ForeignAsset(1); assert_ok!(AssetRegistry::register_asset( @@ -568,26 +587,28 @@ macro_rules! fee_tests { #[test] fn withdraws_correct_dot_foreign_asset_fee() { - let mut t: sp_io::TestExternalities = frame_system::GenesisConfig::default() - .build_storage::() - .unwrap() - .into(); + let mut t: sp_io::TestExternalities = + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { let fee_factor = 143_120_520; let custom_metadata = CustomMetadata { xcm: XcmMetadata { fee_factor: Some(fee_factor) }, ..Default::default() }; - let meta: AssetMetadata = AssetMetadata { - decimals: 10, - name: "Polkadot".into(), - symbol: "DOT".into(), - existential_deposit: ExistentialDeposit::get(), - location: Some(xcm::VersionedMultiLocation::V3( - xcm::latest::MultiLocation::parent(), - )), - additional: custom_metadata, - }; + let meta: AssetMetadata = + AssetMetadata { + decimals: 10, + name: "Polkadot".as_bytes().to_vec().try_into().unwrap(), + symbol: "DOT".as_bytes().to_vec().try_into().unwrap(), + existential_deposit: ExistentialDeposit::get(), + location: Some(xcm::VersionedMultiLocation::V3( + xcm::latest::MultiLocation::parent(), + )), + additional: custom_metadata, + }; let dot_asset_id = 0u32; let dot = Asset::ForeignAsset(dot_asset_id); @@ -607,7 +628,7 @@ macro_rules! fee_tests { let mock_call = RuntimeCall::System(frame_system::Call::remark { remark: vec![] }); let mock_dispatch_info = frame_support::dispatch::DispatchInfo { - weight: frame_support::dispatch::Weight::zero(), + weight: frame_support::weights::Weight::zero(), class: DispatchClass::Normal, pays_fee: frame_support::dispatch::Pays::Yes, }; diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 03a5a3c04..49465d932 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -35,6 +35,24 @@ // // You should have received a copy of the GNU General Public License // along with this program. If not, see . +// +// This file incorporates work covered by the following copyright and +// permission notice: +// +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "512"] @@ -47,20 +65,123 @@ pub mod weights; macro_rules! decl_common_types { () => { use core::marker::PhantomData; - use frame_support::traits::{ - Currency, Imbalance, NeverEnsureOrigin, OnRuntimeUpgrade, OnUnbalanced, + use frame_support::{ + migration::storage_key_iter, + migrations::RemovePallet, + pallet_prelude::StorageVersion, + parameter_types, + storage::child, + traits::{Currency, Get, Imbalance, NeverEnsureOrigin, OnRuntimeUpgrade, OnUnbalanced}, + BoundedVec, Twox64Concat, }; + use frame_system::EnsureSigned; #[cfg(feature = "try-runtime")] use frame_try_runtime::{TryStateSelect, UpgradeCheckSelect}; use orml_traits::MultiCurrency; - use sp_runtime::{generic, DispatchError, DispatchResult, SaturatedConversion}; + use pallet_balances::CreditOf; + use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; + use scale_info::TypeInfo; + use sp_core::storage::ChildInfo; + use sp_runtime::{ + generic, DispatchError, DispatchResult, RuntimeDebug, SaturatedConversion, + }; use zeitgeist_primitives::traits::{DeployPoolApi, DistributeFees, MarketCommonsPalletApi}; pub type Block = generic::Block; type Address = sp_runtime::MultiAddress; - type Migrations = (); + struct FixStorageVersions; + + impl OnRuntimeUpgrade for FixStorageVersions { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + log::info!("FixStorageVersions: Starting..."); + StorageVersion::new(4).put::(); + StorageVersion::new(4).put::(); + StorageVersion::new(1).put::(); + StorageVersion::new(4).put::(); + StorageVersion::new(4).put::(); + StorageVersion::new(4).put::(); + StorageVersion::new(4).put::(); + StorageVersion::new(4).put::(); + StorageVersion::new(15).put::(); + log::info!("FixStorageVersions: Done!"); + ::DbWeight::get().writes(9) + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, DispatchError> { + Ok(vec![]) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_: Vec) -> Result<(), DispatchError> { + Ok(()) + } + } + + type TrieId = BoundedVec>; + + // `ContractInfo` struct that we need for `ClearContractsChildTries` but pallet-contracts + // doesn't expose publicly. + #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)] + pub struct ContractInfo { + pub trie_id: TrieId, + pub code_hash: ::Hash, + pub storage_bytes: u32, + pub storage_items: u32, + pub storage_byte_deposit: Balance, + pub storage_item_deposit: Balance, + pub storage_base_deposit: Balance, + } + + struct ClearContractsChildTries; + + impl OnRuntimeUpgrade for ClearContractsChildTries { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + log::info!("ClearContractsChildTries: Starting..."); + let mut total_reads = 0u64; + let mut total_writes = 0u64; + for (_, contract_info) in storage_key_iter::( + b"Contracts", + b"ContractInfoOf", + ) { + let trie_id = contract_info.trie_id; + let inner_trie_id = trie_id.into_inner(); + let child_info = ChildInfo::new_default(&inner_trie_id); + let multi_removal_result = child::clear_storage(&child_info, None, None); + let writes = multi_removal_result.loops as u64; + log::info!( + "ClearContractsChildTries: Cleared trie {:?} in {:?} loops", + inner_trie_id, + writes + ); + total_reads = total_reads.saturating_add(1); + total_writes = total_writes.saturating_add(writes); + } + log::info!("ClearContractsChildTries: Done!"); + ::DbWeight::get() + .reads_writes(total_reads, total_writes) + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, DispatchError> { + Ok(vec![]) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_: Vec) -> Result<(), DispatchError> { + Ok(()) + } + } + + parameter_types! { + pub const ContractsPalletStr: &'static str = "Contracts"; + } + + type ResetContracts = RemovePallet; + + type Migrations = (ClearContractsChildTries, ResetContracts, FixStorageVersions); pub type Executive = frame_executive::Executive< Runtime, @@ -85,6 +206,10 @@ macro_rules! decl_common_types { // https://docs.rs/pallet-asset-tx-payment/latest/src/pallet_asset_tx_payment/lib.rs.html#32-34 pallet_asset_tx_payment::ChargeAssetTxPayment, ); + pub type EventRecord = frame_system::EventRecord< + ::RuntimeEvent, + ::Hash, + >; pub type SignedPayload = generic::SignedPayload; pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; @@ -255,22 +380,18 @@ macro_rules! create_runtime { // `PredictionMarkets` depends on `SimpleDisputes`. construct_runtime!( - pub enum Runtime where - Block = crate::Block, - NodeBlock = crate::NodeBlock, - UncheckedExtrinsic = crate::UncheckedExtrinsic, - { + pub enum Runtime { // System - System: frame_system::{Call, Config, Event, Pallet, Storage} = 0, + System: frame_system::{Call, Config, Event, Pallet, Storage} = 0, Timestamp: pallet_timestamp::{Call, Pallet, Storage, Inherent} = 1, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 2, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip::{Pallet, Storage} = 2, Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event} = 3, Preimage: pallet_preimage::{Pallet, Call, Storage, Event} = 4, // Money Balances: pallet_balances::{Call, Config, Event, Pallet, Storage} = 10, - TransactionPayment: pallet_transaction_payment::{Config, Event, Pallet, Storage} = 11, - Treasury: pallet_treasury::{Call, Config, Event, Pallet, Storage} = 12, + TransactionPayment: pallet_transaction_payment::{Config, Event, Pallet, Storage} = 11, + Treasury: pallet_treasury::{Call, Config, Event, Pallet, Storage} = 12, Vesting: pallet_vesting::{Call, Config, Event, Pallet, Storage} = 13, Multisig: pallet_multisig::{Call, Event, Pallet, Storage} = 14, Bounties: pallet_bounties::{Call, Event, Pallet, Storage} = 15, @@ -323,19 +444,19 @@ macro_rules! create_runtime_with_additional_pallets { #[cfg(feature = "parachain")] create_runtime!( // System - ParachainSystem: cumulus_pallet_parachain_system::{Call, Config, Event, Inherent, Pallet, Storage, ValidateUnsigned} = 100, - ParachainInfo: parachain_info::{Config, Pallet, Storage} = 101, + ParachainSystem: cumulus_pallet_parachain_system::{Call, Config, Event, Inherent, Pallet, Storage, ValidateUnsigned} = 100, + ParachainInfo: parachain_info::{Config, Pallet, Storage} = 101, // Consensus ParachainStaking: pallet_parachain_staking::{Call, Config, Event, Pallet, Storage} = 110, AuthorInherent: pallet_author_inherent::{Call, Inherent, Pallet, Storage} = 111, - AuthorFilter: pallet_author_slot_filter::{Call, Config, Event, Pallet, Storage} = 112, + AuthorFilter: pallet_author_slot_filter::{Call, Config, Event, Pallet, Storage} = 112, AuthorMapping: pallet_author_mapping::{Call, Config, Event, Pallet, Storage} = 113, // XCM CumulusXcm: cumulus_pallet_xcm::{Event, Origin, Pallet} = 120, DmpQueue: cumulus_pallet_dmp_queue::{Call, Event, Pallet, Storage} = 121, - PolkadotXcm: pallet_xcm::{Call, Config, Event, Origin, Pallet, Storage} = 122, + PolkadotXcm: pallet_xcm::{Call, Config, Event, Origin, Pallet, Storage} = 122, XcmpQueue: cumulus_pallet_xcmp_queue::{Call, Event, Pallet, Storage} = 123, AssetRegistry: orml_asset_registry::{Call, Config, Event, Pallet, Storage} = 124, UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 125, @@ -349,7 +470,7 @@ macro_rules! create_runtime_with_additional_pallets { create_runtime!( // Consensus Aura: pallet_aura::{Config, Pallet, Storage} = 100, - Grandpa: pallet_grandpa::{Call, Config, Event, Pallet, Storage} = 101, + Grandpa: pallet_grandpa::{Call, Config, Event, Pallet, Storage} = 101, // Others $($additional_pallets)* @@ -409,18 +530,17 @@ macro_rules! impl_config_traits { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; type BaseCallFilter = IsCallable; + type Block = Block; type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; - type BlockNumber = BlockNumber; type BlockWeights = RuntimeBlockWeights; type RuntimeCall = RuntimeCall; type DbWeight = RocksDbWeight; type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = generic::Header; - type Index = Index; type Lookup = AccountIdLookup; + type Nonce = Nonce; type MaxConsumers = ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -437,6 +557,7 @@ macro_rules! impl_config_traits { #[cfg(not(feature = "parachain"))] impl pallet_aura::Config for Runtime { + type AllowMultipleBlocksPerSlot = AllowMultipleBlocksPerSlot; type AuthorityId = sp_consensus_aura::sr25519::AuthorityId; type DisabledValidators = (); type MaxAuthorities = MaxAuthorities; @@ -445,8 +566,9 @@ macro_rules! impl_config_traits { #[cfg(feature = "parachain")] impl pallet_author_inherent::Config for Runtime { type AccountLookup = AuthorMapping; + type AuthorId = AccountId; type CanAuthor = AuthorFilter; - type SlotBeacon = cumulus_pallet_parachain_system::RelaychainBlockNumberProvider; + type SlotBeacon = cumulus_pallet_parachain_system::RelaychainDataProvider; type WeightInfo = weights::pallet_author_inherent::WeightInfo; } @@ -473,21 +595,12 @@ macro_rules! impl_config_traits { #[cfg(not(feature = "parachain"))] impl pallet_grandpa::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type KeyOwnerProofSystem = (); - type KeyOwnerProof = - >::Proof; - type KeyOwnerIdentification = - >::IdentificationTuple; - type HandleEquivocation = (); + type EquivocationReportSystem = (); + type KeyOwnerProof = sp_core::Void; type MaxAuthorities = MaxAuthorities; + type MaxNominators = MaxNominators; type MaxSetIdSessionEntries = MaxSetIdSessionEntries; + type RuntimeEvent = RuntimeEvent; // Currently the benchmark does yield an invalid weight implementation // type WeightInfo = weights::pallet_grandpa::WeightInfo; type WeightInfo = (); @@ -495,6 +608,7 @@ macro_rules! impl_config_traits { #[cfg(feature = "parachain")] impl pallet_xcm::Config for Runtime { + type AdminOrigin = EnsureRoot; type ExecuteXcmOrigin = EnsureXcmOrigin; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; @@ -514,16 +628,43 @@ macro_rules! impl_config_traits { type CurrencyMatcher = (); type TrustedLockers = (); type SovereignAccountOf = LocationToAccountId; - type MaxLockers = ConstU32<8>; + type MaxLockers = MaxLockers; + type MaxRemoteLockConsumers = MaxRemoteLockConsumers; type WeightInfo = pallet_xcm::TestWeightInfo; #[cfg(feature = "runtime-benchmarks")] type ReachableDest = ReachableDest; + type RemoteLockConsumerIdentifier = (); const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } + #[cfg(feature = "parachain")] + pub struct OnInactiveCollator; + #[cfg(feature = "parachain")] + impl pallet_parachain_staking::OnInactiveCollator for OnInactiveCollator { + fn on_inactive_collator( + collator_id: AccountId, + round: pallet_parachain_staking::RoundIndex, + ) -> Result< + Weight, + sp_runtime::DispatchErrorWithPostInfo, + > { + use pallet_parachain_staking::WeightInfo; + + ParachainStaking::go_offline_inner(collator_id)?; + let extra_weight = + ::WeightInfo::go_offline( + pallet_parachain_staking::MAX_CANDIDATES, + ); + + Ok(::DbWeight::get() + .reads(1) + .saturating_add(extra_weight)) + } + } + #[cfg(feature = "parachain")] impl pallet_parachain_staking::Config for Runtime { type BlockAuthor = AuthorInherent; @@ -534,16 +675,17 @@ macro_rules! impl_config_traits { type LeaveCandidatesDelay = LeaveCandidatesDelay; type LeaveDelegatorsDelay = LeaveDelegatorsDelay; type MaxBottomDelegationsPerCandidate = MaxBottomDelegationsPerCandidate; - type MaxTopDelegationsPerCandidate = MaxTopDelegationsPerCandidate; + type MaxCandidates = MaxCandidates; type MaxDelegationsPerDelegator = MaxDelegationsPerDelegator; + type MaxTopDelegationsPerCandidate = MaxTopDelegationsPerCandidate; + type MaxOfflineRounds = MaxOfflineRounds; type MinBlocksPerRound = MinBlocksPerRound; - type MinCandidateStk = MinCollatorStk; - type MinCollatorStk = MinCollatorStk; - type MinDelegation = MinDelegatorStk; - type MinDelegatorStk = MinDelegatorStk; + type MinCandidateStk = MinCandidateStk; + type MinDelegation = MinDelegation; type MinSelectedCandidates = MinSelectedCandidates; type MonetaryGovernanceOrigin = EnsureRoot; type OnCollatorPayout = (); + type OnInactiveCollator = OnInactiveCollator; type PayoutCollatorReward = (); type OnNewRound = (); type RevokeDelegationDelay = RevokeDelegationDelay; @@ -559,6 +701,7 @@ macro_rules! impl_config_traits { type Balance = Balance; type CustomMetadata = CustomMetadata; type RuntimeEvent = RuntimeEvent; + type StringLimit = AssetRegistryStringLimit; type WeightInfo = (); } @@ -621,15 +764,30 @@ macro_rules! impl_config_traits { type XcmExecutor = xcm_executor::XcmExecutor; } + pub struct DustIntoTreasury; + type CreditOfBalances = CreditOf; + impl OnUnbalanced for DustIntoTreasury { + fn on_nonzero_unbalanced(mut dust: CreditOfBalances) { + let imbalance = NegativeImbalance::new(dust.peek()); + Treasury::on_nonzero_unbalanced(imbalance); + // Ensure issuance is not reduced via OnDrop + core::mem::forget(dust); + } + } + impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; - type DustRemoval = Treasury; - type RuntimeEvent = RuntimeEvent; + type DustRemoval = DustIntoTreasury; type ExistentialDeposit = ExistentialDeposit; + type FreezeIdentifier = (); + type MaxFreezes = MaxFreezes; + type MaxHolds = MaxHolds; type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; + type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type WeightInfo = weights::pallet_balances::WeightInfo; } @@ -638,8 +796,10 @@ macro_rules! impl_config_traits { type RuntimeEvent = RuntimeEvent; type MaxMembers = AdvisoryCommitteeMaxMembers; type MaxProposals = AdvisoryCommitteeMaxProposals; + type MaxProposalWeight = MaxProposalWeight; type MotionDuration = AdvisoryCommitteeMotionDuration; type RuntimeOrigin = RuntimeOrigin; + type SetMembersOrigin = EnsureRoot; type Proposal = RuntimeCall; type WeightInfo = weights::pallet_collective::WeightInfo; } @@ -649,8 +809,10 @@ macro_rules! impl_config_traits { type RuntimeEvent = RuntimeEvent; type MaxMembers = CouncilMaxMembers; type MaxProposals = CouncilMaxProposals; + type MaxProposalWeight = MaxProposalWeight; type MotionDuration = CouncilMotionDuration; type RuntimeOrigin = RuntimeOrigin; + type SetMembersOrigin = EnsureRoot; type Proposal = RuntimeCall; type WeightInfo = weights::pallet_collective::WeightInfo; } @@ -660,8 +822,10 @@ macro_rules! impl_config_traits { type RuntimeEvent = RuntimeEvent; type MaxMembers = TechnicalCommitteeMaxMembers; type MaxProposals = TechnicalCommitteeMaxProposals; + type MaxProposalWeight = MaxProposalWeight; type MotionDuration = TechnicalCommitteeMotionDuration; type RuntimeOrigin = RuntimeOrigin; + type SetMembersOrigin = EnsureRoot; type Proposal = RuntimeCall; type WeightInfo = weights::pallet_collective::WeightInfo; } @@ -671,17 +835,25 @@ macro_rules! impl_config_traits { type CallFilter = ContractsCallfilter; type CallStack = [pallet_contracts::Frame; 5]; type ChainExtension = (); + type Debug = (); + type DefaultDepositLimit = ContractsDefaultDepositLimit; + type CodeHashLockupDepositPercent = ContractsCodeHashLockupDepositPercent; type Currency = Balances; - type DeletionQueueDepth = ContractsDeletionQueueDepth; - type DeletionWeightLimit = ContractsDeletionWeightLimit; type DepositPerItem = ContractsDepositPerItem; type DepositPerByte = ContractsDepositPerByte; + type Environment = (); type MaxCodeLen = ContractsMaxCodeLen; type MaxDebugBufferLen = ContractsMaxDebugBufferLen; + type MaxDelegateDependencies = ContractsMaxDelegateDependencies; type MaxStorageKeyLen = ContractsMaxStorageKeyLen; + #[cfg(not(feature = "runtime-benchmarks"))] + type Migrations = (); + #[cfg(feature = "runtime-benchmarks")] + type Migrations = pallet_contracts::migration::codegen::BenchMigrations; type Randomness = RandomnessCollectiveFlip; - type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; type Schedule = ContractsSchedule; type Time = Timestamp; type UnsafeUnstableInterface = ContractsUnsafeUnstableInterface; @@ -724,6 +896,7 @@ macro_rules! impl_config_traits { type CooloffPeriod = CooloffPeriod; type Slash = Treasury; type Scheduler = Scheduler; + type SubmitOrigin = EnsureSigned; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; @@ -917,7 +1090,7 @@ macro_rules! impl_config_traits { type AnnouncementDepositFactor = AnnouncementDepositFactor; } - impl pallet_randomness_collective_flip::Config for Runtime {} + impl pallet_insecure_randomness_collective_flip::Config for Runtime {} impl pallet_scheduler::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -926,6 +1099,9 @@ macro_rules! impl_config_traits { type RuntimeCall = RuntimeCall; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = EnsureRoot; + #[cfg(feature = "runtime-benchmarks")] + type MaxScheduledPerBlock = ConstU32<512>; + #[cfg(not(feature = "runtime-benchmarks"))] type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = EqualPrivilegeOnly; @@ -1345,12 +1521,21 @@ macro_rules! create_runtime_api { // return false if author mapping not registered like in can_author impl return false }; + + let candidates = pallet_parachain_staking::Pallet::::compute_top_candidates(); + if candidates.is_empty() { + // If there are zero selected candidates, we use the same eligibility + // as the previous round + return AuthorInherent::can_author(&author, &slot); + } + // predict eligibility post-selection by computing selection results now let (eligible, _) = pallet_author_slot_filter::compute_pseudo_random_subset::( - pallet_parachain_staking::Pallet::::compute_top_candidates(), + candidates, &slot ); + eligible.contains(&author_account_id) } else { AuthorInherent::can_author(&author, &slot) @@ -1364,6 +1549,7 @@ macro_rules! create_runtime_api { Vec, Vec, ) { + use alloc::vec::Vec; use frame_benchmarking::{list_benchmark, baseline::Pallet as BaselineBench, Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; use frame_system_benchmarking::Pallet as SystemBench; @@ -1423,39 +1609,24 @@ macro_rules! create_runtime_api { config: frame_benchmarking::BenchmarkConfig, ) -> Result, sp_runtime::RuntimeString> { use frame_benchmarking::{ - add_benchmark, baseline::{Pallet as BaselineBench, Config as BaselineConfig}, vec, BenchmarkBatch, Benchmarking, TrackedStorageKey, Vec + add_benchmark, + baseline::{ + Pallet as BaselineBench, Config as BaselineConfig + }, + BenchmarkBatch, Benchmarking }; + use alloc::{vec, vec::Vec}; + use frame_support::traits::{TrackedStorageKey, WhitelistedStorageKeys}; use frame_system_benchmarking::Pallet as SystemBench; use orml_benchmarking::{add_benchmark as orml_add_benchmark}; + #[allow(non_local_definitions)] impl frame_system_benchmarking::Config for Runtime {} + #[allow(non_local_definitions)] impl BaselineConfig for Runtime {} - let whitelist: Vec = vec![ - // Block Number - hex_literal::hex!( "26aa394eea5630e07c48ae0c9558cef7" - "02a5c1b19ab7a04f536c519aca4983ac") - .to_vec().into(), - // Total Issuance - hex_literal::hex!( "c2261276cc9d1f8598ea4b6a74b15c2f" - "57c875e4cff74148e4628f264b974c80") - .to_vec().into(), - // Execution Phase - hex_literal::hex!( "26aa394eea5630e07c48ae0c9558cef7" - "ff553b5a9862a516939d82b3d3d8661a") - .to_vec().into(), - // Event Count - hex_literal::hex!( "26aa394eea5630e07c48ae0c9558cef7" - "0a98fdbe9ce6c55837576c60c7af3850") - .to_vec().into(), - // System Events - hex_literal::hex!( "26aa394eea5630e07c48ae0c9558cef7" - "80d41e5e16056765bc8461851072c9d7") - .to_vec().into(), - // System BlockWeight - hex_literal::hex!( "26aa394eea5630e07c48ae0c9558cef7" - "34abf5cb34d6244378cddbf18e849d96") - .to_vec().into(), + let mut whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); + let additional_whitelist: Vec = vec![ // ParachainStaking Round hex_literal::hex!( "a686a3043d0adcf2fa655e57bc595a78" "13792e785168f725b60e2969c7fc2552") @@ -1472,6 +1643,7 @@ macro_rules! create_runtime_api { "04a74d81251e398fd8a0a4d55023bb3f") .to_vec().into(), ]; + whitelist.extend(additional_whitelist.into_iter()); let mut batches = Vec::::new(); let params = (&config, &whitelist); @@ -1524,21 +1696,26 @@ macro_rules! create_runtime_api { } if batches.is_empty() { - return Err("Benchmark not found for this pallet.".into()); + return Err("Benchmark not found for this module.".into()); } Ok(batches) } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } - impl pallet_contracts::ContractsApi - for Runtime - { + impl pallet_contracts::ContractsApi< + Block, + AccountId, + Balance, + BlockNumber, + Hash, + EventRecord + > for Runtime { fn call( origin: AccountId, dest: AccountId, @@ -1546,7 +1723,7 @@ macro_rules! create_runtime_api { gas_limit: Option, storage_deposit_limit: Option, input_data: Vec, - ) -> pallet_contracts_primitives::ContractExecResult { + ) -> pallet_contracts_primitives::ContractExecResult { let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); Contracts::bare_call( origin, @@ -1555,8 +1732,9 @@ macro_rules! create_runtime_api { gas_limit, storage_deposit_limit, input_data, - CONTRACTS_DEBUG_OUTPUT, - pallet_contracts::Determinism::Deterministic, + pallet_contracts::DebugInfo::UnsafeDebug, + pallet_contracts::CollectEvents::UnsafeCollect, + pallet_contracts::Determinism::Enforced, ) } @@ -1568,8 +1746,7 @@ macro_rules! create_runtime_api { code: pallet_contracts_primitives::Code, data: Vec, salt: Vec, - ) -> pallet_contracts_primitives::ContractInstantiateResult - { + ) -> pallet_contracts_primitives::ContractInstantiateResult { let gas_limit = gas_limit.unwrap_or(RuntimeBlockWeights::get().max_block); Contracts::bare_instantiate( origin, @@ -1579,7 +1756,8 @@ macro_rules! create_runtime_api { code, data, salt, - CONTRACTS_DEBUG_OUTPUT, + pallet_contracts::DebugInfo::UnsafeDebug, + pallet_contracts::CollectEvents::UnsafeCollect, ) } @@ -1590,12 +1768,7 @@ macro_rules! create_runtime_api { determinism: pallet_contracts::Determinism, ) -> pallet_contracts_primitives::CodeUploadResult { - Contracts::bare_upload_code( - origin, - code, - storage_deposit_limit, - determinism, - ) + Contracts::bare_upload_code(origin, code, storage_deposit_limit, determinism) } fn get_storage( @@ -1687,6 +1860,14 @@ macro_rules! create_runtime_api { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> Vec { + Runtime::metadata_versions() + } } impl sp_block_builder::BlockBuilder for Runtime { @@ -1722,31 +1903,34 @@ macro_rules! create_runtime_api { } #[cfg(not(feature = "parachain"))] - impl sp_finality_grandpa::GrandpaApi for Runtime { - fn current_set_id() -> pallet_grandpa::fg_primitives::SetId { - Grandpa::current_set_id() - } - - fn generate_key_ownership_proof( - _set_id: pallet_grandpa::fg_primitives::SetId, - _authority_id: pallet_grandpa::AuthorityId, - ) -> Option { - None + impl sp_consensus_grandpa::GrandpaApi for Runtime { + fn grandpa_authorities() -> sp_consensus_grandpa::AuthorityList { + Grandpa::grandpa_authorities() } - fn grandpa_authorities() -> pallet_grandpa::AuthorityList { - Grandpa::grandpa_authorities() + fn current_set_id() -> sp_consensus_grandpa::SetId { + Grandpa::current_set_id() } fn submit_report_equivocation_unsigned_extrinsic( - _equivocation_proof: pallet_grandpa::fg_primitives::EquivocationProof< + _equivocation_proof: sp_consensus_grandpa::EquivocationProof< ::Hash, - sp_runtime::traits::NumberFor, + sp_api::NumberFor, >, - _key_owner_proof: pallet_grandpa::fg_primitives::OpaqueKeyOwnershipProof, + _key_owner_proof: sp_consensus_grandpa::OpaqueKeyOwnershipProof, ) -> Option<()> { None } + + fn generate_key_ownership_proof( + _set_id: sp_consensus_grandpa::SetId, + _authority_id: sp_consensus_grandpa::AuthorityId, + ) -> Option { + // NOTE: this is the only implementation possible since we've + // defined our key owner proof type as a bottom type (i.e. a type + // with no values). + None + } } impl sp_offchain::OffchainWorkerApi for Runtime { @@ -1798,7 +1982,7 @@ macro_rules! create_runtime_api { } fn pool_shares_id(pool_id: PoolId) -> Asset> { - Asset::PoolShare(SerdeWrapper(pool_id)) + Asset::PoolShare(pool_id) } } @@ -1862,24 +2046,22 @@ macro_rules! create_runtime_api { #[macro_export] macro_rules! create_common_benchmark_logic { - {} => { + () => { #[cfg(feature = "runtime-benchmarks")] pub(crate) mod benchmarks { pub(crate) mod currencies { use super::utils::{lookup_of_account, set_balance}; use crate::{ AccountId, Amount, AssetManager, Balance, CurrencyId, ExistentialDeposit, - GetNativeCurrencyId, Runtime + GetNativeCurrencyId, Runtime, }; - use frame_benchmarking::{account, vec, whitelisted_caller}; + use alloc::vec; + use frame_benchmarking::{account, whitelisted_caller}; use frame_system::RawOrigin; - use sp_runtime::traits::UniqueSaturatedInto; use orml_benchmarking::runtime_benchmarks; use orml_traits::MultiCurrency; - use zeitgeist_primitives::{ - constants::BASE, - types::Asset, - }; + use sp_runtime::traits::UniqueSaturatedInto; + use zeitgeist_primitives::{constants::BASE, types::Asset}; const SEED: u32 = 0; const NATIVE: CurrencyId = GetNativeCurrencyId::get(); @@ -1898,7 +2080,10 @@ macro_rules! create_common_benchmark_logic { let to_lookup = lookup_of_account(to.clone()); }: transfer(RawOrigin::Signed(from), to_lookup, ASSET, amount) verify { - assert_eq!(>::total_balance(ASSET, &to), amount); + assert_eq!( + >::total_balance(ASSET, &to), + amount, + ); } // `transfer` native currency and in worst case @@ -1913,7 +2098,10 @@ macro_rules! create_common_benchmark_logic { let to_lookup = lookup_of_account(to.clone()); }: transfer(RawOrigin::Signed(from), to_lookup, NATIVE, amount) verify { - assert_eq!(>::total_balance(NATIVE, &to), amount); + assert_eq!( + >::total_balance(NATIVE, &to), + amount, + ); } // `transfer_native_currency` in worst case @@ -1929,7 +2117,10 @@ macro_rules! create_common_benchmark_logic { let to_lookup = lookup_of_account(to.clone()); }: _(RawOrigin::Signed(from), to_lookup, amount) verify { - assert_eq!(>::total_balance(NATIVE, &to), amount); + assert_eq!( + >::total_balance(NATIVE, &to), + amount, + ); } // `update_balance` for non-native currency @@ -1940,7 +2131,10 @@ macro_rules! create_common_benchmark_logic { let who_lookup = lookup_of_account(who.clone()); }: update_balance(RawOrigin::Root, who_lookup, ASSET, amount) verify { - assert_eq!(>::total_balance(ASSET, &who), balance); + assert_eq!( + >::total_balance(ASSET, &who), + balance, + ); } // `update_balance` for native currency @@ -1953,7 +2147,10 @@ macro_rules! create_common_benchmark_logic { let who_lookup = lookup_of_account(who.clone()); }: update_balance(RawOrigin::Root, who_lookup, NATIVE, amount) verify { - assert_eq!(>::total_balance(NATIVE, &who), balance); + assert_eq!( + >::total_balance(NATIVE, &who), + balance, + ); } // `update_balance` for native currency @@ -1967,7 +2164,10 @@ macro_rules! create_common_benchmark_logic { set_balance(NATIVE, &who, balance); }: update_balance(RawOrigin::Root, who_lookup, NATIVE, -amount) verify { - assert_eq!(>::free_balance(NATIVE, &who), 0); + assert_eq!( + >::free_balance(NATIVE, &who), + 0, + ); } } @@ -1983,8 +2183,9 @@ macro_rules! create_common_benchmark_logic { pub(crate) mod tokens { use super::utils::{lookup_of_account, set_balance as update_balance}; - use crate::{AccountId, Balance, CurrencyId, Tokens, Runtime}; - use frame_benchmarking::{account, vec, whitelisted_caller}; + use crate::{AccountId, Balance, CurrencyId, Runtime, Tokens}; + use alloc::vec; + use frame_benchmarking::{account, whitelisted_caller}; use frame_system::RawOrigin; use orml_benchmarking::runtime_benchmarks; use orml_traits::MultiCurrency; @@ -2051,7 +2252,10 @@ macro_rules! create_common_benchmark_logic { }: _(RawOrigin::Root, who_lookup, ASSET, BASE, BASE) verify { - assert_eq!(>::total_balance(ASSET, &who), 2 * BASE); + assert_eq!( + >::total_balance(ASSET, &who), + 2 * BASE, + ); } } @@ -2066,8 +2270,7 @@ macro_rules! create_common_benchmark_logic { } pub(crate) mod utils { - use crate::{AccountId, AssetManager, Balance, CurrencyId, Runtime, - }; + use crate::{AccountId, AssetManager, Balance, CurrencyId, Runtime}; use frame_support::assert_ok; use orml_traits::MultiCurrencyExtended; use sp_runtime::traits::{SaturatedConversion, StaticLookup}; @@ -2088,18 +2291,24 @@ macro_rules! create_common_benchmark_logic { #[cfg(test)] pub mod tests { + use crate::Runtime; + use sp_runtime::BuildStorage; + pub fn new_test_ext() -> sp_io::TestExternalities { - frame_system::GenesisConfig::default().build_storage::().unwrap().into() + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into() } } } } - } + }; } #[macro_export] macro_rules! create_common_tests { - {} => { + () => { #[cfg(test)] mod common_tests { common_runtime::fee_tests!(); @@ -2107,6 +2316,7 @@ macro_rules! create_common_tests { mod dust_removal { use crate::*; use frame_support::PalletId; + use sp_runtime::BuildStorage; use test_case::test_case; #[test_case(AuthorizedPalletId::get(); "authorized")] @@ -2118,10 +2328,14 @@ macro_rules! create_common_tests { #[test_case(TreasuryPalletId::get(); "treasury")] fn whitelisted_pallet_accounts_dont_get_reaped(pallet_id: PalletId) { let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { let pallet_main_account: AccountId = pallet_id.into_account_truncating(); - let pallet_sub_account: AccountId = pallet_id.into_sub_account_truncating(42); + let pallet_sub_account: AccountId = + pallet_id.into_sub_account_truncating(42); assert!(DustRemovalWhitelist::contains(&pallet_main_account)); assert!(DustRemovalWhitelist::contains(&pallet_sub_account)); }); @@ -2130,7 +2344,10 @@ macro_rules! create_common_tests { #[test] fn non_whitelisted_accounts_get_reaped() { let mut t: sp_io::TestExternalities = - frame_system::GenesisConfig::default().build_storage::().unwrap().into(); + frame_system::GenesisConfig::::default() + .build_storage() + .unwrap() + .into(); t.execute_with(|| { let not_whitelisted = AccountId::from([0u8; 32]); assert!(!DustRemovalWhitelist::contains(¬_whitelisted)) @@ -2138,5 +2355,5 @@ macro_rules! create_common_tests { } } } - } + }; } diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs index 02094be2c..743242b1f 100644 --- a/runtime/common/src/weights/frame_system.rs +++ b/runtime/common/src/weights/frame_system.rs @@ -85,6 +85,19 @@ impl frame_system::weights::WeightInfo for WeightInfo Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `1485` + // Minimum execution time: 84_000_503_000 picoseconds. + Weight::from_parts(87_586_619_000, 1485) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } /// Storage: Skipped Metadata (r:0 w:0) /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured) /// The range of component `i` is `[0, 1000]`. diff --git a/runtime/common/src/weights/pallet_assets.rs b/runtime/common/src/weights/pallet_assets.rs new file mode 100644 index 000000000..0dafad365 --- /dev/null +++ b/runtime/common/src/weights/pallet_assets.rs @@ -0,0 +1,491 @@ +// Copyright 2022-2024 Forecasting Technologies LTD. +// Copyright 2021-2022 Zeitgeist PM LLC. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +//! Autogenerated weights for pallet_assets +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` +//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` + +// Executed Command: +// ./target/production/zeitgeist +// benchmark +// pallet +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=pallet_assets +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --template=./misc/frame_weight_template.hbs +// --header=./HEADER_GPL3 +// --output=./runtime/common/src/weights/ + +#![allow(unused_parens)] +#![allow(unused_imports)] + +use core::marker::PhantomData; +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; + +/// Weight functions for pallet_assets (automatically generated) +pub struct WeightInfo(PhantomData); +impl pallet_assets::weights::WeightInfo for WeightInfo { + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn create() -> Weight { + // Proof Size summary in bytes: + // Measured: `293` + // Estimated: `3675` + // Minimum execution time: 31_340_000 picoseconds. + Weight::from_parts(31_977_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn force_create() -> Weight { + // Proof Size summary in bytes: + // Measured: `153` + // Estimated: `3675` + // Minimum execution time: 13_342_000 picoseconds. + Weight::from_parts(13_782_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn start_destroy() -> Weight { + // Proof Size summary in bytes: + // Measured: `385` + // Estimated: `3675` + // Minimum execution time: 14_437_000 picoseconds. + Weight::from_parts(14_833_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:1001 w:1000) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: System Account (r:1000 w:1000) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// The range of component `c` is `[0, 1000]`. + fn destroy_accounts(c: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + c * (208 ±0)` + // Estimated: `3675 + c * (2609 ±0)` + // Minimum execution time: 18_728_000 picoseconds. + Weight::from_parts(18_982_000, 3675) + // Standard Error: 11_708 + .saturating_add(Weight::from_parts(14_363_570, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(c.into()))) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(c.into()))) + .saturating_add(Weight::from_parts(0, 2609).saturating_mul(c.into())) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Approvals (r:1001 w:1000) + /// Proof: Assets Approvals (max_values: None, max_size: Some(148), added: 2623, mode: MaxEncodedLen) + /// The range of component `a` is `[0, 1000]`. + fn destroy_approvals(a: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `522 + a * (86 ±0)` + // Estimated: `3675 + a * (2623 ±0)` + // Minimum execution time: 18_611_000 picoseconds. + Weight::from_parts(18_970_000, 3675) + // Standard Error: 13_224 + .saturating_add(Weight::from_parts(16_397_299, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 2623).saturating_mul(a.into())) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Metadata (r:1 w:0) + /// Proof: Assets Metadata (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen) + fn finish_destroy() -> Weight { + // Proof Size summary in bytes: + // Measured: `351` + // Estimated: `3675` + // Minimum execution time: 14_504_000 picoseconds. + Weight::from_parts(14_906_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + fn mint() -> Weight { + // Proof Size summary in bytes: + // Measured: `351` + // Estimated: `3675` + // Minimum execution time: 26_653_000 picoseconds. + Weight::from_parts(27_260_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + fn burn() -> Weight { + // Proof Size summary in bytes: + // Measured: `459` + // Estimated: `3675` + // Minimum execution time: 33_625_000 picoseconds. + Weight::from_parts(34_474_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:2 w:2) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `498` + // Estimated: `6208` + // Minimum execution time: 47_609_000 picoseconds. + Weight::from_parts(48_476_000, 6208) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:2 w:2) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn transfer_keep_alive() -> Weight { + // Proof Size summary in bytes: + // Measured: `498` + // Estimated: `6208` + // Minimum execution time: 41_625_000 picoseconds. + Weight::from_parts(43_030_000, 6208) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:2 w:2) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn force_transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `498` + // Estimated: `6208` + // Minimum execution time: 47_661_000 picoseconds. + Weight::from_parts(48_469_000, 6208) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: Assets Asset (r:1 w:0) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + fn freeze() -> Weight { + // Proof Size summary in bytes: + // Measured: `459` + // Estimated: `3675` + // Minimum execution time: 17_727_000 picoseconds. + Weight::from_parts(18_384_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:0) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + fn thaw() -> Weight { + // Proof Size summary in bytes: + // Measured: `459` + // Estimated: `3675` + // Minimum execution time: 17_657_000 picoseconds. + Weight::from_parts(18_282_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn freeze_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `385` + // Estimated: `3675` + // Minimum execution time: 13_743_000 picoseconds. + Weight::from_parts(14_193_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn thaw_asset() -> Weight { + // Proof Size summary in bytes: + // Measured: `385` + // Estimated: `3675` + // Minimum execution time: 13_653_000 picoseconds. + Weight::from_parts(14_263_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Metadata (r:1 w:0) + /// Proof: Assets Metadata (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen) + fn transfer_ownership() -> Weight { + // Proof Size summary in bytes: + // Measured: `351` + // Estimated: `3675` + // Minimum execution time: 15_328_000 picoseconds. + Weight::from_parts(16_042_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn set_team() -> Weight { + // Proof Size summary in bytes: + // Measured: `351` + // Estimated: `3675` + // Minimum execution time: 14_097_000 picoseconds. + Weight::from_parts(14_641_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:0) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Metadata (r:1 w:1) + /// Proof: Assets Metadata (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen) + /// The range of component `n` is `[0, 50]`. + /// The range of component `s` is `[0, 50]`. + fn set_metadata(_n: u32, _s: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `351` + // Estimated: `3675` + // Minimum execution time: 29_535_000 picoseconds. + Weight::from_parts(31_456_892, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:0) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Metadata (r:1 w:1) + /// Proof: Assets Metadata (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen) + fn clear_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `515` + // Estimated: `3675` + // Minimum execution time: 30_680_000 picoseconds. + Weight::from_parts(31_930_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:0) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Metadata (r:1 w:1) + /// Proof: Assets Metadata (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen) + /// The range of component `n` is `[0, 50]`. + /// The range of component `s` is `[0, 50]`. + fn force_set_metadata(_n: u32, s: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `190` + // Estimated: `3675` + // Minimum execution time: 14_660_000 picoseconds. + Weight::from_parts(15_718_387, 3675) + // Standard Error: 622 + .saturating_add(Weight::from_parts(2_640, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:0) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Metadata (r:1 w:1) + /// Proof: Assets Metadata (max_values: None, max_size: Some(140), added: 2615, mode: MaxEncodedLen) + fn force_clear_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `515` + // Estimated: `3675` + // Minimum execution time: 30_853_000 picoseconds. + Weight::from_parts(31_483_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn force_asset_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `351` + // Estimated: `3675` + // Minimum execution time: 13_632_000 picoseconds. + Weight::from_parts(14_077_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Approvals (r:1 w:1) + /// Proof: Assets Approvals (max_values: None, max_size: Some(148), added: 2623, mode: MaxEncodedLen) + fn approve_transfer() -> Weight { + // Proof Size summary in bytes: + // Measured: `385` + // Estimated: `3675` + // Minimum execution time: 33_780_000 picoseconds. + Weight::from_parts(34_533_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Approvals (r:1 w:1) + /// Proof: Assets Approvals (max_values: None, max_size: Some(148), added: 2623, mode: MaxEncodedLen) + /// Storage: Assets Account (r:2 w:2) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn transfer_approved() -> Weight { + // Proof Size summary in bytes: + // Measured: `668` + // Estimated: `6208` + // Minimum execution time: 67_712_000 picoseconds. + Weight::from_parts(69_946_000, 6208) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Approvals (r:1 w:1) + /// Proof: Assets Approvals (max_values: None, max_size: Some(148), added: 2623, mode: MaxEncodedLen) + fn cancel_approval() -> Weight { + // Proof Size summary in bytes: + // Measured: `555` + // Estimated: `3675` + // Minimum execution time: 36_668_000 picoseconds. + Weight::from_parts(37_637_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Approvals (r:1 w:1) + /// Proof: Assets Approvals (max_values: None, max_size: Some(148), added: 2623, mode: MaxEncodedLen) + fn force_cancel_approval() -> Weight { + // Proof Size summary in bytes: + // Measured: `555` + // Estimated: `3675` + // Minimum execution time: 36_685_000 picoseconds. + Weight::from_parts(37_950_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn set_min_balance() -> Weight { + // Proof Size summary in bytes: + // Measured: `351` + // Estimated: `3675` + // Minimum execution time: 14_466_000 picoseconds. + Weight::from_parts(14_924_000, 3675) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn touch() -> Weight { + // Proof Size summary in bytes: + // Measured: `453` + // Estimated: `3675` + // Minimum execution time: 34_874_000 picoseconds. + Weight::from_parts(36_330_000, 3675) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn touch_other() -> Weight { + // Proof Size summary in bytes: + // Measured: `351` + // Estimated: `3675` + // Minimum execution time: 33_278_000 picoseconds. + Weight::from_parts(34_104_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn refund() -> Weight { + // Proof Size summary in bytes: + // Measured: `579` + // Estimated: `3675` + // Minimum execution time: 32_898_000 picoseconds. + Weight::from_parts(33_489_000, 3675) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + /// Storage: Assets Asset (r:1 w:1) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + fn refund_other() -> Weight { + // Proof Size summary in bytes: + // Measured: `510` + // Estimated: `3675` + // Minimum execution time: 31_243_000 picoseconds. + Weight::from_parts(31_909_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Assets Asset (r:1 w:0) + /// Proof: Assets Asset (max_values: None, max_size: Some(210), added: 2685, mode: MaxEncodedLen) + /// Storage: Assets Account (r:1 w:1) + /// Proof: Assets Account (max_values: None, max_size: Some(134), added: 2609, mode: MaxEncodedLen) + fn block() -> Weight { + // Proof Size summary in bytes: + // Measured: `459` + // Estimated: `3675` + // Minimum execution time: 17_692_000 picoseconds. + Weight::from_parts(18_253_000, 3675) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index 5e2f6c805..012c55b91 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -52,81 +52,96 @@ use frame_support::{ /// Weight functions for pallet_balances (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_balances::weights::WeightInfo for WeightInfo { - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - fn transfer() -> Weight { + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn transfer_allow_death() -> Weight { // Proof Size summary in bytes: - // Measured: `1585` - // Estimated: `5214` - // Minimum execution time: 109_871 nanoseconds. - Weight::from_parts(111_051_000, 5214) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 58_474_000 picoseconds. + Weight::from_parts(59_117_000, 3593) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: - // Measured: `1409` - // Estimated: `2607` - // Minimum execution time: 60_490 nanoseconds. - Weight::from_parts(73_760_000, 2607) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 44_629_000 picoseconds. + Weight::from_parts(45_798_000, 3593) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - fn set_balance_creating() -> Weight { + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn force_set_balance_creating() -> Weight { // Proof Size summary in bytes: - // Measured: `1559` - // Estimated: `2607` - // Minimum execution time: 46_650 nanoseconds. - Weight::from_parts(57_640_000, 2607) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `174` + // Estimated: `3593` + // Minimum execution time: 16_483_000 picoseconds. + Weight::from_parts(16_939_000, 3593) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - fn set_balance_killing() -> Weight { + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn force_set_balance_killing() -> Weight { // Proof Size summary in bytes: - // Measured: `1559` - // Estimated: `2607` - // Minimum execution time: 63_361 nanoseconds. - Weight::from_parts(64_691_000, 2607) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `174` + // Estimated: `3593` + // Minimum execution time: 24_638_000 picoseconds. + Weight::from_parts(25_487_000, 3593) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: System Account (r:3 w:3) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1581` - // Estimated: `7821` - // Minimum execution time: 108_390 nanoseconds. - Weight::from_parts(109_831_000, 7821) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `103` + // Estimated: `6196` + // Minimum execution time: 60_041_000 picoseconds. + Weight::from_parts(63_365_000, 6196) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_all() -> Weight { // Proof Size summary in bytes: - // Measured: `1409` - // Estimated: `2607` - // Minimum execution time: 69_251 nanoseconds. - Weight::from_parts(85_261_000, 2607) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `0` + // Estimated: `3593` + // Minimum execution time: 54_445_000 picoseconds. + Weight::from_parts(55_623_000, 3593) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn force_unreserve() -> Weight { // Proof Size summary in bytes: - // Measured: `1443` - // Estimated: `2607` - // Minimum execution time: 49_440 nanoseconds. - Weight::from_parts(50_850_000, 2607) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `174` + // Estimated: `3593` + // Minimum execution time: 19_309_000 picoseconds. + Weight::from_parts(19_953_000, 3593) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `System::Account` (r:999 w:999) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `u` is `[1, 1000]`. + fn upgrade_accounts(u: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + u * (135 ±0)` + // Estimated: `990 + u * (2603 ±0)` + // Minimum execution time: 19_362_000 picoseconds. + Weight::from_parts(19_612_000, 990) + // Standard Error: 13_108 + .saturating_add(Weight::from_parts(16_444_591, 0).saturating_mul(u.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) + .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) } } diff --git a/runtime/common/src/weights/pallet_contracts.rs b/runtime/common/src/weights/pallet_contracts.rs index e8bb96b42..2671199f1 100644 --- a/runtime/common/src/weights/pallet_contracts.rs +++ b/runtime/common/src/weights/pallet_contracts.rs @@ -52,1902 +52,1891 @@ use frame_support::{ /// Weight functions for pallet_contracts (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_contracts::weights::WeightInfo for WeightInfo { - /// Storage: Contracts DeletionQueue (r:1 w:0) - /// Proof: Contracts DeletionQueue (max_values: Some(1), max_size: Some(16642), added: 17137, mode: Ignored) + /// Storage: `Contracts::DeletionQueueCounter` (r:1 w:0) + /// Proof: `Contracts::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) fn on_process_deletion_queue_batch() -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `0` - // Minimum execution time: 7_430 nanoseconds. - Weight::from_parts(7_771_000, 0).saturating_add(T::DbWeight::get().reads(1)) + // Measured: `142` + // Estimated: `1627` + // Minimum execution time: 2_548_000 picoseconds. + Weight::from_parts(2_670_000, 1627).saturating_add(T::DbWeight::get().reads(1_u64)) } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `k` is `[0, 1024]`. fn on_initialize_per_trie_key(k: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `414 + k * (69 ±0)` - // Estimated: `0` - // Minimum execution time: 19_010 nanoseconds. - Weight::from_parts(231_178, 0) - // Standard Error: 7_979 - .saturating_add(Weight::from_parts(2_022_917, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `451 + k * (69 ±0)` + // Estimated: `441 + k * (70 ±0)` + // Minimum execution time: 13_526_000 picoseconds. + Weight::from_parts(13_902_000, 441) + // Standard Error: 1_058 + .saturating_add(Weight::from_parts(1_274_724, 0).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) + .saturating_add(Weight::from_parts(0, 70).saturating_mul(k.into())) } - /// Storage: Contracts DeletionQueue (r:1 w:1) - /// Proof: Contracts DeletionQueue (max_values: Some(1), max_size: Some(16642), added: 17137, mode: Ignored) - /// The range of component `q` is `[0, 128]`. - fn on_initialize_per_queue_item(q: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `214 + q * (33 ±0)` - // Estimated: `0` - // Minimum execution time: 7_500 nanoseconds. - Weight::from_parts(27_206_849, 0) - // Standard Error: 16_209 - .saturating_add(Weight::from_parts(2_358_921, 0).saturating_mul(q.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: Contracts PristineCode (r:1 w:0) - /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Ignored) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// The range of component `c` is `[0, 61717]`. - fn reinstrument(c: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `203 + c * (1 ±0)` - // Estimated: `0` - // Minimum execution time: 60_631 nanoseconds. - Weight::from_parts(96_254_618, 0) - // Standard Error: 269 - .saturating_add(Weight::from_parts(112_614, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:2 w:1) + /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:2 w:1) + /// The range of component `c` is `[0, 125952]`. + fn v9_migration_step(c: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `211 + c * (1 ±0)` + // Estimated: `6149 + c * (1 ±0)` + // Minimum execution time: 8_426_000 picoseconds. + Weight::from_parts(8_591_621, 6149) + // Standard Error: 1 + .saturating_add(Weight::from_parts(1_203, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) + } + /// Storage: `Contracts::ContractInfoOf` (r:2 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + fn v10_migration_step() -> Weight { + // Proof Size summary in bytes: + // Measured: `510` + // Estimated: `6450` + // Minimum execution time: 17_008_000 picoseconds. + Weight::from_parts(17_742_000, 6450) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Contracts::DeletionQueue` (r:1 w:1025) + /// Proof: `Contracts::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) + /// Storage: `Contracts::DeletionQueueCounter` (r:0 w:1) + /// Proof: `Contracts::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// The range of component `k` is `[0, 1024]`. + fn v11_migration_step(k: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `171 + k * (1 ±0)` + // Estimated: `3635 + k * (1 ±0)` + // Minimum execution time: 3_949_000 picoseconds. + Weight::from_parts(4_062_000, 3635) + // Standard Error: 1_983 + .saturating_add(Weight::from_parts(1_173_197, 0).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(k.into())) + } + /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc553053f13fd319a03c211337c76e0fe776df` (r:2 w:0) + /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc553053f13fd319a03c211337c76e0fe776df` (r:2 w:0) + /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:1 w:1) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:0 w:1) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// The range of component `c` is `[0, 125952]`. + fn v12_migration_step(c: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `325 + c * (1 ±0)` + // Estimated: `6263 + c * (1 ±0)` + // Minimum execution time: 17_094_000 picoseconds. + Weight::from_parts(17_338_591, 6263) + // Standard Error: 1 + .saturating_add(Weight::from_parts(436, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) + } + /// Storage: `Contracts::ContractInfoOf` (r:2 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + fn v13_migration_step() -> Weight { + // Proof Size summary in bytes: + // Measured: `440` + // Estimated: `6380` + // Minimum execution time: 12_704_000 picoseconds. + Weight::from_parts(13_147_000, 6380) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Contracts::CodeInfoOf` (r:2 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:0) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + fn v14_migration_step() -> Weight { + // Proof Size summary in bytes: + // Measured: `360` + // Estimated: `6300` + // Minimum execution time: 48_387_000 picoseconds. + Weight::from_parts(50_024_000, 6300) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Contracts::ContractInfoOf` (r:2 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + fn v15_migration_step() -> Weight { + // Proof Size summary in bytes: + // Measured: `594` + // Estimated: `6534` + // Minimum execution time: 59_300_000 picoseconds. + Weight::from_parts(61_805_000, 6534) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:1) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + fn migration_noop() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `1627` + // Minimum execution time: 3_327_000 picoseconds. + Weight::from_parts(3_502_000, 1627) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:1) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:1) + fn migrate() -> Weight { + // Proof Size summary in bytes: + // Measured: `166` + // Estimated: `3631` + // Minimum execution time: 12_759_000 picoseconds. + Weight::from_parts(13_134_000, 3631) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) + fn on_runtime_upgrade_noop() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `3607` + // Minimum execution time: 4_775_000 picoseconds. + Weight::from_parts(5_084_000, 3607).saturating_add(T::DbWeight::get().reads(1_u64)) + } + /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + fn on_runtime_upgrade_in_progress() -> Weight { + // Proof Size summary in bytes: + // Measured: `167` + // Estimated: `3632` + // Minimum execution time: 6_663_000 picoseconds. + Weight::from_parts(6_855_000, 3632).saturating_add(T::DbWeight::get().reads(2_u64)) + } + /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) + /// Storage: `Contracts::MigrationInProgress` (r:1 w:1) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + fn on_runtime_upgrade() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `3607` + // Minimum execution time: 7_212_000 picoseconds. + Weight::from_parts(7_426_000, 3607) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[0, 125952]`. fn call_with_code_per_byte(c: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `675` - // Estimated: `0` - // Minimum execution time: 489_121 nanoseconds. - Weight::from_parts(665_502_356, 0) - // Standard Error: 129 - .saturating_add(Weight::from_parts(64_354, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: Contracts CodeStorage (r:1 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Contracts Nonce (r:1 w:1) - /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: System EventTopics (r:3 w:3) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// Storage: Contracts PristineCode (r:0 w:1) - /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Ignored) - /// Storage: Contracts OwnerInfoOf (r:0 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// The range of component `c` is `[0, 61717]`. + // Measured: `792` + // Estimated: `6743 + c * (1 ±0)` + // Minimum execution time: 289_557_000 picoseconds. + Weight::from_parts(272_895_652, 6743) + // Standard Error: 80 + .saturating_add(Weight::from_parts(39_917, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Balances::Holds` (r:2 w:2) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Storage: `System::EventTopics` (r:3 w:3) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Contracts::Nonce` (r:1 w:1) + /// Proof: `Contracts::Nonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:0 w:1) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// The range of component `c` is `[0, 125952]`. /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. fn instantiate_with_code(c: u32, i: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `157` - // Estimated: `0` - // Minimum execution time: 7_344_163 nanoseconds. - Weight::from_parts(1_338_150_199, 0) - // Standard Error: 519 - .saturating_add(Weight::from_parts(203_646, 0).saturating_mul(c.into())) - // Standard Error: 30 - .saturating_add(Weight::from_parts(2_832, 0).saturating_mul(i.into())) - // Standard Error: 30 - .saturating_add(Weight::from_parts(3_129, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(9)) - } - /// Storage: Contracts CodeStorage (r:1 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Contracts Nonce (r:1 w:1) - /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + // Measured: `323` + // Estimated: `8747` + // Minimum execution time: 4_671_359_000 picoseconds. + Weight::from_parts(586_523_882, 8747) + // Standard Error: 206 + .saturating_add(Weight::from_parts(115_402, 0).saturating_mul(c.into())) + // Standard Error: 24 + .saturating_add(Weight::from_parts(1_797, 0).saturating_mul(i.into())) + // Standard Error: 24 + .saturating_add(Weight::from_parts(2_046, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Contracts::Nonce` (r:1 w:1) + /// Proof: `Contracts::Nonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. fn instantiate(i: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `433` - // Estimated: `0` - // Minimum execution time: 2_937_909 nanoseconds. - Weight::from_parts(891_169_449, 0) - // Standard Error: 44 - .saturating_add(Weight::from_parts(2_010, 0).saturating_mul(i.into())) - // Standard Error: 44 - .saturating_add(Weight::from_parts(3_159, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(7)) - } - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + // Measured: `560` + // Estimated: `6504` + // Minimum execution time: 2_170_657_000 picoseconds. + Weight::from_parts(369_331_405, 6504) + // Standard Error: 7 + .saturating_add(Weight::from_parts(1_940, 0).saturating_mul(i.into())) + // Standard Error: 7 + .saturating_add(Weight::from_parts(1_858, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(10_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `727` - // Estimated: `0` - // Minimum execution time: 227_451 nanoseconds. - Weight::from_parts(280_790_000, 0) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: Contracts CodeStorage (r:1 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: System EventTopics (r:1 w:1) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// Storage: Contracts PristineCode (r:0 w:1) - /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Ignored) - /// Storage: Contracts OwnerInfoOf (r:0 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// The range of component `c` is `[0, 61717]`. + // Measured: `826` + // Estimated: `6766` + // Minimum execution time: 204_287_000 picoseconds. + Weight::from_parts(213_239_000, 6766) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Storage: `System::EventTopics` (r:1 w:1) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:0 w:1) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// The range of component `c` is `[0, 125952]`. fn upload_code(c: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `0` - // Minimum execution time: 471_521 nanoseconds. - Weight::from_parts(687_711_884, 0) - // Standard Error: 394 - .saturating_add(Weight::from_parts(200_341, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// Storage: System EventTopics (r:1 w:1) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// Storage: Contracts CodeStorage (r:0 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Contracts PristineCode (r:0 w:1) - /// Proof: Contracts PristineCode (max_values: None, max_size: Some(125988), added: 128463, mode: Ignored) + // Measured: `142` + // Estimated: `3607` + // Minimum execution time: 285_434_000 picoseconds. + Weight::from_parts(242_697_648, 3607) + // Standard Error: 128 + .saturating_add(Weight::from_parts(76_087, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Storage: `System::EventTopics` (r:1 w:1) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:0 w:1) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `0` - // Minimum execution time: 36_600 nanoseconds. - Weight::from_parts(44_600_000, 0) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts OwnerInfoOf (r:2 w:2) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// Storage: System EventTopics (r:3 w:3) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + // Measured: `315` + // Estimated: `3780` + // Minimum execution time: 46_486_000 picoseconds. + Weight::from_parts(48_422_000, 3780) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:2 w:2) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `System::EventTopics` (r:3 w:3) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_code() -> Weight { // Proof Size summary in bytes: - // Measured: `567` - // Estimated: `0` - // Minimum execution time: 48_240 nanoseconds. - Weight::from_parts(58_330_000, 0) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(6)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `552` + // Estimated: `8967` + // Minimum execution time: 37_568_000 picoseconds. + Weight::from_parts(38_589_000, 8967) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(6_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_caller(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `697 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 431_852 nanoseconds. - Weight::from_parts(517_954_911, 0) - // Standard Error: 272_523 - .saturating_add(Weight::from_parts(41_775_023, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1601 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `866 + r * (6 ±0)` + // Estimated: `6806 + r * (6 ±0)` + // Minimum execution time: 274_513_000 picoseconds. + Weight::from_parts(288_793_403, 6806) + // Standard Error: 650 + .saturating_add(Weight::from_parts(339_309, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1601 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_is_contract(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `749 + r * (19218 ±0)` - // Estimated: `0` - // Minimum execution time: 370_081 nanoseconds. - Weight::from_parts(208_937_394, 0) - // Standard Error: 1_926_054 - .saturating_add(Weight::from_parts(539_165_423, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1601 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `922 + r * (209 ±0)` + // Estimated: `6826 + r * (2684 ±0)` + // Minimum execution time: 260_096_000 picoseconds. + Weight::from_parts(149_954_322, 6826) + // Standard Error: 5_713 + .saturating_add(Weight::from_parts(3_788_924, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1601 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_code_hash(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `741 + r * (19539 ±0)` - // Estimated: `0` - // Minimum execution time: 373_452 nanoseconds. - Weight::from_parts(227_921_076, 0) - // Standard Error: 1_913_473 - .saturating_add(Weight::from_parts(631_118_111, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `921 + r * (213 ±0)` + // Estimated: `6830 + r * (2688 ±0)` + // Minimum execution time: 277_496_000 picoseconds. + Weight::from_parts(285_839_000, 6830) + // Standard Error: 10_076 + .saturating_add(Weight::from_parts(4_720_110, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 2688).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_own_code_hash(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `704 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 379_931 nanoseconds. - Weight::from_parts(528_666_677, 0) - // Standard Error: 374_987 - .saturating_add(Weight::from_parts(50_992_877, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `873 + r * (6 ±0)` + // Estimated: `6815 + r * (6 ±0)` + // Minimum execution time: 275_655_000 picoseconds. + Weight::from_parts(291_386_528, 6815) + // Standard Error: 898 + .saturating_add(Weight::from_parts(428_765, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_caller_is_origin(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `694 + r * (240 ±0)` - // Estimated: `0` - // Minimum execution time: 373_091 nanoseconds. - Weight::from_parts(502_021_184, 0) - // Standard Error: 406_594 - .saturating_add(Weight::from_parts(27_810_692, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `863 + r * (3 ±0)` + // Estimated: `6804 + r * (3 ±0)` + // Minimum execution time: 260_323_000 picoseconds. + Weight::from_parts(286_371_403, 6804) + // Standard Error: 451 + .saturating_add(Weight::from_parts(183_053, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. + fn seal_caller_is_root(r: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `753 + r * (3 ±0)` + // Estimated: `6693 + r * (3 ±0)` + // Minimum execution time: 262_974_000 picoseconds. + Weight::from_parts(276_571_502, 6693) + // Standard Error: 527 + .saturating_add(Weight::from_parts(165_364, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_address(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `698 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 383_501 nanoseconds. - Weight::from_parts(541_475_815, 0) - // Standard Error: 379_203 - .saturating_add(Weight::from_parts(39_598_712, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `867 + r * (6 ±0)` + // Estimated: `6807 + r * (6 ±0)` + // Minimum execution time: 272_826_000 picoseconds. + Weight::from_parts(290_963_001, 6807) + // Standard Error: 810 + .saturating_add(Weight::from_parts(343_762, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_gas_left(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `699 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 387_450 nanoseconds. - Weight::from_parts(529_951_635, 0) - // Standard Error: 392_749 - .saturating_add(Weight::from_parts(40_284_485, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:2 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `863 + r * (6 ±0)` + // Estimated: `6806 + r * (6 ±0)` + // Minimum execution time: 277_324_000 picoseconds. + Weight::from_parts(290_872_814, 6806) + // Standard Error: 766 + .saturating_add(Weight::from_parts(371_542, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:2 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_balance(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `873 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 412_591 nanoseconds. - Weight::from_parts(571_653_506, 0) - // Standard Error: 470_423 - .saturating_add(Weight::from_parts(179_738_554, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `1007 + r * (6 ±0)` + // Estimated: `6931 + r * (6 ±0)` + // Minimum execution time: 274_460_000 picoseconds. + Weight::from_parts(285_748_025, 6931) + // Standard Error: 1_570 + .saturating_add(Weight::from_parts(1_656_237, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_value_transferred(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `708 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 395_131 nanoseconds. - Weight::from_parts(527_037_547, 0) - // Standard Error: 354_055 - .saturating_add(Weight::from_parts(40_615_465, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `877 + r * (6 ±0)` + // Estimated: `6823 + r * (6 ±0)` + // Minimum execution time: 278_254_000 picoseconds. + Weight::from_parts(283_893_525, 6823) + // Standard Error: 726 + .saturating_add(Weight::from_parts(347_368, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_minimum_balance(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `706 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 380_230 nanoseconds. - Weight::from_parts(531_816_816, 0) - // Standard Error: 333_964 - .saturating_add(Weight::from_parts(37_754_742, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `875 + r * (6 ±0)` + // Estimated: `6816 + r * (6 ±0)` + // Minimum execution time: 279_646_000 picoseconds. + Weight::from_parts(292_505_446, 6816) + // Standard Error: 867 + .saturating_add(Weight::from_parts(337_202, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_block_number(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `703 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 390_151 nanoseconds. - Weight::from_parts(577_277_614, 0) - // Standard Error: 503_035 - .saturating_add(Weight::from_parts(36_413_279, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `872 + r * (6 ±0)` + // Estimated: `6819 + r * (6 ±0)` + // Minimum execution time: 274_522_000 picoseconds. + Weight::from_parts(295_135_659, 6819) + // Standard Error: 1_052 + .saturating_add(Weight::from_parts(330_788, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_now(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `694 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 376_551 nanoseconds. - Weight::from_parts(535_008_554, 0) - // Standard Error: 353_325 - .saturating_add(Weight::from_parts(38_594_722, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) - /// Proof: TransactionPayment NextFeeMultiplier (max_values: Some(1), max_size: Some(16), added: 511, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `863 + r * (6 ±0)` + // Estimated: `6804 + r * (6 ±0)` + // Minimum execution time: 274_228_000 picoseconds. + Weight::from_parts(289_201_593, 6804) + // Standard Error: 752 + .saturating_add(Weight::from_parts(337_860, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) + /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_weight_to_fee(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `809 + r * (800 ±0)` - // Estimated: `0` - // Minimum execution time: 397_911 nanoseconds. - Weight::from_parts(528_491_853, 0) - // Standard Error: 429_636 - .saturating_add(Weight::from_parts(134_755_404, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. - fn seal_gas(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `661 + r * (320 ±0)` - // Estimated: `0` - // Minimum execution time: 214_380 nanoseconds. - Weight::from_parts(260_658_643, 0) - // Standard Error: 160_864 - .saturating_add(Weight::from_parts(18_814_649, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `937 + r * (14 ±0)` + // Estimated: `6872 + r * (14 ±0)` + // Minimum execution time: 277_142_000 picoseconds. + Weight::from_parts(296_736_114, 6872) + // Standard Error: 1_502 + .saturating_add(Weight::from_parts(1_446_663, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 14).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_input(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `696 + r * (480 ±0)` - // Estimated: `0` - // Minimum execution time: 403_660 nanoseconds. - Weight::from_parts(545_823_848, 0) - // Standard Error: 357_639 - .saturating_add(Weight::from_parts(32_529_346, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 1024]`. - fn seal_input_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `1176` - // Estimated: `0` - // Minimum execution time: 486_961 nanoseconds. - Weight::from_parts(420_704_430, 0) - // Standard Error: 126_136 - .saturating_add(Weight::from_parts(18_130_065, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + // Measured: `865 + r * (6 ±0)` + // Estimated: `6807 + r * (6 ±0)` + // Minimum execution time: 276_087_000 picoseconds. + Weight::from_parts(287_863_377, 6807) + // Standard Error: 495 + .saturating_add(Weight::from_parts(282_718, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 1048576]`. + fn seal_input_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `869` + // Estimated: `6809` + // Minimum execution time: 277_128_000 picoseconds. + Weight::from_parts(234_478_674, 6809) + // Standard Error: 23 + .saturating_add(Weight::from_parts(1_052, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `r` is `[0, 1]`. fn seal_return(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `684 + r * (8 ±0)` - // Estimated: `0` - // Minimum execution time: 367_101 nanoseconds. - Weight::from_parts(508_054_206, 0) - // Standard Error: 9_076_081 - .saturating_add(Weight::from_parts(100_993, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 1024]`. - fn seal_return_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `694` - // Estimated: `0` - // Minimum execution time: 417_570 nanoseconds. - Weight::from_parts(486_804_833, 0) - // Standard Error: 8_373 - .saturating_add(Weight::from_parts(411_815, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:3 w:3) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts DeletionQueue (r:1 w:1) - /// Proof: Contracts DeletionQueue (max_values: Some(1), max_size: Some(16642), added: 17137, mode: Ignored) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// Storage: System EventTopics (r:3 w:3) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + // Measured: `853 + r * (45 ±0)` + // Estimated: `6793 + r * (45 ±0)` + // Minimum execution time: 251_983_000 picoseconds. + Weight::from_parts(277_986_885, 6793) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 45).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 1048576]`. + fn seal_return_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `863` + // Estimated: `6810` + // Minimum execution time: 275_108_000 picoseconds. + Weight::from_parts(284_552_708, 6810) + // Standard Error: 0 + .saturating_add(Weight::from_parts(391, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:2 w:2) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `Contracts::DeletionQueueCounter` (r:1 w:1) + /// Proof: `Contracts::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:4 w:4) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Storage: `Contracts::DeletionQueue` (r:0 w:1) + /// Proof: `Contracts::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) /// The range of component `r` is `[0, 1]`. fn seal_terminate(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `726 + r * (285 ±0)` - // Estimated: `0` - // Minimum execution time: 370_770 nanoseconds. - Weight::from_parts(515_893_028, 0) - // Standard Error: 9_505_249 - .saturating_add(Weight::from_parts(191_277_471, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((5_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((6_u64).saturating_mul(r.into()))) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) - /// Proof: RandomnessCollectiveFlip RandomMaterial (max_values: Some(1), max_size: Some(2594), added: 3089, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `2972 + r * (316 ±0)` + // Estimated: `8912 + r * (5266 ±0)` + // Minimum execution time: 281_278_000 picoseconds. + Weight::from_parts(306_800_667, 8912) + // Standard Error: 855_257 + .saturating_add(Weight::from_parts(126_508_132, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 5266).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0) + /// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_random(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `775 + r * (800 ±0)` - // Estimated: `0` - // Minimum execution time: 389_531 nanoseconds. - Weight::from_parts(506_659_987, 0) - // Standard Error: 438_015 - .saturating_add(Weight::from_parts(222_549_692, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `944 + r * (10 ±0)` + // Estimated: `6885 + r * (10 ±0)` + // Minimum execution time: 260_609_000 picoseconds. + Weight::from_parts(287_385_076, 6885) + // Standard Error: 2_754 + .saturating_add(Weight::from_parts(2_057_388, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_deposit_event(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `694 + r * (800 ±0)` - // Estimated: `0` - // Minimum execution time: 419_771 nanoseconds. - Weight::from_parts(556_814_111, 0) - // Standard Error: 666_560 - .saturating_add(Weight::from_parts(423_936_920, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:322 w:322) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + // Measured: `863 + r * (10 ±0)` + // Estimated: `6805 + r * (10 ±0)` + // Minimum execution time: 254_770_000 picoseconds. + Weight::from_parts(255_105_647, 6805) + // Standard Error: 5_707 + .saturating_add(Weight::from_parts(3_808_788, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:6 w:6) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `t` is `[0, 4]`. - /// The range of component `n` is `[0, 16]`. - fn seal_deposit_event_per_topic_and_kb(t: u32, n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `1630 + t * (2608 ±0) + n * (8 ±0)` - // Estimated: `0` - // Minimum execution time: 1_916_644 nanoseconds. - Weight::from_parts(876_255_548, 0) - // Standard Error: 2_998_126 - .saturating_add(Weight::from_parts(365_874_853, 0).saturating_mul(t.into())) - // Standard Error: 823_430 - .saturating_add(Weight::from_parts(120_543_255, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(t.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(t.into()))) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + /// The range of component `n` is `[0, 16384]`. + fn seal_deposit_event_per_topic_and_byte(t: u32, n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `880 + t * (32 ±0)` + // Estimated: `6825 + t * (2508 ±0)` + // Minimum execution time: 278_200_000 picoseconds. + Weight::from_parts(288_081_493, 6825) + // Standard Error: 97_535 + .saturating_add(Weight::from_parts(3_683_455, 0).saturating_mul(t.into())) + // Standard Error: 27 + .saturating_add(Weight::from_parts(731, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) + .saturating_add(Weight::from_parts(0, 2508).saturating_mul(t.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_debug_message(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `693 + r * (800 ±0)` - // Estimated: `0` - // Minimum execution time: 211_061 nanoseconds. - Weight::from_parts(291_579_010, 0) - // Standard Error: 162_749 - .saturating_add(Weight::from_parts(27_900_831, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 10]`. + // Measured: `862 + r * (7 ±0)` + // Estimated: `6807 + r * (7 ±0)` + // Minimum execution time: 167_181_000 picoseconds. + Weight::from_parts(178_433_475, 6807) + // Standard Error: 374 + .saturating_add(Weight::from_parts(241_240, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 7).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `MaxEncodedLen`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `i` is `[0, 1048576]`. + fn seal_debug_message_per_byte(i: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `125813` + // Estimated: `131755` + // Minimum execution time: 434_456_000 picoseconds. + Weight::from_parts(400_940_450, 131755) + // Standard Error: 13 + .saturating_add(Weight::from_parts(1_102, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 800]`. fn seal_set_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `720 + r * (23420 ±0)` - // Estimated: `0` - // Minimum execution time: 374_560 nanoseconds. - Weight::from_parts(334_860_847, 0) - // Standard Error: 3_068_197 - .saturating_add(Weight::from_parts(978_042_416, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 8]`. - fn seal_set_storage_per_new_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `12402 + n * (12006 ±0)` - // Estimated: `0` - // Minimum execution time: 683_562 nanoseconds. - Weight::from_parts(1_224_575_174, 0) - // Standard Error: 3_929_725 - .saturating_add(Weight::from_parts(196_261_071, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(52)) - .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(50)) - .saturating_add(T::DbWeight::get().writes((7_u64).saturating_mul(n.into()))) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 8]`. - fn seal_set_storage_per_old_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `14990 + n * (175775 ±0)` - // Estimated: `0` - // Minimum execution time: 597_481 nanoseconds. - Weight::from_parts(1_153_785_439, 0) - // Standard Error: 3_312_108 - .saturating_add(Weight::from_parts(128_606_117, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(51)) - .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(49)) - .saturating_add(T::DbWeight::get().writes((7_u64).saturating_mul(n.into()))) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 10]`. + // Measured: `924 + r * (292 ±0)` + // Estimated: `925 + r * (293 ±0)` + // Minimum execution time: 277_825_000 picoseconds. + Weight::from_parts(159_688_263, 925) + // Standard Error: 13_610 + .saturating_add(Weight::from_parts(7_145_641, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 293).saturating_mul(r.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 16384]`. + fn seal_set_storage_per_new_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1446` + // Estimated: `1429` + // Minimum execution time: 284_745_000 picoseconds. + Weight::from_parts(345_928_316, 1429) + // Standard Error: 70 + .saturating_add(Weight::from_parts(547, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(12_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 16384]`. + fn seal_set_storage_per_old_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1252 + n * (1 ±0)` + // Estimated: `1252 + n * (1 ±0)` + // Minimum execution time: 275_328_000 picoseconds. + Weight::from_parts(300_037_010, 1252) + // Standard Error: 32 + .saturating_add(Weight::from_parts(558, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 800]`. fn seal_clear_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `720 + r * (23100 ±0)` - // Estimated: `0` - // Minimum execution time: 441_841 nanoseconds. - Weight::from_parts(479_192_193, 0) - // Standard Error: 2_871_558 - .saturating_add(Weight::from_parts(916_912_022, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 8]`. - fn seal_clear_storage_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `14670 + n * (175775 ±0)` - // Estimated: `0` - // Minimum execution time: 625_381 nanoseconds. - Weight::from_parts(1_137_973_256, 0) - // Standard Error: 3_381_124 - .saturating_add(Weight::from_parts(130_713_708, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(51)) - .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(48)) - .saturating_add(T::DbWeight::get().writes((7_u64).saturating_mul(n.into()))) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 10]`. + // Measured: `920 + r * (288 ±0)` + // Estimated: `926 + r * (289 ±0)` + // Minimum execution time: 273_742_000 picoseconds. + Weight::from_parts(169_430_806, 926) + // Standard Error: 11_821 + .saturating_add(Weight::from_parts(6_927_074, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 289).saturating_mul(r.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 16384]`. + fn seal_clear_storage_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1248 + n * (1 ±0)` + // Estimated: `1248 + n * (1 ±0)` + // Minimum execution time: 275_167_000 picoseconds. + Weight::from_parts(301_883_655, 1248) + // Standard Error: 35 + .saturating_add(Weight::from_parts(4, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 800]`. fn seal_get_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `730 + r * (23740 ±0)` - // Estimated: `0` - // Minimum execution time: 392_901 nanoseconds. - Weight::from_parts(479_938_978, 0) - // Standard Error: 1_934_626 - .saturating_add(Weight::from_parts(754_683_224, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 8]`. - fn seal_get_storage_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `15321 + n * (175775 ±0)` - // Estimated: `0` - // Minimum execution time: 509_251 nanoseconds. - Weight::from_parts(1_059_139_703, 0) - // Standard Error: 3_539_218 - .saturating_add(Weight::from_parts(303_187_136, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(51)) - .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 10]`. + // Measured: `920 + r * (296 ±0)` + // Estimated: `922 + r * (297 ±0)` + // Minimum execution time: 274_628_000 picoseconds. + Weight::from_parts(195_255_092, 922) + // Standard Error: 9_109 + .saturating_add(Weight::from_parts(5_707_060, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 297).saturating_mul(r.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 16384]`. + fn seal_get_storage_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1264 + n * (1 ±0)` + // Estimated: `1264 + n * (1 ±0)` + // Minimum execution time: 274_202_000 picoseconds. + Weight::from_parts(296_440_752, 1264) + // Standard Error: 38 + .saturating_add(Weight::from_parts(1_010, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 800]`. fn seal_contains_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `723 + r * (23100 ±0)` - // Estimated: `0` - // Minimum execution time: 458_631 nanoseconds. - Weight::from_parts(506_503_466, 0) - // Standard Error: 1_926_675 - .saturating_add(Weight::from_parts(728_611_813, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 8]`. - fn seal_contains_storage_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `14673 + n * (175775 ±0)` - // Estimated: `0` - // Minimum execution time: 525_181 nanoseconds. - Weight::from_parts(1_030_715_942, 0) - // Standard Error: 3_301_932 - .saturating_add(Weight::from_parts(122_011_584, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(51)) - .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 10]`. + // Measured: `931 + r * (288 ±0)` + // Estimated: `928 + r * (289 ±0)` + // Minimum execution time: 274_123_000 picoseconds. + Weight::from_parts(193_280_535, 928) + // Standard Error: 9_264 + .saturating_add(Weight::from_parts(5_548_039, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 289).saturating_mul(r.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 16384]`. + fn seal_contains_storage_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1251 + n * (1 ±0)` + // Estimated: `1251 + n * (1 ±0)` + // Minimum execution time: 276_425_000 picoseconds. + Weight::from_parts(300_521_806, 1251) + // Standard Error: 36 + .saturating_add(Weight::from_parts(83, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 800]`. fn seal_take_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `731 + r * (23740 ±0)` - // Estimated: `0` - // Minimum execution time: 414_821 nanoseconds. - Weight::from_parts(357_950_744, 0) - // Standard Error: 3_475_365 - .saturating_add(Weight::from_parts(981_471_555, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) - } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 8]`. - fn seal_take_storage_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `15322 + n * (175775 ±0)` - // Estimated: `0` - // Minimum execution time: 638_781 nanoseconds. - Weight::from_parts(1_188_783_395, 0) - // Standard Error: 3_951_294 - .saturating_add(Weight::from_parts(314_100_376, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(51)) - .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes(48)) - .saturating_add(T::DbWeight::get().writes((7_u64).saturating_mul(n.into()))) - } - /// Storage: System Account (r:1602 w:1601) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `913 + r * (296 ±0)` + // Estimated: `918 + r * (297 ±0)` + // Minimum execution time: 264_860_000 picoseconds. + Weight::from_parts(191_561_777, 918) + // Standard Error: 10_678 + .saturating_add(Weight::from_parts(6_895_457, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 297).saturating_mul(r.into())) + } + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 16384]`. + fn seal_take_storage_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1265 + n * (1 ±0)` + // Estimated: `1265 + n * (1 ±0)` + // Minimum execution time: 282_501_000 picoseconds. + Weight::from_parts(303_351_919, 1265) + // Standard Error: 37 + .saturating_add(Weight::from_parts(643, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1602 w:1601) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_transfer(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1322 + r * (3601 ±0)` - // Estimated: `0` - // Minimum execution time: 389_761 nanoseconds. - Weight::from_parts(387_985_694, 0) - // Standard Error: 2_529_933 - .saturating_add(Weight::from_parts(2_615_792_463, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().reads((80_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(T::DbWeight::get().writes((80_u64).saturating_mul(r.into()))) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1601 w:1601) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:2 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:1602 w:1602) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `1415 + r * (45 ±0)` + // Estimated: `7307 + r * (2520 ±0)` + // Minimum execution time: 273_198_000 picoseconds. + Weight::from_parts(179_673_238, 7307) + // Standard Error: 34_990 + .saturating_add(Weight::from_parts(38_468_091, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2520).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:801 w:801) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:2 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:2 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:803 w:803) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 800]`. fn seal_call(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `948 + r * (20495 ±0)` - // Estimated: `0` - // Minimum execution time: 435_761 nanoseconds. - Weight::from_parts(68_471_501, 0) - // Standard Error: 94_851_428 - .saturating_add(Weight::from_parts(38_479_425_365, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().reads((160_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((160_u64).saturating_mul(r.into()))) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1536 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:1537 w:1537) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `1260 + r * (245 ±0)` + // Estimated: `9440 + r * (2721 ±0)` + // Minimum execution time: 283_869_000 picoseconds. + Weight::from_parts(288_374_000, 9440) + // Standard Error: 137_512 + .saturating_add(Weight::from_parts(248_206_665, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2721).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:736 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:736 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:737 w:737) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 800]`. fn seal_delegate_call(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + r * (71670 ±0)` - // Estimated: `0` - // Minimum execution time: 382_431 nanoseconds. - Weight::from_parts(477_811_000, 0) - // Standard Error: 42_244_071 - .saturating_add(Weight::from_parts(36_082_816_111, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((150_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((75_u64).saturating_mul(r.into()))) - } - /// Storage: System Account (r:82 w:81) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:81 w:81) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:2 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:82 w:82) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + // Measured: `0 + r * (576 ±0)` + // Estimated: `6812 + r * (2637 ±3)` + // Minimum execution time: 257_577_000 picoseconds. + Weight::from_parts(277_310_000, 6812) + // Standard Error: 150_204 + .saturating_add(Weight::from_parts(249_943_483, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2637).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:3 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:2 w:2) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:2 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:2 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:4 w:4) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `t` is `[0, 1]`. - /// The range of component `c` is `[0, 1024]`. - fn seal_call_per_transfer_clone_kb(t: u32, c: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `21128 + t * (15897 ±0)` - // Estimated: `0` - // Minimum execution time: 18_273_642 nanoseconds. - Weight::from_parts(17_523_937_499, 0) - // Standard Error: 89_878_407 - .saturating_add(Weight::from_parts(2_045_724_783, 0).saturating_mul(t.into())) - // Standard Error: 134_767 - .saturating_add(Weight::from_parts(18_073_327, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(167)) - .saturating_add(T::DbWeight::get().reads((81_u64).saturating_mul(t.into()))) - .saturating_add(T::DbWeight::get().writes(163)) - .saturating_add(T::DbWeight::get().writes((81_u64).saturating_mul(t.into()))) - } - /// Storage: System Account (r:1602 w:1602) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1601 w:1601) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1601 w:1600) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts Nonce (r:1 w:1) - /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts OwnerInfoOf (r:1600 w:1600) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// Storage: System EventTopics (r:1602 w:1602) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + /// The range of component `c` is `[0, 1048576]`. + fn seal_call_per_transfer_clone_byte(t: u32, c: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1307 + t * (277 ±0)` + // Estimated: `12197 + t * (5227 ±0)` + // Minimum execution time: 471_081_000 picoseconds. + Weight::from_parts(79_081_122, 12197) + // Standard Error: 11_777_790 + .saturating_add(Weight::from_parts(357_425_411, 0).saturating_mul(t.into())) + // Standard Error: 17 + .saturating_add(Weight::from_parts(1_111, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(13_u64)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(t.into()))) + .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(t.into()))) + .saturating_add(Weight::from_parts(0, 5227).saturating_mul(t.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:802 w:802) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:801 w:801) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:801 w:800) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:801 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `Contracts::Nonce` (r:1 w:1) + /// Proof: `Contracts::Nonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:803 w:803) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:800 w:800) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// The range of component `r` is `[1, 800]`. fn seal_instantiate(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1512 + r * (25573 ±0)` - // Estimated: `0` - // Minimum execution time: 376_711 nanoseconds. - Weight::from_parts(455_542_000, 0) - // Standard Error: 114_095_743 - .saturating_add(Weight::from_parts(50_953_615_612, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().reads((400_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(5)) - .saturating_add(T::DbWeight::get().writes((400_u64).saturating_mul(r.into()))) - } - /// Storage: System Account (r:82 w:82) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:81 w:81) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:2 w:1) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts Nonce (r:1 w:1) - /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts OwnerInfoOf (r:1 w:1) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// Storage: System EventTopics (r:82 w:82) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) + // Measured: `1278 + r * (255 ±0)` + // Estimated: `9620 + r * (2731 ±0)` + // Minimum execution time: 672_742_000 picoseconds. + Weight::from_parts(680_025_000, 9620) + // Standard Error: 313_642 + .saturating_add(Weight::from_parts(388_311_259, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(7_u64)) + .saturating_add(T::DbWeight::get().writes((5_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2731).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:2 w:2) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:2 w:1) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:2 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `Contracts::Nonce` (r:1 w:1) + /// Proof: `Contracts::Nonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:4 w:4) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) /// The range of component `t` is `[0, 1]`. - /// The range of component `i` is `[0, 960]`. - /// The range of component `s` is `[0, 960]`. - fn seal_instantiate_per_transfer_input_salt_kb(t: u32, i: u32, s: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `5505 + t * (68 ±0)` - // Estimated: `0` - // Minimum execution time: 210_322_618 nanoseconds. - Weight::from_parts(31_023_451_273, 0) - // Standard Error: 648_986 - .saturating_add(Weight::from_parts(213_692_481, 0).saturating_mul(i.into())) - // Standard Error: 648_986 - .saturating_add(Weight::from_parts(217_643_843, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(249)) + /// The range of component `i` is `[0, 983040]`. + /// The range of component `s` is `[0, 983040]`. + fn seal_instantiate_per_transfer_input_salt_byte(t: u32, i: u32, s: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1303 + t * (104 ±0)` + // Estimated: `12211 + t * (2549 ±1)` + // Minimum execution time: 2_733_870_000 picoseconds. + Weight::from_parts(1_001_793_458, 12211) + // Standard Error: 12 + .saturating_add(Weight::from_parts(1_963, 0).saturating_mul(i.into())) + // Standard Error: 12 + .saturating_add(Weight::from_parts(2_060, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(16_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) - .saturating_add(T::DbWeight::get().writes(247)) + .saturating_add(T::DbWeight::get().writes(11_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 1]`. + .saturating_add(Weight::from_parts(0, 2549).saturating_mul(t.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_hash_sha2_256(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `691 + r * (642 ±0)` - // Estimated: `0` - // Minimum execution time: 370_871 nanoseconds. - Weight::from_parts(517_046_881, 0) - // Standard Error: 9_392_544 - .saturating_add(Weight::from_parts(1_484_618, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 1024]`. - fn seal_hash_sha2_256_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `1493` - // Estimated: `0` - // Minimum execution time: 435_121 nanoseconds. - Weight::from_parts(502_631_000, 0) - // Standard Error: 81_123 - .saturating_add(Weight::from_parts(94_181_133, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 1]`. + // Measured: `862 + r * (8 ±0)` + // Estimated: `6801 + r * (8 ±0)` + // Minimum execution time: 272_658_000 picoseconds. + Weight::from_parts(282_717_645, 6801) + // Standard Error: 517 + .saturating_add(Weight::from_parts(400_604, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 1048576]`. + fn seal_hash_sha2_256_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `870` + // Estimated: `6808` + // Minimum execution time: 260_969_000 picoseconds. + Weight::from_parts(265_206_847, 6808) + // Standard Error: 2 + .saturating_add(Weight::from_parts(1_134, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_hash_keccak_256(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `693 + r * (642 ±0)` - // Estimated: `0` - // Minimum execution time: 372_401 nanoseconds. - Weight::from_parts(558_599_716, 0) - // Standard Error: 10_105_961 - .saturating_add(Weight::from_parts(103_731_083, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 1024]`. - fn seal_hash_keccak_256_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `1495` - // Estimated: `0` - // Minimum execution time: 537_732 nanoseconds. - Weight::from_parts(579_512_000, 0) - // Standard Error: 208_304 - .saturating_add(Weight::from_parts(369_317_236, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 1]`. + // Measured: `864 + r * (8 ±0)` + // Estimated: `6806 + r * (8 ±0)` + // Minimum execution time: 262_351_000 picoseconds. + Weight::from_parts(286_974_296, 6806) + // Standard Error: 514 + .saturating_add(Weight::from_parts(802_363, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 1048576]`. + fn seal_hash_keccak_256_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `872` + // Estimated: `6814` + // Minimum execution time: 276_907_000 picoseconds. + Weight::from_parts(277_928_418, 6814) + // Standard Error: 1 + .saturating_add(Weight::from_parts(3_410, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_hash_blake2_256(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `693 + r * (642 ±0)` - // Estimated: `0` - // Minimum execution time: 368_311 nanoseconds. - Weight::from_parts(507_392_248, 0) - // Standard Error: 8_916_313 - .saturating_add(Weight::from_parts(108_580_551, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 1024]`. - fn seal_hash_blake2_256_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `1495` - // Estimated: `0` - // Minimum execution time: 522_392 nanoseconds. - Weight::from_parts(567_922_000, 0) - // Standard Error: 111_886 - .saturating_add(Weight::from_parts(163_798_185, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 1]`. + // Measured: `864 + r * (8 ±0)` + // Estimated: `6808 + r * (8 ±0)` + // Minimum execution time: 263_660_000 picoseconds. + Weight::from_parts(285_665_916, 6808) + // Standard Error: 527 + .saturating_add(Weight::from_parts(480_457, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 1048576]`. + fn seal_hash_blake2_256_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `872` + // Estimated: `6813` + // Minimum execution time: 262_071_000 picoseconds. + Weight::from_parts(270_115_341, 6813) + // Standard Error: 1 + .saturating_add(Weight::from_parts(1_254, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_hash_blake2_128(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `693 + r * (642 ±0)` - // Estimated: `0` - // Minimum execution time: 366_951 nanoseconds. - Weight::from_parts(500_280_304, 0) - // Standard Error: 9_646_663 - .saturating_add(Weight::from_parts(51_759_095, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `n` is `[0, 1024]`. - fn seal_hash_blake2_128_per_kb(n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `1495` - // Estimated: `0` - // Minimum execution time: 540_452 nanoseconds. - Weight::from_parts(603_082_000, 0) - // Standard Error: 162_534 - .saturating_add(Weight::from_parts(166_126_166, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 1]`. + // Measured: `864 + r * (8 ±0)` + // Estimated: `6805 + r * (8 ±0)` + // Minimum execution time: 265_568_000 picoseconds. + Weight::from_parts(285_791_811, 6805) + // Standard Error: 559 + .saturating_add(Weight::from_parts(505_330, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 1048576]`. + fn seal_hash_blake2_128_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `872` + // Estimated: `6811` + // Minimum execution time: 271_336_000 picoseconds. + Weight::from_parts(272_829_313, 6811) + // Standard Error: 0 + .saturating_add(Weight::from_parts(1_252, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `n` is `[0, 125697]`. + fn seal_sr25519_verify_per_byte(n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `997 + n * (1 ±0)` + // Estimated: `6934 + n * (1 ±0)` + // Minimum execution time: 351_146_000 picoseconds. + Weight::from_parts(355_368_323, 6934) + // Standard Error: 14 + .saturating_add(Weight::from_parts(6_155, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 160]`. + fn seal_sr25519_verify(r: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `807 + r * (112 ±0)` + // Estimated: `6748 + r * (112 ±0)` + // Minimum execution time: 277_250_000 picoseconds. + Weight::from_parts(346_490_114, 6748) + // Standard Error: 14_654 + .saturating_add(Weight::from_parts(56_127_492, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 112).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 160]`. fn seal_ecdsa_recover(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `737 + r * (6083 ±0)` - // Estimated: `0` - // Minimum execution time: 372_331 nanoseconds. - Weight::from_parts(500_234_279, 0) - // Standard Error: 9_708_530 - .saturating_add(Weight::from_parts(6_049_554_620, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 1]`. + // Measured: `907 + r * (76 ±0)` + // Estimated: `6801 + r * (77 ±0)` + // Minimum execution time: 272_697_000 picoseconds. + Weight::from_parts(345_385_667, 6801) + // Standard Error: 14_226 + .saturating_add(Weight::from_parts(46_037_637, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 77).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 160]`. fn seal_ecdsa_to_eth_address(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `706 + r * (3362 ±0)` - // Estimated: `0` - // Minimum execution time: 370_281 nanoseconds. - Weight::from_parts(487_345_571, 0) - // Standard Error: 8_255_395 - .saturating_add(Weight::from_parts(1_383_599_828, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1536 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts OwnerInfoOf (r:1536 w:1536) - /// Proof: Contracts OwnerInfoOf (max_values: None, max_size: Some(88), added: 2563, mode: Ignored) - /// Storage: System EventTopics (r:1538 w:1538) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `877 + r * (42 ±0)` + // Estimated: `6816 + r * (42 ±0)` + // Minimum execution time: 271_800_000 picoseconds. + Weight::from_parts(314_891_136, 6816) + // Standard Error: 9_762 + .saturating_add(Weight::from_parts(11_949_979, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 42).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1536 w:1536) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1536 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:1538 w:1538) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_set_code_hash(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + r * (79300 ±0)` - // Estimated: `0` - // Minimum execution time: 468_402 nanoseconds. - Weight::from_parts(491_662_000, 0) - // Standard Error: 11_442_378 - .saturating_add(Weight::from_parts(3_208_414_115, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((225_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((150_u64).saturating_mul(r.into()))) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `0 + r * (965 ±0)` + // Estimated: `6807 + r * (3090 ±10)` + // Minimum execution time: 274_238_000 picoseconds. + Weight::from_parts(278_034_000, 6807) + // Standard Error: 77_011 + .saturating_add(Weight::from_parts(27_627_005, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 3090).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:33 w:32) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 32]`. + fn add_delegate_dependency(r: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `928 + r * (131 ±0)` + // Estimated: `6878 + r * (2606 ±0)` + // Minimum execution time: 271_519_000 picoseconds. + Weight::from_parts(292_726_476, 6878) + // Standard Error: 23_870 + .saturating_add(Weight::from_parts(6_695_172, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2606).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `MaxEncodedLen`) + /// Storage: `Contracts::CodeInfoOf` (r:33 w:32) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `MaxEncodedLen`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 32]`. + fn remove_delegate_dependency(r: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `969 + r * (183 ±0)` + // Estimated: `129453 + r * (2568 ±0)` + // Minimum execution time: 274_675_000 picoseconds. + Weight::from_parts(293_727_489, 129453) + // Standard Error: 23_160 + .saturating_add(Weight::from_parts(5_895_043, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) + .saturating_add(Weight::from_parts(0, 2568).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_reentrance_count(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `689 + r * (240 ±0)` - // Estimated: `0` - // Minimum execution time: 418_421 nanoseconds. - Weight::from_parts(536_436_097, 0) - // Standard Error: 310_626 - .saturating_add(Weight::from_parts(20_913_646, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `858 + r * (3 ±0)` + // Estimated: `6804 + r * (3 ±0)` + // Minimum execution time: 253_330_000 picoseconds. + Weight::from_parts(281_079_564, 6804) + // Standard Error: 378 + .saturating_add(Weight::from_parts(180_655, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_account_reentrance_count(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1387 + r * (3140 ±0)` - // Estimated: `0` - // Minimum execution time: 397_661 nanoseconds. - Weight::from_parts(613_318_772, 0) - // Standard Error: 378_470 - .saturating_add(Weight::from_parts(29_430_515, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: Ignored) - /// Storage: Contracts ContractInfoOf (r:1 w:1) - /// Proof: Contracts ContractInfoOf (max_values: None, max_size: Some(258), added: 2733, mode: Ignored) - /// Storage: Contracts CodeStorage (r:1 w:0) - /// Proof: Contracts CodeStorage (max_values: None, max_size: Some(126001), added: 128476, mode: Ignored) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: Contracts Nonce (r:1 w:1) - /// Proof: Contracts Nonce (max_values: Some(1), max_size: Some(8), added: 503, mode: Ignored) - /// Storage: System EventTopics (r:2 w:2) - /// Proof Skipped: System EventTopics (max_values: None, max_size: None, mode: Ignored) - /// The range of component `r` is `[0, 20]`. + // Measured: `2109 + r * (39 ±0)` + // Estimated: `7899 + r * (40 ±0)` + // Minimum execution time: 276_552_000 picoseconds. + Weight::from_parts(368_521_088, 7899) + // Standard Error: 2_310 + .saturating_add(Weight::from_parts(318_129, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(Weight::from_parts(0, 40).saturating_mul(r.into())) + } + /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) + /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) + /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) + /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) + /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) + /// Storage: `Contracts::PristineCode` (r:1 w:0) + /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `Contracts::Nonce` (r:1 w:1) + /// Proof: `Contracts::Nonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) + /// Storage: `System::EventTopics` (r:2 w:2) + /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `r` is `[0, 1600]`. fn seal_instantiation_nonce(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `692 + r * (240 ±0)` - // Estimated: `0` - // Minimum execution time: 369_881 nanoseconds. - Weight::from_parts(476_815_394, 0) - // Standard Error: 269_936 - .saturating_add(Weight::from_parts(18_315_800, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// The range of component `r` is `[0, 50]`. + // Measured: `861 + r * (3 ±0)` + // Estimated: `6801 + r * (3 ±0)` + // Minimum execution time: 258_953_000 picoseconds. + Weight::from_parts(288_222_836, 6801) + // Standard Error: 367 + .saturating_add(Weight::from_parts(152_842, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) + } + /// The range of component `r` is `[0, 5000]`. fn instr_i64const(r: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_780 nanoseconds. - Weight::from_parts(3_136_743, 0) - // Standard Error: 4_188 - .saturating_add(Weight::from_parts(621_351, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64load(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_770 nanoseconds. - Weight::from_parts(9_352_462, 0) - // Standard Error: 15_166 - .saturating_add(Weight::from_parts(1_557_402, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64store(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_860 nanoseconds. - Weight::from_parts(8_180_062, 0) - // Standard Error: 13_817 - .saturating_add(Weight::from_parts(1_622_066, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_select(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_460 nanoseconds. - Weight::from_parts(2_551_334, 0) - // Standard Error: 11_841 - .saturating_add(Weight::from_parts(1_665_255, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_if(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_480 nanoseconds. - Weight::from_parts(2_191_446, 0) - // Standard Error: 12_533 - .saturating_add(Weight::from_parts(2_098_157, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_630 nanoseconds. - Weight::from_parts(1_945_536, 0) - // Standard Error: 6_420 - .saturating_add(Weight::from_parts(984_796, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br_if(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_520 nanoseconds. - Weight::from_parts(1_854_661, 0) - // Standard Error: 7_036 - .saturating_add(Weight::from_parts(1_381_991, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_br_table(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_531 nanoseconds. - Weight::from_parts(1_429_591, 0) - // Standard Error: 8_514 - .saturating_add(Weight::from_parts(1_816_297, 0).saturating_mul(r.into())) - } - /// The range of component `e` is `[1, 256]`. - fn instr_br_table_per_entry(e: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_630 nanoseconds. - Weight::from_parts(7_467_038, 0) - // Standard Error: 333 - .saturating_add(Weight::from_parts(4_907, 0).saturating_mul(e.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_call(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_560 nanoseconds. - Weight::from_parts(1_650_551, 0) - // Standard Error: 35_615 - .saturating_add(Weight::from_parts(5_246_652, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_call_indirect(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_790 nanoseconds. - Weight::from_parts(8_229_172, 0) - // Standard Error: 36_662 - .saturating_add(Weight::from_parts(5_895_045, 0).saturating_mul(r.into())) - } - /// The range of component `p` is `[0, 128]`. - fn instr_call_indirect_per_param(p: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_690 nanoseconds. - Weight::from_parts(13_888_593, 0) - // Standard Error: 3_490 - .saturating_add(Weight::from_parts(312_955, 0).saturating_mul(p.into())) - } - /// The range of component `l` is `[0, 1024]`. - fn instr_call_per_local(l: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_050 nanoseconds. - Weight::from_parts(8_811_701, 0) - // Standard Error: 656 - .saturating_add(Weight::from_parts(93_440, 0).saturating_mul(l.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_get(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_840 nanoseconds. - Weight::from_parts(5_853_123, 0) - // Standard Error: 6_625 - .saturating_add(Weight::from_parts(765_633, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_set(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_340 nanoseconds. - Weight::from_parts(4_113_945, 0) - // Standard Error: 8_909 - .saturating_add(Weight::from_parts(1_198_001, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_local_tee(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_970 nanoseconds. - Weight::from_parts(4_643_752, 0) - // Standard Error: 9_875 - .saturating_add(Weight::from_parts(1_463_310, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_global_get(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_620 nanoseconds. - Weight::from_parts(2_315_667, 0) - // Standard Error: 13_076 - .saturating_add(Weight::from_parts(2_015_150, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_global_set(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_600 nanoseconds. - Weight::from_parts(1_483_134, 0) - // Standard Error: 11_873 - .saturating_add(Weight::from_parts(2_058_012, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_memory_current(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_990 nanoseconds. - Weight::from_parts(3_095_465, 0) - // Standard Error: 10_245 - .saturating_add(Weight::from_parts(1_332_117, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 1]`. - fn instr_memory_grow(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_480 nanoseconds. - Weight::from_parts(1_934_187, 0) - // Standard Error: 1_165_957 - .saturating_add(Weight::from_parts(352_987_712, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64clz(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_830 nanoseconds. - Weight::from_parts(3_764_219, 0) - // Standard Error: 7_276 - .saturating_add(Weight::from_parts(908_339, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ctz(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_440 nanoseconds. - Weight::from_parts(2_932_299, 0) - // Standard Error: 6_288 - .saturating_add(Weight::from_parts(927_100, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64popcnt(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_810 nanoseconds. - Weight::from_parts(3_383_481, 0) - // Standard Error: 6_988 - .saturating_add(Weight::from_parts(911_269, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64eqz(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_690 nanoseconds. - Weight::from_parts(2_921_686, 0) - // Standard Error: 5_839 - .saturating_add(Weight::from_parts(943_173, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extendsi32(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_500 nanoseconds. - Weight::from_parts(2_623_859, 0) - // Standard Error: 6_524 - .saturating_add(Weight::from_parts(928_298, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64extendui32(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_550 nanoseconds. - Weight::from_parts(4_627_690, 0) - // Standard Error: 8_179 - .saturating_add(Weight::from_parts(863_051, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i32wrapi64(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_550 nanoseconds. - Weight::from_parts(2_595_110, 0) - // Standard Error: 6_474 - .saturating_add(Weight::from_parts(928_065, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64eq(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_510 nanoseconds. - Weight::from_parts(3_894_235, 0) - // Standard Error: 8_463 - .saturating_add(Weight::from_parts(1_219_500, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ne(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_460 nanoseconds. - Weight::from_parts(2_563_440, 0) - // Standard Error: 8_687 - .saturating_add(Weight::from_parts(1_247_172, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64lts(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_740 nanoseconds. - Weight::from_parts(3_152_891, 0) - // Standard Error: 8_071 - .saturating_add(Weight::from_parts(1_248_541, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ltu(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_520 nanoseconds. - Weight::from_parts(3_388_594, 0) - // Standard Error: 9_001 - .saturating_add(Weight::from_parts(1_217_995, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64gts(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_740 nanoseconds. - Weight::from_parts(1_635_986, 0) - // Standard Error: 6_243 - .saturating_add(Weight::from_parts(1_305_180, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64gtu(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_710 nanoseconds. - Weight::from_parts(2_638_243, 0) - // Standard Error: 5_966 - .saturating_add(Weight::from_parts(1_275_338, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64les(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_450 nanoseconds. - Weight::from_parts(3_146_830, 0) - // Standard Error: 8_968 - .saturating_add(Weight::from_parts(1_227_357, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64leu(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_460 nanoseconds. - Weight::from_parts(3_252_838, 0) - // Standard Error: 7_613 - .saturating_add(Weight::from_parts(1_246_230, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64ges(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_530 nanoseconds. - Weight::from_parts(2_491_422, 0) - // Standard Error: 7_290 - .saturating_add(Weight::from_parts(1_279_578, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64geu(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_480 nanoseconds. - Weight::from_parts(1_696_914, 0) - // Standard Error: 7_284 - .saturating_add(Weight::from_parts(1_291_501, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64add(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_720 nanoseconds. - Weight::from_parts(3_244_000, 0) - // Standard Error: 8_247 - .saturating_add(Weight::from_parts(1_223_730, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64sub(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_740 nanoseconds. - Weight::from_parts(2_339_735, 0) - // Standard Error: 6_588 - .saturating_add(Weight::from_parts(1_275_672, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64mul(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_760 nanoseconds. - Weight::from_parts(3_085_111, 0) - // Standard Error: 7_619 - .saturating_add(Weight::from_parts(1_248_370, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64divs(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_490 nanoseconds. - Weight::from_parts(2_468_536, 0) - // Standard Error: 9_812 - .saturating_add(Weight::from_parts(1_454_375, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64divu(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_520 nanoseconds. - Weight::from_parts(3_650_517, 0) - // Standard Error: 9_928 - .saturating_add(Weight::from_parts(1_207_003, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rems(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_470 nanoseconds. - Weight::from_parts(1_449_755, 0) - // Standard Error: 9_386 - .saturating_add(Weight::from_parts(1_576_210, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64remu(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_530 nanoseconds. - Weight::from_parts(3_604_036, 0) - // Standard Error: 9_582 - .saturating_add(Weight::from_parts(1_387_067, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64and(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_450 nanoseconds. - Weight::from_parts(3_741_153, 0) - // Standard Error: 9_330 - .saturating_add(Weight::from_parts(1_187_944, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64or(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_550 nanoseconds. - Weight::from_parts(1_900_000, 0) - // Standard Error: 23_251 - .saturating_add(Weight::from_parts(1_513_468, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64xor(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_510 nanoseconds. - Weight::from_parts(2_921_475, 0) - // Standard Error: 7_444 - .saturating_add(Weight::from_parts(1_249_617, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shl(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_780 nanoseconds. - Weight::from_parts(3_548_981, 0) - // Standard Error: 7_767 - .saturating_add(Weight::from_parts(1_242_323, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shrs(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_710 nanoseconds. - Weight::from_parts(1_904_247, 0) - // Standard Error: 7_361 - .saturating_add(Weight::from_parts(1_279_805, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64shru(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_450 nanoseconds. - Weight::from_parts(1_679_219, 0) - // Standard Error: 6_529 - .saturating_add(Weight::from_parts(1_291_802, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rotl(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_720 nanoseconds. - Weight::from_parts(3_744_484, 0) - // Standard Error: 8_338 - .saturating_add(Weight::from_parts(1_227_022, 0).saturating_mul(r.into())) - } - /// The range of component `r` is `[0, 50]`. - fn instr_i64rotr(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_500 nanoseconds. - Weight::from_parts(3_433_997, 0) - // Standard Error: 8_899 - .saturating_add(Weight::from_parts(1_211_884, 0).saturating_mul(r.into())) + // Minimum execution time: 1_476_000 picoseconds. + Weight::from_parts(2_119_717, 0) + // Standard Error: 28 + .saturating_add(Weight::from_parts(9_805, 0).saturating_mul(r.into())) } } diff --git a/runtime/common/src/weights/pallet_democracy.rs b/runtime/common/src/weights/pallet_democracy.rs index 81df45f93..78f1f7ee1 100644 --- a/runtime/common/src/weights/pallet_democracy.rs +++ b/runtime/common/src/weights/pallet_democracy.rs @@ -57,105 +57,113 @@ impl pallet_democracy::weights::WeightInfo for WeightIn /// Storage: Democracy PublicProps (r:1 w:1) /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) /// Storage: Democracy Blacklist (r:1 w:0) - /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3242), added: 5717, mode: MaxEncodedLen) + /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen) /// Storage: Democracy DepositOf (r:0 w:1) /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) fn propose() -> Weight { // Proof Size summary in bytes: - // Measured: `4835` - // Estimated: `23413` - // Minimum execution time: 50_690 nanoseconds. - Weight::from_parts(63_110_000, 23413) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `4801` + // Estimated: `18187` + // Minimum execution time: 49_339_000 picoseconds. + Weight::from_parts(50_942_000, 18187) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Democracy DepositOf (r:1 w:1) /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) fn second() -> Weight { // Proof Size summary in bytes: - // Measured: `3591` - // Estimated: `5705` - // Minimum execution time: 43_520 nanoseconds. - Weight::from_parts(45_040_000, 5705) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `3556` + // Estimated: `6695` + // Minimum execution time: 43_291_000 picoseconds. + Weight::from_parts(44_856_000, 6695) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3799), added: 6274, mode: MaxEncodedLen) + /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) /// Storage: Balances Locks (r:1 w:1) /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn vote_new() -> Weight { // Proof Size summary in bytes: - // Measured: `3500` - // Estimated: `12732` - // Minimum execution time: 59_010 nanoseconds. - Weight::from_parts(72_290_000, 12732) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `3470` + // Estimated: `7260` + // Minimum execution time: 61_890_000 picoseconds. + Weight::from_parts(63_626_000, 7260) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3799), added: 6274, mode: MaxEncodedLen) + /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) /// Storage: Balances Locks (r:1 w:1) /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) fn vote_existing() -> Weight { // Proof Size summary in bytes: - // Measured: `3522` - // Estimated: `12732` - // Minimum execution time: 59_810 nanoseconds. - Weight::from_parts(72_890_000, 12732) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `3492` + // Estimated: `7260` + // Minimum execution time: 67_802_000 picoseconds. + Weight::from_parts(69_132_000, 7260) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// Storage: Democracy Cancellations (r:1 w:1) /// Proof: Democracy Cancellations (max_values: None, max_size: Some(33), added: 2508, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:1 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) fn emergency_cancel() -> Weight { // Proof Size summary in bytes: - // Measured: `295` - // Estimated: `5192` - // Minimum execution time: 26_390 nanoseconds. - Weight::from_parts(32_000_000, 5192) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `366` + // Estimated: `3666` + // Minimum execution time: 25_757_000 picoseconds. + Weight::from_parts(27_226_000, 3666) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Democracy PublicProps (r:1 w:1) /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) /// Storage: Democracy DepositOf (r:1 w:1) /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:3 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) /// Storage: Democracy NextExternal (r:1 w:1) /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// Storage: Democracy Blacklist (r:0 w:1) - /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3242), added: 5717, mode: MaxEncodedLen) + /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen) fn blacklist() -> Weight { // Proof Size summary in bytes: - // Measured: `6251` - // Estimated: `31427` - // Minimum execution time: 112_670 nanoseconds. - Weight::from_parts(139_060_000, 31427) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(7)) + // Measured: `5910` + // Estimated: `18187` + // Minimum execution time: 113_060_000 picoseconds. + Weight::from_parts(114_813_000, 18187) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) } /// Storage: Democracy NextExternal (r:1 w:1) /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) /// Storage: Democracy Blacklist (r:1 w:0) - /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3242), added: 5717, mode: MaxEncodedLen) + /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen) fn external_propose() -> Weight { // Proof Size summary in bytes: - // Measured: `3419` - // Estimated: `6344` - // Minimum execution time: 28_210 nanoseconds. - Weight::from_parts(28_970_000, 6344) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `3416` + // Estimated: `6703` + // Minimum execution time: 13_413_000 picoseconds. + Weight::from_parts(13_794_000, 6703) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Democracy NextExternal (r:0 w:1) /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) @@ -163,8 +171,8 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_060 nanoseconds. - Weight::from_parts(6_540_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 3_213_000 picoseconds. + Weight::from_parts(3_429_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Democracy NextExternal (r:0 w:1) /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) @@ -172,80 +180,90 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_150 nanoseconds. - Weight::from_parts(6_650_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 3_280_000 picoseconds. + Weight::from_parts(3_389_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Democracy NextExternal (r:1 w:1) /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) /// Storage: Democracy ReferendumCount (r:1 w:1) /// Proof: Democracy ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:1 w:2) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) /// Storage: Democracy ReferendumInfoOf (r:0 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) fn fast_track() -> Weight { // Proof Size summary in bytes: - // Measured: `179` - // Estimated: `1126` - // Minimum execution time: 28_070 nanoseconds. - Weight::from_parts(34_820_000, 1126) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `286` + // Estimated: `3518` + // Minimum execution time: 28_142_000 picoseconds. + Weight::from_parts(28_862_000, 3518) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) } /// Storage: Democracy NextExternal (r:1 w:1) /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) /// Storage: Democracy Blacklist (r:1 w:1) - /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3242), added: 5717, mode: MaxEncodedLen) + /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:1 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) fn veto_external() -> Weight { // Proof Size summary in bytes: - // Measured: `3448` - // Estimated: `6344` - // Minimum execution time: 36_350 nanoseconds. - Weight::from_parts(44_300_000, 6344) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `3519` + // Estimated: `6703` + // Minimum execution time: 32_395_000 picoseconds. + Weight::from_parts(33_617_000, 6703) + .saturating_add(T::DbWeight::get().reads(3_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Democracy PublicProps (r:1 w:1) /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) /// Storage: Democracy DepositOf (r:1 w:1) /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:1 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) fn cancel_proposal() -> Weight { // Proof Size summary in bytes: - // Measured: `6122` - // Estimated: `28116` - // Minimum execution time: 94_210 nanoseconds. - Weight::from_parts(115_161_000, 28116) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `5821` + // Estimated: `18187` + // Minimum execution time: 92_255_000 picoseconds. + Weight::from_parts(93_704_000, 18187) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(4_u64)) } + /// Storage: Democracy MetadataOf (r:1 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) /// Storage: Democracy ReferendumInfoOf (r:0 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) fn cancel_referendum() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 11_520 nanoseconds. - Weight::from_parts(13_900_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Measured: `271` + // Estimated: `3518` + // Minimum execution time: 19_623_000 picoseconds. + Weight::from_parts(20_545_000, 3518) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: Democracy LowestUnbaked (r:1 w:1) /// Proof: Democracy LowestUnbaked (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Democracy ReferendumCount (r:1 w:0) /// Proof: Democracy ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: Democracy ReferendumInfoOf (r:99 w:0) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `174 + r * (125 ±0)` - // Estimated: `998 + r * (2684 ±0)` - // Minimum execution time: 14_730 nanoseconds. - Weight::from_parts(28_833_321, 998) - // Standard Error: 37_839 - .saturating_add(Weight::from_parts(4_701_815, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `244 + r * (86 ±0)` + // Estimated: `1489 + r * (2676 ±0)` + // Minimum execution time: 7_032_000 picoseconds. + Weight::from_parts(7_931_421, 1489) + // Standard Error: 7_395 + .saturating_add(Weight::from_parts(3_236_964, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into())) } /// Storage: Democracy LowestUnbaked (r:1 w:1) /// Proof: Democracy LowestUnbaked (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) @@ -258,60 +276,62 @@ impl pallet_democracy::weights::WeightInfo for WeightIn /// Storage: Democracy PublicProps (r:1 w:0) /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) /// Storage: Democracy ReferendumInfoOf (r:99 w:0) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `174 + r * (125 ±0)` - // Estimated: `19318 + r * (2684 ±0)` - // Minimum execution time: 18_190 nanoseconds. - Weight::from_parts(29_838_845, 19318) - // Standard Error: 39_893 - .saturating_add(Weight::from_parts(4_571_724, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `244 + r * (86 ±0)` + // Estimated: `18187 + r * (2676 ±0)` + // Minimum execution time: 10_524_000 picoseconds. + Weight::from_parts(10_369_064, 18187) + // Standard Error: 8_385 + .saturating_add(Weight::from_parts(3_242_334, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into())) } /// Storage: Democracy VotingOf (r:3 w:3) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3799), added: 6274, mode: MaxEncodedLen) + /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) /// Storage: Democracy ReferendumInfoOf (r:99 w:99) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// Storage: Balances Locks (r:1 w:1) /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) /// The range of component `r` is `[0, 99]`. fn delegate(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `897 + r * (147 ±0)` - // Estimated: `22596 + r * (2684 ±0)` - // Minimum execution time: 55_960 nanoseconds. - Weight::from_parts(72_937_258, 22596) - // Standard Error: 49_578 - .saturating_add(Weight::from_parts(6_045_111, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `830 + r * (108 ±0)` + // Estimated: `19800 + r * (2676 ±0)` + // Minimum execution time: 46_106_000 picoseconds. + Weight::from_parts(48_936_654, 19800) + // Standard Error: 8_879 + .saturating_add(Weight::from_parts(4_708_141, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(4_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into())) } /// Storage: Democracy VotingOf (r:2 w:2) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3799), added: 6274, mode: MaxEncodedLen) + /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) /// Storage: Democracy ReferendumInfoOf (r:99 w:99) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `522 + r * (147 ±0)` - // Estimated: `12548 + r * (2684 ±0)` - // Minimum execution time: 33_530 nanoseconds. - Weight::from_parts(45_434_419, 12548) - // Standard Error: 48_431 - .saturating_add(Weight::from_parts(6_200_443, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `493 + r * (108 ±0)` + // Estimated: `13530 + r * (2676 ±0)` + // Minimum execution time: 21_078_000 picoseconds. + Weight::from_parts(22_732_737, 13530) + // Standard Error: 7_969 + .saturating_add(Weight::from_parts(4_626_458, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into())) } /// Storage: Democracy PublicProps (r:0 w:1) /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) @@ -319,73 +339,161 @@ impl pallet_democracy::weights::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_870 nanoseconds. - Weight::from_parts(7_050_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 3_229_000 picoseconds. + Weight::from_parts(3_415_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3799), added: 6274, mode: MaxEncodedLen) + /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) /// Storage: Balances Locks (r:1 w:1) /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// The range of component `r` is `[0, 99]`. - fn unlock_remove(_r: u32) -> Weight { + fn unlock_remove(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `554` - // Estimated: `12655` - // Minimum execution time: 31_950 nanoseconds. - Weight::from_parts(46_451_047, 12655) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `563` + // Estimated: `7260` + // Minimum execution time: 25_735_000 picoseconds. + Weight::from_parts(41_341_468, 7260) + // Standard Error: 3_727 + .saturating_add(Weight::from_parts(94_755, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3799), added: 6274, mode: MaxEncodedLen) + /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) /// Storage: Balances Locks (r:1 w:1) /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `555 + r * (22 ±0)` - // Estimated: `12655` - // Minimum execution time: 34_100 nanoseconds. - Weight::from_parts(44_669_466, 12655) - // Standard Error: 5_077 - .saturating_add(Weight::from_parts(42_607, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `564 + r * (22 ±0)` + // Estimated: `7260` + // Minimum execution time: 36_233_000 picoseconds. + Weight::from_parts(39_836_017, 7260) + // Standard Error: 1_791 + .saturating_add(Weight::from_parts(132_158, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3799), added: 6274, mode: MaxEncodedLen) + /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `760 + r * (26 ±0)` - // Estimated: `8958` - // Minimum execution time: 26_160 nanoseconds. - Weight::from_parts(34_737_151, 8958) - // Standard Error: 4_560 - .saturating_add(Weight::from_parts(64_111, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `728 + r * (26 ±0)` + // Estimated: `7260` + // Minimum execution time: 16_081_000 picoseconds. + Weight::from_parts(19_624_101, 7260) + // Standard Error: 1_639 + .saturating_add(Weight::from_parts(133_630, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(209), added: 2684, mode: MaxEncodedLen) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3799), added: 6274, mode: MaxEncodedLen) + /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `760 + r * (26 ±0)` - // Estimated: `8958` - // Minimum execution time: 25_821 nanoseconds. - Weight::from_parts(32_571_293, 8958) - // Standard Error: 3_984 - .saturating_add(Weight::from_parts(94_520, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `728 + r * (26 ±0)` + // Estimated: `7260` + // Minimum execution time: 15_634_000 picoseconds. + Weight::from_parts(19_573_407, 7260) + // Standard Error: 1_790 + .saturating_add(Weight::from_parts(139_707, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: Democracy NextExternal (r:1 w:0) + /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) + /// Storage: Preimage StatusFor (r:1 w:0) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:0 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + fn set_external_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `356` + // Estimated: `3556` + // Minimum execution time: 18_344_000 picoseconds. + Weight::from_parts(18_727_000, 3556) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Democracy NextExternal (r:1 w:0) + /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:1 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + fn clear_external_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `286` + // Estimated: `3518` + // Minimum execution time: 16_497_000 picoseconds. + Weight::from_parts(16_892_000, 3518) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Democracy PublicProps (r:1 w:0) + /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) + /// Storage: Preimage StatusFor (r:1 w:0) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:0 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + fn set_proposal_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `4888` + // Estimated: `18187` + // Minimum execution time: 39_517_000 picoseconds. + Weight::from_parts(40_632_000, 18187) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Democracy PublicProps (r:1 w:0) + /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:1 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + fn clear_proposal_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `4822` + // Estimated: `18187` + // Minimum execution time: 37_108_000 picoseconds. + Weight::from_parts(37_599_000, 18187) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Preimage StatusFor (r:1 w:0) + /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:0 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + fn set_referendum_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `144` + // Estimated: `3556` + // Minimum execution time: 13_997_000 picoseconds. + Weight::from_parts(14_298_000, 3556) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) + /// Storage: Democracy MetadataOf (r:1 w:1) + /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + fn clear_referendum_metadata() -> Weight { + // Proof Size summary in bytes: + // Measured: `302` + // Estimated: `3666` + // Minimum execution time: 18_122_000 picoseconds. + Weight::from_parts(18_655_000, 3666) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } } diff --git a/runtime/common/src/weights/pallet_parachain_staking.rs b/runtime/common/src/weights/pallet_parachain_staking.rs index 0ff678f08..788b12083 100644 --- a/runtime/common/src/weights/pallet_parachain_staking.rs +++ b/runtime/common/src/weights/pallet_parachain_staking.rs @@ -56,67 +56,67 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Proof Skipped: ParachainStaking InflationConfig (max_values: Some(1), max_size: None, mode: Measured) fn set_staking_expectations() -> Weight { // Proof Size summary in bytes: - // Measured: `119` - // Estimated: `614` - // Minimum execution time: 21_650 nanoseconds. - Weight::from_parts(22_480_000, 614) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `88` + // Estimated: `1573` + // Minimum execution time: 15_889_000 picoseconds. + Weight::from_parts(16_404_000, 1573) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainStaking InflationConfig (r:1 w:1) /// Proof Skipped: ParachainStaking InflationConfig (max_values: Some(1), max_size: None, mode: Measured) fn set_inflation() -> Weight { // Proof Size summary in bytes: - // Measured: `119` - // Estimated: `614` - // Minimum execution time: 76_630 nanoseconds. - Weight::from_parts(77_480_000, 614) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `88` + // Estimated: `1573` + // Minimum execution time: 44_509_000 picoseconds. + Weight::from_parts(45_011_000, 1573) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainStaking ParachainBondInfo (r:1 w:1) /// Proof Skipped: ParachainStaking ParachainBondInfo (max_values: Some(1), max_size: None, mode: Measured) fn set_parachain_bond_account() -> Weight { // Proof Size summary in bytes: - // Measured: `52` - // Estimated: `547` - // Minimum execution time: 19_300 nanoseconds. - Weight::from_parts(19_930_000, 547) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `6` + // Estimated: `1491` + // Minimum execution time: 14_675_000 picoseconds. + Weight::from_parts(15_094_000, 1491) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainStaking ParachainBondInfo (r:1 w:1) /// Proof Skipped: ParachainStaking ParachainBondInfo (max_values: Some(1), max_size: None, mode: Measured) fn set_parachain_bond_reserve_percent() -> Weight { // Proof Size summary in bytes: - // Measured: `52` - // Estimated: `547` - // Minimum execution time: 18_880 nanoseconds. - Weight::from_parts(19_530_000, 547) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `6` + // Estimated: `1491` + // Minimum execution time: 13_898_000 picoseconds. + Weight::from_parts(14_492_000, 1491) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainStaking TotalSelected (r:1 w:1) /// Proof Skipped: ParachainStaking TotalSelected (max_values: Some(1), max_size: None, mode: Measured) fn set_total_selected() -> Weight { // Proof Size summary in bytes: // Measured: `28` - // Estimated: `523` - // Minimum execution time: 20_290 nanoseconds. - Weight::from_parts(20_680_000, 523) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Estimated: `1513` + // Minimum execution time: 15_666_000 picoseconds. + Weight::from_parts(15_939_000, 1513) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainStaking CollatorCommission (r:1 w:1) /// Proof Skipped: ParachainStaking CollatorCommission (max_values: Some(1), max_size: None, mode: Measured) fn set_collator_commission() -> Weight { // Proof Size summary in bytes: // Measured: `27` - // Estimated: `522` - // Minimum execution time: 17_990 nanoseconds. - Weight::from_parts(19_230_000, 522) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Estimated: `1512` + // Minimum execution time: 13_997_000 picoseconds. + Weight::from_parts(14_320_000, 1512) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainStaking TotalSelected (r:1 w:0) /// Proof Skipped: ParachainStaking TotalSelected (max_values: Some(1), max_size: None, mode: Measured) @@ -124,12 +124,12 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Proof Skipped: ParachainStaking InflationConfig (max_values: Some(1), max_size: None, mode: Measured) fn set_blocks_per_round() -> Weight { // Proof Size summary in bytes: - // Measured: `147` - // Estimated: `1284` - // Minimum execution time: 81_350 nanoseconds. - Weight::from_parts(82_360_000, 1284) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `116` + // Estimated: `1601` + // Minimum execution time: 48_389_000 picoseconds. + Weight::from_parts(49_554_000, 1601) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) @@ -138,183 +138,255 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) /// Storage: ParachainStaking TopDelegations (r:0 w:1) /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking BottomDelegations (r:0 w:1) /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) - /// The range of component `x` is `[3, 1000]`. + /// The range of component `x` is `[3, 200]`. fn join_candidates(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1898 + x * (49 ±0)` - // Estimated: `22371 + x * (300 ±0)` - // Minimum execution time: 66_890 nanoseconds. - Weight::from_parts(96_425_237, 22371) - // Standard Error: 2_143 - .saturating_add(Weight::from_parts(185_610, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(7)) - .saturating_add(Weight::from_parts(0, 300).saturating_mul(x.into())) + // Measured: `1421 + x * (38 ±0)` + // Estimated: `4752 + x * (41 ±0)` + // Minimum execution time: 76_742_000 picoseconds. + Weight::from_parts(88_864_511, 4752) + // Standard Error: 2_004 + .saturating_add(Weight::from_parts(88_538, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + .saturating_add(Weight::from_parts(0, 41).saturating_mul(x.into())) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// The range of component `x` is `[3, 1000]`. + /// The range of component `x` is `[3, 200]`. fn schedule_leave_candidates(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `990 + x * (48 ±0)` - // Estimated: `4794 + x * (98 ±0)` - // Minimum execution time: 31_150 nanoseconds. - Weight::from_parts(45_204_630, 4794) - // Standard Error: 1_892 - .saturating_add(Weight::from_parts(159_930, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 98).saturating_mul(x.into())) + // Measured: `702 + x * (37 ±0)` + // Estimated: `4060 + x * (38 ±0)` + // Minimum execution time: 27_238_000 picoseconds. + Weight::from_parts(34_109_750, 4060) + // Standard Error: 1_116 + .saturating_add(Weight::from_parts(62_292, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 38).saturating_mul(x.into())) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking TopDelegations (r:1 w:1) /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking DelegatorState (r:349 w:349) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) /// Storage: Balances Locks (r:350 w:350) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:350 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) /// Storage: System Account (r:350 w:350) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking BottomDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking Total (r:1 w:1) + /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + /// The range of component `x` is `[2, 350]`. + fn execute_leave_candidates_worst_case(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1157 + x * (431 ±0)` + // Estimated: `4696 + x * (3762 ±0)` + // Minimum execution time: 141_946_000 picoseconds. + Weight::from_parts(144_961_000, 4696) + // Standard Error: 79_832 + .saturating_add(Weight::from_parts(49_060_154, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into()))) + .saturating_add(Weight::from_parts(0, 3762).saturating_mul(x.into())) + } + /// Storage: ParachainStaking CandidateInfo (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking TopDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking DelegatorState (r:349 w:349) + /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) + /// Storage: Balances Locks (r:350 w:350) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:350 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) + /// Storage: System Account (r:350 w:350) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) + /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking BottomDelegations (r:1 w:1) /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) /// The range of component `x` is `[2, 350]`. - fn execute_leave_candidates(x: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `238 + x * (595 ±0)` - // Estimated: `18229 + x * (12995 ±0)` - // Minimum execution time: 121_740 nanoseconds. - Weight::from_parts(137_141_000, 18229) - // Standard Error: 158_049 - .saturating_add(Weight::from_parts(46_465_017, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) - .saturating_add(T::DbWeight::get().writes(5)) + /// The range of component `y` is `[2, 350]`. + fn execute_leave_candidates_ideal(x: u32, _y: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1149 + x * (431 ±0)` + // Estimated: `4696 + x * (3762 ±0)` + // Minimum execution time: 133_121_000 picoseconds. + Weight::from_parts(134_388_000, 4696) + // Standard Error: 34_256 + .saturating_add(Weight::from_parts(50_828_386, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(5_u64)) + .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(5_u64)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into()))) - .saturating_add(Weight::from_parts(0, 12995).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 3762).saturating_mul(x.into())) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// The range of component `x` is `[3, 1000]`. + /// The range of component `x` is `[3, 200]`. fn cancel_leave_candidates(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `946 + x * (48 ±0)` - // Estimated: `4704 + x * (98 ±0)` - // Minimum execution time: 31_720 nanoseconds. - Weight::from_parts(41_148_720, 4704) - // Standard Error: 1_807 - .saturating_add(Weight::from_parts(174_213, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 98).saturating_mul(x.into())) + // Measured: `670 + x * (37 ±0)` + // Estimated: `4028 + x * (38 ±0)` + // Minimum execution time: 25_910_000 picoseconds. + Weight::from_parts(32_465_127, 4028) + // Standard Error: 1_064 + .saturating_add(Weight::from_parts(60_655, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 38).saturating_mul(x.into())) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - fn go_offline() -> Weight { - // Proof Size summary in bytes: - // Measured: `371` - // Estimated: `3712` - // Minimum execution time: 34_840 nanoseconds. - Weight::from_parts(35_820_000, 3712) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + /// The range of component `x` is `[1, 200]`. + fn go_offline(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `567 + x * (38 ±0)` + // Estimated: `3968 + x * (39 ±0)` + // Minimum execution time: 24_471_000 picoseconds. + Weight::from_parts(30_875_133, 3968) + // Standard Error: 1_124 + .saturating_add(Weight::from_parts(66_032, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(x.into())) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - fn go_online() -> Weight { - // Proof Size summary in bytes: - // Measured: `322` - // Estimated: `3614` - // Minimum execution time: 34_860 nanoseconds. - Weight::from_parts(36_040_000, 3614) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + /// The range of component `x` is `[1, 200]`. + fn go_online(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `531 + x * (38 ±0)` + // Estimated: `3932 + x * (39 ±0)` + // Minimum execution time: 24_249_000 picoseconds. + Weight::from_parts(30_765_292, 3932) + // Standard Error: 1_181 + .saturating_add(Weight::from_parts(65_935, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(x.into())) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking CandidatePool (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - fn candidate_bond_more() -> Weight { - // Proof Size summary in bytes: - // Measured: `650` - // Estimated: `11796` - // Minimum execution time: 61_311 nanoseconds. - Weight::from_parts(75_650_000, 11796) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(5)) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) + /// The range of component `x` is `[1, 200]`. + fn candidate_bond_more(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1270 + x * (42 ±0)` + // Estimated: `4752 + x * (44 ±0)` + // Minimum execution time: 68_720_000 picoseconds. + Weight::from_parts(79_722_709, 4752) + // Standard Error: 2_059 + .saturating_add(Weight::from_parts(113_832, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(Weight::from_parts(0, 44).saturating_mul(x.into())) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) fn schedule_candidate_bond_less() -> Weight { // Proof Size summary in bytes: - // Measured: `216` - // Estimated: `2691` - // Minimum execution time: 29_000 nanoseconds. - Weight::from_parts(29_870_000, 2691) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `171` + // Estimated: `3636` + // Minimum execution time: 21_049_000 picoseconds. + Weight::from_parts(21_735_000, 3636) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking CandidatePool (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - fn execute_candidate_bond_less() -> Weight { - // Proof Size summary in bytes: - // Measured: `670` - // Estimated: `11856` - // Minimum execution time: 65_100 nanoseconds. - Weight::from_parts(66_880_000, 11856) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(5)) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// The range of component `x` is `[1, 200]`. + fn execute_candidate_bond_less(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1322 + x * (42 ±0)` + // Estimated: `4752 + x * (43 ±0)` + // Minimum execution time: 71_996_000 picoseconds. + Weight::from_parts(80_620_929, 4752) + // Standard Error: 1_363 + .saturating_add(Weight::from_parts(94_580, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) } /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) fn cancel_candidate_bond_less() -> Weight { // Proof Size summary in bytes: - // Measured: `236` - // Estimated: `2711` - // Minimum execution time: 22_170 nanoseconds. - Weight::from_parts(27_290_000, 2711) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `191` + // Estimated: `3656` + // Minimum execution time: 18_991_000 picoseconds. + Weight::from_parts(19_491_000, 3656) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + fn set_candidate_bond_to_zero(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1322 + x * (42 ±0)` + // Estimated: `4752 + x * (43 ±0)` + // Minimum execution time: 71_996_000 picoseconds. + Weight::from_parts(80_620_929, 4752) + // Standard Error: 1_363 + .saturating_add(Weight::from_parts(94_580, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) } /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidateInfo (r:1 w:1) @@ -324,106 +396,105 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) /// The range of component `x` is `[3, 100]`. /// The range of component `y` is `[2, 300]`. fn delegate(x: u32, y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2374 + x * (103 ±0) + y * (52 ±0)` - // Estimated: `25391 + x * (530 ±0) + y * (265 ±0)` - // Minimum execution time: 125_490 nanoseconds. - Weight::from_parts(135_398_832, 25391) - // Standard Error: 6_396 - .saturating_add(Weight::from_parts(265_077, 0).saturating_mul(x.into())) - // Standard Error: 2_098 - .saturating_add(Weight::from_parts(138_672, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(7)) - .saturating_add(Weight::from_parts(0, 530).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 265).saturating_mul(y.into())) + // Measured: `2479 + x * (79 ±0) + y * (38 ±0)` + // Estimated: `5723 + x * (81 ±0) + y * (39 ±0)` + // Minimum execution time: 120_061_000 picoseconds. + Weight::from_parts(111_894_468, 5723) + // Standard Error: 1_320 + .saturating_add(Weight::from_parts(135_446, 0).saturating_mul(x.into())) + // Standard Error: 433 + .saturating_add(Weight::from_parts(41_110, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + .saturating_add(Weight::from_parts(0, 81).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(y.into())) } /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - fn schedule_leave_delegators() -> Weight { - // Proof Size summary in bytes: - // Measured: `176` - // Estimated: `5302` - // Minimum execution time: 32_930 nanoseconds. - Weight::from_parts(33_951_000, 5302) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + /// The range of component `x` is `[0, 349]`. + fn schedule_revoke_delegation(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `566 + x * (42 ±0)` + // Estimated: `4012 + x * (43 ±0)` + // Minimum execution time: 25_479_000 picoseconds. + Weight::from_parts(35_344_986, 4012) + // Standard Error: 803 + .saturating_add(Weight::from_parts(60_212, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) } /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:99 w:99) + /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:99 w:99) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: Balances Locks (r:1 w:1) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) + /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:99 w:99) + /// Storage: ParachainStaking TopDelegations (r:1 w:1) /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:99 w:0) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// The range of component `x` is `[2, 100]`. - fn execute_leave_delegators(x: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `755 + x * (558 ±0)` - // Estimated: `26542 + x * (13492 ±2)` - // Minimum execution time: 105_910 nanoseconds. - Weight::from_parts(108_141_000, 26542) - // Standard Error: 76_935 - .saturating_add(Weight::from_parts(37_566_563, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into()))) - .saturating_add(Weight::from_parts(0, 13492).saturating_mul(x.into())) + /// The range of component `x` is `[0, 349]`. + fn delegator_bond_more(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1996 + x * (79 ±0)` + // Estimated: `5428 + x * (79 ±0)` + // Minimum execution time: 90_985_000 picoseconds. + Weight::from_parts(111_258_553, 5428) + // Standard Error: 1_580 + .saturating_add(Weight::from_parts(109_354, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(7_u64)) + .saturating_add(Weight::from_parts(0, 79).saturating_mul(x.into())) } /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - fn cancel_leave_delegators() -> Weight { - // Proof Size summary in bytes: - // Measured: `298` - // Estimated: `5546` - // Minimum execution time: 36_750 nanoseconds. - Weight::from_parts(38_090_000, 5546) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + /// The range of component `x` is `[0, 349]`. + fn schedule_delegator_bond_less(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `566 + x * (42 ±0)` + // Estimated: `4012 + x * (43 ±0)` + // Minimum execution time: 25_784_000 picoseconds. + Weight::from_parts(35_792_924, 4012) + // Standard Error: 793 + .saturating_add(Weight::from_parts(60_874, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) } /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - fn schedule_revoke_delegation() -> Weight { - // Proof Size summary in bytes: - // Measured: `176` - // Estimated: `5302` - // Minimum execution time: 27_410 nanoseconds. - Weight::from_parts(33_560_000, 5302) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:0) + /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking TopDelegations (r:1 w:1) @@ -432,54 +503,45 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) - fn delegator_bond_more() -> Weight { - // Proof Size summary in bytes: - // Measured: `1066` - // Estimated: `23667` - // Minimum execution time: 103_840 nanoseconds. - Weight::from_parts(105_370_000, 23667) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(7)) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - fn schedule_delegator_bond_less() -> Weight { + fn execute_revoke_delegation() -> Weight { // Proof Size summary in bytes: - // Measured: `176` - // Estimated: `5302` - // Minimum execution time: 28_110 nanoseconds. - Weight::from_parts(34_080_000, 5302) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + // Measured: `964` + // Estimated: `4752` + // Minimum execution time: 113_086_000 picoseconds. + Weight::from_parts(115_421_000, 4752) + .saturating_add(T::DbWeight::get().reads(10_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) } /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:0) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking TopDelegations (r:1 w:1) /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking BottomDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) - fn execute_revoke_delegation() -> Weight { + fn execute_delegator_revoke_delegation_worst() -> Weight { // Proof Size summary in bytes: - // Measured: `1243` - // Estimated: `28447` - // Minimum execution time: 103_180 nanoseconds. - Weight::from_parts(126_781_000, 28447) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(8)) + // Measured: `37308` + // Estimated: `40773` + // Minimum execution time: 179_325_000 picoseconds. + Weight::from_parts(182_100_000, 40773) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(10_u64)) } /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) @@ -488,49 +550,44 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Storage: ParachainStaking CandidateInfo (r:1 w:1) /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) /// Storage: ParachainStaking TopDelegations (r:1 w:1) /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking BottomDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) - fn execute_delegator_bond_less() -> Weight { + fn execute_delegator_bond_less_worst() -> Weight { // Proof Size summary in bytes: - // Measured: `1188` - // Estimated: `24399` - // Minimum execution time: 80_960 nanoseconds. - Weight::from_parts(95_831_000, 24399) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(8)) + // Measured: `29930` + // Estimated: `33395` + // Minimum execution time: 150_818_000 picoseconds. + Weight::from_parts(152_294_000, 33395) + .saturating_add(T::DbWeight::get().reads(10_u64)) + .saturating_add(T::DbWeight::get().writes(9_u64)) } /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - fn cancel_revoke_delegation() -> Weight { - // Proof Size summary in bytes: - // Measured: `298` - // Estimated: `5546` - // Minimum execution time: 27_681 nanoseconds. - Weight::from_parts(34_100_000, 5546) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - fn cancel_delegator_bond_less() -> Weight { - // Proof Size summary in bytes: - // Measured: `298` - // Estimated: `5546` - // Minimum execution time: 34_470 nanoseconds. - Weight::from_parts(35_990_000, 5546) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) + /// The range of component `x` is `[0, 349]`. + fn cancel_delegation_request(x: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `663 + x * (42 ±0)` + // Estimated: `4092 + x * (43 ±0)` + // Minimum execution time: 30_062_000 picoseconds. + Weight::from_parts(37_242_991, 4092) + // Standard Error: 767 + .saturating_add(Weight::from_parts(62_995, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) } /// Storage: ParachainStaking Points (r:1 w:0) /// Proof Skipped: ParachainStaking Points (max_values: None, max_size: None, mode: Measured) @@ -541,19 +598,19 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Storage: ParachainStaking ParachainBondInfo (r:1 w:0) /// Proof Skipped: ParachainStaking ParachainBondInfo (max_values: Some(1), max_size: None, mode: Measured) /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) /// Storage: ParachainStaking CollatorCommission (r:1 w:0) /// Proof Skipped: ParachainStaking CollatorCommission (max_values: Some(1), max_size: None, mode: Measured) /// Storage: ParachainStaking DelayedPayouts (r:0 w:1) /// Proof Skipped: ParachainStaking DelayedPayouts (max_values: None, max_size: None, mode: Measured) fn prepare_staking_payouts() -> Weight { // Proof Size summary in bytes: - // Measured: `438` - // Estimated: `11670` - // Minimum execution time: 57_220 nanoseconds. - Weight::from_parts(58_131_000, 11670) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) + // Measured: `380` + // Estimated: `3845` + // Minimum execution time: 48_260_000 picoseconds. + Weight::from_parts(49_856_000, 3845) + .saturating_add(T::DbWeight::get().reads(6_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) @@ -562,14 +619,14 @@ impl pallet_parachain_staking::weights::WeightInfo for /// The range of component `y` is `[0, 100]`. fn get_rewardable_delegators(y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `118 + y * (48 ±0)` - // Estimated: `5180 + y * (96 ±0)` - // Minimum execution time: 9_370 nanoseconds. - Weight::from_parts(11_359_043, 5180) - // Standard Error: 1_783 - .saturating_add(Weight::from_parts(143_685, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(Weight::from_parts(0, 96).saturating_mul(y.into())) + // Measured: `73 + y * (36 ±0)` + // Estimated: `3537 + y * (36 ±0)` + // Minimum execution time: 8_183_000 picoseconds. + Weight::from_parts(10_416_160, 3537) + // Standard Error: 780 + .saturating_add(Weight::from_parts(44_865, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(y.into())) } /// Storage: ParachainStaking TotalSelected (r:1 w:0) /// Proof Skipped: ParachainStaking TotalSelected (max_values: Some(1), max_size: None, mode: Measured) @@ -591,20 +648,61 @@ impl pallet_parachain_staking::weights::WeightInfo for /// The range of component `y` is `[0, 100]`. fn select_top_candidates(x: u32, y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + x * (5122 ±0) + y * (2400 ±0)` - // Estimated: `13898 + x * (26124 ±53) + y * (6816 ±26)` - // Minimum execution time: 37_410 nanoseconds. - Weight::from_parts(37_950_000, 13898) - // Standard Error: 177_349 - .saturating_add(Weight::from_parts(30_156_055, 0).saturating_mul(x.into())) - // Standard Error: 88_439 - .saturating_add(Weight::from_parts(2_943_699, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(6)) + // Measured: `0 + x * (3816 ±0) + y * (1800 ±0)` + // Estimated: `3730 + x * (3975 ±39) + y * (639 ±19)` + // Minimum execution time: 31_870_000 picoseconds. + Weight::from_parts(32_158_000, 3730) + // Standard Error: 51_554 + .saturating_add(Weight::from_parts(22_540_635, 0).saturating_mul(x.into())) + // Standard Error: 25_709 + .saturating_add(Weight::from_parts(957_745, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(2_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x.into()))) - .saturating_add(Weight::from_parts(0, 26124).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 6816).saturating_mul(y.into())) + .saturating_add(Weight::from_parts(0, 3975).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 639).saturating_mul(y.into())) + } + /// Storage: System Account (r:349 w:349) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: ParachainStaking DelegatorState (r:349 w:349) + /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) + /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) + /// Storage: Balances Locks (r:349 w:349) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:349 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) + /// Storage: ParachainStaking CandidateInfo (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking TopDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking CandidatePool (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainStaking Total (r:1 w:1) + /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainStaking BottomDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) + /// The range of component `x` is `[0, 349]`. + /// The range of component `y` is `[0, 349]`. + /// The range of component `z` is `[0, 349]`. + fn pay_one_collator_reward_best(x: u32, y: u32, z: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `0 + x * (395 ±0) + y * (156 ±0) + z * (41 ±0)` + // Estimated: `125757 + x * (2591 ±19) + y * (2234 ±19) + z * (28 ±0)` + // Minimum execution time: 459_000 picoseconds. + Weight::from_parts(472_000, 125757) + // Standard Error: 685_607 + .saturating_add(Weight::from_parts(74_007_162, 0).saturating_mul(x.into())) + // Standard Error: 685_607 + .saturating_add(Weight::from_parts(43_825_857, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(y.into()))) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(y.into()))) + .saturating_add(Weight::from_parts(0, 2591).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 2234).saturating_mul(y.into())) + .saturating_add(Weight::from_parts(0, 28).saturating_mul(z.into())) } /// Storage: ParachainStaking DelayedPayouts (r:1 w:0) /// Proof Skipped: ParachainStaking DelayedPayouts (max_values: None, max_size: None, mode: Measured) @@ -614,29 +712,33 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Proof Skipped: ParachainStaking AtStake (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking AwardedPts (r:1 w:1) /// Proof Skipped: ParachainStaking AwardedPts (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) + /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) + /// Storage: MoonbeamOrbiters OrbiterPerRound (r:1 w:0) + /// Proof Skipped: MoonbeamOrbiters OrbiterPerRound (max_values: None, max_size: None, mode: Measured) /// Storage: System Account (r:301 w:301) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) /// The range of component `y` is `[0, 300]`. fn pay_one_collator_reward(y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `485 + y * (219 ±0)` - // Estimated: `16898 + y * (3483 ±0)` - // Minimum execution time: 67_041 nanoseconds. - Weight::from_parts(50_795_146, 16898) - // Standard Error: 39_567 - .saturating_add(Weight::from_parts(21_634_242, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(6)) + // Measured: `1208 + y * (160 ±0)` + // Estimated: `6978 + y * (2591 ±0)` + // Minimum execution time: 65_428_000 picoseconds. + Weight::from_parts(68_535_135, 6978) + // Standard Error: 6_093 + .saturating_add(Weight::from_parts(25_186_464, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(y.into()))) - .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(T::DbWeight::get().writes(3_u64)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(y.into()))) - .saturating_add(Weight::from_parts(0, 3483).saturating_mul(y.into())) + .saturating_add(Weight::from_parts(0, 2591).saturating_mul(y.into())) } fn base_on_initialize() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_940 nanoseconds. - Weight::from_parts(2_240_000, 0) + // Minimum execution time: 2_024_000 picoseconds. + Weight::from_parts(2_168_000, 0) } /// Storage: ParachainStaking DelegatorState (r:1 w:0) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) @@ -646,21 +748,21 @@ impl pallet_parachain_staking::weights::WeightInfo for /// The range of component `y` is `[0, 100]`. fn set_auto_compound(x: u32, y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `718 + x * (34 ±0) + y * (48 ±0)` - // Estimated: `6134 + x * (70 ±0) + y * (98 ±0)` - // Minimum execution time: 45_920 nanoseconds. - Weight::from_parts(57_096_271, 6134) - // Standard Error: 899 - .saturating_add(Weight::from_parts(84_579, 0).saturating_mul(x.into())) - // Standard Error: 2_691 - .saturating_add(Weight::from_parts(64_670, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 70).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 98).saturating_mul(y.into())) + // Measured: `671 + x * (22 ±0) + y * (36 ±0)` + // Estimated: `4027 + x * (23 ±0) + y * (36 ±0)` + // Minimum execution time: 34_494_000 picoseconds. + Weight::from_parts(33_677_881, 4027) + // Standard Error: 278 + .saturating_add(Weight::from_parts(45_734, 0).saturating_mul(x.into())) + // Standard Error: 833 + .saturating_add(Weight::from_parts(39_753, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(2_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(Weight::from_parts(0, 23).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(y.into())) } /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) /// Storage: ParachainStaking DelegatorState (r:1 w:1) /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) /// Storage: ParachainStaking CandidateInfo (r:1 w:1) @@ -674,7 +776,9 @@ impl pallet_parachain_staking::weights::WeightInfo for /// Storage: ParachainStaking CandidatePool (r:1 w:1) /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:1 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) /// Storage: ParachainStaking Total (r:1 w:1) /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) /// The range of component `x` is `[0, 350]`. @@ -682,31 +786,86 @@ impl pallet_parachain_staking::weights::WeightInfo for /// The range of component `z` is `[0, 99]`. fn delegate_with_auto_compound(x: u32, y: u32, z: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + x * (84 ±0) + y * (33 ±0) + z * (114 ±0)` - // Estimated: `127262 + x * (367 ±0) + y * (73 ±0) + z * (230 ±1)` - // Minimum execution time: 120_201 nanoseconds. - Weight::from_parts(118_425_126, 127262) - // Standard Error: 2_407 - .saturating_add(Weight::from_parts(242_420, 0).saturating_mul(x.into())) - // Standard Error: 2_413 - .saturating_add(Weight::from_parts(48_797, 0).saturating_mul(y.into())) - // Standard Error: 8_501 - .saturating_add(Weight::from_parts(281_230, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(8)) - .saturating_add(Weight::from_parts(0, 367).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 73).saturating_mul(y.into())) - .saturating_add(Weight::from_parts(0, 230).saturating_mul(z.into())) + // Measured: `0 + x * (60 ±0) + y * (21 ±0) + z * (78 ±0)` + // Estimated: `26253 + x * (44 ±0) + y * (19 ±0) + z * (76 ±1)` + // Minimum execution time: 130_103_000 picoseconds. + Weight::from_parts(116_616_415, 26253) + // Standard Error: 1_141 + .saturating_add(Weight::from_parts(117_041, 0).saturating_mul(x.into())) + // Standard Error: 4_030 + .saturating_add(Weight::from_parts(178_483, 0).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(8_u64)) + .saturating_add(Weight::from_parts(0, 44).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 19).saturating_mul(y.into())) + .saturating_add(Weight::from_parts(0, 76).saturating_mul(z.into())) + } + /// Storage: System Account (r:2 w:2) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: ParachainStaking DelegatorState (r:2 w:2) + /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking CandidateInfo (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking TopDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking BottomDelegations (r:1 w:1) + /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: Balances Locks (r:2 w:2) + /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) + /// Storage: Balances Freezes (r:2 w:0) + /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) + /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) + /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking CandidatePool (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainStaking Total (r:1 w:1) + /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + fn delegate_with_auto_compound_worst() -> Weight { + // Proof Size summary in bytes: + // Measured: `48167` + // Estimated: `54107` + // Minimum execution time: 276_584_000 picoseconds. + Weight::from_parts(279_594_000, 54107) + .saturating_add(T::DbWeight::get().reads(15_u64)) + .saturating_add(T::DbWeight::get().writes(13_u64)) } /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) fn mint_collator_reward() -> Weight { // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `2607` - // Minimum execution time: 23_320 nanoseconds. - Weight::from_parts(28_710_000, 2607) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) + // Measured: `128` + // Estimated: `3581` + // Minimum execution time: 28_741_000 picoseconds. + Weight::from_parts(29_344_000, 3581) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: ParachainStaking EnableMarkingOffline (r:1 w:0) + /// Proof Skipped: ParachainStaking EnableMarkingOffline (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainStaking TotalSelected (r:1 w:0) + /// Proof Skipped: ParachainStaking TotalSelected (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainStaking SelectedCandidates (r:1 w:0) + /// Proof Skipped: ParachainStaking SelectedCandidates (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: ParachainStaking AtStake (r:2 w:0) + /// Proof Skipped: ParachainStaking AtStake (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking AwardedPts (r:2 w:0) + /// Proof Skipped: ParachainStaking AwardedPts (max_values: None, max_size: None, mode: Measured) + /// Storage: MoonbeamOrbiters OrbiterPerRound (r:1 w:0) + /// Proof Skipped: MoonbeamOrbiters OrbiterPerRound (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking CandidateInfo (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) + /// Storage: ParachainStaking CandidatePool (r:1 w:1) + /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) + fn notify_inactive_collator() -> Weight { + // Proof Size summary in bytes: + // Measured: `11494` + // Estimated: `17434` + // Minimum execution time: 41_130_000 picoseconds. + Weight::from_parts(41_130_000, 0) + .saturating_add(Weight::from_parts(0, 17434)) + .saturating_add(T::DbWeight::get().reads(10_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) } } diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index a32835f6e..dbf7ce3f9 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -18,11 +18,11 @@ pallet-contracts = { workspace = true } pallet-contracts-primitives = { workspace = true } pallet-democracy = { workspace = true } pallet-identity = { workspace = true } +pallet-insecure-randomness-collective-flip = { workspace = true } pallet-membership = { workspace = true } pallet-multisig = { workspace = true } pallet-preimage = { workspace = true } pallet-proxy = { workspace = true } -pallet-randomness-collective-flip = { workspace = true } pallet-scheduler = { workspace = true } pallet-timestamp = { workspace = true } pallet-transaction-payment = { workspace = true } @@ -77,14 +77,14 @@ session-keys-primitives = { workspace = true, optional = true } # Polkadot -polkadot-parachain = { workspace = true, optional = true } +polkadot-parachain-primitives = { workspace = true, optional = true } # Standalone pallet-aura = { workspace = true } pallet-grandpa = { workspace = true } sp-consensus-aura = { workspace = true } -sp-finality-grandpa = { workspace = true } +sp-consensus-grandpa = { workspace = true } # Utility cfg-if = { workspace = true } @@ -96,6 +96,7 @@ orml-asset-registry = { workspace = true, optional = true } orml-unknown-tokens = { workspace = true, optional = true } orml-xcm-support = { workspace = true, optional = true } orml-xtokens = { workspace = true, optional = true } +pallet-message-queue = { workspace = true, optional = true } pallet-xcm = { workspace = true, optional = true } polkadot-runtime = { workspace = true, optional = true } polkadot-runtime-parachains = { workspace = true, optional = true } @@ -124,6 +125,10 @@ zrml-swaps = { workspace = true } zrml-swaps-runtime-api = { workspace = true } [dev-dependencies] +env_logger = { workspace = true } +pallet-im-online = { workspace = true, features = ["default"] } +sp-authority-discovery = { workspace = true, features = ["default"] } +sp-consensus-babe = { workspace = true, features = ["default"] } sp-io = { workspace = true, features = ["default"] } test-case = { workspace = true } xcm-emulator = { workspace = true } @@ -150,7 +155,7 @@ parachain = [ "pallet-author-mapping", "pallet-author-slot-filter", "pallet-parachain-staking", - "polkadot-parachain", + "polkadot-parachain-primitives", "session-keys-primitives", # XCM @@ -161,6 +166,7 @@ parachain = [ "orml-unknown-tokens", "orml-xcm-support", "orml-xtokens", + "pallet-message-queue", "pallet-xcm", "xcm-builder", "xcm-executor", @@ -242,10 +248,11 @@ std = [ "pallet-democracy/std", "pallet-identity/std", "pallet-membership/std", + "pallet-message-queue?/std", "pallet-multisig/std", "pallet-preimage/std", "pallet-proxy/std", - "pallet-randomness-collective-flip/std", + "pallet-insecure-randomness-collective-flip/std", "pallet-scheduler/std", "pallet-timestamp/std", "pallet-transaction-payment-rpc-runtime-api/std", @@ -310,7 +317,7 @@ std = [ "pallet-aura/std", "pallet-grandpa/std", "sp-consensus-aura/std", - "sp-finality-grandpa/std", + "sp-consensus-grandpa/std", # Zeitgeist @@ -336,12 +343,11 @@ try-runtime = [ "frame-try-runtime/try-runtime", # For every pallet in the runtime include try-runtime - # System runtime pallets "frame-support/try-runtime", "frame-system/try-runtime", "pallet-timestamp/try-runtime", - "pallet-randomness-collective-flip/try-runtime", + "pallet-insecure-randomness-collective-flip/try-runtime", "pallet-scheduler/try-runtime", "pallet-preimage/try-runtime", @@ -405,13 +411,16 @@ try-runtime = [ "cumulus-pallet-xcm?/try-runtime", "cumulus-pallet-xcmp-queue?/try-runtime", "parachain-info?/try-runtime", + + # Polkadot + "polkadot-runtime?/try-runtime", ] # Allow to print logs details (no wasm:stripped) force-debug = ["sp-debug-derive/force-debug"] [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zeitgeist-runtime" version = "0.5.2" diff --git a/runtime/zeitgeist/src/integration_tests/xcm/genesis/mod.rs b/runtime/zeitgeist/src/integration_tests/xcm/genesis/mod.rs new file mode 100644 index 000000000..5b5ed972a --- /dev/null +++ b/runtime/zeitgeist/src/integration_tests/xcm/genesis/mod.rs @@ -0,0 +1,19 @@ +// Copyright 2024 Forecasting Technologies LTD. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +pub(super) mod polkadot; +pub(super) mod zeitgeist; diff --git a/runtime/zeitgeist/src/integration_tests/xcm/genesis/polkadot.rs b/runtime/zeitgeist/src/integration_tests/xcm/genesis/polkadot.rs new file mode 100644 index 000000000..99e61bc08 --- /dev/null +++ b/runtime/zeitgeist/src/integration_tests/xcm/genesis/polkadot.rs @@ -0,0 +1,135 @@ +// Copyright 2024 Forecasting Technologies LTD. +// +// Copyright (C) Parity Technologies (UK) Ltd. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +use crate::integration_tests::xcm::setup::{accounts, accounts::get_from_seed, dot}; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; +use polkadot_primitives::{AccountId, AssignmentId, BlockNumber, ValidatorId}; +use polkadot_runtime_parachains::configuration::HostConfiguration; +use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; +use sp_consensus_babe::AuthorityId as BabeId; +use sp_consensus_grandpa::AuthorityId as GrandpaId; +use sp_core::{sr25519, storage::Storage}; +use sp_runtime::BuildStorage; +use xcm_emulator::helpers::get_account_id_from_seed; + +const ENDOWMENT: u128 = dot(1_000_000); + +fn session_keys( + grandpa: GrandpaId, + babe: BabeId, + im_online: ImOnlineId, + para_validator: ValidatorId, + para_assignment: AssignmentId, + authority_discovery: AuthorityDiscoveryId, +) -> polkadot_runtime::SessionKeys { + polkadot_runtime::SessionKeys { + grandpa, + babe, + im_online, + para_validator, + para_assignment, + authority_discovery, + } +} + +fn get_host_config() -> HostConfiguration { + HostConfiguration { + max_upward_queue_count: 10, + max_upward_queue_size: 51200, + max_upward_message_size: 51200, + max_upward_message_num_per_candidate: 10, + max_downward_message_size: 51200, + hrmp_sender_deposit: 0, + hrmp_recipient_deposit: 0, + hrmp_channel_max_capacity: 1000, + hrmp_channel_max_message_size: 102400, + hrmp_channel_max_total_size: 102400, + hrmp_max_parachain_outbound_channels: 30, + hrmp_max_parachain_inbound_channels: 30, + ..Default::default() + } +} + +mod validators { + use super::*; + + #[allow(clippy::type_complexity)] + pub fn initial_authorities() -> Vec<( + AccountId, + AccountId, + GrandpaId, + BabeId, + ImOnlineId, + ValidatorId, + AssignmentId, + AuthorityDiscoveryId, + )> { + let seed = "Alice"; + vec![( + get_account_id_from_seed::(&format!("{}//stash", seed)), + get_account_id_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + get_from_seed::(seed), + )] + } +} + +pub(crate) fn genesis() -> Storage { + let genesis_config = polkadot_runtime::RuntimeGenesisConfig { + system: polkadot_runtime::SystemConfig { + code: polkadot_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::default() + }, + balances: polkadot_runtime::BalancesConfig { + balances: accounts::init_balances().iter().map(|k| (k.clone(), ENDOWMENT)).collect(), + }, + session: polkadot_runtime::SessionConfig { + keys: validators::initial_authorities() + .iter() + .map(|x| { + ( + x.0.clone(), + x.0.clone(), + session_keys( + x.2.clone(), + x.3.clone(), + x.4.clone(), + x.5.clone(), + x.6.clone(), + x.7.clone(), + ), + ) + }) + .collect::>(), + }, + babe: polkadot_runtime::BabeConfig { + authorities: Default::default(), + epoch_config: Some(polkadot_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() + }, + configuration: polkadot_runtime::ConfigurationConfig { config: get_host_config() }, + ..Default::default() + }; + + genesis_config.build_storage().unwrap() +} diff --git a/runtime/zeitgeist/src/integration_tests/xcm/genesis/zeitgeist.rs b/runtime/zeitgeist/src/integration_tests/xcm/genesis/zeitgeist.rs new file mode 100644 index 000000000..45d9e00d6 --- /dev/null +++ b/runtime/zeitgeist/src/integration_tests/xcm/genesis/zeitgeist.rs @@ -0,0 +1,81 @@ +// Copyright 2024 Forecasting Technologies LTD. +// +// This file is part of Zeitgeist. +// +// Zeitgeist is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by the +// Free Software Foundation, either version 3 of the License, or (at +// your option) any later version. +// +// Zeitgeist is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Zeitgeist. If not, see . + +use crate::{ + integration_tests::xcm::setup::{ + accounts, ztg, BTC_ID, ETH_ID, FOREIGN_PARENT_ID, FOREIGN_SIBLING_ID, FOREIGN_ZTG_ID, + }, + parachain_params::MinCandidateStk, + parameters::ZeitgeistTreasuryAccount, +}; +use nimbus_primitives::NimbusId; +use sp_core::storage::Storage; +use sp_runtime::BuildStorage; + +const ENDOWMENT: u128 = ztg(1_000_000_000_000_000); +const SAFE_XCM_VERSION: u32 = 2; + +pub(crate) fn genesis(parachain_id: u32) -> Storage { + let genesis_config = crate::RuntimeGenesisConfig { + author_mapping: crate::AuthorMappingConfig { + mappings: vec![( + accounts::get_from_seed::(accounts::ALICE), + accounts::alice(), + )], + }, + balances: crate::BalancesConfig { + balances: accounts::init_balances() + .iter() + .map(|k| (k.clone(), ztg(ENDOWMENT))) + .collect(), + }, + parachain_info: crate::ParachainInfoConfig { + parachain_id: parachain_id.into(), + ..Default::default() + }, + parachain_staking: crate::ParachainStakingConfig { + candidates: vec![(accounts::alice(), MinCandidateStk::get())], + ..Default::default() + }, + polkadot_xcm: crate::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() + }, + system: crate::SystemConfig { + code: crate::WASM_BINARY.unwrap().to_vec(), + ..Default::default() + }, + tokens: crate::TokensConfig { + balances: accounts::init_balances() + .iter() + .chain([(ZeitgeistTreasuryAccount::get())].iter()) + .flat_map(|k| { + vec![ + (k.clone(), FOREIGN_PARENT_ID, ENDOWMENT), + (k.clone(), FOREIGN_SIBLING_ID, ENDOWMENT), + (k.clone(), FOREIGN_ZTG_ID, ENDOWMENT), + (k.clone(), BTC_ID, ENDOWMENT), + (k.clone(), ETH_ID, ENDOWMENT), + ] + }) + .collect::>(), + }, + ..Default::default() + }; + + genesis_config.build_storage().unwrap() +} diff --git a/runtime/zeitgeist/src/integration_tests/xcm/mod.rs b/runtime/zeitgeist/src/integration_tests/xcm/mod.rs index d37a62036..9ba9a1de3 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/mod.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -17,6 +17,7 @@ #![cfg(all(feature = "parachain", test))] +mod genesis; mod setup; mod test_net; mod tests; diff --git a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs index 5343a2bff..3dd142182 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/setup.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/setup.rs @@ -1,5 +1,4 @@ // Copyright 2022-2024 Forecasting Technologies LTD. -// Copyright 2021 Centrifuge Foundation (centrifuge.io). // // This file is part of Zeitgeist. // @@ -18,90 +17,71 @@ use crate::{ xcm_config::config::{general_key, zeitgeist}, - AccountId, AssetRegistry, Balance, CurrencyId, ExistentialDeposit, Runtime, RuntimeOrigin, - System, + AccountId, AssetRegistry, AssetRegistryStringLimit, Balance, CurrencyId, ExistentialDeposit, + RuntimeOrigin, }; -use frame_support::{assert_ok, traits::GenesisBuild}; +use frame_support::assert_ok; use orml_traits::asset_registry::AssetMetadata; -use sp_runtime::AccountId32; +use sp_core::{sr25519, Pair, Public}; use xcm::{ latest::{Junction::Parachain, Junctions::X2, MultiLocation}, VersionedMultiLocation, }; +use xcm_emulator::helpers::get_account_id_from_seed; use zeitgeist_primitives::types::{Asset, CustomMetadata}; -pub(super) struct ExtBuilder { - balances: Vec<(AccountId, CurrencyId, Balance)>, - parachain_id: u32, -} - -impl Default for ExtBuilder { - fn default() -> Self { - Self { balances: vec![], parachain_id: zeitgeist::ID } +pub(super) mod accounts { + use super::*; + pub const ALICE: &str = "Alice"; + pub const BOB: &str = "Bob"; + pub const CHARLIE: &str = "Charlie"; + pub const DAVE: &str = "Dave"; + pub const EVE: &str = "Eve"; + pub const FERDIE: &str = "Ferdie"; + pub const ALICE_STASH: &str = "Alice//stash"; + pub const BOB_STASH: &str = "Bob//stash"; + pub const CHARLIE_STASH: &str = "Charlie//stash"; + pub const DAVE_STASH: &str = "Dave//stash"; + pub const EVE_STASH: &str = "Eve//stash"; + pub const FERDIE_STASH: &str = "Ferdie//stash"; + + pub fn init_balances() -> Vec { + vec![ + get_account_id_from_seed::(ALICE), + get_account_id_from_seed::(BOB), + get_account_id_from_seed::(CHARLIE), + get_account_id_from_seed::(DAVE), + get_account_id_from_seed::(EVE), + get_account_id_from_seed::(FERDIE), + get_account_id_from_seed::(ALICE_STASH), + get_account_id_from_seed::(BOB_STASH), + get_account_id_from_seed::(CHARLIE_STASH), + get_account_id_from_seed::(DAVE_STASH), + get_account_id_from_seed::(EVE_STASH), + get_account_id_from_seed::(FERDIE_STASH), + ] } -} -impl ExtBuilder { - pub fn set_balances(mut self, balances: Vec<(AccountId, CurrencyId, Balance)>) -> Self { - self.balances = balances; - self + pub fn alice() -> AccountId { + get_account_id_from_seed::(ALICE) } - pub fn set_parachain_id(mut self, parachain_id: u32) -> Self { - self.parachain_id = parachain_id; - self + pub fn bob() -> AccountId { + get_account_id_from_seed::(BOB) } - pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - let native_currency_id = CurrencyId::Ztg; - pallet_balances::GenesisConfig:: { - balances: self - .balances - .clone() - .into_iter() - .filter(|(_, currency_id, _)| *currency_id == native_currency_id) - .map(|(account_id, _, initial_balance)| (account_id, initial_balance)) - .collect::>(), - } - .assimilate_storage(&mut t) - .unwrap(); - - orml_tokens::GenesisConfig:: { - balances: self - .balances - .into_iter() - .filter(|(_, currency_id, _)| *currency_id != native_currency_id) - .collect::>(), - } - .assimilate_storage(&mut t) - .unwrap(); - - >::assimilate_storage( - ¶chain_info::GenesisConfig { parachain_id: self.parachain_id.into() }, - &mut t, - ) - .unwrap(); - - >::assimilate_storage( - &pallet_xcm::GenesisConfig { safe_xcm_version: Some(2) }, - &mut t, - ) - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); - ext + /// Helper function to generate a crypto pair from seed + pub fn get_from_seed(seed: &str) -> ::Public { + TPublic::Pair::from_string(&format!("//{}", seed), None) + .expect("static values are valid; qed") + .public() } } -/// Accounts -pub const ALICE: AccountId32 = AccountId32::new([0u8; 32]); -pub const BOB: AccountId32 = AccountId32::new([1u8; 32]); - /// A PARA ID used for a sibling parachain. /// It must be one that doesn't collide with any other in use. pub const PARA_ID_SIBLING: u32 = 3000; +pub const PARA_ID_ZEITGEIST: u32 = zeitgeist::ID; /// IDs that are used to represent tokens from other chains pub const FOREIGN_ZTG_ID: Asset = CurrencyId::ForeignAsset(0); @@ -152,7 +132,7 @@ pub(super) const fn adjusted_balance(foreign_base: Balance, amount: Balance) -> // Multilocations that are used to represent tokens from other chains #[inline] pub(super) fn foreign_ztg_multilocation() -> MultiLocation { - MultiLocation::new(1, X2(Parachain(zeitgeist::ID), general_key(zeitgeist::KEY))) + MultiLocation::new(1, X2(Parachain(PARA_ID_ZEITGEIST), general_key(zeitgeist::KEY))) } #[inline] @@ -167,10 +147,10 @@ pub(super) fn foreign_parent_multilocation() -> MultiLocation { pub(super) fn register_foreign_ztg(additional_meta: Option) { // Register ZTG as foreign asset. - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 10, - name: "Zeitgeist".into(), - symbol: "ZTG".into(), + name: "Zeitgeist".as_bytes().to_vec().try_into().unwrap(), + symbol: "ZTG".as_bytes().to_vec().try_into().unwrap(), existential_deposit: ExistentialDeposit::get(), location: Some(VersionedMultiLocation::V3(foreign_ztg_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -180,10 +160,10 @@ pub(super) fn register_foreign_ztg(additional_meta: Option) { } pub(super) fn register_btc(additional_meta: Option) { - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 8, - name: "Bitcoin".into(), - symbol: "BTC".into(), + name: "Bitcoin".as_bytes().to_vec().try_into().unwrap(), + symbol: "BTC".as_bytes().to_vec().try_into().unwrap(), existential_deposit: ExistentialDeposit::get(), location: Some(VersionedMultiLocation::V3(foreign_sibling_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -193,10 +173,10 @@ pub(super) fn register_btc(additional_meta: Option) { } pub(super) fn register_eth(additional_meta: Option) { - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 18, - name: "Ethereum".into(), - symbol: "ETH".into(), + name: "Ethereum".as_bytes().to_vec().try_into().unwrap(), + symbol: "ETH".as_bytes().to_vec().try_into().unwrap(), existential_deposit: ExistentialDeposit::get(), location: Some(VersionedMultiLocation::V3(foreign_sibling_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -207,10 +187,10 @@ pub(super) fn register_eth(additional_meta: Option) { pub(super) fn register_foreign_sibling(additional_meta: Option) { // Register native Sibling token as foreign asset. - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 10, - name: "Sibling".into(), - symbol: "SBL".into(), + name: "Sibling".as_bytes().to_vec().try_into().unwrap(), + symbol: "SBL".as_bytes().to_vec().try_into().unwrap(), existential_deposit: ExistentialDeposit::get(), location: Some(VersionedMultiLocation::V3(foreign_sibling_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -225,10 +205,10 @@ pub(super) fn register_foreign_sibling(additional_meta: Option) pub(super) fn register_foreign_parent(additional_meta: Option) { // Register dot as foreign asset in the sibling parachain - let meta: AssetMetadata = AssetMetadata { + let meta: AssetMetadata = AssetMetadata { decimals: 10, - name: "Polkadot".into(), - symbol: "DOT".into(), + name: "Polkadot".as_bytes().to_vec().try_into().unwrap(), + symbol: "DOT".as_bytes().to_vec().try_into().unwrap(), existential_deposit: 10_000_000_000, // 1 location: Some(VersionedMultiLocation::V3(foreign_parent_multilocation())), additional: additional_meta.unwrap_or_default(), @@ -244,12 +224,12 @@ pub(super) fn sibling_parachain_account() -> AccountId { #[inline] pub(super) fn zeitgeist_parachain_account() -> AccountId { - parachain_account(zeitgeist::ID) + parachain_account(PARA_ID_ZEITGEIST) } #[inline] fn parachain_account(id: u32) -> AccountId { use sp_runtime::traits::AccountIdConversion; - polkadot_parachain::primitives::Sibling::from(id).into_account_truncating() + polkadot_parachain_primitives::primitives::Sibling::from(id).into_account_truncating() } diff --git a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs index 11f94529b..b44d3d246 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/test_net.rs @@ -1,5 +1,4 @@ // Copyright 2022-2024 Forecasting Technologies LTD. -// Copyright 2021-2022 Centrifuge GmbH (centrifuge.io). // // This file is part of Zeitgeist. // @@ -16,131 +15,78 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . +use super::{ + genesis::{polkadot, zeitgeist}, + setup::{PARA_ID_SIBLING, PARA_ID_ZEITGEIST}, +}; use crate::{ - parameters::ZeitgeistTreasuryAccount, xcm_config::config::zeitgeist, CurrencyId, DmpQueue, - Runtime, RuntimeOrigin, XcmpQueue, + xcm_config::config::LocationToAccountId, AssetManager, Balances, DmpQueue, ParachainInfo, + PolkadotXcm, XTokens, XcmpQueue, +}; +use xcm_emulator::{ + decl_test_networks, decl_test_parachains, decl_test_relay_chains, DefaultMessageProcessor, }; -use frame_support::{traits::GenesisBuild, weights::Weight}; -use polkadot_primitives::v2::{BlockNumber, MAX_CODE_SIZE, MAX_POV_SIZE}; -use polkadot_runtime_parachains::configuration::HostConfiguration; -use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; - -use super::setup::{dot, ztg, ExtBuilder, ALICE, FOREIGN_PARENT_ID, PARA_ID_SIBLING}; -decl_test_relay_chain! { - pub struct PolkadotNet { - Runtime = polkadot_runtime::Runtime, - XcmConfig = polkadot_runtime::xcm_config::XcmConfig, - new_ext = relay_ext(), - } +decl_test_relay_chains! { + #[api_version(5)] + pub struct Polkadot { + genesis = polkadot::genesis(), + on_init = (), + runtime = polkadot_runtime, + core = { + MessageProcessor: DefaultMessageProcessor, + SovereignAccountOf: polkadot_runtime::xcm_config::SovereignAccountOf, + }, + pallets = { + XcmPallet: polkadot_runtime::XcmPallet, + Balances: polkadot_runtime::Balances, + } + }, } - -decl_test_parachain! { +decl_test_parachains! { pub struct Zeitgeist { - Runtime = Runtime, - RuntimeOrigin = RuntimeOrigin, - XcmpMessageHandler = XcmpQueue, - DmpMessageHandler = DmpQueue, - new_ext = para_ext(zeitgeist::ID), - } -} - -decl_test_parachain! { + genesis = zeitgeist::genesis(PARA_ID_ZEITGEIST), + on_init = (), + runtime = crate, + core = { + XcmpMessageHandler: XcmpQueue, + DmpMessageHandler: DmpQueue, + LocationToAccountId: LocationToAccountId, + ParachainInfo: ParachainInfo, + }, + pallets = { + PolkadotXcm: PolkadotXcm, + AssetManager: AssetManager, + Balances: Balances, + XTokens: XTokens, + } + }, pub struct Sibling { - Runtime = Runtime, - RuntimeOrigin = RuntimeOrigin, - XcmpMessageHandler = XcmpQueue, - DmpMessageHandler = DmpQueue, - new_ext = para_ext(PARA_ID_SIBLING), - } + genesis = zeitgeist::genesis(PARA_ID_SIBLING), + on_init = (), + runtime = crate, + core = { + XcmpMessageHandler: XcmpQueue, + DmpMessageHandler: DmpQueue, + LocationToAccountId: LocationToAccountId, + ParachainInfo: ParachainInfo, + }, + pallets = { + PolkadotXcm: PolkadotXcm, + AssetManager: AssetManager, + Balances: Balances, + XTokens: XTokens, + } + }, } -decl_test_network! { +decl_test_networks! { pub struct TestNet { - relay_chain = PolkadotNet, + relay_chain = Polkadot, parachains = vec![ - // N.B: Ideally, we could use the defined para id constants but doing so - // fails with: "error: arbitrary expressions aren't allowed in patterns" - - // Be sure to use `xcm_config::config::zeitgeist::ID` - (2092, Zeitgeist), - // Be sure to use `PARA_ID_SIBLING` - (3000, Sibling), + Zeitgeist, + Sibling, ], - } -} - -pub(super) fn relay_ext() -> sp_io::TestExternalities { - use polkadot_runtime::{Runtime, System}; - - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); - - pallet_balances::GenesisConfig:: { balances: vec![(ALICE, dot(2002))] } - .assimilate_storage(&mut t) - .unwrap(); - - polkadot_runtime_parachains::configuration::GenesisConfig:: { - config: default_parachains_host_configuration(), - } - .assimilate_storage(&mut t) - .unwrap(); - - >::assimilate_storage( - &pallet_xcm::GenesisConfig { safe_xcm_version: Some(2) }, - &mut t, - ) - .unwrap(); - - let mut ext = sp_io::TestExternalities::new(t); - ext.execute_with(|| System::set_block_number(1)); - ext -} - -pub(super) fn para_ext(parachain_id: u32) -> sp_io::TestExternalities { - ExtBuilder::default() - .set_balances(vec![ - (ALICE, CurrencyId::Ztg, ztg(10)), - (ALICE, FOREIGN_PARENT_ID, dot(10)), - (ZeitgeistTreasuryAccount::get(), FOREIGN_PARENT_ID, dot(10)), - ]) - .set_parachain_id(parachain_id) - .build() -} - -fn default_parachains_host_configuration() -> HostConfiguration { - HostConfiguration { - minimum_validation_upgrade_delay: 5, - validation_upgrade_cooldown: 5u32, - validation_upgrade_delay: 5, - code_retention_period: 1200, - max_code_size: MAX_CODE_SIZE, - max_pov_size: MAX_POV_SIZE, - max_head_data_size: 32 * 1024, - group_rotation_frequency: 20, - chain_availability_period: 4, - thread_availability_period: 4, - max_upward_queue_count: 8, - max_upward_queue_size: 1024 * 1024, - max_downward_message_size: 1024, - ump_service_total_weight: Weight::from_ref_time(4_u64 * 1_000_000_000_u64), - max_upward_message_size: 50 * 1024, - max_upward_message_num_per_candidate: 5, - hrmp_sender_deposit: 0, - hrmp_recipient_deposit: 0, - hrmp_channel_max_capacity: 8, - hrmp_channel_max_total_size: 8 * 1024, - hrmp_max_parachain_inbound_channels: 4, - hrmp_max_parathread_inbound_channels: 4, - hrmp_channel_max_message_size: 1024 * 1024, - hrmp_max_parachain_outbound_channels: 4, - hrmp_max_parathread_outbound_channels: 4, - hrmp_max_message_num_per_candidate: 5, - dispute_period: 6, - no_show_slots: 2, - n_delay_tranches: 25, - needed_approvals: 2, - relay_vrf_modulo_samples: 2, - zeroth_delay_tranche_width: 0, - ..Default::default() + bridge = () } } diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs index da7e3ee03..076775890 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/currency_id_convert.rs @@ -21,101 +21,127 @@ use crate::{ setup::{ foreign_parent_multilocation, foreign_sibling_multilocation, foreign_ztg_multilocation, register_foreign_parent, register_foreign_sibling, FOREIGN_PARENT_ID, - FOREIGN_SIBLING_ID, + FOREIGN_SIBLING_ID, PARA_ID_ZEITGEIST, }, test_net::Zeitgeist, }, xcm_config::config::{general_key, zeitgeist, AssetConvert}, - CurrencyId, + CurrencyId, CustomMetadata, ScalarPosition, }; - -use frame_support::assert_err; -use sp_runtime::traits::Convert as C2; +use core::fmt::Debug; +use sp_runtime::traits::{Convert, MaybeEquivalence}; +use test_case::test_case; use xcm::latest::{Junction::*, Junctions::*, MultiLocation}; use xcm_emulator::TestExt; -use xcm_executor::traits::Convert as C1; +use zeitgeist_primitives::types::Asset; -#[test] -fn convert_native() { +fn convert_common_native(expected: T) +where + T: Copy + Debug + PartialEq, + AssetConvert: MaybeEquivalence + Convert>, +{ assert_eq!(zeitgeist::KEY.to_vec(), vec![0, 1]); // The way Ztg is represented relative within the Zeitgeist runtime let ztg_location_inner: MultiLocation = MultiLocation::new(0, X1(general_key(zeitgeist::KEY))); - assert_eq!(>::convert(ztg_location_inner), Ok(CurrencyId::Ztg)); + assert_eq!( + >::convert(&ztg_location_inner), + Some(expected) + ); // The canonical way Ztg is represented out in the wild Zeitgeist::execute_with(|| { assert_eq!( - >::convert(CurrencyId::Ztg), + >::convert(expected), Some(foreign_ztg_multilocation()) ) }); } -#[test] -fn convert_any_registered_parent_multilocation() { +fn convert_common_non_native( + expected: T, + multilocation: MultiLocation, + register: fn(Option), +) where + T: Copy + Debug + PartialEq, + AssetConvert: MaybeEquivalence + Convert>, +{ Zeitgeist::execute_with(|| { - assert_err!( - >::convert(foreign_parent_multilocation()), - foreign_parent_multilocation() - ); - - assert_eq!(>::convert(FOREIGN_PARENT_ID), None); - + assert_eq!(>::convert(&multilocation), None); + assert_eq!(>::convert(expected), None); // Register parent as foreign asset in the Zeitgeist parachain - register_foreign_parent(None); - + register(None); assert_eq!( - >::convert(foreign_parent_multilocation()), - Ok(FOREIGN_PARENT_ID), - ); - - assert_eq!( - >::convert(FOREIGN_PARENT_ID), - Some(foreign_parent_multilocation()) + >::convert(&multilocation), + Some(expected) ); + assert_eq!(>::convert(expected), Some(multilocation)); }); } #[test] -fn convert_any_registered_sibling_multilocation() { - Zeitgeist::execute_with(|| { - assert_err!( - >::convert(foreign_sibling_multilocation()), - foreign_sibling_multilocation() - ); +fn convert_native_assets() { + convert_common_native(Asset::Ztg); +} - assert_eq!(>::convert(FOREIGN_SIBLING_ID), None); +#[test] +fn convert_any_registered_parent_multilocation_assets() { + convert_common_non_native( + FOREIGN_PARENT_ID, + foreign_parent_multilocation(), + register_foreign_parent, + ); +} - // Register sibling as foreign asset in the Zeitgeist parachain - register_foreign_sibling(None); +#[test] +fn convert_any_registered_parent_multilocation_xcm_assets() { + convert_common_non_native( + FOREIGN_PARENT_ID, + foreign_parent_multilocation(), + register_foreign_parent, + ); +} - assert_eq!( - >::convert(foreign_sibling_multilocation()), - Ok(FOREIGN_SIBLING_ID), - ); +#[test] +fn convert_any_registered_sibling_multilocation_assets() { + convert_common_non_native( + FOREIGN_SIBLING_ID, + foreign_sibling_multilocation(), + register_foreign_sibling, + ); +} - assert_eq!( - >::convert(FOREIGN_SIBLING_ID), - Some(foreign_sibling_multilocation()) - ); - }); +#[test] +fn convert_any_registered_sibling_multilocation_xcm_assets() { + convert_common_non_native( + FOREIGN_SIBLING_ID, + foreign_sibling_multilocation(), + register_foreign_sibling, + ); } #[test] fn convert_unkown_multilocation() { let unknown_location: MultiLocation = - MultiLocation::new(1, X2(Parachain(zeitgeist::ID), general_key(&[42]))); + MultiLocation::new(1, X2(Parachain(PARA_ID_ZEITGEIST), general_key(&[42]))); Zeitgeist::execute_with(|| { - assert!(>::convert(unknown_location).is_err()); + assert!( + >::convert(&unknown_location).is_none() + ); }); } -#[test] -fn convert_unsupported_currency() { - Zeitgeist::execute_with(|| { - assert_eq!(>::convert(CurrencyId::CombinatorialOutcome), None) - }); +#[test_case(Asset::CategoricalOutcome(7, 8))] +#[test_case(Asset::ScalarOutcome(7, ScalarPosition::Long))] +#[test_case(Asset::PoolShare(7))] +#[test_case(Asset::ForeignAsset(7))] +#[test_case(Asset::ParimutuelShare(7, 8))] +fn convert_unsupported_asset(asset: T) +where + T: Copy + Debug + PartialEq, + AssetConvert: Convert>, +{ + Zeitgeist::execute_with(|| assert_eq!(>::convert(asset), None)); } diff --git a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs index 2638f76f5..618bb827f 100644 --- a/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs +++ b/runtime/zeitgeist/src/integration_tests/xcm/tests/transfers.rs @@ -19,46 +19,46 @@ use crate::{ integration_tests::xcm::{ setup::{ + accounts::{alice, bob}, adjusted_balance, btc, dot, eth, register_btc, register_eth, register_foreign_parent, register_foreign_ztg, sibling_parachain_account, zeitgeist_parachain_account, ztg, - ALICE, BOB, BTC_ID, ETH_ID, FOREIGN_PARENT_ID, FOREIGN_ZTG_ID, PARA_ID_SIBLING, + BTC_ID, ETH_ID, FOREIGN_PARENT_ID, FOREIGN_ZTG_ID, PARA_ID_SIBLING, PARA_ID_ZEITGEIST, }, - test_net::{PolkadotNet, Sibling, TestNet, Zeitgeist}, + test_net::{Polkadot, Sibling, Zeitgeist}, }, - xcm_config::{config::zeitgeist, fees::default_per_second}, - AssetRegistry, Balance, Balances, CurrencyId, RuntimeOrigin, Tokens, XTokens, + xcm_config::fees::default_per_second, + AssetManager, Balance, Balances, CurrencyId, RuntimeOrigin, Tokens, XTokens, ZeitgeistTreasuryAccount, }; -use frame_support::assert_ok; +use frame_support::{assert_ok, traits::tokens::fungible::Mutate}; use orml_traits::MultiCurrency; use xcm::latest::{Junction, Junction::*, Junctions::*, MultiLocation, WeightLimit}; -use xcm_emulator::TestExt; +use xcm_emulator::{RelayChain, TestExt}; use zeitgeist_primitives::{ constants::{BalanceFractionalDecimals, BASE}, - types::{CustomMetadata, XcmMetadata}, + types::{Asset, CustomMetadata, XcmMetadata}, }; #[test] fn transfer_ztg_to_sibling() { - TestNet::reset(); - - let alice_initial_balance = ztg(10); + let mut alice_initial_balance = 0; + let mut bob_initial_balance = 0; let transfer_amount = ztg(5); let mut treasury_initial_balance = 0; Sibling::execute_with(|| { treasury_initial_balance = - Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); + AssetManager::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); + bob_initial_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); register_foreign_ztg(None); }); Zeitgeist::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); + alice_initial_balance = Balances::free_balance(alice()); assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(alice()), CurrencyId::Ztg, transfer_amount, Box::new( @@ -66,7 +66,7 @@ fn transfer_ztg_to_sibling() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: None, id: BOB.into() } + Junction::AccountId32 { network: None, id: bob().into() } ) ) .into() @@ -75,92 +75,137 @@ fn transfer_ztg_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance - transfer_amount); - + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the sibling account here assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); }); Sibling::execute_with(|| { - let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); + let current_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); + let bob_expected = bob_initial_balance + transfer_amount - ztg_fee(); + let treasury_expected = treasury_initial_balance + ztg_fee(); + assert_eq!(current_balance, bob_expected); + assert_eq!( + Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), + treasury_expected + ) + }); +} + +#[test] +fn transfer_ztg_to_sibling_with_custom_fee() { + // 10x fee factor, so ZTG has 10x the worth of sibling currency. + let fee_factor = 100_000_000_000; + let transfer_amount = ztg(5); + let mut treasury_initial_balance = 0; + let mut bob_initial_balance = 0; + + Sibling::execute_with(|| { + treasury_initial_balance = + AssetManager::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); + bob_initial_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); + let custom_metadata = CustomMetadata { + xcm: XcmMetadata { fee_factor: Some(fee_factor) }, + ..Default::default() + }; + register_foreign_ztg(Some(custom_metadata)); + }); + + Zeitgeist::execute_with(|| { + let alice_initial_balance = Balances::free_balance(alice()); + assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); + assert_ok!(XTokens::transfer( + RuntimeOrigin::signed(alice()), + Asset::Ztg, + transfer_amount, + Box::new( + MultiLocation::new( + 1, + X2( + Parachain(PARA_ID_SIBLING), + Junction::AccountId32 { network: None, id: bob().into() } + ) + ) + .into() + ), + WeightLimit::Limited(4_000_000_000.into()), + )); + // Confirm that Alice's balance is initial_balance - amount_transferred + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); + // Verify that the amount transferred is now part of the sibling account here + assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); + }); - // Verify that BOB now has (amount transferred - fee) - assert_eq!(current_balance, transfer_amount - ztg_fee()); + Sibling::execute_with(|| { + let current_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); + let custom_fee = ztg_fee() * fee_factor / BASE; + let bob_expected = bob_initial_balance + transfer_amount - custom_fee; + let treasury_expected = treasury_initial_balance + custom_fee; + // Verify that bob() now has (amount transferred - fee) + assert_eq!(current_balance, bob_expected); // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), - treasury_initial_balance + ztg_fee() + AssetManager::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), + treasury_expected ) }); } #[test] fn transfer_ztg_sibling_to_zeitgeist() { - TestNet::reset(); - - // In order to be able to transfer ZTG from Sibling to Zeitgeist, we need to first send - // ZTG from Zeitgeist to Sibling, or else it fails since it'd be like Sibling had minted - // ZTG on their side. - transfer_ztg_to_sibling(); - - let alice_initial_balance = ztg(5); - let bob_initial_balance = ztg(5) - ztg_fee(); + let mut alice_initial_balance = 0; let mut treasury_initial_balance = 0; - let sibling_sovereign_initial_balance = ztg(5); let transfer_amount = ztg(1); - // Note: This asset was registered in `transfer_ztg_to_sibling` + let sibling_initial_balance = transfer_amount; Zeitgeist::execute_with(|| { treasury_initial_balance = Balances::free_balance(ZeitgeistTreasuryAccount::get()); - - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); + alice_initial_balance = Balances::free_balance(alice()); assert_eq!( - Balances::free_balance(sibling_parachain_account()), - sibling_sovereign_initial_balance + Balances::set_balance(&sibling_parachain_account(), sibling_initial_balance), + sibling_initial_balance ); }); Sibling::execute_with(|| { - assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), 0); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), bob_initial_balance); + register_foreign_ztg(None); + let bob_initial_balance = AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()); + assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(BOB), + RuntimeOrigin::signed(bob()), FOREIGN_ZTG_ID, transfer_amount, Box::new( MultiLocation::new( 1, X2( - Parachain(zeitgeist::ID), - Junction::AccountId32 { network: None, id: ALICE.into() } + Parachain(PARA_ID_ZEITGEIST), + Junction::AccountId32 { network: None, id: alice().into() } ) ) .into() ), WeightLimit::Limited(4_000_000_000.into()), )); - // Confirm that Bobs's balance is initial balance - amount transferred assert_eq!( - Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), + AssetManager::free_balance(FOREIGN_ZTG_ID, &bob()), bob_initial_balance - transfer_amount ); }); Zeitgeist::execute_with(|| { - // Verify that ALICE now has initial balance + amount transferred - fee + // Verify that alice() now has initial balance + amount transferred - fee assert_eq!( - Balances::free_balance(&ALICE), + Balances::free_balance(alice()), alice_initial_balance + transfer_amount - ztg_fee(), ); - // Verify that the reserve has been adjusted properly assert_eq!( Balances::free_balance(sibling_parachain_account()), - sibling_sovereign_initial_balance - transfer_amount + sibling_initial_balance - transfer_amount ); - // Verify that fees (of native currency) have been put into treasury assert_eq!( Balances::free_balance(ZeitgeistTreasuryAccount::get()), @@ -171,50 +216,45 @@ fn transfer_ztg_sibling_to_zeitgeist() { #[test] fn transfer_btc_sibling_to_zeitgeist() { - TestNet::reset(); - - let sibling_alice_initial_balance = ztg(10); - let zeitgeist_alice_initial_balance = btc(0); - let initial_sovereign_balance = btc(100); + let mut zeitgeist_alice_initial_balance = 0; let transfer_amount = btc(100); let mut treasury_initial_balance = 0; Zeitgeist::execute_with(|| { register_btc(None); - treasury_initial_balance = Tokens::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(BTC_ID, &ALICE), zeitgeist_alice_initial_balance,); + treasury_initial_balance = + AssetManager::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()); + zeitgeist_alice_initial_balance = AssetManager::free_balance(BTC_ID, &alice()); }); Sibling::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE), sibling_alice_initial_balance); + let alice_initial_balance = Balances::free_balance(alice()); + let initial_sovereign_balance = transfer_amount; + // Set the sovereign balance such that it is not subject to dust collection - assert_ok!(Balances::set_balance( - RuntimeOrigin::root(), - zeitgeist_parachain_account().into(), - initial_sovereign_balance, - 0 - )); + assert_eq!( + Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), + initial_sovereign_balance + ); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), - // Target chain will interpret CurrencyId::Ztg as BTC in this context. - CurrencyId::Ztg, + RuntimeOrigin::signed(alice()), + // Target chain will interpret XcmAsset::Ztg as BTC in this context. + Asset::Ztg, transfer_amount, Box::new( MultiLocation::new( 1, X2( - Parachain(zeitgeist::ID), - Junction::AccountId32 { network: None, id: ALICE.into() } + Parachain(PARA_ID_ZEITGEIST), + Junction::AccountId32 { network: None, id: alice().into() } ) ) .into() ), WeightLimit::Limited(4_000_000_000.into()), )); - // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE), sibling_alice_initial_balance - transfer_amount); - + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the zeitgeist account here assert_eq!( Balances::free_balance(zeitgeist_parachain_account()), @@ -225,39 +265,43 @@ fn transfer_btc_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { let expected = transfer_amount - btc_fee(); let expected_adjusted = adjusted_balance(btc(1), expected); + let expected_treasury = treasury_initial_balance + adjusted_balance(btc(1), btc_fee()); // Verify that remote Alice now has initial balance + amount transferred - fee assert_eq!( - Tokens::free_balance(BTC_ID, &ALICE), + AssetManager::free_balance(BTC_ID, &alice()), zeitgeist_alice_initial_balance + expected_adjusted, ); - // Verify that fees (of foreign currency) have been put into treasury assert_eq!( Tokens::free_balance(BTC_ID, &ZeitgeistTreasuryAccount::get()), // Align decimal fractional places - treasury_initial_balance + adjusted_balance(btc(1), btc_fee()) + expected_treasury ) }); } #[test] fn transfer_btc_zeitgeist_to_sibling() { - TestNet::reset(); - - let transfer_amount = btc(100) - btc_fee(); - let initial_sovereign_balance = 2 * btc(100); - let sibling_bob_initial_balance = btc(0); - - transfer_btc_sibling_to_zeitgeist(); + let transfer_amount = btc(100); + let initial_sovereign_balance = transfer_amount; + let mut bob_initial_balance = 0; Sibling::execute_with(|| { - assert_eq!(Tokens::free_balance(BTC_ID, &BOB), sibling_bob_initial_balance,); + bob_initial_balance = Balances::free_balance(bob()); + // Set the sovereign balance such that it is not subject to dust collection + assert_eq!( + Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), + initial_sovereign_balance + ); }); Zeitgeist::execute_with(|| { + register_btc(None); + let alice_initial_balance = AssetManager::free_balance(BTC_ID, &alice()); + assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(alice()), BTC_ID, transfer_amount, Box::new( @@ -265,7 +309,7 @@ fn transfer_btc_zeitgeist_to_sibling() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: None, id: BOB.into() } + Junction::AccountId32 { network: None, id: bob().into() } ) ) .into() @@ -274,57 +318,46 @@ fn transfer_btc_zeitgeist_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Tokens::free_balance(BTC_ID, &ALICE), 0); + let alice_balance = AssetManager::free_balance(BTC_ID, &alice()); + let alice_expected = alice_initial_balance - adjusted_balance(btc(1), transfer_amount); + assert_eq!(alice_balance, alice_expected); }); Sibling::execute_with(|| { - let fee_adjusted = adjusted_balance(btc(1), btc_fee()); - let expected = transfer_amount - fee_adjusted; + let expected = bob_initial_balance + transfer_amount - adjusted_balance(btc(1), btc_fee()); + let expected_sovereign = initial_sovereign_balance - transfer_amount; // Verify that Bob now has initial balance + amount transferred - fee - assert_eq!(Balances::free_balance(&BOB), sibling_bob_initial_balance + expected,); - + assert_eq!(Balances::free_balance(bob()), expected); // Verify that the amount transferred is now subtracted from the zeitgeist account at sibling - assert_eq!( - Balances::free_balance(zeitgeist_parachain_account()), - initial_sovereign_balance - transfer_amount - ); + assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), expected_sovereign); }); } #[test] fn transfer_eth_sibling_to_zeitgeist() { - TestNet::reset(); - - let sibling_alice_initial_balance = ztg(10) + eth(1); - let zeitgeist_alice_initial_balance = eth(0); - let initial_sovereign_balance = eth(1); - let transfer_amount = eth(1); + let mut zeitgeist_alice_initial_balance = 0; + let transfer_amount = eth(100); let mut treasury_initial_balance = 0; Zeitgeist::execute_with(|| { register_eth(None); - treasury_initial_balance = Tokens::free_balance(ETH_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(ETH_ID, &ALICE), zeitgeist_alice_initial_balance,); + treasury_initial_balance = + AssetManager::free_balance(ETH_ID, &ZeitgeistTreasuryAccount::get()); + zeitgeist_alice_initial_balance = AssetManager::free_balance(ETH_ID, &alice()); }); Sibling::execute_with(|| { + let alice_initial_balance = Balances::free_balance(alice()); + let initial_sovereign_balance = transfer_amount; + // Set the sovereign balance such that it is not subject to dust collection - assert_ok!(Balances::set_balance( - RuntimeOrigin::root(), - zeitgeist_parachain_account().into(), - initial_sovereign_balance, - 0 - )); - // Add 1 "fake" ETH to Alice's balance - assert_ok!(Balances::set_balance( - RuntimeOrigin::root(), - ALICE.into(), - sibling_alice_initial_balance, - 0 - )); + assert_eq!( + Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), + initial_sovereign_balance + ); assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(alice()), // Target chain will interpret CurrencyId::Ztg as ETH in this context. CurrencyId::Ztg, transfer_amount, @@ -332,18 +365,16 @@ fn transfer_eth_sibling_to_zeitgeist() { MultiLocation::new( 1, X2( - Parachain(zeitgeist::ID), - Junction::AccountId32 { network: None, id: ALICE.into() } + Parachain(PARA_ID_ZEITGEIST), + Junction::AccountId32 { network: None, id: alice().into() } ) ) .into() ), WeightLimit::Limited(4_000_000_000.into()), )); - // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE), sibling_alice_initial_balance - transfer_amount); - + assert_eq!(Balances::free_balance(alice()), alice_initial_balance - transfer_amount); // Verify that the amount transferred is now part of the zeitgeist account here assert_eq!( Balances::free_balance(zeitgeist_parachain_account()), @@ -354,39 +385,43 @@ fn transfer_eth_sibling_to_zeitgeist() { Zeitgeist::execute_with(|| { let expected = transfer_amount - eth_fee(); let expected_adjusted = adjusted_balance(eth(1), expected); + let expected_treasury = treasury_initial_balance + adjusted_balance(eth(1), eth_fee()); // Verify that remote Alice now has initial balance + amount transferred - fee assert_eq!( - Tokens::free_balance(ETH_ID, &ALICE), + AssetManager::free_balance(ETH_ID, &alice()), zeitgeist_alice_initial_balance + expected_adjusted, ); - // Verify that fees (of foreign currency) have been put into treasury assert_eq!( Tokens::free_balance(ETH_ID, &ZeitgeistTreasuryAccount::get()), // Align decimal fractional places - treasury_initial_balance + adjusted_balance(eth(1), eth_fee()) + expected_treasury ) }); } #[test] fn transfer_eth_zeitgeist_to_sibling() { - TestNet::reset(); - - let transfer_amount = eth(1) - eth_fee(); - let initial_sovereign_balance = 2 * eth(1); - let sibling_bob_initial_balance = eth(0); - - transfer_eth_sibling_to_zeitgeist(); + let transfer_amount = eth(100); + let initial_sovereign_balance = transfer_amount; + let mut bob_initial_balance = 0; Sibling::execute_with(|| { - assert_eq!(Tokens::free_balance(ETH_ID, &BOB), sibling_bob_initial_balance,); + bob_initial_balance = Balances::free_balance(bob()); + // Set the sovereign balance such that it is not subject to dust collection + assert_eq!( + Balances::set_balance(&zeitgeist_parachain_account(), initial_sovereign_balance,), + initial_sovereign_balance + ); }); Zeitgeist::execute_with(|| { + register_eth(None); + let alice_initial_balance = AssetManager::free_balance(ETH_ID, &alice()); + assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), + RuntimeOrigin::signed(alice()), ETH_ID, transfer_amount, Box::new( @@ -394,7 +429,7 @@ fn transfer_eth_zeitgeist_to_sibling() { 1, X2( Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: None, id: BOB.into() } + Junction::AccountId32 { network: None, id: bob().into() } ) ) .into() @@ -403,197 +438,147 @@ fn transfer_eth_zeitgeist_to_sibling() { )); // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Tokens::free_balance(ETH_ID, &ALICE), 0); + let alice_balance = AssetManager::free_balance(ETH_ID, &alice()); + let alice_expected = alice_initial_balance - adjusted_balance(eth(1), transfer_amount); + assert_eq!(alice_balance, alice_expected); }); Sibling::execute_with(|| { - let fee_adjusted = adjusted_balance(eth(1), eth_fee()); - let expected = transfer_amount - fee_adjusted; + let expected = bob_initial_balance + transfer_amount - adjusted_balance(eth(1), eth_fee()); + let expected_sovereign = initial_sovereign_balance - transfer_amount; // Verify that Bob now has initial balance + amount transferred - fee - assert_eq!(Balances::free_balance(&BOB), sibling_bob_initial_balance + expected,); - + assert_eq!(Balances::free_balance(bob()), expected); // Verify that the amount transferred is now subtracted from the zeitgeist account at sibling - assert_eq!( - Balances::free_balance(zeitgeist_parachain_account()), - initial_sovereign_balance - transfer_amount - ); + assert_eq!(Balances::free_balance(zeitgeist_parachain_account()), expected_sovereign); }); } #[test] fn transfer_dot_from_relay_chain() { - TestNet::reset(); - - let transfer_amount: Balance = dot(2); + let transfer_amount: Balance = dot(1); + let mut treasury_initial_balance = 0; + let mut bob_initial_balance = 0; Zeitgeist::execute_with(|| { register_foreign_parent(None); + treasury_initial_balance = + AssetManager::free_balance(FOREIGN_PARENT_ID, &ZeitgeistTreasuryAccount::get()); + bob_initial_balance = AssetManager::free_balance(FOREIGN_PARENT_ID, &bob()); }); - PolkadotNet::execute_with(|| { - let initial_balance = polkadot_runtime::Balances::free_balance(&ALICE); + Polkadot::execute_with(|| { + let initial_balance = polkadot_runtime::Balances::free_balance(alice()); assert!(initial_balance >= transfer_amount); assert_ok!(polkadot_runtime::XcmPallet::reserve_transfer_assets( - polkadot_runtime::RuntimeOrigin::signed(ALICE), - Box::new(Parachain(zeitgeist::ID).into()), - Box::new(Junction::AccountId32 { network: None, id: BOB.into() }.into()), + polkadot_runtime::RuntimeOrigin::signed(alice()), + Box::new(Parachain(PARA_ID_ZEITGEIST).into()), + Box::new(Junction::AccountId32 { network: None, id: bob().into() }.into()), Box::new((Here, transfer_amount).into()), 0 )); }); Zeitgeist::execute_with(|| { - assert_eq!(Tokens::free_balance(FOREIGN_PARENT_ID, &BOB), transfer_amount - dot_fee()); - }); -} - -#[test] -fn transfer_dot_to_relay_chain() { - TestNet::reset(); - - let transfer_amount: Balance = dot(2); - transfer_dot_from_relay_chain(); - - Zeitgeist::execute_with(|| { - let initial_balance = Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE); - assert!(initial_balance >= transfer_amount); - - assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), - FOREIGN_PARENT_ID, - transfer_amount, - Box::new( - MultiLocation::new(1, X1(Junction::AccountId32 { id: BOB.into(), network: None })) - .into() - ), - WeightLimit::Unlimited, - )); + let expected = transfer_amount - dot_fee(); + let bob_expected = bob_initial_balance + adjusted_balance(dot(1), expected); + let treasury_expected = treasury_initial_balance + adjusted_balance(dot(1), dot_fee()); + assert_eq!(AssetManager::free_balance(FOREIGN_PARENT_ID, &bob()), bob_expected); + // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - Tokens::free_balance(FOREIGN_PARENT_ID, &ALICE), - initial_balance - transfer_amount + AssetManager::free_balance(FOREIGN_PARENT_ID, &ZeitgeistTreasuryAccount::get()), + treasury_expected ) }); - - PolkadotNet::execute_with(|| { - assert_eq!(polkadot_runtime::Balances::free_balance(&BOB), 19_637_471_000); - }); } #[test] -fn transfer_ztg_to_sibling_with_custom_fee() { - TestNet::reset(); - - let alice_initial_balance = ztg(10); - // 10x fee factor, so ZTG has 10x the worth of sibling currency. - let fee_factor = 100_000_000_000; - let transfer_amount = ztg(5); - let mut treasury_initial_balance = 0; - - Sibling::execute_with(|| { - treasury_initial_balance = - Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()); - assert_eq!(Tokens::free_balance(FOREIGN_ZTG_ID, &BOB), 0); +fn transfer_dot_to_relay_chain() { + let transfer_amount: Balance = dot(1); + let transfer_amount_local: Balance = adjusted_balance(dot(1), transfer_amount); + let mut initial_balance_bob = 0; - register_foreign_ztg(None); - let custom_metadata = CustomMetadata { - xcm: XcmMetadata { fee_factor: Some(fee_factor) }, - ..Default::default() - }; - assert_ok!(AssetRegistry::do_update_asset( - FOREIGN_ZTG_ID, - None, - None, - None, - None, - None, - Some(custom_metadata) - )); + Polkadot::execute_with(|| { + initial_balance_bob = polkadot_runtime::Balances::free_balance(bob()); + let bs_acc = Polkadot::sovereign_account_id_of_child_para(PARA_ID_ZEITGEIST.into()); + assert_eq!( + polkadot_runtime::Balances::set_balance(&bs_acc, transfer_amount), + transfer_amount + ); }); Zeitgeist::execute_with(|| { - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance); - assert_eq!(Balances::free_balance(sibling_parachain_account()), 0); + register_foreign_parent(None); + let initial_balance = AssetManager::free_balance(FOREIGN_PARENT_ID, &alice()); + assert!(initial_balance >= transfer_amount_local); + assert_ok!(XTokens::transfer( - RuntimeOrigin::signed(ALICE), - CurrencyId::Ztg, + RuntimeOrigin::signed(alice()), + FOREIGN_PARENT_ID, transfer_amount, Box::new( MultiLocation::new( 1, - X2( - Parachain(PARA_ID_SIBLING), - Junction::AccountId32 { network: None, id: BOB.into() } - ) + X1(Junction::AccountId32 { id: bob().into(), network: None }) ) .into() ), - WeightLimit::Limited(4_000_000_000.into()), + WeightLimit::Limited(4_000_000_000.into()) )); - // Confirm that Alice's balance is initial_balance - amount_transferred - assert_eq!(Balances::free_balance(&ALICE), alice_initial_balance - transfer_amount); - - // Verify that the amount transferred is now part of the sibling account here - assert_eq!(Balances::free_balance(sibling_parachain_account()), transfer_amount); - }); - - Sibling::execute_with(|| { - let current_balance = Tokens::free_balance(FOREIGN_ZTG_ID, &BOB); - let custom_fee = calc_fee(default_per_second(10) * 10); - - // Verify that BOB now has (amount transferred - fee) - assert_eq!(current_balance, transfer_amount - custom_fee); - - // Sanity check for the actual amount BOB ends up with - assert_eq!(current_balance, transfer_amount - ztg_fee() * fee_factor / BASE); - - // Verify that fees (of foreign currency) have been put into treasury assert_eq!( - Tokens::free_balance(FOREIGN_ZTG_ID, &ZeitgeistTreasuryAccount::get()), - treasury_initial_balance + custom_fee + AssetManager::free_balance(FOREIGN_PARENT_ID, &alice()), + initial_balance - transfer_amount_local ) }); + + #[cfg(not(feature = "runtime-benchmarks"))] + // polkadot-runtime does not process messages when runtime-benchmarks is enabled: + // https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.1.0/polkadot/runtime/polkadot/src/lib.rs#L1138-L1140 + Polkadot::execute_with(|| { + let expected_fee = 21_062_795; + let expected_balance_bob = initial_balance_bob + transfer_amount - expected_fee; + assert_eq!(polkadot_runtime::Balances::free_balance(&bob()), expected_balance_bob); + }); } #[test] fn test_total_fee() { - assert_eq!(ztg_fee(), 80_128_000); - assert_eq!(dot_fee(), ztg_fee()); + assert_eq!(btc_fee(), 642_960); + assert_eq!(dot_fee(), 80_370_000); + assert_eq!(ztg_fee(), 64_296_000); + assert_eq!(eth_fee(), 6_429_600_000_000_000); } #[inline] fn ztg_fee() -> Balance { - fee(BalanceFractionalDecimals::get().into()) + fee(BalanceFractionalDecimals::get().into(), 8) } #[inline] -fn fee(decimals: u32) -> Balance { - calc_fee(default_per_second(decimals)) +fn fee(decimals: u32, multiplier: Balance) -> Balance { + calc_fee(default_per_second(decimals), multiplier) } -// The fee associated with transferring dot tokens #[inline] fn dot_fee() -> Balance { - fee(10) + fee(10, 10) } #[inline] fn btc_fee() -> Balance { - fee(8) + fee(8, 8) } #[inline] fn eth_fee() -> Balance { - fee(18) + fee(18, 8) } #[inline] -const fn calc_fee(fee_per_second: Balance) -> Balance { - // We divide the fee to align its unit and multiply by 8 as that seems to be the unit of - // time the tests take. - // NOTE: it is possible that in different machines this value may differ. We shall see. - fee_per_second / 10_000 * 8 +const fn calc_fee(fee_per_second: Balance, multiplier: Balance) -> Balance { + // Adjust fee per second to actual test execution time + fee_per_second / 10_000 * multiplier } diff --git a/runtime/zeitgeist/src/lib.rs b/runtime/zeitgeist/src/lib.rs index cef575871..35d5adf80 100644 --- a/runtime/zeitgeist/src/lib.rs +++ b/runtime/zeitgeist/src/lib.rs @@ -17,7 +17,7 @@ // along with Zeitgeist. If not, see . #![cfg_attr(not(feature = "std"), no_std)] -#![recursion_limit = "512"] +#![recursion_limit = "1024"] extern crate alloc; @@ -64,11 +64,10 @@ use { use frame_support::construct_runtime; -use sp_api::impl_runtime_apis; +use sp_api::{impl_runtime_apis, BlockT}; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, - traits::Block as BlockT, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; @@ -90,8 +89,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("zeitgeist"), impl_name: create_runtime_str!("zeitgeist"), authoring_version: 1, - spec_version: 55, - impl_version: 1, + spec_version: 56, + impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 29, state_version: 1, @@ -112,7 +111,7 @@ impl Contains for IsCallable { kill_prefix, kill_storage, set_code, set_code_without_checks, set_storage, }; use orml_currencies::Call::update_balance; - use pallet_balances::Call::{force_transfer, set_balance}; + use pallet_balances::Call::{force_set_balance, force_transfer}; use pallet_collective::Call::set_members; use pallet_contracts::Call::{ call, call_old_weight, instantiate, instantiate_old_weight, remove_code, @@ -129,7 +128,7 @@ impl Contains for IsCallable { match runtime_call { // Membership is managed by the respective Membership instance RuntimeCall::AdvisoryCommittee(set_members { .. }) => false, - // See "balance.set_balance" + // See "balance.force_set_balance" RuntimeCall::AssetManager(update_balance { .. }) => false, RuntimeCall::Balances(inner_call) => { match inner_call { @@ -139,7 +138,7 @@ impl Contains for IsCallable { // in case something goes terribly wrong (like a hack that draws the funds // from such an account, see Maganta hack). Invoking this function one can // also easily mess up consistency in regards to reserved tokens and locks. - set_balance { .. } => false, + force_set_balance { .. } => false, // There should be no reason to force an account to transfer funds. force_transfer { .. } => false, _ => true, diff --git a/runtime/zeitgeist/src/parachain_params.rs b/runtime/zeitgeist/src/parachain_params.rs index c08bd8549..55bf67d07 100644 --- a/runtime/zeitgeist/src/parachain_params.rs +++ b/runtime/zeitgeist/src/parachain_params.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -38,6 +38,9 @@ use zeitgeist_primitives::{ }; parameter_types! { + // Asset registry + pub const AssetRegistryStringLimit: u32 = 1024; + // Author-Mapping /// The amount that should be taken as a security deposit when registering a NimbusId pub const CollatorDeposit: Balance = 2 * BASE; @@ -67,22 +70,30 @@ parameter_types! { pub const LeaveDelegatorsDelay: u32 = 2; /// Maximum bottom delegations per candidate pub const MaxBottomDelegationsPerCandidate: u32 = 50; + /// Maximum number of collator candidates + pub const MaxCandidates: u32 = 200; /// Maximum delegations per delegator pub const MaxDelegationsPerDelegator: u32 = 100; /// Maximum top delegations per candidate pub const MaxTopDelegationsPerCandidate: u32 = 300; + /// Number of rounds until a collator not producing blocks is marked as inactive. + pub const MaxOfflineRounds: u32 = 1; /// Minimum round length is 2 minutes pub const MinBlocksPerRound: u32 = 2 * BLOCKS_PER_MINUTE as u32; /// Minimum stake required to become a collator - pub const MinCollatorStk: u128 = 64 * BASE; + pub const MinCandidateStk: u128 = 64 * BASE; /// Minimum stake required to be reserved to be a delegator - pub const MinDelegatorStk: u128 = BASE / 2; + pub const MinDelegation: u128 = BASE / 2; /// Minimum collators selected per round, default at genesis and minimum forever after pub const MinSelectedCandidates: u32 = 8; /// Rounds before the delegator revocation can be executed pub const RevokeDelegationDelay: u32 = 2; /// Rounds before the reward is paid pub const RewardPaymentDelay: u32 = 2; + /// The maximum number of local XCM locks that a single account may have. + pub const MaxLockers: u32 = 8; + /// The maximum number of consumers a single remote lock may have. + pub const MaxRemoteLockConsumers: u32 = 0; // XCM /// Base weight for XCM execution diff --git a/runtime/zeitgeist/src/parameters.rs b/runtime/zeitgeist/src/parameters.rs index 250173ea3..94d54089e 100644 --- a/runtime/zeitgeist/src/parameters.rs +++ b/runtime/zeitgeist/src/parameters.rs @@ -46,7 +46,7 @@ use zeitgeist_primitives::{constants::*, types::*}; pub(crate) const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); pub(crate) const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), - polkadot_primitives::v2::MAX_POV_SIZE as u64, + polkadot_primitives::MAX_POV_SIZE as u64, ); pub(crate) const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); pub(crate) const FEES_AND_TIPS_TREASURY_PERCENTAGE: u32 = 100; @@ -55,11 +55,12 @@ pub(crate) const FEES_AND_TIPS_BURN_PERCENTAGE: u32 = 0; #[cfg(not(feature = "parachain"))] parameter_types! { // Aura + pub const AllowMultipleBlocksPerSlot: bool = false; pub const MaxAuthorities: u32 = 32; // Grandpa - // Can be 0, as equivocation handling is not enabled (HandleEquivocation = ()) pub const MaxSetIdSessionEntries: u32 = 0; + pub const MaxNominators: u32 = 0; } parameter_types! { @@ -69,6 +70,8 @@ parameter_types! { // Balance pub const ExistentialDeposit: u128 = 5 * MILLI; + pub const MaxHolds: u32 = 1; + pub const MaxFreezes: u32 = 1; pub const MaxLocks: u32 = 50; pub const MaxReserves: u32 = 50; @@ -81,23 +84,20 @@ parameter_types! { pub const CouncilMaxMembers: u32 = 100; pub const CouncilMaxProposals: u32 = 100; pub const CouncilMotionDuration: BlockNumber = 7 * BLOCKS_PER_DAY; + pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; pub const TechnicalCommitteeMaxMembers: u32 = 100; pub const TechnicalCommitteeMaxProposals: u32 = 64; pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * BLOCKS_PER_DAY; // Contracts - pub const ContractsDeletionQueueDepth: u32 = 128; - pub ContractsDeletionWeightLimit: Weight = Perbill::from_percent(10) - * RuntimeBlockWeights::get() - .per_class - .get(DispatchClass::Normal) - .max_total - .unwrap_or(RuntimeBlockWeights::get().max_block); + pub const ContractsCodeHashLockupDepositPercent: Perbill = Perbill::from_percent(10); + pub const ContractsDefaultDepositLimit: Balance = deposit(16, 16 * 1024 * 1024); pub const ContractsDepositPerByte: Balance = deposit(0,1); pub const ContractsDepositPerItem: Balance = deposit(1,0); pub const ContractsMaxCodeLen: u32 = 123 * 1024; pub const ContractsMaxStorageKeyLen: u32 = 128; pub const ContractsMaxDebugBufferLen: u32 = 2 * 1024 * 1024; + pub const ContractsMaxDelegateDependencies: u32 = 32; pub const ContractsUnsafeUnstableInterface: bool = false; pub ContractsSchedule: pallet_contracts::Schedule = Default::default(); @@ -390,7 +390,7 @@ parameter_types! { /// The maximum number of approvals that can wait in the spending queue. pub const MaxApprovals: u32 = 100; /// Maximum amount a verified origin can spend - pub const MaxTreasurySpend: Balance = Balance::max_value(); + pub const MaxTreasurySpend: Balance = Balance::MAX; /// Fraction of a proposal's value that should be bonded in order to place the proposal. /// An accepted proposal gets these back. A rejected proposal does not. pub const ProposalBond: Permill = Permill::from_percent(5); diff --git a/runtime/zeitgeist/src/xcm_config/asset_registry.rs b/runtime/zeitgeist/src/xcm_config/asset_registry.rs index 92746377d..4b3b044a6 100644 --- a/runtime/zeitgeist/src/xcm_config/asset_registry.rs +++ b/runtime/zeitgeist/src/xcm_config/asset_registry.rs @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use crate::{Balance, CurrencyId}; +use crate::{AssetRegistryStringLimit, Balance, CurrencyId}; use orml_traits::asset_registry::{AssetMetadata, AssetProcessor}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; @@ -29,11 +29,16 @@ use zeitgeist_primitives::types::CustomMetadata; /// Only pre check is to ensure an asset id was passed. pub struct CustomAssetProcessor; -impl AssetProcessor> for CustomAssetProcessor { +impl AssetProcessor> + for CustomAssetProcessor +{ fn pre_register( id: Option, - metadata: AssetMetadata, - ) -> Result<(CurrencyId, AssetMetadata), DispatchError> { + metadata: AssetMetadata, + ) -> Result< + (CurrencyId, AssetMetadata), + DispatchError, + > { match id { Some(id) => Ok((id, metadata)), None => Err(DispatchError::Other("asset-registry: AssetId is required")), @@ -42,7 +47,7 @@ impl AssetProcessor> for Cust fn post_register( _id: CurrencyId, - _asset_metadata: AssetMetadata, + _asset_metadata: AssetMetadata, ) -> Result<(), DispatchError> { Ok(()) } diff --git a/runtime/zeitgeist/src/xcm_config/config.rs b/runtime/zeitgeist/src/xcm_config/config.rs index f9424eaea..4a39a2557 100644 --- a/runtime/zeitgeist/src/xcm_config/config.rs +++ b/runtime/zeitgeist/src/xcm_config/config.rs @@ -36,8 +36,8 @@ use orml_xcm_support::{ DepositToAlternative, IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset, }; use pallet_xcm::XcmPassthrough; -use polkadot_parachain::primitives::Sibling; -use sp_runtime::traits::Convert; +use polkadot_parachain_primitives::primitives::Sibling; +use sp_runtime::traits::{ConstU32, Convert, MaybeEquivalence}; use xcm::{ latest::{ prelude::{AccountId32, AssetId, Concrete, GeneralKey, MultiAsset, XcmContext, X1, X2}, @@ -50,13 +50,13 @@ use xcm_builder::{ AllowTopLevelPaidExecutionFrom, FixedRateOfFungible, FixedWeightBounds, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, - TakeWeightCredit, + TakeWeightCredit, WithComputedOrigin, }; -use xcm_executor::{traits::TransactAsset, Assets, Config}; +use xcm_executor::{traits::TransactAsset, Assets}; use zeitgeist_primitives::{constants::BalanceFractionalDecimals, types::Asset}; pub mod zeitgeist { - #[cfg(test)] + #[cfg(any(test, feature = "runtime-benchmarks"))] pub const ID: u32 = 2092; pub const KEY: &[u8] = &[0, 1]; } @@ -66,7 +66,10 @@ pub struct XcmConfig; /// The main XCM config /// This is where we configure the core of our XCM integrations: how tokens are transferred, /// how fees are calculated, what barriers we impose on incoming XCM messages, etc. -impl Config for XcmConfig { +impl xcm_executor::Config for XcmConfig { + /// A list of (Origin, Target) pairs allowing a given Origin to be substituted with its + /// corresponding Target pair. + type Aliasers = Nothing; /// Handler for exchanging assets. type AssetExchanger = (); /// The handler for when there is an instruction to claim assets. @@ -124,12 +127,18 @@ impl Config for XcmConfig { pub type Barrier = ( // Execution barrier that just takes max_weight from weight_credit TakeWeightCredit, - // Ensures that execution time is bought with BuyExecution instruction - AllowTopLevelPaidExecutionFrom, // Expected responses are OK. AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, + WithComputedOrigin< + ( + // If the message is one that immediately attemps to pay for execution, then allow it. + AllowTopLevelPaidExecutionFrom, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + ), + UniversalLocation, + ConstU32<8>, + >, ); /// The means of purchasing weight credit for XCM execution. @@ -153,11 +162,10 @@ pub struct ToTreasury; impl TakeRevenue for ToTreasury { fn take_revenue(revenue: MultiAsset) { use orml_traits::MultiCurrency; - use xcm_executor::traits::Convert; if let MultiAsset { id: Concrete(location), fun: Fungible(_amount) } = revenue { - if let Ok(asset_id) = - >::convert(location) + if let Some(asset_id) = + >::convert(&location) { let adj_am = AlignedFractionalMultiAssetTransactor::adjust_fractional_places(&revenue).fun; @@ -353,35 +361,45 @@ impl Convert> for AssetConvert { /// Convert an incoming `MultiLocation` into a `Asset` if possible. /// Here we need to know the canonical representation of all the tokens we handle in order to /// correctly convert their `MultiLocation` representation into our internal `Asset` type. -impl xcm_executor::traits::Convert for AssetConvert { - fn convert(location: MultiLocation) -> Result { +impl MaybeEquivalence for AssetConvert { + fn convert(location: &MultiLocation) -> Option { match location { MultiLocation { parents: 0, interior: X1(GeneralKey { data, length }) } => { - let key = &data[..data.len().min(length as usize)]; + let key = &data[..data.len().min(*length as usize)]; if key == zeitgeist::KEY { - return Ok(CurrencyId::Ztg); + return Some(CurrencyId::Ztg); } - Err(location) + None } MultiLocation { parents: 1, interior: X2(Junction::Parachain(para_id), GeneralKey { data, length }), } => { - let key = &data[..data.len().min(length as usize)]; + let key = &data[..data.len().min(*length as usize)]; - if para_id == u32::from(ParachainInfo::parachain_id()) { - if key == zeitgeist::KEY { - return Ok(CurrencyId::Ztg); - } - - return Err(location); + if *para_id == u32::from(ParachainInfo::parachain_id()) { + if key == zeitgeist::KEY { Some(CurrencyId::Ztg) } else { None } + } else { + AssetRegistry::location_to_asset_id(location) } - - AssetRegistry::location_to_asset_id(location).ok_or(location) } - _ => AssetRegistry::location_to_asset_id(location).ok_or(location), + _ => AssetRegistry::location_to_asset_id(location), + } + } + + fn convert_back(id: &CurrencyId) -> Option { + match id { + Asset::Ztg => Some(MultiLocation::new( + 1, + X2( + Junction::Parachain(ParachainInfo::parachain_id().into()), + general_key(zeitgeist::KEY), + ), + )), + Asset::ForeignAsset(_) => AssetRegistry::multilocation(id).ok()?, + _ => None, } } } @@ -389,7 +407,7 @@ impl xcm_executor::traits::Convert for AssetConvert { impl Convert> for AssetConvert { fn convert(asset: MultiAsset) -> Option { if let MultiAsset { id: Concrete(location), .. } = asset { - >::convert(location).ok() + >::convert(&location) } else { None } @@ -398,7 +416,7 @@ impl Convert> for AssetConvert { impl Convert> for AssetConvert { fn convert(location: MultiLocation) -> Option { - >::convert(location).ok() + >::convert(&location) } } diff --git a/rust-toolchain b/rust-toolchain index 79f0cd6f9..00cf94259 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-01-31" +channel = "nightly-2024-04-15" components = ["clippy", "rustfmt", "llvm-tools-preview"] profile = "minimal" targets = ["wasm32-unknown-unknown"] diff --git a/zrml/authorized/Cargo.toml b/zrml/authorized/Cargo.toml index c25afbea9..aa6655625 100644 --- a/zrml/authorized/Cargo.toml +++ b/zrml/authorized/Cargo.toml @@ -37,6 +37,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-authorized" version = "0.5.2" diff --git a/zrml/authorized/src/benchmarks.rs b/zrml/authorized/src/benchmarks.rs index db649941b..658df6bc6 100644 --- a/zrml/authorized/src/benchmarks.rs +++ b/zrml/authorized/src/benchmarks.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -27,10 +27,7 @@ use crate::{ Pallet, }; use frame_benchmarking::benchmarks; -use frame_support::{ - dispatch::UnfilteredDispatchable, - traits::{EnsureOrigin, Get, Imbalance}, -}; +use frame_support::traits::{EnsureOrigin, Get, Imbalance, UnfilteredDispatchable}; use sp_runtime::traits::Saturating; use zeitgeist_primitives::{ traits::{DisputeApi, DisputeResolutionApi}, diff --git a/zrml/authorized/src/lib.rs b/zrml/authorized/src/lib.rs index f155bf38f..4c2615887 100644 --- a/zrml/authorized/src/lib.rs +++ b/zrml/authorized/src/lib.rs @@ -44,7 +44,7 @@ mod pallet { traits::{Currency, Get, Hooks, IsType, StorageVersion}, PalletId, Twox64Concat, }; - use frame_system::pallet_prelude::OriginFor; + use frame_system::pallet_prelude::{BlockNumberFor, OriginFor}; use sp_runtime::{traits::Saturating, DispatchError, DispatchResult}; use zeitgeist_primitives::{ traits::{DisputeApi, DisputeMaxWeightApi, DisputeResolutionApi}, @@ -70,7 +70,7 @@ mod pallet { pub(crate) type MarketOf = Market< ::AccountId, BalanceOf, - ::BlockNumber, + BlockNumberFor, MomentOf, MarketIdOf, >; @@ -133,18 +133,18 @@ mod pallet { /// The period, in which the authority can correct the outcome of a market. /// This value must not be zero. #[pallet::constant] - type CorrectionPeriod: Get; + type CorrectionPeriod: Get>; type DisputeResolution: DisputeResolutionApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = MarketIdOf, Moment = MomentOf, >; type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, Balance = BalanceOf, >; @@ -180,7 +180,7 @@ mod pallet { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] @@ -191,7 +191,7 @@ mod pallet { T: Config, { /// Return the resolution block number for the given market. - fn get_auto_resolve(market_id: &MarketIdOf) -> Option { + fn get_auto_resolve(market_id: &MarketIdOf) -> Option> { AuthorizedOutcomeReports::::get(market_id).map(|report| report.resolve_at) } @@ -245,7 +245,7 @@ mod pallet { type AccountId = T::AccountId; type Balance = BalanceOf; type NegativeImbalance = NegativeImbalanceOf; - type BlockNumber = T::BlockNumber; + type BlockNumber = BlockNumberFor; type MarketId = MarketIdOf; type Moment = MomentOf; type Origin = T::RuntimeOrigin; @@ -360,7 +360,7 @@ mod pallet { #[pallet::storage] #[pallet::getter(fn outcomes)] pub type AuthorizedOutcomeReports = - StorageMap<_, Twox64Concat, MarketIdOf, AuthorityReport, OptionQuery>; + StorageMap<_, Twox64Concat, MarketIdOf, AuthorityReport>, OptionQuery>; } #[cfg(any(feature = "runtime-benchmarks", test))] diff --git a/zrml/authorized/src/mock.rs b/zrml/authorized/src/mock.rs index 5669d8096..a3df02779 100644 --- a/zrml/authorized/src/mock.rs +++ b/zrml/authorized/src/mock.rs @@ -22,25 +22,19 @@ extern crate alloc; use crate::{self as zrml_authorized, mock_storage::pallet as mock_storage}; use alloc::{vec, vec::Vec}; -use frame_support::{ - construct_runtime, ord_parameter_types, - pallet_prelude::{DispatchError, Weight}, - traits::Everything, -}; -use frame_system::EnsureSignedBy; +use frame_support::{construct_runtime, ord_parameter_types, traits::Everything, weights::Weight}; +use frame_system::{mocking::MockBlock, EnsureSignedBy}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, DispatchError, }; use zeitgeist_primitives::{ constants::mock::{ - AuthorizedPalletId, BlockHashCount, CorrectionPeriod, MaxReserves, MinimumPeriod, BASE, + AuthorizedPalletId, BlockHashCount, CorrectionPeriod, ExistentialDeposit, MaxLocks, + MaxReserves, MinimumPeriod, BASE, }, traits::{DisputeResolutionApi, MarketOfDisputeResolutionApi}, - types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, - }, + types::{AccountIdTest, Balance, BlockNumber, Hash, MarketId, Moment}, }; pub const ALICE: AccountIdTest = 0; @@ -48,19 +42,14 @@ pub const BOB: AccountIdTest = 1; pub const CHARLIE: AccountIdTest = 2; construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Authorized: zrml_authorized::{Event, Pallet, Storage}, - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, + pub enum Runtime { + Authorized: zrml_authorized, + Balances: pallet_balances, + MarketCommons: zrml_market_commons, + System: frame_system, + Timestamp: pallet_timestamp, // Just a mock storage for testing. - MockStorage: mock_storage::{Storage}, + MockStorage: mock_storage, } ); @@ -113,7 +102,7 @@ impl DisputeResolutionApi for MockResolution { impl crate::Config for Runtime { type Currency = Balances; - type RuntimeEvent = (); + type RuntimeEvent = RuntimeEvent; type CorrectionPeriod = CorrectionPeriod; type DisputeResolution = MockResolution; type MarketCommons = MarketCommons; @@ -131,18 +120,17 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); - type RuntimeEvent = (); + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -158,9 +146,13 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type RuntimeEvent = (); - type ExistentialDeposit = (); - type MaxLocks = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposit = ExistentialDeposit; + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); @@ -191,7 +183,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/authorized/src/mock_storage.rs b/zrml/authorized/src/mock_storage.rs index a58bb2748..cacbc6926 100644 --- a/zrml/authorized/src/mock_storage.rs +++ b/zrml/authorized/src/mock_storage.rs @@ -23,6 +23,7 @@ pub(crate) mod pallet { use core::marker::PhantomData; use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::BlockNumberFor; use zrml_market_commons::MarketCommonsPalletApi; pub(crate) type MarketIdOf = @@ -32,7 +33,7 @@ pub(crate) mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type MarketCommons: MarketCommonsPalletApi; + type MarketCommons: MarketCommonsPalletApi>; } #[pallet::pallet] @@ -43,7 +44,7 @@ pub(crate) mod pallet { pub(crate) type MarketIdsPerDisputeBlock = StorageMap< _, Twox64Concat, - T::BlockNumber, + BlockNumberFor, BoundedVec, CacheSize>, ValueQuery, >; diff --git a/zrml/authorized/src/tests.rs b/zrml/authorized/src/tests.rs index 81192a638..8780673ae 100644 --- a/zrml/authorized/src/tests.rs +++ b/zrml/authorized/src/tests.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -24,7 +24,8 @@ use crate::{ mock_storage::pallet as mock_storage, AuthorizedOutcomeReports, Error, }; -use frame_support::{assert_noop, assert_ok, dispatch::DispatchError}; +use frame_support::{assert_noop, assert_ok}; +use sp_runtime::DispatchError; use zeitgeist_primitives::{ traits::DisputeApi, types::{AuthorityReport, MarketDisputeMechanism, MarketStatus, OutcomeReport}, diff --git a/zrml/court/Cargo.toml b/zrml/court/Cargo.toml index 1920b8b65..cc79a5433 100644 --- a/zrml/court/Cargo.toml +++ b/zrml/court/Cargo.toml @@ -3,6 +3,7 @@ arrayvec = { workspace = true } frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } +log = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } rand = { workspace = true, features = ["alloc", "std_rng"] } rand_chacha = { workspace = true } @@ -16,7 +17,7 @@ zrml-market-commons = { workspace = true } [dev-dependencies] env_logger = { workspace = true } pallet-balances = { workspace = true, features = ["default"] } -pallet-randomness-collective-flip = { workspace = true, features = ["default"] } +pallet-insecure-randomness-collective-flip = { workspace = true, features = ["default"] } pallet-timestamp = { workspace = true, features = ["default"] } pallet-treasury = { workspace = true, features = ["default"] } sp-io = { workspace = true, features = ["default"] } @@ -46,6 +47,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-court" version = "0.5.2" diff --git a/zrml/court/src/benchmarks.rs b/zrml/court/src/benchmarks.rs index bd60950b3..2a6c5828d 100644 --- a/zrml/court/src/benchmarks.rs +++ b/zrml/court/src/benchmarks.rs @@ -31,8 +31,8 @@ use crate::{ }; use alloc::{vec, vec::Vec}; use frame_benchmarking::{account, benchmarks, whitelisted_caller}; -use frame_support::traits::{Currency, Get, NamedReservableCurrency}; -use frame_system::RawOrigin; +use frame_support::traits::{Currency, Get, Imbalance, NamedReservableCurrency}; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use sp_arithmetic::Perbill; use sp_runtime::{ traits::{Bounded, Hash, Saturating, StaticLookup, Zero}, @@ -64,15 +64,16 @@ where metadata: vec![], oracle: account("oracle", 0, 0), period: MarketPeriod::Block( - 0u64.saturated_into::()..100u64.saturated_into::(), + 0u64.saturated_into::>() + ..100u64.saturated_into::>(), ), deadlines: Deadlines { - grace_period: 1_u64.saturated_into::(), - oracle_duration: 1_u64.saturated_into::(), - dispute_duration: 1_u64.saturated_into::(), + grace_period: 1_u64.saturated_into::>(), + oracle_duration: 1_u64.saturated_into::>(), + dispute_duration: 1_u64.saturated_into::>(), }, report: Some(Report { - at: 1u64.saturated_into::(), + at: 1u64.saturated_into::>(), by: account("oracle", 0, 0), outcome: ORACLE_REPORT, }), @@ -128,7 +129,7 @@ where court_participant: juror.clone(), consumed_stake, joined_at, - uneligible_index: 0u64.saturated_into::(), + uneligible_index: 0u64.saturated_into::>(), uneligible_stake: BalanceOf::::zero(), }; match pool.binary_search_by_key(&(stake, &juror), |pool_item| { @@ -178,10 +179,10 @@ fn setup_court() -> Result<(crate::MarketIdOf, CourtId), &'static str> where T: Config, { - >::set_block_number(1u64.saturated_into::()); + >::set_block_number(1u64.saturated_into::>()); let now = >::block_number(); - >::put(now + 1u64.saturated_into::()); + >::put(now + 1u64.saturated_into::>()); let market_id = T::MarketCommons::push_market(get_market::()).unwrap(); Court::::on_dispute(&market_id, &get_market::()).unwrap(); @@ -262,7 +263,7 @@ benchmarks! { joined_at_before, ); >::set_block_number( - joined_at_before + 1u64.saturated_into::(), + joined_at_before + 1u64.saturated_into::>(), ); let new_stake = T::MinJurorStake::get() @@ -298,7 +299,7 @@ benchmarks! { joined_at_before, ); >::set_block_number( - joined_at_before + 1u64.saturated_into::(), + joined_at_before + 1u64.saturated_into::>(), ); let juror_pool = >::get(); @@ -411,7 +412,7 @@ benchmarks! { >::insert(court_id, draws); >::set_block_number( - pre_vote + 1u64.saturated_into::(), + pre_vote + 1u64.saturated_into::>(), ); let commitment_vote = Default::default(); @@ -466,7 +467,7 @@ benchmarks! { >::insert(court_id, draws); >::set_block_number( - pre_vote + 1u64.saturated_into::(), + pre_vote + 1u64.saturated_into::>(), ); }: _(RawOrigin::Signed(caller), court_id, denounced_juror_unlookup, vote_item.clone(), salt) verify { @@ -515,7 +516,7 @@ benchmarks! { >::insert(court_id, draws); >::set_block_number( - vote_end + 1u64.saturated_into::() + vote_end + 1u64.saturated_into::>() ); }: _(RawOrigin::Signed(caller.clone()), court_id, vote_item.clone(), salt) verify { @@ -587,9 +588,9 @@ benchmarks! { } >::insert(court_id, draws); - >::set_block_number(aggregation + 1u64.saturated_into::()); + >::set_block_number(aggregation + 1u64.saturated_into::>()); let now = >::block_number(); - >::put(now + 1u64.saturated_into::()); + >::put(now + 1u64.saturated_into::>()); let new_resolve_at = >::get() + T::VotePeriod::get() @@ -699,7 +700,7 @@ benchmarks! { let r in 0..62; let now = >::block_number(); - let pre_vote_end = now + 1u64.saturated_into::(); + let pre_vote_end = now + 1u64.saturated_into::>(); >::put(pre_vote_end); let appeal_end = pre_vote_end @@ -763,7 +764,8 @@ benchmarks! { for i in 0..a { let backer = account("backer", i, 0); let bond = T::MinJurorStake::get(); - let _ = T::Currency::deposit_creating(&backer, bond); + let deposit = bond.saturating_add(T::Currency::minimum_balance()); + assert_eq!(T::Currency::deposit_creating(&backer, deposit).peek(), deposit); T::Currency::reserve_named(&Court::::reserve_id(), &backer, bond).unwrap(); let appeal_info = AppealInfo { backer, @@ -813,7 +815,8 @@ benchmarks! { for i in 0..a { let backer = account("backer", i, 0); let bond = T::MinJurorStake::get(); - let _ = T::Currency::deposit_creating(&backer, bond); + let deposit = bond.saturating_add(T::Currency::minimum_balance()); + assert_eq!(T::Currency::deposit_creating(&backer, deposit).peek(), deposit); T::Currency::reserve_named(&Court::::reserve_id(), &backer, bond).unwrap(); let appeal_info = AppealInfo { backer, diff --git a/zrml/court/src/lib.rs b/zrml/court/src/lib.rs index 3bd7dd9b9..2f2258094 100644 --- a/zrml/court/src/lib.rs +++ b/zrml/court/src/lib.rs @@ -35,17 +35,19 @@ use alloc::{ use core::marker::PhantomData; use frame_support::{ dispatch::DispatchResult, - ensure, log, + ensure, pallet_prelude::{ ConstU32, Decode, DispatchResultWithPostInfo, Encode, EnsureOrigin, Hooks, OptionQuery, - StorageMap, StorageValue, TypeInfo, ValueQuery, Weight, + StorageMap, StorageValue, TypeInfo, ValueQuery, }, traits::{ Currency, Get, Imbalance, IsType, LockIdentifier, LockableCurrency, NamedReservableCurrency, OnUnbalanced, Randomness, ReservableCurrency, StorageVersion, WithdrawReasons, }, - transactional, Blake2_128Concat, BoundedVec, PalletId, RuntimeDebug, Twox64Concat, + transactional, + weights::Weight, + Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, }; use frame_system::{ ensure_signed, @@ -59,7 +61,7 @@ use sp_arithmetic::{ }; use sp_runtime::{ traits::{AccountIdConversion, CheckedDiv, Hash, Saturating, StaticLookup, Zero}, - DispatchError, Perbill, SaturatedConversion, + DispatchError, Perbill, RuntimeDebug, SaturatedConversion, }; use zeitgeist_macros::unreachable_non_terminating; use zeitgeist_primitives::{ @@ -98,19 +100,19 @@ mod pallet { /// The expected blocks per year to calculate the inflation emission. #[pallet::constant] - type BlocksPerYear: Get; + type BlocksPerYear: Get>; /// The time in which the jurors can cast their commitment vote. #[pallet::constant] - type VotePeriod: Get; + type VotePeriod: Get>; /// The time in which the jurors should reveal their commitment vote. #[pallet::constant] - type AggregationPeriod: Get; + type AggregationPeriod: Get>; /// The time in which a court case can get appealed. #[pallet::constant] - type AppealPeriod: Get; + type AppealPeriod: Get>; /// The court lock identifier. #[pallet::constant] @@ -123,12 +125,12 @@ mod pallet { /// The currency implementation used to transfer, lock and reserve tokens. type Currency: Currency + NamedReservableCurrency - + LockableCurrency; + + LockableCurrency>; /// The functionality to allow controlling the markets resolution time. type DisputeResolution: DisputeResolutionApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = MarketIdOf, Moment = MomentOf, >; @@ -138,12 +140,12 @@ mod pallet { /// The inflation period in which new tokens are minted. #[pallet::constant] - type InflationPeriod: Get; + type InflationPeriod: Get>; /// Market commons type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, Balance = BalanceOf, >; @@ -185,11 +187,11 @@ mod pallet { type MonetaryGovernanceOrigin: EnsureOrigin; /// Randomness source - type Random: Randomness; + type Random: Randomness>; /// The global interval which schedules the start of new court vote periods. #[pallet::constant] - type RequestInterval: Get; + type RequestInterval: Get>; /// Handler for slashed funds. type Slash: OnUnbalanced>; @@ -220,17 +222,12 @@ mod pallet { pub(crate) type MarketIdOf = <::MarketCommons as MarketCommonsPalletApi>::MarketId; pub(crate) type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; - pub(crate) type MarketOf = Market< - AccountIdOf, - BalanceOf, - ::BlockNumber, - MomentOf, - MarketIdOf, - >; + pub(crate) type MarketOf = + Market, BalanceOf, BlockNumberFor, MomentOf, MarketIdOf>; pub(crate) type HashOf = ::Hash; pub(crate) type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; - pub(crate) type CourtOf = CourtInfo<::BlockNumber, AppealsOf>; + pub(crate) type CourtOf = CourtInfo, AppealsOf>; pub(crate) type DelegatedStakesOf = BoundedVec<(AccountIdOf, BalanceOf), ::MaxDelegations>; pub(crate) type SelectionValueOf = SelectionValue, DelegatedStakesOf>; @@ -296,7 +293,7 @@ mod pallet { /// The future block number when jurors should start voting. /// This is useful for the user experience of the jurors to vote for multiple courts at once. #[pallet::storage] - pub type RequestBlock = StorageValue<_, T::BlockNumber, ValueQuery>; + pub type RequestBlock = StorageValue<_, BlockNumberFor, ValueQuery>; #[pallet::type_value] pub fn DefaultYearlyInflation() -> Perbill { @@ -489,8 +486,8 @@ mod pallet { } #[pallet::hooks] - impl Hooks for Pallet { - fn on_initialize(now: T::BlockNumber) -> Weight { + impl Hooks> for Pallet { + fn on_initialize(now: BlockNumberFor) -> Weight { let mut total_weight: Weight = Weight::zero(); total_weight = total_weight.saturating_add(Self::handle_inflation(now)); total_weight = total_weight.saturating_add(T::DbWeight::get().reads(1)); @@ -1363,7 +1360,7 @@ mod pallet { } // Handle the external incentivisation of the court system. - pub(crate) fn handle_inflation(now: T::BlockNumber) -> Weight { + pub(crate) fn handle_inflation(now: BlockNumberFor) -> Weight { let inflation_period = T::InflationPeriod::get(); match now.checked_rem(&inflation_period) { Some(rem) if rem.is_zero() => (), @@ -1968,7 +1965,7 @@ mod pallet { pub(crate) fn check_appealable_market( court_id: CourtId, court: &CourtOf, - now: T::BlockNumber, + now: BlockNumberFor, ) -> Result<(), DispatchError> { if let Some(market_id) = >::get(court_id) { let market = T::MarketCommons::market(&market_id)?; @@ -2308,7 +2305,7 @@ mod pallet { type AccountId = T::AccountId; type Balance = BalanceOf; type NegativeImbalance = NegativeImbalanceOf; - type BlockNumber = T::BlockNumber; + type BlockNumber = BlockNumberFor; type MarketId = MarketIdOf; type Moment = MomentOf; type Origin = T::RuntimeOrigin; diff --git a/zrml/court/src/mock.rs b/zrml/court/src/mock.rs index 6af67d134..ccfba25a7 100644 --- a/zrml/court/src/mock.rs +++ b/zrml/court/src/mock.rs @@ -26,23 +26,20 @@ use frame_support::{ traits::{Everything, Hooks, NeverEnsureOrigin}, PalletId, }; -use frame_system::{EnsureRoot, EnsureSignedBy}; +use frame_system::{mocking::MockBlock, EnsureRoot, EnsureSignedBy}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use zeitgeist_primitives::{ constants::mock::{ AggregationPeriod, AppealBond, AppealPeriod, BlockHashCount, BlocksPerYear, CourtPalletId, - InflationPeriod, LockId, MaxAppeals, MaxApprovals, MaxCourtParticipants, MaxDelegations, - MaxReserves, MaxSelectedDraws, MaxYearlyInflation, MinJurorStake, MinimumPeriod, - RequestInterval, VotePeriod, BASE, + ExistentialDeposit, InflationPeriod, LockId, MaxAppeals, MaxApprovals, + MaxCourtParticipants, MaxDelegations, MaxLocks, MaxReserves, MaxSelectedDraws, + MaxYearlyInflation, MinJurorStake, MinimumPeriod, RequestInterval, VotePeriod, BASE, }, traits::{DisputeResolutionApi, MarketOfDisputeResolutionApi}, - types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, - }, + types::{AccountIdTest, Balance, BlockNumber, Hash, MarketId, Moment}, }; pub const ALICE: AccountIdTest = 0; @@ -63,20 +60,15 @@ parameter_types! { } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - Court: zrml_court::{Event, Pallet, Storage}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, - Treasury: pallet_treasury::{Call, Event, Pallet, Storage}, + pub enum Runtime { + Balances: pallet_balances, + Court: zrml_court, + MarketCommons: zrml_market_commons, + System: frame_system, + Timestamp: pallet_timestamp, + Treasury: pallet_treasury, // Just a mock storage for testing. - MockStorage: mock_storage::{Storage}, + MockStorage: mock_storage, } ); @@ -161,18 +153,17 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -188,9 +179,13 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = (); - type MaxLocks = (); + type ExistentialDeposit = ExistentialDeposit; + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); @@ -249,7 +244,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/court/src/mock_storage.rs b/zrml/court/src/mock_storage.rs index 296766ea7..5d5599a28 100644 --- a/zrml/court/src/mock_storage.rs +++ b/zrml/court/src/mock_storage.rs @@ -19,6 +19,7 @@ #![allow(dead_code)] #![allow(unused_imports)] +use frame_system::pallet_prelude::BlockNumberFor; pub use pallet::*; use parity_scale_codec::Encode; use sp_runtime::traits::Hash; @@ -27,6 +28,7 @@ use sp_runtime::traits::Hash; pub(crate) mod pallet { use core::marker::PhantomData; use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::BlockNumberFor; use zrml_market_commons::MarketCommonsPalletApi; pub(crate) type MarketIdOf = @@ -36,7 +38,7 @@ pub(crate) mod pallet { #[pallet::config] pub trait Config: frame_system::Config { - type MarketCommons: MarketCommonsPalletApi; + type MarketCommons: MarketCommonsPalletApi>; } #[pallet::pallet] @@ -47,14 +49,14 @@ pub(crate) mod pallet { pub(crate) type MarketIdsPerDisputeBlock = StorageMap< _, Twox64Concat, - T::BlockNumber, + BlockNumberFor, BoundedVec, CacheSize>, ValueQuery, >; } -impl frame_support::traits::Randomness for Pallet { - fn random(subject: &[u8]) -> (T::Hash, T::BlockNumber) { +impl frame_support::traits::Randomness> for Pallet { + fn random(subject: &[u8]) -> (T::Hash, BlockNumberFor) { let block_number = >::block_number(); let seed = subject.using_encoded(T::Hashing::hash); diff --git a/zrml/court/src/tests.rs b/zrml/court/src/tests.rs index 42dd23c72..3e9450f49 100644 --- a/zrml/court/src/tests.rs +++ b/zrml/court/src/tests.rs @@ -33,12 +33,18 @@ use crate::{ }; use alloc::collections::BTreeMap; use frame_support::{ - assert_noop, assert_ok, storage_root, - traits::{fungible::Balanced, tokens::imbalance::Imbalance, Currency, NamedReservableCurrency}, - StateVersion, + assert_noop, assert_ok, + storage::child::StateVersion, + traits::{ + fungible::Balanced, + tokens::{imbalance::Imbalance, Precision}, + Currency, NamedReservableCurrency, + }, }; +use frame_system::pallet_prelude::BlockNumberFor; use pallet_balances::{BalanceLock, NegativeImbalance}; use rand::seq::SliceRandom; +use sp_io::storage::root as storage_root; use sp_runtime::{ traits::{BlakeTwo256, Hash, Zero}, Perbill, Perquintill, @@ -61,8 +67,6 @@ use zeitgeist_primitives::{ }; use zrml_market_commons::{Error as MError, MarketCommonsPalletApi}; -type BlockNumberOf = ::BlockNumber; - const ORACLE_REPORT: OutcomeReport = OutcomeReport::Scalar(u128::MAX); const DEFAULT_MARKET: MarketOf = Market { @@ -119,7 +123,7 @@ fn fill_juror_pool(jurors_len: u32) { for i in 0..jurors_len { let amount = MinJurorStake::get() + i as u128; let juror = (i + 1000) as u128; - let _ = Balances::deposit(&juror, amount).unwrap(); + let _ = Balances::deposit(&juror, amount, Precision::Exact).unwrap(); assert_ok!(Court::join_court(RuntimeOrigin::signed(juror), amount)); } } @@ -467,7 +471,7 @@ fn join_court_fails_amount_below_lowest_juror() { let max_amount = min_amount + max_accounts as u128; for i in 1..=max_accounts { let amount = max_amount - i as u128; - let _ = Balances::deposit(&(i as u128), amount).unwrap(); + let _ = Balances::deposit(&(i as u128), amount, Precision::Exact).unwrap(); assert_ok!(Court::join_court(RuntimeOrigin::signed(i as u128), amount)); } @@ -513,7 +517,7 @@ fn prepare_exit_court_removes_lowest_staked_juror() { for i in 0..CourtPoolOf::::bound() { let amount = min_amount + i as u128; let juror = i as u128; - let _ = Balances::deposit(&juror, amount).unwrap(); + let _ = Balances::deposit(&juror, amount, Precision::Exact).unwrap(); assert_ok!(Court::join_court(RuntimeOrigin::signed(juror), amount)); } @@ -541,7 +545,7 @@ fn prepare_exit_court_removes_middle_staked_juror() { for i in 0..CourtPoolOf::::bound() { let amount = min_amount + i as u128; let juror = i as u128; - let _ = Balances::deposit(&juror, amount).unwrap(); + let _ = Balances::deposit(&juror, amount, Precision::Exact).unwrap(); assert_ok!(Court::join_court(RuntimeOrigin::signed(juror), amount)); } @@ -571,7 +575,7 @@ fn prepare_exit_court_removes_highest_staked_juror() { for i in 0..CourtPoolOf::::bound() { let amount = min_amount + i as u128; let juror = i as u128; - let _ = Balances::deposit(&juror, amount).unwrap(); + let _ = Balances::deposit(&juror, amount, Precision::Exact).unwrap(); assert_ok!(Court::join_court(RuntimeOrigin::signed(juror), amount)); } @@ -606,7 +610,7 @@ fn join_court_binary_search_sorted_insert_works() { for i in random_numbers { let amount = max_amount - i as u128; let juror = i as u128; - let _ = Balances::deposit(&juror, amount).unwrap(); + let _ = Balances::deposit(&juror, amount, Precision::Exact).unwrap(); assert_ok!(Court::join_court(RuntimeOrigin::signed(juror), amount)); } @@ -2179,7 +2183,7 @@ fn reassign_court_stakes_slashes_loosers_and_awards_winners() { let reward_pot = Court::reward_pot(court_id); let tardy_or_denounced_value = 5 * MinJurorStake::get(); - let _ = Balances::deposit(&reward_pot, tardy_or_denounced_value).unwrap(); + let _ = Balances::deposit(&reward_pot, tardy_or_denounced_value, Precision::Exact).unwrap(); assert_ok!(Court::reassign_court_stakes(RuntimeOrigin::signed(EVE), court_id)); @@ -2298,7 +2302,7 @@ fn reassign_court_stakes_works_for_delegations() { let reward_pot = Court::reward_pot(court_id); let tardy_or_denounced_value = 5 * MinJurorStake::get(); - let _ = Balances::deposit(&reward_pot, tardy_or_denounced_value).unwrap(); + let _ = Balances::deposit(&reward_pot, tardy_or_denounced_value, Precision::Exact).unwrap(); assert_ok!(Court::reassign_court_stakes(RuntimeOrigin::signed(EVE), court_id)); @@ -2534,7 +2538,7 @@ fn exchange_slashes_unjustified_and_unreserves_justified_appealers() { }; let backer = number; - let _ = Balances::deposit(&backer, bond).unwrap(); + let _ = Balances::deposit(&backer, bond, Precision::Exact).unwrap(); assert_ok!(Balances::reserve_named(&Court::reserve_id(), &backer, bond)); let free_balance = Balances::free_balance(backer); free_balances_before.insert(backer, free_balance); @@ -2680,7 +2684,7 @@ fn choose_multiple_weighted_works() { for i in 0..necessary_draws_weight { let amount = MinJurorStake::get() + i as u128; let juror = i as u128; - let _ = Balances::deposit(&juror, amount).unwrap(); + let _ = Balances::deposit(&juror, amount, Precision::Exact).unwrap(); assert_ok!(Court::join_court(RuntimeOrigin::signed(juror), amount)); } let random_jurors = Court::choose_multiple_weighted(necessary_draws_weight).unwrap(); @@ -2723,7 +2727,7 @@ fn select_participants_fails_if_not_enough_jurors(appeal_number: usize) { for i in 0..(necessary_draws_weight - 1usize) { let amount = MinJurorStake::get() + i as u128; let juror = (i + 1000) as u128; - let _ = Balances::deposit(&juror, amount).unwrap(); + let _ = Balances::deposit(&juror, amount, Precision::Exact).unwrap(); assert_ok!(Court::join_court(RuntimeOrigin::signed(juror), amount)); } @@ -3106,7 +3110,7 @@ fn handle_inflation_works() { for number in jurors_list.iter() { let stake = *number; let juror = *number; - let _ = Balances::deposit(&juror, stake).unwrap(); + let _ = Balances::deposit(&juror, stake, Precision::Exact).unwrap(); free_balances_before.insert(juror, stake); jurors .try_push(CourtPoolItem { @@ -3211,7 +3215,7 @@ fn gain_equal( struct Params { stake: BalanceOf, - uneligible_index: BlockNumberOf, + uneligible_index: BlockNumberFor, uneligible_stake: BalanceOf, } @@ -3424,7 +3428,7 @@ fn handle_inflation_without_waiting_one_inflation_period() { for number in jurors_list.iter() { let stake = *number; let juror = *number; - let _ = Balances::deposit(&juror, stake).unwrap(); + let _ = Balances::deposit(&juror, stake, Precision::Exact).unwrap(); free_balances_before.insert(juror, stake); jurors .try_push(CourtPoolItem { diff --git a/zrml/global-disputes/Cargo.toml b/zrml/global-disputes/Cargo.toml index 797dba502..b828dc30e 100644 --- a/zrml/global-disputes/Cargo.toml +++ b/zrml/global-disputes/Cargo.toml @@ -2,6 +2,7 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } +log = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } sp-runtime = { workspace = true } @@ -15,7 +16,7 @@ num-traits = { workspace = true, optional = true } [dev-dependencies] env_logger = { workspace = true } -pallet-balances = { workspace = true, features = ["default"] } +pallet-balances = { workspace = true, features = ["default", "insecure_zero_ed"] } pallet-timestamp = { workspace = true, features = ["default"] } sp-io = { workspace = true, features = ["default"] } zeitgeist-primitives = { workspace = true, features = ["mock", "default"] } @@ -44,6 +45,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-global-disputes" version = "0.5.2" diff --git a/zrml/global-disputes/src/lib.rs b/zrml/global-disputes/src/lib.rs index 4ac07e4c0..4449880b4 100644 --- a/zrml/global-disputes/src/lib.rs +++ b/zrml/global-disputes/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -40,7 +40,7 @@ mod pallet { use crate::{types::*, weights::WeightInfoZeitgeist, GlobalDisputesPalletApi, InitialItemOf}; use core::marker::PhantomData; use frame_support::{ - ensure, log, + ensure, pallet_prelude::{ DispatchResultWithPostInfo, OptionQuery, StorageDoubleMap, StorageMap, ValueQuery, }, @@ -51,7 +51,10 @@ mod pallet { }, Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, }; - use frame_system::{ensure_signed, pallet_prelude::OriginFor}; + use frame_system::{ + ensure_signed, + pallet_prelude::{BlockNumberFor, OriginFor}, + }; use sp_runtime::{ traits::{AccountIdConversion, CheckedDiv, Saturating, Zero}, DispatchError, DispatchResult, @@ -69,12 +72,8 @@ mod pallet { pub(crate) type OwnerInfoOf = BoundedVec, ::MaxOwners>; pub type OutcomeInfoOf = OutcomeInfo, BalanceOf, OwnerInfoOf>; - pub type GlobalDisputeInfoOf = GlobalDisputeInfo< - AccountIdOf, - BalanceOf, - OwnerInfoOf, - ::BlockNumber, - >; + pub type GlobalDisputeInfoOf = + GlobalDisputeInfo, BalanceOf, OwnerInfoOf, BlockNumberFor>; type AccountIdLookupOf = <::Lookup as StaticLookup>::Source; pub type LockInfoOf = @@ -91,16 +90,16 @@ mod pallet { pub trait Config: frame_system::Config { /// The time period in which the addition of new outcomes are allowed. #[pallet::constant] - type AddOutcomePeriod: Get; + type AddOutcomePeriod: Get>; /// The currency implementation used to lock tokens for voting. - type Currency: LockableCurrency; + type Currency: LockableCurrency>; type RuntimeEvent: From> + IsType<::RuntimeEvent>; type DisputeResolution: DisputeResolutionApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = MarketIdOf, Moment = MomentOf, >; @@ -117,7 +116,7 @@ mod pallet { type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, Balance = BalanceOf, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, >; /// The maximum numbers of distinct markets @@ -142,7 +141,7 @@ mod pallet { /// The time period in which votes are allowed. #[pallet::constant] - type GdVotingPeriod: Get; + type GdVotingPeriod: Get>; /// The fee required to add a voting outcome. #[pallet::constant] @@ -764,16 +763,16 @@ mod pallet { } } - impl GlobalDisputesPalletApi, AccountIdOf, BalanceOf, T::BlockNumber> + impl GlobalDisputesPalletApi, AccountIdOf, BalanceOf, BlockNumberFor> for Pallet where T: Config, { - fn get_add_outcome_period() -> T::BlockNumber { + fn get_add_outcome_period() -> BlockNumberFor { T::AddOutcomePeriod::get() } - fn get_vote_period() -> T::BlockNumber { + fn get_vote_period() -> BlockNumberFor { T::GdVotingPeriod::get() } diff --git a/zrml/global-disputes/src/mock.rs b/zrml/global-disputes/src/mock.rs index 25132468a..796eea66e 100644 --- a/zrml/global-disputes/src/mock.rs +++ b/zrml/global-disputes/src/mock.rs @@ -24,21 +24,19 @@ use frame_support::{ parameter_types, traits::Everything, }; +use frame_system::mocking::MockBlock; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use zeitgeist_primitives::{ constants::mock::{ AddOutcomePeriod, BlockHashCount, GdVotingPeriod, GlobalDisputeLockId, - GlobalDisputesPalletId, MaxReserves, MinOutcomeVoteAmount, MinimumPeriod, RemoveKeysLimit, - VotingOutcomeFee, BASE, + GlobalDisputesPalletId, MaxLocks, MaxReserves, MinOutcomeVoteAmount, MinimumPeriod, + RemoveKeysLimit, VotingOutcomeFee, BASE, }, traits::{DisputeResolutionApi, MarketOfDisputeResolutionApi}, - types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, - }, + types::{AccountIdTest, Balance, BlockNumber, Hash, MarketId, Moment}, }; pub const ALICE: AccountIdTest = 0; @@ -49,17 +47,12 @@ pub const POOR_PAUL: AccountIdTest = 4; pub const DAVE: AccountIdTest = 5; construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - GlobalDisputes: zrml_global_disputes::{Event, Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, + pub enum Runtime { + Balances: pallet_balances, + MarketCommons: zrml_market_commons, + GlobalDisputes: zrml_global_disputes, + System: frame_system, + Timestamp: pallet_timestamp, } ); @@ -122,18 +115,17 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -149,9 +141,13 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = (); - type MaxLocks = (); + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); @@ -190,7 +186,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/global-disputes/src/tests.rs b/zrml/global-disputes/src/tests.rs index 78b3ff94a..2c6951833 100644 --- a/zrml/global-disputes/src/tests.rs +++ b/zrml/global-disputes/src/tests.rs @@ -29,8 +29,8 @@ use frame_support::{ traits::{Currency, ReservableCurrency}, BoundedVec, }; -use pallet_balances::{BalanceLock, Error as BalancesError}; -use sp_runtime::{traits::Zero, SaturatedConversion}; +use pallet_balances::BalanceLock; +use sp_runtime::{traits::Zero, DispatchError, SaturatedConversion, TokenError}; use test_case::test_case; use zeitgeist_primitives::{ constants::mock::{ @@ -479,7 +479,7 @@ fn add_vote_outcome_fails_if_balance_too_low() { market_id, OutcomeReport::Scalar(80), ), - BalancesError::::InsufficientBalance + DispatchError::Token(TokenError::FundsUnavailable) ); }); } @@ -846,7 +846,7 @@ fn transfer_fails_with_fully_locked_balance() { assert_noop!( Balances::transfer(RuntimeOrigin::signed(*disputor), BOB, arbitrary_amount + 1), - pallet_balances::Error::::LiquidityRestrictions + DispatchError::Token(TokenError::Frozen) ); assert_ok!(Balances::transfer(RuntimeOrigin::signed(*disputor), BOB, arbitrary_amount)); }); diff --git a/zrml/global-disputes/src/utils.rs b/zrml/global-disputes/src/utils.rs index a593280cd..277ec7189 100644 --- a/zrml/global-disputes/src/utils.rs +++ b/zrml/global-disputes/src/utils.rs @@ -18,11 +18,12 @@ #![cfg(any(feature = "runtime-benchmarks", test))] use crate::*; +use frame_system::pallet_prelude::BlockNumberFor; type MarketOf = zeitgeist_primitives::types::Market< ::AccountId, BalanceOf, - ::BlockNumber, + BlockNumberFor, MomentOf, MarketIdOf, >; diff --git a/zrml/hybrid-router/Cargo.toml b/zrml/hybrid-router/Cargo.toml index 81a24316b..6ff10558e 100644 --- a/zrml/hybrid-router/Cargo.toml +++ b/zrml/hybrid-router/Cargo.toml @@ -9,12 +9,12 @@ sp-runtime = { workspace = true } zeitgeist-primitives = { workspace = true } zrml-market-commons = { workspace = true } - +cfg-if = { workspace = true, optional = true } orml-asset-registry = { workspace = true, optional = true } orml-currencies = { workspace = true, optional = true } orml-tokens = { workspace = true, optional = true } pallet-balances = { workspace = true, optional = true } -pallet-randomness-collective-flip = { workspace = true, optional = true } +pallet-insecure-randomness-collective-flip = { workspace = true, optional = true } pallet-timestamp = { workspace = true, optional = true } pallet-treasury = { workspace = true, optional = true } pallet-xcm = { workspace = true, optional = true } @@ -39,11 +39,12 @@ zrml-hybrid-router = { workspace = true, features = ["mock"] } [features] default = ["std"] mock = [ + "cfg-if", "orml-asset-registry/default", "orml-currencies/default", "orml-tokens/default", "pallet-balances/default", - "pallet-randomness-collective-flip/default", + "pallet-insecure-randomness-collective-flip/default", "pallet-timestamp/default", "pallet-treasury/default", "pallet-xcm/default", @@ -91,6 +92,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-hybrid-router" version = "0.5.2" diff --git a/zrml/hybrid-router/src/benchmarking.rs b/zrml/hybrid-router/src/benchmarking.rs index 1aa8718c0..23d7c9415 100644 --- a/zrml/hybrid-router/src/benchmarking.rs +++ b/zrml/hybrid-router/src/benchmarking.rs @@ -25,6 +25,7 @@ use crate::Pallet as HybridRouter; use crate::*; +use alloc::{vec, vec::Vec}; use frame_benchmarking::v2::*; use frame_support::{ assert_ok, @@ -97,10 +98,7 @@ fn create_market_and_deploy_pool( base_asset: AssetOf, asset_count: u16, amount: BalanceOf, -) -> MarketIdOf -where - T: Config, -{ +) -> MarketIdOf { let market_id = create_market::(caller.clone(), base_asset, asset_count); let total_cost = amount + T::AssetManager::minimum_balance(base_asset); assert_ok!(T::AssetManager::deposit(base_asset, &caller, total_cost)); @@ -219,7 +217,11 @@ mod benchmarks { let order_creator: T::AccountId = account("order_creator", *order_id as u32, 0); let surplus = ((i + 1) as u128) * _1_2; let taker_amount = taker_amount + surplus.saturated_into::>(); - assert_ok!(T::AssetManager::deposit(maker_asset, &order_creator, maker_amount)); + assert_ok!(T::AssetManager::deposit( + maker_asset, + &order_creator, + maker_amount + _100.saturated_into() + )); T::Orderbook::place_order( order_creator, market_id, diff --git a/zrml/hybrid-router/src/lib.rs b/zrml/hybrid-router/src/lib.rs index 4892585f4..1544559d2 100644 --- a/zrml/hybrid-router/src/lib.rs +++ b/zrml/hybrid-router/src/lib.rs @@ -40,17 +40,18 @@ mod pallet { use alloc::{vec, vec::Vec}; use core::marker::PhantomData; use frame_support::{ - ensure, - pallet_prelude::DispatchError, - require_transactional, + ensure, require_transactional, traits::{IsType, StorageVersion}, PalletId, }; - use frame_system::{ensure_signed, pallet_prelude::OriginFor}; + use frame_system::{ + ensure_signed, + pallet_prelude::{BlockNumberFor, OriginFor}, + }; use orml_traits::MultiCurrency; use sp_runtime::{ traits::{Get, Zero}, - DispatchResult, SaturatedConversion, Saturating, + DispatchError, DispatchResult, SaturatedConversion, Saturating, }; #[cfg(feature = "runtime-benchmarks")] use zeitgeist_primitives::traits::{CompleteSetOperationsApi, DeployPoolApi}; @@ -90,7 +91,7 @@ mod pallet { /// The identifier of individual markets. type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, Balance = BalanceOf, >; diff --git a/zrml/hybrid-router/src/mock.rs b/zrml/hybrid-router/src/mock.rs index 2682f950f..8246d648e 100644 --- a/zrml/hybrid-router/src/mock.rs +++ b/zrml/hybrid-router/src/mock.rs @@ -29,17 +29,12 @@ use frame_support::{ construct_runtime, ord_parameter_types, parameter_types, traits::{Contains, Everything, NeverEnsureOrigin}, }; -use frame_system::{EnsureRoot, EnsureSignedBy}; -#[cfg(feature = "parachain")] -use orml_asset_registry::AssetMetadata; +use frame_system::{mocking::MockBlock, EnsureRoot, EnsureSignedBy}; use orml_traits::MultiCurrency; use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, Get, IdentityLookup, Zero}, - Perbill, Percent, SaturatedConversion, + traits::{BlakeTwo256, ConstU32, Get, IdentityLookup, Zero}, + BuildStorage, Perbill, Percent, SaturatedConversion, }; -#[cfg(feature = "parachain")] -use zeitgeist_primitives::types::Asset; use zeitgeist_primitives::{ constants::mock::{ AddOutcomePeriod, AggregationPeriod, AppealBond, AppealPeriod, AuthorizedPalletId, @@ -60,10 +55,15 @@ use zeitgeist_primitives::{ }, traits::DistributeFees, types::{ - AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, - Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, CurrencyId, Hash, MarketId, Moment, }, }; +#[cfg(feature = "parachain")] +use { + orml_traits::asset_registry::AssetProcessor, parity_scale_codec::Encode, + sp_runtime::DispatchError, zeitgeist_primitives::types::Asset, + zeitgeist_primitives::types::CustomMetadata, +}; pub const ALICE: AccountIdTest = 0; #[allow(unused)] @@ -138,8 +138,6 @@ where } } -pub type UncheckedExtrinsic = UncheckedExtrinsicTest; - pub struct DustRemovalWhitelist; impl Contains for DustRemovalWhitelist { @@ -149,29 +147,26 @@ impl Contains for DustRemovalWhitelist { } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsic, - { - HybridRouter: zrml_hybrid_router::{Pallet, Call, Storage, Event}, - AssetManager: orml_currencies::{Call, Pallet, Storage}, - Orderbook: zrml_orderbook::{Call, Event, Pallet, Storage}, - NeoSwaps: zrml_neo_swaps::{Call, Event, Pallet}, - Authorized: zrml_authorized::{Event, Pallet, Storage}, - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - Court: zrml_court::{Event, Pallet, Storage}, - LiquidityMining: zrml_liquidity_mining::{Config, Event, Pallet}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - PredictionMarkets: zrml_prediction_markets::{Event, Pallet, Storage}, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, - SimpleDisputes: zrml_simple_disputes::{Event, Pallet, Storage}, - GlobalDisputes: zrml_global_disputes::{Event, Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, - Treasury: pallet_treasury::{Call, Event, Pallet, Storage}, + pub enum Runtime { + HybridRouter: zrml_hybrid_router, + Orderbook: zrml_orderbook, + NeoSwaps: zrml_neo_swaps, + #[cfg(feature = "parachain")] + AssetRegistry: orml_asset_registry, + Authorized: zrml_authorized, + Balances: pallet_balances, + Court: zrml_court, + AssetManager: orml_currencies, + LiquidityMining: zrml_liquidity_mining, + MarketCommons: zrml_market_commons, + PredictionMarkets: zrml_prediction_markets, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip, + SimpleDisputes: zrml_simple_disputes, + GlobalDisputes: zrml_global_disputes, + System: frame_system, + Timestamp: pallet_timestamp, + Tokens: orml_tokens, + Treasury: pallet_treasury, } ); @@ -211,14 +206,14 @@ impl zrml_neo_swaps::Config for Runtime { type WeightInfo = zrml_neo_swaps::weights::WeightInfo; } -impl pallet_randomness_collective_flip::Config for Runtime {} +impl pallet_insecure_randomness_collective_flip::Config for Runtime {} impl zrml_prediction_markets::Config for Runtime { type AdvisoryBond = AdvisoryBond; type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; type ApproveOrigin = EnsureSignedBy; #[cfg(feature = "parachain")] - type AssetRegistry = MockRegistry; + type AssetRegistry = AssetRegistry; type Authorized = Authorized; type CloseEarlyBlockPeriod = CloseEarlyBlockPeriod; type CloseEarlyDisputeBond = CloseEarlyDisputeBond; @@ -312,29 +307,57 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type OnSetCode = (); type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); type Version = (); + type OnSetCode = (); } +cfg_if::cfg_if!( + if #[cfg(feature = "parachain")] { + type AssetMetadata = orml_traits::asset_registry::AssetMetadata< + Balance, + CustomMetadata, + ConstU32<1024> + >; + pub struct NoopAssetProcessor {} + + impl AssetProcessor for NoopAssetProcessor { + fn pre_register(id: Option, asset_metadata: AssetMetadata) + -> Result<(CurrencyId, AssetMetadata), DispatchError> { + Ok((id.unwrap(), asset_metadata)) + } + } + + impl orml_asset_registry::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CustomMetadata = CustomMetadata; + type AssetId = CurrencyId; + type AuthorityOrigin = EnsureRoot; + type AssetProcessor = NoopAssetProcessor; + type Balance = Balance; + type StringLimit = ConstU32<1024>; + type WeightInfo = (); + } + } +); + impl orml_currencies::Config for Runtime { type GetNativeCurrencyId = GetNativeCurrencyId; type MultiCurrency = Tokens; @@ -360,8 +383,12 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; + type MaxHolds = (); + type MaxFreezes = (); type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; @@ -429,14 +456,6 @@ impl pallet_treasury::Config for Runtime { type WeightInfo = (); } -#[cfg(feature = "parachain")] -zrml_prediction_markets::impl_mock_registry! { - MockRegistry, - CurrencyId, - Balance, - zeitgeist_primitives::types::CustomMetadata -} - #[allow(unused)] pub struct ExtBuilder { balances: Vec<(AccountIdTest, Balance)>, @@ -461,7 +480,7 @@ impl Default for ExtBuilder { #[allow(unused)] impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); pallet_balances::GenesisConfig:: { balances: self.balances } @@ -469,7 +488,6 @@ impl ExtBuilder { .unwrap(); #[cfg(feature = "parachain")] { - use frame_support::traits::GenesisBuild; orml_tokens::GenesisConfig:: { balances: vec![ (ALICE, FOREIGN_ASSET, INITIAL_BALANCE), @@ -482,18 +500,20 @@ impl ExtBuilder { allow_as_base_asset: true, ..Default::default() }; - orml_asset_registry_mock::GenesisConfig { - metadata: vec![( + orml_asset_registry::GenesisConfig:: { + assets: vec![( FOREIGN_ASSET, AssetMetadata { decimals: 18, - name: "MKL".as_bytes().to_vec(), - symbol: "MKL".as_bytes().to_vec(), + name: "MKL".as_bytes().to_vec().try_into().unwrap(), + symbol: "MKL".as_bytes().to_vec().try_into().unwrap(), existential_deposit: 0, location: None, additional: custom_metadata, - }, + } + .encode(), )], + last_asset_id: FOREIGN_ASSET, } .assimilate_storage(&mut t) .unwrap(); diff --git a/zrml/hybrid-router/src/tests/buy.rs b/zrml/hybrid-router/src/tests/buy.rs index 6c5a36f82..dec84799d 100644 --- a/zrml/hybrid-router/src/tests/buy.rs +++ b/zrml/hybrid-router/src/tests/buy.rs @@ -674,7 +674,7 @@ fn buy_fails_if_balance_too_low() { let asset = Asset::CategoricalOutcome(market_id, 0); let amount = 10 * BASE; - assert_ok!(Balances::set_balance(RuntimeOrigin::root(), ALICE, amount - 1, 0)); + assert_eq!(Balances::set_balance(&ALICE, amount - 1), amount - 1); let max_price = (BASE / 2).saturated_into::>(); let orders = vec![]; let strategy = Strategy::LimitOrder; diff --git a/zrml/hybrid-router/src/tests/mod.rs b/zrml/hybrid-router/src/tests/mod.rs index 4c42c9e25..78c80d8a2 100644 --- a/zrml/hybrid-router/src/tests/mod.rs +++ b/zrml/hybrid-router/src/tests/mod.rs @@ -18,7 +18,7 @@ #![cfg(all(feature = "mock", test))] use crate::{mock::*, types::*, utils::*, AccountIdOf, BalanceOf, MarketIdOf, *}; -use frame_support::{assert_noop, assert_ok}; +use frame_support::{assert_noop, assert_ok, traits::fungible::Mutate}; use orml_currencies::Error as CurrenciesError; use orml_tokens::Error as TokensError; use orml_traits::MultiCurrency; diff --git a/zrml/hybrid-router/src/tests/sell.rs b/zrml/hybrid-router/src/tests/sell.rs index 837b4bac2..1d76359f5 100644 --- a/zrml/hybrid-router/src/tests/sell.rs +++ b/zrml/hybrid-router/src/tests/sell.rs @@ -805,7 +805,7 @@ fn sell_emits_event() { let order_creator = i as AccountIdTest; let surplus = ((i + 1) as u128) * _1_2; let taker_amount = taker_amount + surplus.saturated_into::>(); - assert_ok!(AssetManager::deposit(maker_asset, &order_creator, maker_amount)); + assert_ok!(AssetManager::deposit(maker_asset, &order_creator, maker_amount + _100)); assert_ok!(Orderbook::place_order( RuntimeOrigin::signed(order_creator), market_id, diff --git a/zrml/hybrid-router/src/types.rs b/zrml/hybrid-router/src/types.rs index 03296651e..2d6a1d2fc 100644 --- a/zrml/hybrid-router/src/types.rs +++ b/zrml/hybrid-router/src/types.rs @@ -19,7 +19,7 @@ use crate::{AmmTradeOf, BalanceOf, Config, OrderTradeOf}; use alloc::vec::Vec; use frame_support::pallet_prelude::*; use scale_info::TypeInfo; -use sp_runtime::traits::Zero; +use sp_runtime::{traits::Zero, DispatchError}; use zeitgeist_primitives::math::checked_ops_res::{CheckedAddRes, CheckedSubRes}; /// Represents the strategy used when placing an order in a trading environment. diff --git a/zrml/liquidity-mining/Cargo.toml b/zrml/liquidity-mining/Cargo.toml index cecf83500..9f6886add 100644 --- a/zrml/liquidity-mining/Cargo.toml +++ b/zrml/liquidity-mining/Cargo.toml @@ -2,6 +2,7 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } +log = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } serde = { workspace = true, optional = true } @@ -39,6 +40,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-liquidity-mining" version = "0.5.2" diff --git a/zrml/liquidity-mining/src/lib.rs b/zrml/liquidity-mining/src/lib.rs index a2346ebfa..ad96e8317 100644 --- a/zrml/liquidity-mining/src/lib.rs +++ b/zrml/liquidity-mining/src/lib.rs @@ -51,21 +51,22 @@ mod pallet { }; use alloc::vec::Vec; use core::marker::PhantomData; - #[cfg(feature = "std")] - use frame_support::traits::GenesisBuild; use frame_support::{ dispatch::DispatchResult, - log, storage::{ types::{StorageDoubleMap, StorageValue, ValueQuery}, with_transaction, }, traits::{ - Currency, ExistenceRequirement, Get, Hooks, IsType, StorageVersion, WithdrawReasons, + BuildGenesisConfig, Currency, ExistenceRequirement, Get, Hooks, IsType, StorageVersion, + WithdrawReasons, }, Blake2_128Concat, PalletId, Twox64Concat, }; - use frame_system::{ensure_root, pallet_prelude::OriginFor}; + use frame_system::{ + ensure_root, + pallet_prelude::{BlockNumberFor, OriginFor}, + }; use sp_runtime::{ traits::{AccountIdConversion, Saturating}, TransactionOutcome, @@ -107,7 +108,7 @@ mod pallet { type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = Self::MarketId, Balance = BalanceOf, >; @@ -141,9 +142,8 @@ mod pallet { FundDoesNotHaveEnoughBalance, } - #[cfg(feature = "std")] #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { let _ = T::Currency::deposit_creating( &Pallet::::pallet_account_id(), @@ -153,7 +153,6 @@ mod pallet { } } - #[cfg(feature = "std")] #[derive(scale_info::TypeInfo, Debug)] #[pallet::genesis_config] pub struct GenesisConfig { @@ -161,7 +160,6 @@ mod pallet { pub per_block_distribution: BalanceOf, } - #[cfg(feature = "std")] impl Default for GenesisConfig where T: Config, @@ -176,9 +174,9 @@ mod pallet { } #[pallet::hooks] - impl Hooks for Pallet { + impl Hooks> for Pallet { // Manages incentives on each block finalization. - fn on_finalize(block: T::BlockNumber) { + fn on_finalize(block: BlockNumberFor) { let fun = || { let added_len = TrackIncentivesBasedOnBoughtShares::::exec(block)?; if added_len > 0 { @@ -221,7 +219,7 @@ mod pallet { { type AccountId = T::AccountId; type Balance = BalanceOf; - type BlockNumber = T::BlockNumber; + type BlockNumber = BlockNumberFor; type MarketId = T::MarketId; fn add_shares( @@ -339,7 +337,7 @@ mod pallet { T::MarketId, Twox64Concat, T::AccountId, - OwnedValuesParams, T::BlockNumber>, + OwnedValuesParams, BlockNumberFor>, ValueQuery, >; diff --git a/zrml/liquidity-mining/src/mock.rs b/zrml/liquidity-mining/src/mock.rs index b4fa05cbc..6cd49ddc1 100644 --- a/zrml/liquidity-mining/src/mock.rs +++ b/zrml/liquidity-mining/src/mock.rs @@ -19,46 +19,36 @@ #![cfg(test)] use crate as zrml_liquidity_mining; -use frame_support::{ - construct_runtime, - traits::{Everything, GenesisBuild}, -}; +use frame_support::{construct_runtime, traits::Everything}; +use frame_system::mocking::MockBlock; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use zeitgeist_primitives::{ constants::mock::{ BlockHashCount, ExistentialDeposit, LiquidityMiningPalletId, MaxLocks, MaxReserves, MinimumPeriod, BASE, }, - types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, - }, + types::{AccountIdTest, Balance, Hash, MarketId, Moment}, }; pub const ALICE: AccountIdTest = 0; pub const BOB: AccountIdTest = 1; construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - LiquidityMining: zrml_liquidity_mining::{Config, Event, Pallet}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, + pub enum Runtime { + Balances: pallet_balances, + LiquidityMining: zrml_liquidity_mining, + MarketCommons: zrml_market_commons, + System: frame_system, + Timestamp: pallet_timestamp, } ); impl crate::Config for Runtime { type Currency = Balances; - type RuntimeEvent = (); + type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type MarketId = MarketId; type PalletId = LiquidityMiningPalletId; @@ -69,18 +59,17 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); - type RuntimeEvent = (); + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -96,11 +85,15 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type ReserveIdentifier = [u8; 8]; - type RuntimeEvent = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; + type MaxHolds = (); + type MaxFreezes = (); type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; type WeightInfo = (); } @@ -135,7 +128,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/liquidity-mining/src/tests.rs b/zrml/liquidity-mining/src/tests.rs index 671d52f3f..55b2aa4f3 100644 --- a/zrml/liquidity-mining/src/tests.rs +++ b/zrml/liquidity-mining/src/tests.rs @@ -27,10 +27,10 @@ use crate::{ use core::ops::Range; use frame_support::{ assert_err, assert_ok, - dispatch::DispatchError, traits::{Currency, OnFinalize}, }; use frame_system::RawOrigin; +use sp_runtime::DispatchError; use zeitgeist_primitives::types::{ Asset, Deadlines, Market, MarketBonds, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, MarketType, ScoringRule, diff --git a/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs b/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs index b62893e30..208189b20 100644 --- a/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs +++ b/zrml/liquidity-mining/src/track_incentives_based_on_bought_shares.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -22,6 +22,7 @@ use crate::{ }; use alloc::{collections::BTreeSet, vec::Vec}; use core::marker::PhantomData; +use frame_system::pallet_prelude::BlockNumberFor; use sp_runtime::traits::{CheckedDiv, Saturating}; use zeitgeist_primitives::types::MarketPeriod; use zrml_market_commons::MarketCommonsPalletApi; @@ -37,7 +38,7 @@ impl TrackIncentivesBasedOnBoughtShares where T: crate::Config, { - pub(crate) fn exec(curr_block: T::BlockNumber) -> Option { + pub(crate) fn exec(curr_block: BlockNumberFor) -> Option { let per_block_incentives = >::get(); let market_incentives = Self::markets_incentives(per_block_incentives, curr_block)?; let market_incentives_len = market_incentives.len(); @@ -59,7 +60,7 @@ where let perpetual_incentives = calculate_perthousand_value(ppb, raw_incentives); let incentives = raw_incentives.saturating_sub(perpetual_incentives); >::mutate(market_id, account_id, |values| { - let one = T::BlockNumber::from(1u8); + let one = BlockNumberFor::::from(1u8); values.perpetual_incentives = values.perpetual_incentives.saturating_add(perpetual_incentives); @@ -70,7 +71,7 @@ where } } - let _ = >::clear(u32::max_value(), None); + let _ = >::clear(u32::MAX, None); Some(market_incentives_len) } @@ -94,7 +95,7 @@ where )] fn markets_incentives( per_block_incentives: BalanceOf, - curr_block: T::BlockNumber, + curr_block: BlockNumberFor, ) -> Option)>> { let mut normalized_total = BalanceOf::::from(0u8); let markets_periods: BTreeSet<_> = >::iter().map(|el| el.0).collect(); @@ -141,9 +142,9 @@ where // // The greater the output, the more incentives the market will receive fn normalize_market( - curr_block: T::BlockNumber, + curr_block: BlockNumberFor, now: MomentOf, - period: &MarketPeriod>, + period: &MarketPeriod, MomentOf>, ) -> BalanceOf { let opt = match period { MarketPeriod::Block(range) => { diff --git a/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs b/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs index 1efbacf0d..d6cf15628 100644 --- a/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs +++ b/zrml/liquidity-mining/src/track_incentives_based_on_sold_shares.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Forecasting Technologies LTD. +// Copyright 2022, 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -58,7 +58,7 @@ where }); counter = counter.saturating_add(1); } - let _ = >::clear(u32::max_value(), None); + let _ = >::clear(u32::MAX, None); counter } } diff --git a/zrml/liquidity-mining/src/utils.rs b/zrml/liquidity-mining/src/utils.rs index f05276dd3..eb5523c52 100644 --- a/zrml/liquidity-mining/src/utils.rs +++ b/zrml/liquidity-mining/src/utils.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -17,6 +18,7 @@ use crate::MomentOf; use core::ops::{Div, Range}; +use frame_system::pallet_prelude::BlockNumberFor; use sp_runtime::{ traits::{CheckedDiv, Saturating, UniqueSaturatedInto}, SaturatedConversion, @@ -29,7 +31,7 @@ use zeitgeist_primitives::constants::MILLISECS_PER_BLOCK; // To convert the block number type to the moment type, is is necessary to first convert the // block number value to `u32`, which caps the maximum output to `u32::MAX`. Since this function // is only used to evaluate perpetual balances, such limitation shouldn't be a problem. -pub fn calculate_average_blocks_of_a_time_period(range: &Range>) -> T::BlockNumber +pub fn calculate_average_blocks_of_a_time_period(range: &Range>) -> BlockNumberFor where T: crate::Config, { diff --git a/zrml/market-commons/Cargo.toml b/zrml/market-commons/Cargo.toml index f25f7154f..5ce9fd31d 100644 --- a/zrml/market-commons/Cargo.toml +++ b/zrml/market-commons/Cargo.toml @@ -1,6 +1,7 @@ [dependencies] frame-support = { workspace = true } frame-system = { workspace = true } +log = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } sp-arithmetic = { workspace = true } @@ -31,6 +32,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-market-commons" version = "0.5.2" diff --git a/zrml/market-commons/src/lib.rs b/zrml/market-commons/src/lib.rs index 93082ef61..cce65a670 100644 --- a/zrml/market-commons/src/lib.rs +++ b/zrml/market-commons/src/lib.rs @@ -42,6 +42,7 @@ mod pallet { traits::{Hooks, StorageVersion, Time}, Blake2_128Concat, Parameter, }; + use frame_system::pallet_prelude::BlockNumberFor; use parity_scale_codec::{FullCodec, MaxEncodedLen}; use sp_runtime::{ traits::{ @@ -61,16 +62,15 @@ mod pallet { pub(crate) type AccountIdOf = ::AccountId; pub(crate) type AssetOf = Asset>; pub(crate) type BalanceOf = ::Balance; - pub(crate) type BlockNumberOf = ::BlockNumber; pub(crate) type MarketIdOf = ::MarketId; pub(crate) type MarketOf = - Market, BalanceOf, BlockNumberOf, MomentOf, MarketIdOf>; + Market, BalanceOf, BlockNumberFor, MomentOf, MarketIdOf>; pub(crate) type MomentOf = <::Timestamp as frame_support::traits::Time>::Moment; - pub(crate) type DeadlinesOf = Deadlines>; - pub(crate) type EarlyCloseOf = EarlyClose, MomentOf>; + pub(crate) type DeadlinesOf = Deadlines>; + pub(crate) type EarlyCloseOf = EarlyClose, MomentOf>; pub(crate) type MarketBondsOf = MarketBonds, BalanceOf>; - pub(crate) type MarketPeriodOf = MarketPeriod, MomentOf>; - pub(crate) type ReportOf = Report, BlockNumberOf>; + pub(crate) type MarketPeriodOf = MarketPeriod, MomentOf>; + pub(crate) type ReportOf = Report, BlockNumberFor>; #[pallet::call] impl Pallet {} @@ -117,7 +117,7 @@ mod pallet { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] @@ -147,7 +147,7 @@ mod pallet { ::Timestamp: Time, { type AccountId = AccountIdOf; - type BlockNumber = T::BlockNumber; + type BlockNumber = BlockNumberFor; type Balance = T::Balance; type MarketId = T::MarketId; type Moment = MomentOf; diff --git a/zrml/market-commons/src/mock.rs b/zrml/market-commons/src/mock.rs index bf692a1a8..ebc14469b 100644 --- a/zrml/market-commons/src/mock.rs +++ b/zrml/market-commons/src/mock.rs @@ -20,29 +20,22 @@ use crate::{self as zrml_market_commons}; use frame_support::{construct_runtime, traits::Everything}; +use frame_system::mocking::MockBlock; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use zeitgeist_primitives::{ - constants::mock::{BlockHashCount, MaxReserves, MinimumPeriod}, - types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, MarketId, Moment, - UncheckedExtrinsicTest, - }, + constants::mock::{BlockHashCount, ExistentialDeposit, MaxLocks, MaxReserves, MinimumPeriod}, + types::{AccountIdTest, Balance, Hash, MarketId, Moment}, }; construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - System: frame_system::{Call, Config,Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, + pub enum Runtime { + Balances: pallet_balances, + MarketCommons: zrml_market_commons, + System: frame_system, + Timestamp: pallet_timestamp, } ); @@ -56,18 +49,17 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); - type RuntimeEvent = (); + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -83,9 +75,13 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type RuntimeEvent = (); - type ExistentialDeposit = (); - type MaxLocks = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); + type RuntimeEvent = RuntimeEvent; + type ExistentialDeposit = ExistentialDeposit; + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); @@ -103,7 +99,7 @@ pub struct ExtBuilder {} impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/market-commons/src/types/market_builder.rs b/zrml/market-commons/src/types/market_builder.rs index f70979c65..cc7e57fd8 100644 --- a/zrml/market-commons/src/types/market_builder.rs +++ b/zrml/market-commons/src/types/market_builder.rs @@ -16,10 +16,11 @@ // along with Zeitgeist. If not, see . use crate::{ - AccountIdOf, AssetOf, BalanceOf, BlockNumberOf, Config, DeadlinesOf, EarlyCloseOf, Error, - MarketBondsOf, MarketIdOf, MarketOf, MarketPeriodOf, MomentOf, ReportOf, + AccountIdOf, AssetOf, BalanceOf, Config, DeadlinesOf, EarlyCloseOf, Error, MarketBondsOf, + MarketIdOf, MarketOf, MarketPeriodOf, MomentOf, ReportOf, }; use alloc::vec::Vec; +use frame_system::pallet_prelude::BlockNumberFor; use sp_runtime::{DispatchError, Perbill}; use zeitgeist_primitives::{ traits::MarketBuilderTrait, @@ -112,7 +113,7 @@ where } impl - MarketBuilderTrait, BalanceOf, BlockNumberOf, MomentOf, MarketIdOf> + MarketBuilderTrait, BalanceOf, BlockNumberFor, MomentOf, MarketIdOf> for MarketBuilder where T: Config, diff --git a/zrml/neo-swaps/Cargo.toml b/zrml/neo-swaps/Cargo.toml index c7611f358..f6873dbf1 100644 --- a/zrml/neo-swaps/Cargo.toml +++ b/zrml/neo-swaps/Cargo.toml @@ -5,6 +5,7 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } hydra-dx-math = { workspace = true } +log = { workspace = true } orml-traits = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } @@ -20,7 +21,7 @@ orml-asset-registry = { workspace = true, optional = true } orml-currencies = { workspace = true, optional = true } orml-tokens = { workspace = true, optional = true } pallet-balances = { workspace = true, optional = true } -pallet-randomness-collective-flip = { workspace = true, optional = true } +pallet-insecure-randomness-collective-flip = { workspace = true, optional = true } pallet-timestamp = { workspace = true, optional = true } pallet-treasury = { workspace = true, optional = true } pallet-xcm = { workspace = true, optional = true } @@ -48,7 +49,7 @@ mock = [ "orml-currencies/default", "orml-tokens/default", "pallet-balances", - "pallet-randomness-collective-flip/default", + "pallet-insecure-randomness-collective-flip/default", "pallet-timestamp/default", "pallet-treasury/default", "sp-api/default", @@ -100,6 +101,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-neo-swaps" version = "0.5.2" diff --git a/zrml/neo-swaps/src/benchmarking.rs b/zrml/neo-swaps/src/benchmarking.rs index 1557f349c..22c0d58b2 100644 --- a/zrml/neo-swaps/src/benchmarking.rs +++ b/zrml/neo-swaps/src/benchmarking.rs @@ -23,6 +23,7 @@ use crate::{ traits::{liquidity_shares_manager::LiquiditySharesManager, pool_operations::PoolOperations}, AssetOf, BalanceOf, MarketIdOf, Pallet as NeoSwaps, Pools, MIN_SPOT_PRICE, }; +use alloc::{vec, vec::Vec}; use core::{cell::Cell, iter, marker::PhantomData}; use frame_benchmarking::v2::*; use frame_support::{ @@ -31,7 +32,10 @@ use frame_support::{ }; use frame_system::RawOrigin; use orml_traits::MultiCurrency; -use sp_runtime::{traits::Get, Perbill, SaturatedConversion}; +use sp_runtime::{ + traits::{Get, Zero}, + Perbill, SaturatedConversion, +}; use zeitgeist_primitives::{ constants::{base_multiples::*, CENT}, math::fixed::{BaseProvider, FixedDiv, FixedMul, ZeitgeistBase}, @@ -52,10 +56,7 @@ macro_rules! assert_ok_with_transaction { }}; } -trait LiquidityTreeBenchmarkHelper -where - T: Config, -{ +trait LiquidityTreeBenchmarkHelper { fn calculate_min_pool_shares_amount(&self) -> BalanceOf; } @@ -79,10 +80,7 @@ struct BenchmarkHelper { _marker: PhantomData, } -impl BenchmarkHelper -where - T: Config, -{ +impl BenchmarkHelper { fn new() -> Self { BenchmarkHelper { current_id: Cell::new(0), _marker: PhantomData } } @@ -171,14 +169,11 @@ where } } -fn create_market( +fn create_market( caller: T::AccountId, base_asset: AssetOf, asset_count: AssetIndexType, -) -> MarketIdOf -where - T: Config, -{ +) -> MarketIdOf { let market = Market { market_id: 0u8.into(), base_asset, @@ -215,10 +210,7 @@ fn create_market_and_deploy_pool( base_asset: AssetOf, asset_count: AssetIndexType, amount: BalanceOf, -) -> MarketIdOf -where - T: Config, -{ +) -> MarketIdOf { let market_id = create_market::(caller.clone(), base_asset, asset_count); let total_cost = amount + T::MultiCurrency::minimum_balance(base_asset); assert_ok!(T::MultiCurrency::deposit(base_asset, &caller, total_cost)); @@ -237,10 +229,7 @@ where market_id } -fn deposit_fees(market_id: MarketIdOf, amount: BalanceOf) -where - T: Config, -{ +fn deposit_fees(market_id: MarketIdOf, amount: BalanceOf) { let mut pool = Pools::::get(market_id).unwrap(); assert_ok!(T::MultiCurrency::deposit(pool.collateral, &pool.account_id, amount)); assert_ok!(pool.liquidity_shares_manager.deposit_fees(amount)); @@ -248,10 +237,7 @@ where } // Let `caller` join the pool of `market_id` after adding the required funds to their account. -fn add_liquidity_provider_to_market(market_id: MarketIdOf, caller: AccountIdOf) -where - T: Config, -{ +fn add_liquidity_provider_to_market(market_id: MarketIdOf, caller: AccountIdOf) { let pool = Pools::::get(market_id).unwrap(); // Buy a little more to account for rounding. let pool_shares_amount = @@ -472,7 +458,6 @@ mod benchmarks { // Mock up some fees. Needs to be large enough to ensure that Bob's share is not smaller // than the existential deposit. - let pool = Pools::::get(market_id).unwrap(); let max_node_count = LiquidityTreeOf::::max_node_count() as u128; let fee_amount = (max_node_count * _10).saturated_into(); deposit_fees::(market_id, fee_amount); diff --git a/zrml/neo-swaps/src/lib.rs b/zrml/neo-swaps/src/lib.rs index 1a0518581..07d3d3566 100644 --- a/zrml/neo-swaps/src/lib.rs +++ b/zrml/neo-swaps/src/lib.rs @@ -53,15 +53,18 @@ mod pallet { pallet_prelude::StorageMap, require_transactional, traits::{Get, IsType, StorageVersion}, - transactional, PalletError, PalletId, RuntimeDebug, Twox64Concat, + transactional, PalletError, PalletId, Twox64Concat, + }; + use frame_system::{ + ensure_signed, + pallet_prelude::{BlockNumberFor, OriginFor}, }; - use frame_system::{ensure_signed, pallet_prelude::OriginFor}; use orml_traits::MultiCurrency; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; use sp_runtime::{ traits::{AccountIdConversion, CheckedSub, Saturating, Zero}, - DispatchError, DispatchResult, Perbill, SaturatedConversion, + DispatchError, DispatchResult, Perbill, RuntimeDebug, SaturatedConversion, }; use zeitgeist_primitives::{ constants::{BASE, CENT}, @@ -120,7 +123,7 @@ mod pallet { MarketId = MarketIdOf, >; - type MarketCommons: MarketCommonsPalletApi; + type MarketCommons: MarketCommonsPalletApi>; type MultiCurrency: MultiCurrency>; @@ -142,7 +145,6 @@ mod pallet { #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(PhantomData); #[pallet::storage] diff --git a/zrml/neo-swaps/src/liquidity_tree/traits/liquidity_tree_helper.rs b/zrml/neo-swaps/src/liquidity_tree/traits/liquidity_tree_helper.rs index e73073d08..8ec63ad2f 100644 --- a/zrml/neo-swaps/src/liquidity_tree/traits/liquidity_tree_helper.rs +++ b/zrml/neo-swaps/src/liquidity_tree/traits/liquidity_tree_helper.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2023-2024 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -84,11 +84,6 @@ where op: UpdateDescendantStakeOperation, ) -> DispatchResult; - /// Mutate each child of the node at `index` using `mutator`. - fn mutate_each_child(&mut self, index: u32, mutator: F) -> DispatchResult - where - F: FnMut(&mut Self::Node) -> DispatchResult; - /// Return the number of nodes in the tree. Note that abandoned nodes are counted. fn node_count(&self) -> u32; diff --git a/zrml/neo-swaps/src/liquidity_tree/types/liquidity_tree.rs b/zrml/neo-swaps/src/liquidity_tree/types/liquidity_tree.rs index 5986b85f2..c95a5d996 100644 --- a/zrml/neo-swaps/src/liquidity_tree/types/liquidity_tree.rs +++ b/zrml/neo-swaps/src/liquidity_tree/types/liquidity_tree.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2023-2024 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -377,18 +377,6 @@ where Ok(()) } - fn mutate_each_child(&mut self, index: u32, mut mutator: F) -> DispatchResult - where - F: FnMut(&mut Self::Node) -> DispatchResult, - { - let child_indices = self.children(index)?; - child_indices.apply(|index| { - self.mutate_node(index, |node| mutator(node))?; - Ok(()) - })?; - Ok(()) - } - fn node_count(&self) -> u32 { self.nodes.len() as u32 } diff --git a/zrml/neo-swaps/src/liquidity_tree/types/liquidity_tree_child_indices.rs b/zrml/neo-swaps/src/liquidity_tree/types/liquidity_tree_child_indices.rs index 4a4d47cad..55e4c51b4 100644 --- a/zrml/neo-swaps/src/liquidity_tree/types/liquidity_tree_child_indices.rs +++ b/zrml/neo-swaps/src/liquidity_tree/types/liquidity_tree_child_indices.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2023-2024 Forecasting Technologies LTD. // // This file is part of Zeitgeist. // @@ -15,8 +15,6 @@ // You should have received a copy of the GNU General Public License // along with Zeitgeist. If not, see . -use sp_runtime::DispatchError; - /// Structure for managing children in a liquidity tree. pub(crate) struct LiquidityTreeChildIndices { /// Left-hand side child; `None` if there's no left-hand side child (the node is either empty or @@ -27,22 +25,6 @@ pub(crate) struct LiquidityTreeChildIndices { pub(crate) rhs: Option, } -impl LiquidityTreeChildIndices { - /// Applies a `mutator` function to each child if it exists. - pub fn apply(&self, mut mutator: F) -> Result<(), DispatchError> - where - F: FnMut(u32) -> Result<(), DispatchError>, - { - if let Some(lhs) = self.lhs { - mutator(lhs)?; - } - if let Some(rhs) = self.rhs { - mutator(rhs)?; - } - Ok(()) - } -} - // Implement `From` for destructuring impl From for (Option, Option) { fn from(child_indices: LiquidityTreeChildIndices) -> (Option, Option) { diff --git a/zrml/neo-swaps/src/math.rs b/zrml/neo-swaps/src/math.rs index 92aa104be..401dfb8be 100644 --- a/zrml/neo-swaps/src/math.rs +++ b/zrml/neo-swaps/src/math.rs @@ -423,6 +423,7 @@ mod transcendental { #[cfg(test)] mod tests { + use super::*; use alloc::str::FromStr; use fixed::types::U64F64; @@ -504,6 +505,9 @@ mod transcendental { #[cfg(test)] mod tests { + // TODO(#1328): Remove after rustc nightly-2024-04-22 + #![allow(clippy::duplicated_attributes)] + use super::*; use crate::{mock::Runtime as MockRuntime, MAX_SPOT_PRICE, MIN_SPOT_PRICE}; use alloc::str::FromStr; diff --git a/zrml/neo-swaps/src/migration.rs b/zrml/neo-swaps/src/migration.rs index 2aa4996f9..8650ec124 100644 --- a/zrml/neo-swaps/src/migration.rs +++ b/zrml/neo-swaps/src/migration.rs @@ -22,20 +22,20 @@ use crate::{ use alloc::collections::BTreeMap; use core::marker::PhantomData; use frame_support::{ - dispatch::Weight, - log, traits::{Get, OnRuntimeUpgrade, StorageVersion}, - RuntimeDebug, + weights::Weight, }; +use log; use parity_scale_codec::{Decode, Encode}; use scale_info::TypeInfo; -use sp_runtime::Saturating; +use sp_runtime::{RuntimeDebug, Saturating}; cfg_if::cfg_if! { if #[cfg(feature = "try-runtime")] { use crate::{MarketIdOf}; use alloc::{format, vec::Vec}; use frame_support::{migration::storage_key_iter, pallet_prelude::Twox64Concat}; + use sp_runtime::DispatchError; } } @@ -111,7 +111,7 @@ where } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, &'static str> { + fn pre_upgrade() -> Result, DispatchError> { let old_pools = storage_key_iter::, OldPoolOf, Twox64Concat>(NEO_SWAPS, POOLS) .collect::>(); @@ -119,7 +119,7 @@ where } #[cfg(feature = "try-runtime")] - fn post_upgrade(previous_state: Vec) -> Result<(), &'static str> { + fn post_upgrade(previous_state: Vec) -> Result<(), DispatchError> { let old_pools: BTreeMap, OldPoolOf> = Decode::decode(&mut &previous_state[..]) .map_err(|_| "Failed to decode state: Invalid state")?; @@ -152,11 +152,11 @@ mod tests { MarketIdOf, PoolOf, Pools, }; use alloc::collections::BTreeMap; - use frame_support::{ - dispatch::fmt::Debug, migration::put_storage_value, storage_root, StateVersion, - StorageHasher, Twox64Concat, - }; + use core::fmt::Debug; + use frame_support::{migration::put_storage_value, StorageHasher, Twox64Concat}; use parity_scale_codec::Encode; + use sp_io::storage::root as storage_root; + use sp_runtime::StateVersion; use zeitgeist_primitives::types::Asset; #[test] diff --git a/zrml/neo-swaps/src/mock.rs b/zrml/neo-swaps/src/mock.rs index af8009a9b..f066a31cd 100644 --- a/zrml/neo-swaps/src/mock.rs +++ b/zrml/neo-swaps/src/mock.rs @@ -30,14 +30,11 @@ use frame_support::{ construct_runtime, ord_parameter_types, parameter_types, traits::{Contains, Everything, NeverEnsureOrigin}, }; -use frame_system::{EnsureRoot, EnsureSignedBy}; -#[cfg(feature = "parachain")] -use orml_asset_registry::AssetMetadata; +use frame_system::{mocking::MockBlock, EnsureRoot, EnsureSignedBy}; use orml_traits::MultiCurrency; use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, Get, IdentityLookup, Zero}, - DispatchResult, Perbill, Percent, SaturatedConversion, + traits::{BlakeTwo256, ConstU32, Get, IdentityLookup, Zero}, + BuildStorage, DispatchResult, Perbill, Percent, SaturatedConversion, }; #[cfg(feature = "parachain")] use zeitgeist_primitives::types::Asset; @@ -64,11 +61,15 @@ use zeitgeist_primitives::{ math::fixed::FixedMul, traits::{DeployPoolApi, DistributeFees}, types::{ - AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, - Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, CurrencyId, Hash, MarketId, Moment, }, }; use zrml_neo_swaps::BalanceOf; +#[cfg(feature = "parachain")] +use { + orml_traits::asset_registry::AssetProcessor, parity_scale_codec::Encode, + sp_runtime::DispatchError, zeitgeist_primitives::types::CustomMetadata, +}; pub const ALICE: AccountIdTest = 0; #[allow(unused)] @@ -151,8 +152,6 @@ where } } -pub type UncheckedExtrinsic = UncheckedExtrinsicTest; - pub struct DustRemovalWhitelist; impl Contains for DustRemovalWhitelist { @@ -162,27 +161,24 @@ impl Contains for DustRemovalWhitelist { } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsic, - { - NeoSwaps: zrml_neo_swaps::{Call, Event, Pallet}, - Authorized: zrml_authorized::{Event, Pallet, Storage}, - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - Court: zrml_court::{Event, Pallet, Storage}, - AssetManager: orml_currencies::{Call, Pallet, Storage}, - LiquidityMining: zrml_liquidity_mining::{Config, Event, Pallet}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - PredictionMarkets: zrml_prediction_markets::{Event, Pallet, Storage}, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, - SimpleDisputes: zrml_simple_disputes::{Event, Pallet, Storage}, - GlobalDisputes: zrml_global_disputes::{Event, Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, - Treasury: pallet_treasury::{Call, Event, Pallet, Storage}, + pub enum Runtime { + NeoSwaps: zrml_neo_swaps, + AssetManager: orml_currencies, + #[cfg(feature = "parachain")] + AssetRegistry: orml_asset_registry, + Authorized: zrml_authorized, + Balances: pallet_balances, + Court: zrml_court, + LiquidityMining: zrml_liquidity_mining, + MarketCommons: zrml_market_commons, + PredictionMarkets: zrml_prediction_markets, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip, + SimpleDisputes: zrml_simple_disputes, + GlobalDisputes: zrml_global_disputes, + System: frame_system, + Timestamp: pallet_timestamp, + Tokens: orml_tokens, + Treasury: pallet_treasury, } ); @@ -198,14 +194,14 @@ impl crate::Config for Runtime { type WeightInfo = zrml_neo_swaps::weights::WeightInfo; } -impl pallet_randomness_collective_flip::Config for Runtime {} +impl pallet_insecure_randomness_collective_flip::Config for Runtime {} impl zrml_prediction_markets::Config for Runtime { type AdvisoryBond = AdvisoryBond; type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; type ApproveOrigin = EnsureSignedBy; #[cfg(feature = "parachain")] - type AssetRegistry = MockRegistry; + type AssetRegistry = AssetRegistry; type Authorized = Authorized; type CloseEarlyBlockPeriod = CloseEarlyBlockPeriod; type CloseEarlyDisputeBond = CloseEarlyDisputeBond; @@ -299,27 +295,26 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; - type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type MaxConsumers = ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type OnSetCode = (); type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); type Version = (); + type OnSetCode = (); } impl orml_currencies::Config for Runtime { @@ -347,8 +342,12 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; + type MaxHolds = (); + type MaxFreezes = (); type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; @@ -416,13 +415,34 @@ impl pallet_treasury::Config for Runtime { type WeightInfo = (); } -#[cfg(feature = "parachain")] -zrml_prediction_markets::impl_mock_registry! { - MockRegistry, - CurrencyId, - Balance, - zeitgeist_primitives::types::CustomMetadata -} +cfg_if::cfg_if!( + if #[cfg(feature = "parachain")] { + type AssetMetadata = orml_traits::asset_registry::AssetMetadata< + Balance, + CustomMetadata, + ConstU32<1024> + >; + pub struct NoopAssetProcessor {} + + impl AssetProcessor for NoopAssetProcessor { + fn pre_register(id: Option, asset_metadata: AssetMetadata) + -> Result<(CurrencyId, AssetMetadata), DispatchError> { + Ok((id.unwrap(), asset_metadata)) + } + } + + impl orml_asset_registry::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CustomMetadata = CustomMetadata; + type AssetId = CurrencyId; + type AuthorityOrigin = EnsureRoot; + type AssetProcessor = NoopAssetProcessor; + type Balance = Balance; + type StringLimit = ConstU32<1024>; + type WeightInfo = (); + } + } +); #[allow(unused)] pub struct ExtBuilder { @@ -440,7 +460,7 @@ impl Default for ExtBuilder { #[allow(unused)] impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); pallet_balances::GenesisConfig:: { balances: self.balances } @@ -448,7 +468,6 @@ impl ExtBuilder { .unwrap(); #[cfg(feature = "parachain")] { - use frame_support::traits::GenesisBuild; orml_tokens::GenesisConfig:: { balances: vec![(ALICE, FOREIGN_ASSET, 100_000_000_001 * _1)], } @@ -458,18 +477,20 @@ impl ExtBuilder { allow_as_base_asset: true, ..Default::default() }; - orml_asset_registry_mock::GenesisConfig { - metadata: vec![( + orml_asset_registry::GenesisConfig:: { + assets: vec![( FOREIGN_ASSET, AssetMetadata { decimals: 18, - name: "MKL".as_bytes().to_vec(), - symbol: "MKL".as_bytes().to_vec(), + name: "MKL".as_bytes().to_vec().try_into().unwrap(), + symbol: "MKL".as_bytes().to_vec().try_into().unwrap(), existential_deposit: 0, location: None, additional: custom_metadata, - }, + } + .encode(), )], + last_asset_id: FOREIGN_ASSET, } .assimilate_storage(&mut t) .unwrap(); diff --git a/zrml/neo-swaps/src/tests/buy.rs b/zrml/neo-swaps/src/tests/buy.rs index 799549c69..4267fca21 100644 --- a/zrml/neo-swaps/src/tests/buy.rs +++ b/zrml/neo-swaps/src/tests/buy.rs @@ -16,6 +16,8 @@ // along with Zeitgeist. If not, see . use super::*; +#[cfg(not(feature = "parachain"))] +use sp_runtime::{DispatchError, TokenError}; use test_case::test_case; // Example taken from @@ -299,7 +301,7 @@ fn buy_fails_on_insufficient_funds() { ); let amount_in = _10; #[cfg(not(feature = "parachain"))] - let expected_error = pallet_balances::Error::::InsufficientBalance; + let expected_error = DispatchError::Token(TokenError::FundsUnavailable); #[cfg(feature = "parachain")] let expected_error = orml_tokens::Error::::BalanceTooLow; assert_ok!(AssetManager::deposit(BASE_ASSET, &BOB, amount_in - 1)); diff --git a/zrml/orderbook/Cargo.toml b/zrml/orderbook/Cargo.toml index bd8508c76..f8d5e482c 100644 --- a/zrml/orderbook/Cargo.toml +++ b/zrml/orderbook/Cargo.toml @@ -55,6 +55,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-orderbook" version = "0.5.2" diff --git a/zrml/orderbook/fuzz/Cargo.toml b/zrml/orderbook/fuzz/Cargo.toml index 4daed00cc..9c5071779 100644 --- a/zrml/orderbook/fuzz/Cargo.toml +++ b/zrml/orderbook/fuzz/Cargo.toml @@ -13,7 +13,7 @@ zrml-orderbook = { workspace = true, features = ["default", "mock"] } [package] authors = ["Automatically generated"] -edition = "2021" +edition.workspace = true name = "zrml-orderbook-fuzz" publish = false version = "0.0.0" diff --git a/zrml/orderbook/fuzz/orderbook_v1_full_workflow.rs b/zrml/orderbook/fuzz/orderbook_v1_full_workflow.rs index 90863f7fa..a23fa0330 100644 --- a/zrml/orderbook/fuzz/orderbook_v1_full_workflow.rs +++ b/zrml/orderbook/fuzz/orderbook_v1_full_workflow.rs @@ -19,7 +19,7 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use zeitgeist_primitives::types::{Asset, ScalarPosition, SerdeWrapper}; +use zeitgeist_primitives::types::{Asset, ScalarPosition}; use zrml_orderbook::mock::{ExtBuilder, Orderbook, RuntimeOrigin}; #[cfg(feature = "arbitrary")] @@ -92,7 +92,7 @@ fn asset(seed: (u128, u16)) -> Asset { if seed1 % 2 == 0 { ScalarPosition::Long } else { ScalarPosition::Short }; Asset::ScalarOutcome(seed0, scalar_position) } - 2 => Asset::PoolShare(SerdeWrapper(seed0)), + 2 => Asset::PoolShare(seed0), _ => Asset::Ztg, } } diff --git a/zrml/orderbook/src/benchmarks.rs b/zrml/orderbook/src/benchmarks.rs index d42b67710..039f70420 100644 --- a/zrml/orderbook/src/benchmarks.rs +++ b/zrml/orderbook/src/benchmarks.rs @@ -26,7 +26,7 @@ use super::*; use crate::{utils::market_mock, Pallet as Orderbook}; use frame_benchmarking::{account, benchmarks, whitelisted_caller}; -use frame_support::dispatch::UnfilteredDispatchable; +use frame_support::traits::UnfilteredDispatchable; use frame_system::RawOrigin; use orml_traits::MultiCurrency; use sp_runtime::SaturatedConversion; @@ -37,7 +37,7 @@ fn generate_funded_account( asset: AssetOf, ) -> Result { let acc = if let Some(s) = seed { account("AssetHolder", 0, s) } else { whitelisted_caller() }; - T::AssetManager::deposit(asset, &acc, BASE.saturating_mul(1_000).saturated_into())?; + T::AssetManager::deposit(asset, &acc, BASE.saturating_mul(1_100).saturated_into())?; Ok(acc) } diff --git a/zrml/orderbook/src/lib.rs b/zrml/orderbook/src/lib.rs index f97fc938c..0a4512d52 100644 --- a/zrml/orderbook/src/lib.rs +++ b/zrml/orderbook/src/lib.rs @@ -32,7 +32,10 @@ use frame_support::{ traits::{IsType, StorageVersion}, transactional, PalletId, Twox64Concat, }; -use frame_system::{ensure_signed, pallet_prelude::OriginFor}; +use frame_system::{ + ensure_signed, + pallet_prelude::{BlockNumberFor, OriginFor}, +}; use orml_traits::{BalanceStatus, MultiCurrency, NamedMultiReservableCurrency}; pub use pallet::*; use sp_runtime::traits::{Get, Zero}; @@ -84,7 +87,7 @@ mod pallet { type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, Balance = BalanceOf, >; @@ -105,13 +108,8 @@ mod pallet { pub(crate) type ExternalFeeOf = ExternalFee, BalanceOf>; pub(crate) type MarketIdOf = <::MarketCommons as MarketCommonsPalletApi>::MarketId; - pub(crate) type MarketOf = Market< - AccountIdOf, - BalanceOf, - ::BlockNumber, - MomentOf, - MarketIdOf, - >; + pub(crate) type MarketOf = + Market, BalanceOf, BlockNumberFor, MomentOf, MarketIdOf>; pub(crate) type MomentOf = <::MarketCommons as MarketCommonsPalletApi>::Moment; pub(crate) type OrderOf = Order, BalanceOf, MarketIdOf>; pub(crate) type OrderbookTradeOf = OrderbookTrade, BalanceOf>; diff --git a/zrml/orderbook/src/mock.rs b/zrml/orderbook/src/mock.rs index e5b9f08f3..d33f1bff7 100644 --- a/zrml/orderbook/src/mock.rs +++ b/zrml/orderbook/src/mock.rs @@ -18,15 +18,15 @@ #![cfg(feature = "mock")] -use crate as orderbook_v1; +use crate as zrml_orderbook; use crate::{AssetOf, BalanceOf, MarketIdOf}; use core::marker::PhantomData; use frame_support::{construct_runtime, pallet_prelude::Get, parameter_types, traits::Everything}; +use frame_system::mocking::MockBlock; use orml_traits::MultiCurrency; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup, Zero}, - Perbill, SaturatedConversion, + BuildStorage, Perbill, SaturatedConversion, }; use zeitgeist_primitives::{ constants::mock::{ @@ -35,18 +35,14 @@ use zeitgeist_primitives::{ }, traits::DistributeFees, types::{ - AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, - Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, CurrencyId, Hash, MarketId, Moment, }, }; pub const ALICE: AccountIdTest = 0; pub const BOB: AccountIdTest = 1; - pub const MARKET_CREATOR: AccountIdTest = 42; - pub const INITIAL_BALANCE: Balance = 100 * BASE; - pub const EXTERNAL_FEES: Balance = CENT; parameter_types! { @@ -91,19 +87,14 @@ where } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - Orderbook: orderbook_v1::{Call, Event, Pallet}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, - AssetManager: orml_currencies::{Call, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, + pub enum Runtime { + Balances: pallet_balances, + MarketCommons: zrml_market_commons, + Orderbook: zrml_orderbook, + System: frame_system, + Tokens: orml_tokens, + AssetManager: orml_currencies, + Timestamp: pallet_timestamp, } ); @@ -113,25 +104,24 @@ impl crate::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MarketCommons = MarketCommons; type PalletId = OrderbookPalletId; - type WeightInfo = orderbook_v1::weights::WeightInfo; + type WeightInfo = zrml_orderbook::weights::WeightInfo; } impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -168,8 +158,12 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; + type MaxHolds = (); + type MaxFreezes = (); type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; @@ -200,7 +194,7 @@ impl Default for ExtBuilder { } impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/orderbook/src/utils.rs b/zrml/orderbook/src/utils.rs index 0e83c12a1..8cf9b37ce 100644 --- a/zrml/orderbook/src/utils.rs +++ b/zrml/orderbook/src/utils.rs @@ -18,6 +18,7 @@ #![cfg(any(feature = "runtime-benchmarks", test))] use crate::*; +use frame_system::pallet_prelude::BlockNumberFor; use sp_runtime::traits::AccountIdConversion; use zeitgeist_primitives::types::{ Asset, Deadlines, Market, MarketCreation, MarketDisputeMechanism, MarketPeriod, MarketStatus, @@ -27,7 +28,7 @@ use zeitgeist_primitives::types::{ type MarketOf = Market< ::AccountId, BalanceOf, - ::BlockNumber, + BlockNumberFor, MomentOf, MarketIdOf, >; diff --git a/zrml/parimutuel/Cargo.toml b/zrml/parimutuel/Cargo.toml index 4db93d8f4..e05998b66 100644 --- a/zrml/parimutuel/Cargo.toml +++ b/zrml/parimutuel/Cargo.toml @@ -2,6 +2,7 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } +log = { workspace = true } orml-traits = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } @@ -13,7 +14,7 @@ zrml-market-commons = { workspace = true } env_logger = { workspace = true } orml-currencies = { workspace = true, features = ["default"] } orml-tokens = { workspace = true, features = ["default"] } -pallet-balances = { workspace = true, features = ["default"] } +pallet-balances = { workspace = true, features = ["default", "insecure_zero_ed"] } pallet-timestamp = { workspace = true, features = ["default"] } sp-io = { workspace = true, features = ["default"] } zeitgeist-primitives = { workspace = true, features = ["mock", "default"] } @@ -43,6 +44,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-parimutuel" version = "0.5.2" diff --git a/zrml/parimutuel/src/benchmarking.rs b/zrml/parimutuel/src/benchmarking.rs index bf70b76f3..40b2c1290 100644 --- a/zrml/parimutuel/src/benchmarking.rs +++ b/zrml/parimutuel/src/benchmarking.rs @@ -22,11 +22,12 @@ #![cfg(feature = "runtime-benchmarks")] use crate::{utils::*, Pallet as Parimutuel, *}; +use alloc::vec; use frame_benchmarking::v2::*; -use frame_support::traits::Get; +use frame_support::{assert_ok, traits::Get}; use frame_system::RawOrigin; use orml_traits::MultiCurrency; -use sp_runtime::{SaturatedConversion, Saturating}; +use sp_runtime::{traits::Zero, SaturatedConversion, Saturating}; use zeitgeist_primitives::types::{Asset, MarketStatus, MarketType, OutcomeReport}; use zrml_market_commons::MarketCommonsPalletApi; @@ -54,6 +55,7 @@ fn buy_asset( #[benchmarks] mod benchmarks { use super::*; + // use alloc::vec; #[benchmark] fn buy() { @@ -88,11 +90,11 @@ mod benchmarks { T::MinBetSize::get().saturating_mul(10u128.saturated_into::>()); buy_asset::(market_id, loser_asset, &loser, loser_amount); - T::MarketCommons::mutate_market(&market_id, |market| { + assert_ok!(T::MarketCommons::mutate_market(&market_id, |market| { market.status = MarketStatus::Resolved; market.resolved_outcome = Some(OutcomeReport::Categorical(0u16)); Ok(()) - })?; + })); #[extrinsic_call] claim_rewards(RawOrigin::Signed(winner), market_id); @@ -117,7 +119,7 @@ mod benchmarks { T::MinBetSize::get().saturating_mul(10u128.saturated_into::>()); buy_asset::(market_id, loser_1_asset, &loser_1, loser_1_amount); - T::MarketCommons::mutate_market(&market_id, |market| { + assert_ok!(T::MarketCommons::mutate_market(&market_id, |market| { market.status = MarketStatus::Resolved; let resolved_index = 9u16; let resolved_outcome = OutcomeReport::Categorical(resolved_index); @@ -128,7 +130,7 @@ mod benchmarks { assert!(resolved_issuance_asset.is_zero()); market.resolved_outcome = Some(resolved_outcome); Ok(()) - })?; + })); #[extrinsic_call] claim_refunds(RawOrigin::Signed(loser_0), loser_0_asset); diff --git a/zrml/parimutuel/src/lib.rs b/zrml/parimutuel/src/lib.rs index 81953d92c..b1855e061 100644 --- a/zrml/parimutuel/src/lib.rs +++ b/zrml/parimutuel/src/lib.rs @@ -18,6 +18,8 @@ #![doc = include_str!("../README.md")] #![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; + mod benchmarking; mod mock; mod tests; @@ -31,11 +33,11 @@ mod pallet { use crate::weights::WeightInfoZeitgeist; use core::marker::PhantomData; use frame_support::{ - ensure, log, - pallet_prelude::{Decode, DispatchError, Encode, TypeInfo}, + ensure, + pallet_prelude::{Decode, Encode, TypeInfo}, require_transactional, traits::{Get, IsType, StorageVersion}, - PalletId, RuntimeDebug, + PalletId, }; use frame_system::{ ensure_signed, @@ -44,7 +46,7 @@ mod pallet { use orml_traits::MultiCurrency; use sp_runtime::{ traits::{AccountIdConversion, CheckedSub, Zero}, - DispatchResult, + DispatchError, DispatchResult, RuntimeDebug, }; use zeitgeist_primitives::{ math::fixed::FixedMulDiv, @@ -68,7 +70,7 @@ mod pallet { type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, Balance = BalanceOf, >; diff --git a/zrml/parimutuel/src/mock.rs b/zrml/parimutuel/src/mock.rs index fa78bc29c..756f0cd38 100644 --- a/zrml/parimutuel/src/mock.rs +++ b/zrml/parimutuel/src/mock.rs @@ -24,21 +24,20 @@ use crate::{AssetOf, BalanceOf, MarketIdOf}; use alloc::{vec, vec::Vec}; use core::marker::PhantomData; use frame_support::{construct_runtime, pallet_prelude::Get, parameter_types, traits::Everything}; +use frame_system::mocking::MockBlock; use orml_traits::MultiCurrency; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, - Perbill, SaturatedConversion, + BuildStorage, Perbill, SaturatedConversion, }; use zeitgeist_primitives::{ constants::mock::{ - BlockHashCount, ExistentialDeposits, GetNativeCurrencyId, MaxReserves, MinBetSize, - MinimumPeriod, ParimutuelPalletId, BASE, CENT, + BlockHashCount, ExistentialDeposits, GetNativeCurrencyId, MaxLocks, MaxReserves, + MinBetSize, MinimumPeriod, ParimutuelPalletId, BASE, CENT, }, traits::DistributeFees, types::{ - AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, - Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, CurrencyId, Hash, MarketId, Moment, }, }; @@ -92,19 +91,14 @@ where } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Parimutuel: zrml_parimutuel::{Event, Pallet, Storage}, - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - AssetManager: orml_currencies::{Call, Pallet, Storage}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, + pub enum Runtime { + AssetManager: orml_currencies, + Balances: pallet_balances, + MarketCommons: zrml_market_commons, + Parimutuel: zrml_parimutuel, + System: frame_system, + Timestamp: pallet_timestamp, + Tokens: orml_tokens, } ); @@ -122,18 +116,17 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -149,9 +142,13 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = (); - type MaxLocks = (); + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); @@ -209,7 +206,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index 066928568..ae4574460 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -2,6 +2,7 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } +log = { workspace = true } orml-traits = { workspace = true } parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } @@ -18,12 +19,13 @@ zrml-simple-disputes = { workspace = true } # Mock +cfg-if = { workspace = true, optional = true } env_logger = { workspace = true, optional = true } orml-asset-registry = { workspace = true, optional = true } orml-currencies = { workspace = true, optional = true } orml-tokens = { workspace = true, optional = true } pallet-balances = { workspace = true, optional = true } -pallet-randomness-collective-flip = { workspace = true, optional = true } +pallet-insecure-randomness-collective-flip = { workspace = true, optional = true } pallet-timestamp = { workspace = true, optional = true } pallet-treasury = { workspace = true, optional = true } sp-api = { workspace = true, optional = true } @@ -39,10 +41,13 @@ zrml-prediction-markets = { workspace = true, features = ["mock", "default"] } [features] default = ["std"] mock = [ + "cfg-if", + "env_logger/default", + "orml-asset-registry/default", "orml-currencies/default", "orml-tokens/default", - "pallet-balances", - "pallet-randomness-collective-flip/default", + "pallet-balances/default", + "pallet-insecure-randomness-collective-flip/default", "pallet-timestamp/default", "pallet-treasury/default", "serde/default", @@ -89,6 +94,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-prediction-markets" version = "0.5.2" diff --git a/zrml/prediction-markets/fuzz/Cargo.toml b/zrml/prediction-markets/fuzz/Cargo.toml index 4f88a31d2..703a2f229 100644 --- a/zrml/prediction-markets/fuzz/Cargo.toml +++ b/zrml/prediction-markets/fuzz/Cargo.toml @@ -15,7 +15,7 @@ zrml-simple-disputes = { workspace = true, features = ["default"] } [package] authors = ["Automatically generated"] -edition = "2021" +edition.workspace = true name = "zrml-prediction-markets-fuzz" publish = false version = "0.0.0" diff --git a/zrml/prediction-markets/runtime-api/Cargo.toml b/zrml/prediction-markets/runtime-api/Cargo.toml index 16d8f1b48..4e914db2e 100644 --- a/zrml/prediction-markets/runtime-api/Cargo.toml +++ b/zrml/prediction-markets/runtime-api/Cargo.toml @@ -13,6 +13,6 @@ std = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-prediction-markets-runtime-api" version = "0.5.2" diff --git a/zrml/prediction-markets/src/benchmarks.rs b/zrml/prediction-markets/src/benchmarks.rs index 61d18b4c1..fa1782063 100644 --- a/zrml/prediction-markets/src/benchmarks.rs +++ b/zrml/prediction-markets/src/benchmarks.rs @@ -26,13 +26,13 @@ use super::*; #[cfg(test)] use crate::Pallet as PredictionMarket; -use alloc::vec::Vec; -use frame_benchmarking::{account, benchmarks, vec, whitelisted_caller}; +use alloc::{vec, vec::Vec}; +use frame_benchmarking::{account, benchmarks, whitelisted_caller}; use frame_support::{ - dispatch::UnfilteredDispatchable, - traits::{EnsureOrigin, Get}, + traits::{EnsureOrigin, Get, Hooks, UnfilteredDispatchable}, + BoundedVec, }; -use frame_system::RawOrigin; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use orml_traits::MultiCurrency; use sp_runtime::{ traits::{SaturatedConversion, Saturating, Zero}, @@ -54,8 +54,6 @@ use zrml_authorized::Pallet as AuthorizedPallet; use zrml_global_disputes::GlobalDisputesPalletApi; use zrml_market_commons::MarketCommonsPalletApi; -use frame_support::{traits::Hooks, BoundedVec}; - fn assert_last_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_last_event(generic_event.into()); } @@ -66,11 +64,11 @@ const LIQUIDITY: u128 = 100 * BASE; // amount of native currency fn create_market_common_parameters( is_disputable: bool, -) -> Result<(T::AccountId, T::AccountId, Deadlines, MultiHash), &'static str> { +) -> Result<(T::AccountId, T::AccountId, Deadlines>, MultiHash), &'static str> { let caller: T::AccountId = whitelisted_caller(); T::AssetManager::deposit(Asset::Ztg, &caller, (100u128 * LIQUIDITY).saturated_into()).unwrap(); let oracle = caller.clone(); - let deadlines = Deadlines:: { + let deadlines = Deadlines::> { grace_period: 1_u32.into(), oracle_duration: T::MinOracleDuration::get(), dispute_duration: if is_disputable { T::MinDisputeDuration::get() } else { Zero::zero() }, @@ -86,7 +84,7 @@ fn create_market_common( creation: MarketCreation, options: MarketType, scoring_rule: ScoringRule, - period: Option>>, + period: Option, MomentOf>>, dispute_mechanism: Option, ) -> Result<(T::AccountId, MarketIdOf), &'static str> { pallet_timestamp::Pallet::::set_timestamp(0u32.into()); @@ -540,7 +538,7 @@ benchmarks! { |ids| ids.try_push(i.into()), ).unwrap(); } - let new_deadlines = Deadlines:: { + let new_deadlines = Deadlines::> { grace_period: 2_u32.into(), oracle_duration: T::MinOracleDuration::get(), dispute_duration: T::MinDisputeDuration::get(), @@ -620,7 +618,7 @@ benchmarks! { } MarketIdsPerDisputeBlock::::insert(appeal_end, market_ids_2); - frame_system::Pallet::::set_block_number(appeal_end - 1u64.saturated_into::()); + frame_system::Pallet::::set_block_number(appeal_end - 1u64.saturated_into::>()); let now = frame_system::Pallet::::block_number(); @@ -760,7 +758,7 @@ benchmarks! { on_initialize_resolve_overhead { // wait for timestamp to get initialized (that's why block 2) - let now = 2u64.saturated_into::(); + let now = 2u64.saturated_into::>(); }: { Pallet::::on_initialize(now) } redeem_shares_categorical { @@ -860,7 +858,7 @@ benchmarks! { creator_fee: Perbill::zero(), oracle: caller.clone(), period: MarketPeriod::Timestamp(start..end), - deadlines: Deadlines:: { + deadlines: Deadlines::> { grace_period: 0u8.into(), oracle_duration: T::MinOracleDuration::get(), dispute_duration: 0u8.into(), @@ -906,8 +904,8 @@ benchmarks! { let f in 1..31; // ensure markets exist - let start_block: T::BlockNumber = 100_000u64.saturated_into(); - let end_block: T::BlockNumber = 1_000_000u64.saturated_into(); + let start_block: BlockNumberFor = 100_000u64.saturated_into(); + let end_block: BlockNumberFor = 1_000_000u64.saturated_into(); for _ in 0..31 { create_market_common::( MarketCreation::Permissionless, @@ -930,7 +928,7 @@ benchmarks! { ).unwrap(); } - let block_number: T::BlockNumber = Zero::zero(); + let block_number: BlockNumberFor = Zero::zero(); for i in 1..=b { MarketIdsPerCloseBlock::::try_mutate(block_number, |ids| { ids.try_push(i.into()) @@ -986,7 +984,7 @@ benchmarks! { })?; } - let block_number: T::BlockNumber = Zero::zero(); + let block_number: BlockNumberFor = Zero::zero(); let mut r_ids_vec = Vec::new(); for i in 1..=r { diff --git a/zrml/prediction-markets/src/lib.rs b/zrml/prediction-markets/src/lib.rs index d9eef6771..3d6896889 100644 --- a/zrml/prediction-markets/src/lib.rs +++ b/zrml/prediction-markets/src/lib.rs @@ -26,7 +26,6 @@ extern crate alloc; mod benchmarks; pub mod migrations; pub mod mock; -pub mod orml_asset_registry; mod tests; pub mod weights; @@ -38,8 +37,8 @@ mod pallet { use alloc::{format, vec, vec::Vec}; use core::{cmp, marker::PhantomData}; use frame_support::{ - dispatch::{DispatchResultWithPostInfo, Pays, Weight}, - ensure, log, + dispatch::{DispatchResultWithPostInfo, Pays}, + ensure, pallet_prelude::{ConstU32, StorageMap, StorageValue, ValueQuery}, require_transactional, storage::{with_transaction, TransactionOutcome}, @@ -47,7 +46,9 @@ mod pallet { tokens::BalanceStatus, Currency, EnsureOrigin, Get, Hooks, Imbalance, IsType, NamedReservableCurrency, OnUnbalanced, StorageVersion, }, - transactional, Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, + transactional, + weights::Weight, + Blake2_128Concat, BoundedVec, PalletId, Twox64Concat, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; use sp_runtime::traits::AccountIdConversion; @@ -55,6 +56,7 @@ mod pallet { #[cfg(feature = "parachain")] use {orml_traits::asset_registry::Inspect, zeitgeist_primitives::types::CustomMetadata}; + use frame_system::pallet_prelude::BlockNumberFor; use orml_traits::{MultiCurrency, NamedMultiReservableCurrency}; use sp_arithmetic::per_things::{Perbill, Percent}; use sp_runtime::{ @@ -90,22 +92,21 @@ mod pallet { pub(crate) type AccountIdOf = ::AccountId; pub(crate) type AssetOf = Asset>; pub(crate) type BalanceOf = ::Balance; - pub(crate) type BlockNumberOf = ::BlockNumber; pub(crate) type CacheSize = ConstU32<64>; - pub(crate) type DeadlinesOf = Deadlines>; + pub(crate) type DeadlinesOf = Deadlines>; pub(crate) type EditReason = BoundedVec::MaxEditReasonLen>; pub(crate) type InitialItemOf = InitialItem, BalanceOf>; pub(crate) type MarketBondsOf = MarketBonds, BalanceOf>; pub(crate) type MarketIdOf = ::MarketId; pub(crate) type MarketOf = - Market, BalanceOf, BlockNumberOf, MomentOf, MarketIdOf>; - pub(crate) type MarketPeriodOf = MarketPeriod, MomentOf>; + Market, BalanceOf, BlockNumberFor, MomentOf, MarketIdOf>; + pub(crate) type MarketPeriodOf = MarketPeriod, MomentOf>; pub(crate) type MomentOf = <::Timestamp as frame_support::traits::Time>::Moment; pub(crate) type NegativeImbalanceOf = <::Currency as Currency>>::NegativeImbalance; pub(crate) type RejectReason = BoundedVec::MaxRejectReasonLen>; - pub(crate) type ReportOf = Report, BlockNumberOf>; + pub(crate) type ReportOf = Report, BlockNumberFor>; pub(crate) type TimeFrame = u64; macro_rules! impl_unreserve_bond { @@ -1531,7 +1532,7 @@ mod pallet { AccountId = Self::AccountId, Balance = BalanceOf, NegativeImbalance = NegativeImbalanceOf, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = MarketIdOf, Moment = MomentOf, Origin = Self::RuntimeOrigin, @@ -1562,7 +1563,7 @@ mod pallet { /// The block time to wait for the `CloseMarketsEarlyOrigin` /// before the early market close actually happens (fat-finger protection). #[pallet::constant] - type CloseEarlyProtectionBlockPeriod: Get; + type CloseEarlyProtectionBlockPeriod: Get>; /// The base amount of currency that must be bonded /// by the market creator in order to schedule an early market closure. @@ -1574,7 +1575,7 @@ mod pallet { AccountId = Self::AccountId, Balance = BalanceOf, NegativeImbalance = NegativeImbalanceOf, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = MarketIdOf, Moment = MomentOf, Origin = Self::RuntimeOrigin, @@ -1599,13 +1600,13 @@ mod pallet { MarketIdOf, Self::AccountId, BalanceOf, - Self::BlockNumber, + BlockNumberFor, >; type LiquidityMining: LiquidityMiningPalletApi< AccountId = Self::AccountId, Balance = BalanceOf, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = MarketIdOf, >; @@ -1628,27 +1629,27 @@ mod pallet { /// The minimum number of blocks allowed to be specified as dispute_duration /// in create_market. #[pallet::constant] - type MinDisputeDuration: Get; + type MinDisputeDuration: Get>; /// The minimum number of blocks allowed to be specified as oracle_duration /// in create_market. #[pallet::constant] - type MinOracleDuration: Get; + type MinOracleDuration: Get>; /// The maximum number of blocks allowed to be specified as grace_period /// in create_market. #[pallet::constant] - type MaxGracePeriod: Get; + type MaxGracePeriod: Get>; /// The maximum number of blocks allowed to be specified as oracle_duration /// in create_market. #[pallet::constant] - type MaxOracleDuration: Get; + type MaxOracleDuration: Get>; /// The maximum number of blocks allowed to be specified as dispute_duration /// in create_market. #[pallet::constant] - type MaxDisputeDuration: Get; + type MaxDisputeDuration: Get>; /// The maximum length of reject reason string. #[pallet::constant] @@ -1656,7 +1657,7 @@ mod pallet { /// The maximum allowed duration of a market from creation to market close in blocks. #[pallet::constant] - type MaxMarketLifetime: Get; + type MaxMarketLifetime: Get>; /// The maximum number of bytes allowed as edit reason. #[pallet::constant] @@ -1672,7 +1673,7 @@ mod pallet { /// The block time to wait for the market creator /// before the early market close actually happens. #[pallet::constant] - type CloseEarlyBlockPeriod: Get; + type CloseEarlyBlockPeriod: Get>; /// The milliseconds to wait for the market creator /// before the early market close actually happens. @@ -1698,7 +1699,7 @@ mod pallet { AccountId = Self::AccountId, Balance = BalanceOf, NegativeImbalance = NegativeImbalanceOf, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = MarketIdOf, Moment = MomentOf, Origin = Self::RuntimeOrigin, @@ -1865,7 +1866,7 @@ mod pallet { /// A market has been scheduled to close early. MarketEarlyCloseScheduled { market_id: MarketIdOf, - new_period: MarketPeriod>, + new_period: MarketPeriod, MomentOf>, state: EarlyCloseState, }, /// A market early close request has been disputed. @@ -1899,9 +1900,8 @@ mod pallet { } #[pallet::hooks] - impl Hooks for Pallet { - // TODO(#792): Remove outcome assets for accounts! Delete "resolved" assets of `orml_tokens` with storage migration. - fn on_initialize(now: T::BlockNumber) -> Weight { + impl Hooks> for Pallet { + fn on_initialize(now: BlockNumberFor) -> Weight { let mut total_weight: Weight = Weight::zero(); // If we are at genesis or the first block the timestamp is be undefined. No @@ -1998,7 +1998,7 @@ mod pallet { pub type MarketIdsPerCloseBlock = StorageMap< _, Blake2_128Concat, - T::BlockNumber, + BlockNumberFor, BoundedVec, CacheSize>, ValueQuery, >; @@ -2023,7 +2023,7 @@ mod pallet { pub type MarketIdsPerDisputeBlock = StorageMap< _, Twox64Concat, - T::BlockNumber, + BlockNumberFor, BoundedVec, CacheSize>, ValueQuery, >; @@ -2033,7 +2033,7 @@ mod pallet { pub type MarketIdsPerReportBlock = StorageMap< _, Twox64Concat, - T::BlockNumber, + BlockNumberFor, BoundedVec, CacheSize>, ValueQuery, >; @@ -2773,7 +2773,7 @@ mod pallet { } pub(crate) fn market_status_manager( - block_number: T::BlockNumber, + block_number: BlockNumberFor, last_time_frame: TimeFrame, current_time_frame: TimeFrame, mut mutation: F, @@ -2781,7 +2781,7 @@ mod pallet { where F: FnMut(&MarketIdOf, MarketOf) -> DispatchResult, MarketIdsPerBlock: frame_support::StorageMap< - T::BlockNumber, + BlockNumberFor, BoundedVec, CacheSize>, Query = BoundedVec, CacheSize>, >, @@ -2835,7 +2835,7 @@ mod pallet { } pub(crate) fn resolution_manager( - now: T::BlockNumber, + now: BlockNumberFor, mut cb: F, ) -> Result where @@ -3036,7 +3036,7 @@ mod pallet { fn remove_auto_resolve( market_id: &MarketIdOf, - resolve_at: T::BlockNumber, + resolve_at: BlockNumberFor, ) -> u32 { MarketIdsPerDisputeBlock::::mutate(resolve_at, |ids| -> u32 { let ids_len = ids.len() as u32; @@ -3051,7 +3051,7 @@ mod pallet { { type AccountId = T::AccountId; type Balance = BalanceOf; - type BlockNumber = T::BlockNumber; + type BlockNumber = BlockNumberFor; type MarketId = MarketIdOf; type Moment = MomentOf; diff --git a/zrml/prediction-markets/src/mock.rs b/zrml/prediction-markets/src/mock.rs index f371ebf0b..8201292c4 100644 --- a/zrml/prediction-markets/src/mock.rs +++ b/zrml/prediction-markets/src/mock.rs @@ -27,14 +27,11 @@ use frame_support::{ construct_runtime, ord_parameter_types, parameter_types, traits::{Everything, NeverEnsureOrigin, OnFinalize, OnInitialize}, }; -use frame_system::{EnsureRoot, EnsureSignedBy}; -#[cfg(feature = "parachain")] -use orml_asset_registry::AssetMetadata; +use frame_system::{mocking::MockBlock, EnsureRoot, EnsureSignedBy}; use sp_arithmetic::per_things::Percent; use sp_runtime::{ - testing::Header, - traits::{BlakeTwo256, IdentityLookup}, - DispatchError, DispatchResult, + traits::{BlakeTwo256, ConstU32, IdentityLookup}, + BuildStorage, DispatchError, DispatchResult, }; use std::cell::RefCell; use zeitgeist_primitives::{ @@ -47,19 +44,24 @@ use zeitgeist_primitives::{ GlobalDisputeLockId, GlobalDisputesPalletId, InflationPeriod, LiquidityMiningPalletId, LockId, MaxAppeals, MaxApprovals, MaxCategories, MaxCourtParticipants, MaxCreatorFee, MaxDelegations, MaxDisputeDuration, MaxDisputes, MaxEditReasonLen, MaxGlobalDisputeVotes, - MaxGracePeriod, MaxMarketLifetime, MaxOracleDuration, MaxOwners, MaxRejectReasonLen, - MaxReserves, MaxSelectedDraws, MaxYearlyInflation, MinCategories, MinDisputeDuration, - MinJurorStake, MinOracleDuration, MinOutcomeVoteAmount, MinimumPeriod, OutcomeBond, - OutcomeFactor, OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval, + MaxGracePeriod, MaxLocks, MaxMarketLifetime, MaxOracleDuration, MaxOwners, + MaxRejectReasonLen, MaxReserves, MaxSelectedDraws, MaxYearlyInflation, MinCategories, + MinDisputeDuration, MinJurorStake, MinOracleDuration, MinOutcomeVoteAmount, MinimumPeriod, + OutcomeBond, OutcomeFactor, OutsiderBond, PmPalletId, RemoveKeysLimit, RequestInterval, SimpleDisputesPalletId, TreasuryPalletId, VotePeriod, VotingOutcomeFee, BASE, CENT, MILLISECS_PER_BLOCK, }, traits::DeployPoolApi, types::{ AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, - CurrencyId, Hash, Index, MarketId, Moment, SerdeWrapper, UncheckedExtrinsicTest, + CurrencyId, Hash, MarketId, Moment, }, }; +#[cfg(feature = "parachain")] +use { + orml_traits::asset_registry::AssetProcessor, parity_scale_codec::Encode, + zeitgeist_primitives::types::CustomMetadata, +}; pub const ALICE: AccountIdTest = 0; pub const BOB: AccountIdTest = 1; @@ -165,26 +167,23 @@ parameter_types! { } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Authorized: zrml_authorized::{Event, Pallet, Storage}, - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - Court: zrml_court::{Event, Pallet, Storage}, - AssetManager: orml_currencies::{Call, Pallet, Storage}, - LiquidityMining: zrml_liquidity_mining::{Config, Event, Pallet}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - PredictionMarkets: prediction_markets::{Event, Pallet, Storage}, - RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage}, - SimpleDisputes: zrml_simple_disputes::{Event, Pallet, Storage}, - GlobalDisputes: zrml_global_disputes::{Event, Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, - Treasury: pallet_treasury::{Call, Event, Pallet, Storage}, + pub enum Runtime { + #[cfg(feature = "parachain")] + AssetRegistry: orml_asset_registry, + Authorized: zrml_authorized, + Balances: pallet_balances, + Court: zrml_court, + AssetManager: orml_currencies, + LiquidityMining: zrml_liquidity_mining, + MarketCommons: zrml_market_commons, + PredictionMarkets: prediction_markets, + RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip, + SimpleDisputes: zrml_simple_disputes, + GlobalDisputes: zrml_global_disputes, + System: frame_system, + Timestamp: pallet_timestamp, + Tokens: orml_tokens, + Treasury: pallet_treasury, } ); @@ -193,7 +192,7 @@ impl crate::Config for Runtime { type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage; type ApproveOrigin = EnsureSignedBy; #[cfg(feature = "parachain")] - type AssetRegistry = MockRegistry; + type AssetRegistry = AssetRegistry; type Authorized = Authorized; type CloseEarlyDisputeBond = CloseEarlyDisputeBond; type CloseMarketEarlyOrigin = EnsureSignedBy; @@ -239,27 +238,26 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; - type MaxConsumers = frame_support::traits::ConstU32<16>; + type Nonce = u64; + type MaxConsumers = ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type OnSetCode = (); type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); type Version = (); + type OnSetCode = (); } impl orml_currencies::Config for Runtime { @@ -269,6 +267,35 @@ impl orml_currencies::Config for Runtime { type WeightInfo = (); } +cfg_if::cfg_if!( + if #[cfg(feature = "parachain")] { + type AssetMetadata = orml_traits::asset_registry::AssetMetadata< + Balance, + CustomMetadata, + ConstU32<1024> + >; + pub struct NoopAssetProcessor {} + + impl AssetProcessor for NoopAssetProcessor { + fn pre_register(id: Option, asset_metadata: AssetMetadata) + -> Result<(CurrencyId, AssetMetadata), DispatchError> { + Ok((id.unwrap(), asset_metadata)) + } + } + + impl orml_asset_registry::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type CustomMetadata = CustomMetadata; + type AssetId = CurrencyId; + type AuthorityOrigin = EnsureRoot; + type AssetProcessor = NoopAssetProcessor; + type Balance = Balance; + type StringLimit = ConstU32<1024>; + type WeightInfo = (); + } + } +); + impl orml_tokens::Config for Runtime { type Amount = Amount; type Balance = Balance; @@ -283,27 +310,31 @@ impl orml_tokens::Config for Runtime { type WeightInfo = (); } -#[cfg(feature = "parachain")] -crate::orml_asset_registry::impl_mock_registry! { - MockRegistry, - CurrencyId, - Balance, - zeitgeist_primitives::types::CustomMetadata -} +// #[cfg(feature = "parachain")] +// crate::orml_asset_registry::impl_mock_registry! { +// MockRegistry, +// CurrencyId, +// Balance, +// zeitgeist_primitives::types::CustomMetadata +// } impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; - type MaxLocks = (); + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); } -impl pallet_randomness_collective_flip::Config for Runtime {} +impl pallet_insecure_randomness_collective_flip::Config for Runtime {} impl pallet_timestamp::Config for Runtime { type MinimumPeriod = MinimumPeriod; @@ -441,7 +472,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); @@ -449,50 +480,54 @@ impl ExtBuilder { pallet_balances::GenesisConfig:: { balances: self.balances } .assimilate_storage(&mut t) .unwrap(); + #[cfg(feature = "parachain")] - use frame_support::traits::GenesisBuild; - #[cfg(feature = "parachain")] - orml_tokens::GenesisConfig:: { - balances: (0..69) - .map(|idx| (idx, CurrencyId::ForeignAsset(100), INITIAL_BALANCE)) - .collect(), - } - .assimilate_storage(&mut t) - .unwrap(); - #[cfg(feature = "parachain")] - let custom_metadata = zeitgeist_primitives::types::CustomMetadata { - allow_as_base_asset: true, - ..Default::default() - }; - #[cfg(feature = "parachain")] - orml_asset_registry_mock::GenesisConfig { - metadata: vec![ - ( - CurrencyId::ForeignAsset(100), - AssetMetadata { - decimals: 18, - name: "ACALA USD".as_bytes().to_vec(), - symbol: "AUSD".as_bytes().to_vec(), - existential_deposit: 0, - location: None, - additional: custom_metadata, - }, - ), - ( - CurrencyId::ForeignAsset(420), - AssetMetadata { - decimals: 18, - name: "FANCY_TOKEN".as_bytes().to_vec(), - symbol: "FTK".as_bytes().to_vec(), - existential_deposit: 0, - location: None, - additional: zeitgeist_primitives::types::CustomMetadata::default(), - }, - ), - ], + { + orml_tokens::GenesisConfig:: { + balances: (0..69) + .map(|idx| (idx, Asset::ForeignAsset(100), INITIAL_BALANCE)) + .collect(), + } + .assimilate_storage(&mut t) + .unwrap(); + + let custom_metadata = zeitgeist_primitives::types::CustomMetadata { + allow_as_base_asset: true, + ..Default::default() + }; + + orml_asset_registry::GenesisConfig:: { + assets: vec![ + ( + Asset::ForeignAsset(100), + AssetMetadata { + decimals: 18, + name: "ACALA USD".as_bytes().to_vec().try_into().unwrap(), + symbol: "AUSD".as_bytes().to_vec().try_into().unwrap(), + existential_deposit: 0, + location: None, + additional: custom_metadata, + } + .encode(), + ), + ( + Asset::ForeignAsset(420), + AssetMetadata { + decimals: 18, + name: "FANCY_TOKEN".as_bytes().to_vec().try_into().unwrap(), + symbol: "FTK".as_bytes().to_vec().try_into().unwrap(), + existential_deposit: 0, + location: None, + additional: zeitgeist_primitives::types::CustomMetadata::default(), + } + .encode(), + ), + ], + last_asset_id: Asset::ForeignAsset(420), + } + .assimilate_storage(&mut t) + .unwrap(); } - .assimilate_storage(&mut t) - .unwrap(); let mut test_ext: sp_io::TestExternalities = t.into(); test_ext.execute_with(|| System::set_block_number(1)); @@ -525,10 +560,12 @@ pub fn set_timestamp_for_on_initialize(time: Moment) { Timestamp::set_timestamp(time - MILLISECS_PER_BLOCK as u64); } +type Block = MockBlock; + sp_api::mock_impl_runtime_apis! { impl zrml_prediction_markets_runtime_api::PredictionMarketsApi, MarketId, Hash> for Runtime { fn market_outcome_share_id(_: MarketId, _: u16) -> Asset { - Asset::PoolShare(SerdeWrapper(1)) + Asset::PoolShare(1) } } } diff --git a/zrml/prediction-markets/src/orml_asset_registry.rs b/zrml/prediction-markets/src/orml_asset_registry.rs deleted file mode 100644 index ebabafa10..000000000 --- a/zrml/prediction-markets/src/orml_asset_registry.rs +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright 2023 Forecasting Technologies Ltd. -// Copyright 2021 Centrifuge Foundation (centrifuge.io). -// -// This file is part of Zeitgeist. -// -// Zeitgeist is free software: you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the -// Free Software Foundation, either version 3 of the License, or (at -// your option) any later version. -// -// Zeitgeist is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Zeitgeist. If not, see . - -#![cfg(all(feature = "mock", feature = "parachain"))] - -#[macro_export] -macro_rules! impl_mock_registry { - ($name:ident, $asset_id:ty, $balance:ty, $custom_metadata:ty) => { - pub use orml_asset_registry_mock::$name; - - mod orml_asset_registry_mock { - use frame_support::{ - dispatch::{DispatchError, DispatchResult}, - traits::GenesisBuild, - }; - use orml_traits::asset_registry::{AssetMetadata, Inspect, Mutate}; - use xcm::{latest::prelude::MultiLocation, VersionedMultiLocation}; - - use super::*; - - pub struct $name; - - impl Inspect for $name { - type AssetId = $asset_id; - type Balance = $balance; - type CustomMetadata = $custom_metadata; - - fn asset_id(location: &MultiLocation) -> Option { - __private::STATE.with(|s| s.borrow().get_asset_from_location(location)) - } - - fn metadata( - asset_id: &Self::AssetId, - ) -> Option> { - __private::STATE.with(|s| s.borrow().get_meta(asset_id)) - } - - fn metadata_by_location( - location: &MultiLocation, - ) -> Option> { - __private::STATE.with(|s| s.borrow().get_meta_from_location(location)) - } - - fn location( - asset_id: &Self::AssetId, - ) -> Result, DispatchError> { - let maybe_location = - __private::STATE.with(|s| s.borrow().get_location(asset_id)); - - Ok(maybe_location) - } - } - - impl Mutate for $name { - fn register_asset( - asset_id: Option, - metadata: AssetMetadata, - ) -> DispatchResult { - if let Some(asset_id) = asset_id { - __private::STATE.with(|s| s.borrow_mut().insert_meta(&asset_id, metadata)) - } else { - Err(DispatchError::Other("Mock can only register metadata with asset_id")) - } - } - - fn update_asset( - asset_id: Self::AssetId, - decimals: Option, - name: Option>, - symbol: Option>, - existential_deposit: Option, - location: Option>, - additional: Option, - ) -> DispatchResult { - __private::STATE.with(|s| { - s.borrow_mut().update_asset( - asset_id, - decimals, - name, - symbol, - existential_deposit, - location, - additional, - ) - }) - } - } - - #[derive(Default)] - pub struct GenesisConfig { - pub metadata: Vec<($asset_id, AssetMetadata<$balance, $custom_metadata>)>, - } - - use serde::{ - de::{Deserialize, Deserializer}, - ser::{Serialize, SerializeStruct, Serializer}, - }; - - impl GenesisBuild<()> for GenesisConfig { - fn build(&self) { - for (asset, metadata) in &self.metadata { - __private::STATE - .with(|s| s.borrow_mut().insert_meta(asset, metadata.clone())) - .expect("Genesis must not fail") - } - } - } - - // NOTE: We need this dummy impl as `AssetMetadata` does NOT derive - // serialize in std - impl Serialize for GenesisConfig { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let state = serializer.serialize_struct("GenesisConfig", 1)?; - state.end() - } - } - - // NOTE: We need this dummy impl as `AssetMetadata` does NOT derive - // deserialize in std - impl<'de> Deserialize<'de> for GenesisConfig { - fn deserialize(_deserializer: D) -> Result - where - D: Deserializer<'de>, - { - Ok(GenesisConfig::default()) - } - } - - mod __private { - use std::{cell::RefCell, vec::Vec}; - - use super::*; - - // TODO(#936): This will not be required post polkadot v0.9.29 upgrade. - pub struct RegistryState { - pub location_to_asset: Vec<(MultiLocation, $asset_id)>, - pub metadata: Vec<($asset_id, AssetMetadata<$balance, $custom_metadata>)>, - } - - impl RegistryState { - pub fn get_meta( - &self, - asset_id: &$asset_id, - ) -> Option> { - for (curr_id, meta) in &self.metadata { - if curr_id == asset_id { - return Some(meta.clone()); - } - } - - None - } - - pub fn insert_meta( - &mut self, - asset_id: &$asset_id, - meta: AssetMetadata<$balance, $custom_metadata>, - ) -> DispatchResult { - for (curr_id, curr_meta) in &mut self.metadata { - if curr_id == asset_id { - *curr_meta = meta; - return Ok(()); - } - } - - self.metadata.push((asset_id.clone(), meta)); - Ok(()) - } - - pub fn get_location(&self, asset_id: &$asset_id) -> Option { - for (curr_id, meta) in &self.metadata { - if curr_id == asset_id { - return meta - .location - .as_ref() - .map(|versioned| versioned.clone().try_into().ok()) - .flatten(); - } - } - - None - } - - pub fn get_asset_from_location( - &self, - location: &MultiLocation, - ) -> Option<$asset_id> { - for (curr_location, asset_id) in &self.location_to_asset { - if curr_location == location { - return Some(asset_id.clone()); - } - } - - None - } - - pub fn get_meta_from_location( - &self, - location: &MultiLocation, - ) -> Option> { - let asset_id = self.get_asset_from_location(location)?; - self.get_meta(&asset_id) - } - - pub fn update_asset( - &mut self, - asset_id: $asset_id, - _decimals: Option, - _name: Option>, - _symbol: Option>, - _existential_deposit: Option<$balance>, - _location: Option>, - _additional: Option<$custom_metadata>, - ) -> DispatchResult { - if let Some(_meta) = self.get_meta(&asset_id) { - Ok(()) - } else { - Err(DispatchError::Other("Asset not registered")) - } - } - } - - impl RegistryState { - fn new() -> Self { - Self { location_to_asset: Vec::new(), metadata: Vec::new() } - } - } - - thread_local! { - pub static STATE: RefCell< - RegistryState, - > = RefCell::new(RegistryState::new()); - } - } - } - }; -} - -pub use impl_mock_registry; diff --git a/zrml/prediction-markets/src/tests/mod.rs b/zrml/prediction-markets/src/tests/mod.rs index 95d13c1a8..5954a1561 100644 --- a/zrml/prediction-markets/src/tests/mod.rs +++ b/zrml/prediction-markets/src/tests/mod.rs @@ -43,7 +43,8 @@ mod sell_complete_set; mod start_global_dispute; use crate::{ - mock::*, AccountIdOf, AssetOf, BalanceOf, Config, Error, Event, MarketIdsPerDisputeBlock, + mock::*, AccountIdOf, AssetOf, BalanceOf, Config, DeadlinesOf, Error, Event, + MarketIdsPerDisputeBlock, }; use core::ops::Range; use frame_support::{assert_noop, assert_ok, traits::NamedReservableCurrency}; @@ -62,7 +63,7 @@ use zrml_market_commons::MarketCommonsPalletApi; const SENTINEL_AMOUNT: u128 = BASE; -fn get_deadlines() -> Deadlines<::BlockNumber> { +fn get_deadlines() -> DeadlinesOf { Deadlines { grace_period: 1_u32.into(), oracle_duration: ::MinOracleDuration::get(), diff --git a/zrml/rikiddo/Cargo.toml b/zrml/rikiddo/Cargo.toml index 64947e298..f6187b517 100644 --- a/zrml/rikiddo/Cargo.toml +++ b/zrml/rikiddo/Cargo.toml @@ -42,6 +42,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-rikiddo" version = "0.5.2" diff --git a/zrml/rikiddo/fuzz/Cargo.toml b/zrml/rikiddo/fuzz/Cargo.toml index 0f9f597bc..aa397bbac 100644 --- a/zrml/rikiddo/fuzz/Cargo.toml +++ b/zrml/rikiddo/fuzz/Cargo.toml @@ -80,7 +80,7 @@ zrml-rikiddo = { workspace = true, features = ["arbitrary", "mock", "default"] } [package] authors = ["Automatically generated"] -edition = "2021" +edition.workspace = true name = "zrml-rikiddo-fuzz" publish = false version = "0.0.0" diff --git a/zrml/rikiddo/src/lib.rs b/zrml/rikiddo/src/lib.rs index be7f94817..049885acd 100644 --- a/zrml/rikiddo/src/lib.rs +++ b/zrml/rikiddo/src/lib.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -72,6 +73,7 @@ pub mod pallet { traits::{Get, Hooks, StorageVersion, Time}, Twox64Concat, }; + use frame_system::pallet_prelude::BlockNumberFor; use parity_scale_codec::{Decode, Encode, FullCodec, FullEncode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_runtime::DispatchError; @@ -150,7 +152,7 @@ pub mod pallet { StorageMap<_, Twox64Concat, T::PoolId, T::Rikiddo>; #[pallet::hooks] - impl, I: 'static> Hooks for Pallet {} + impl, I: 'static> Hooks> for Pallet {} #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] diff --git a/zrml/rikiddo/src/mock.rs b/zrml/rikiddo/src/mock.rs index 970a89d40..40a1431e3 100644 --- a/zrml/rikiddo/src/mock.rs +++ b/zrml/rikiddo/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2023-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -26,17 +26,15 @@ use crate::types::{EmaMarketVolume, FeeSigmoid, RikiddoSigmoidMV}; use frame_support::{construct_runtime, parameter_types, traits::Everything}; +use frame_system::mocking::MockBlock; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use substrate_fixed::{types::extra::U33, FixedI128, FixedU128}; use zeitgeist_primitives::{ - constants::mock::{BlockHashCount, ExistentialDeposit, MaxReserves, BASE}, - types::{ - AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, Moment, PoolId, - UncheckedExtrinsicTest, - }, + constants::mock::{BlockHashCount, ExistentialDeposit, MaxLocks, MaxReserves, BASE}, + types::{AccountIdTest, Balance, Hash, Moment, PoolId}, }; pub const ALICE: AccountIdTest = 0; @@ -52,16 +50,11 @@ parameter_types! { } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - Rikiddo: crate::{Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Call, Pallet, Storage, Inherent}, + pub enum Runtime { + Balances: pallet_balances, + Rikiddo: crate, + System: frame_system, + Timestamp: pallet_timestamp, } ); @@ -84,37 +77,40 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type OnSetCode = (); type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); type Version = (); + type OnSetCode = (); } impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; - type MaxReserves = MaxReserves; type ExistentialDeposit = ExistentialDeposit; - type MaxLocks = (); + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; + type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); } @@ -147,7 +143,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/rikiddo/src/types.rs b/zrml/rikiddo/src/types.rs index cff58f86b..5a5858e1e 100644 --- a/zrml/rikiddo/src/types.rs +++ b/zrml/rikiddo/src/types.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -23,8 +24,7 @@ extern crate alloc; use arbitrary::{Arbitrary, Result as ArbiraryResult, Unstructured}; #[cfg(feature = "arbitrary")] use core::mem; -use frame_support::dispatch::{Decode, Encode}; -use parity_scale_codec::MaxEncodedLen; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; use substrate_fixed::traits::Fixed; diff --git a/zrml/rikiddo/src/types/ema_market_volume.rs b/zrml/rikiddo/src/types/ema_market_volume.rs index a6d49cd27..847f1dbc5 100644 --- a/zrml/rikiddo/src/types/ema_market_volume.rs +++ b/zrml/rikiddo/src/types/ema_market_volume.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -25,8 +26,7 @@ use crate::{ use arbitrary::{Arbitrary, Result as ArbitraryResult, Unstructured}; #[cfg(feature = "arbitrary")] use core::mem; -use frame_support::dispatch::{Decode, Encode}; -use parity_scale_codec::MaxEncodedLen; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; use substrate_fixed::{ diff --git a/zrml/rikiddo/src/types/rikiddo_sigmoid_mv.rs b/zrml/rikiddo/src/types/rikiddo_sigmoid_mv.rs index 65e355b5d..eba866310 100644 --- a/zrml/rikiddo/src/types/rikiddo_sigmoid_mv.rs +++ b/zrml/rikiddo/src/types/rikiddo_sigmoid_mv.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -28,9 +29,8 @@ use alloc::vec::Vec; #[cfg(feature = "arbitrary")] use arbitrary::{Arbitrary, Result as ArbiraryResult, Unstructured}; use core::ops::{AddAssign, BitOrAssign, ShlAssign}; -use frame_support::dispatch::{Decode, Encode}; use hashbrown::HashMap; -use parity_scale_codec::MaxEncodedLen; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; use substrate_fixed::{ diff --git a/zrml/rikiddo/src/types/sigmoid_fee.rs b/zrml/rikiddo/src/types/sigmoid_fee.rs index d122c64ec..97640057a 100644 --- a/zrml/rikiddo/src/types/sigmoid_fee.rs +++ b/zrml/rikiddo/src/types/sigmoid_fee.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -26,8 +27,7 @@ use crate::{ use arbitrary::{Arbitrary, Result as ArbiraryResult, Unstructured}; #[cfg(feature = "arbitrary")] use core::mem; -use frame_support::dispatch::{Decode, Encode}; -use parity_scale_codec::MaxEncodedLen; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; use scale_info::TypeInfo; use sp_core::RuntimeDebug; use substrate_fixed::{ diff --git a/zrml/simple-disputes/Cargo.toml b/zrml/simple-disputes/Cargo.toml index 75265192f..271a019f4 100644 --- a/zrml/simple-disputes/Cargo.toml +++ b/zrml/simple-disputes/Cargo.toml @@ -13,7 +13,7 @@ zrml-market-commons = { workspace = true } env_logger = { workspace = true } orml-currencies = { workspace = true, features = ["default"] } orml-tokens = { workspace = true, features = ["default"] } -pallet-balances = { workspace = true, features = ["default"] } +pallet-balances = { workspace = true, features = ["default", "insecure_zero_ed"] } pallet-timestamp = { workspace = true, features = ["default"] } sp-io = { workspace = true, features = ["default"] } zeitgeist-primitives = { workspace = true, features = ["mock", "default"] } @@ -40,6 +40,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-simple-disputes" version = "0.5.2" diff --git a/zrml/simple-disputes/src/benchmarks.rs b/zrml/simple-disputes/src/benchmarks.rs index 2f06b5652..8df924268 100644 --- a/zrml/simple-disputes/src/benchmarks.rs +++ b/zrml/simple-disputes/src/benchmarks.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2023-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -31,6 +31,7 @@ use frame_support::{ dispatch::RawOrigin, traits::{Currency, Get, Imbalance}, }; +use frame_system::pallet_prelude::BlockNumberFor; use sp_runtime::traits::{One, Saturating}; use zrml_market_commons::MarketCommonsPalletApi; @@ -47,7 +48,7 @@ fn fill_disputes(market_id: MarketIdOf, d: u32) { outcome, ) .unwrap(); - >::set_block_number(now.saturating_add(T::BlockNumber::one())); + >::set_block_number(now.saturating_add(BlockNumberFor::::one())); } } diff --git a/zrml/simple-disputes/src/lib.rs b/zrml/simple-disputes/src/lib.rs index 2a3401e5c..02f4822c6 100644 --- a/zrml/simple-disputes/src/lib.rs +++ b/zrml/simple-disputes/src/lib.rs @@ -53,12 +53,11 @@ mod pallet { traits::{Currency, Get, Hooks, Imbalance, IsType, NamedReservableCurrency}, transactional, BoundedVec, PalletId, }; - use frame_system::pallet_prelude::*; + use frame_system::pallet_prelude::{BlockNumberFor, *}; use sp_runtime::{ traits::{CheckedDiv, Saturating, Zero}, DispatchError, SaturatedConversion, }; - use zrml_market_commons::MarketCommonsPalletApi; #[pallet::config] @@ -74,7 +73,7 @@ mod pallet { type DisputeResolution: DisputeResolutionApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, MarketId = MarketIdOf, Moment = MomentOf, >; @@ -87,7 +86,7 @@ mod pallet { /// The identifier of individual markets. type MarketCommons: MarketCommonsPalletApi< AccountId = Self::AccountId, - BlockNumber = Self::BlockNumber, + BlockNumber = BlockNumberFor, Balance = BalanceOf, >; @@ -113,16 +112,12 @@ mod pallet { pub(crate) type MarketOf = Market< ::AccountId, BalanceOf, - ::BlockNumber, + BlockNumberFor, MomentOf, MarketIdOf, >; pub(crate) type DisputesOf = BoundedVec< - MarketDispute< - ::AccountId, - ::BlockNumber, - BalanceOf, - >, + MarketDispute<::AccountId, BlockNumberFor, BalanceOf>, ::MaxDisputes, >; pub type CacheSize = ConstU32<64>; @@ -144,7 +139,7 @@ mod pallet { { OutcomeReserved { market_id: MarketIdOf, - dispute: MarketDispute>, + dispute: MarketDispute, BalanceOf>, }, } @@ -164,7 +159,7 @@ mod pallet { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { @@ -223,8 +218,8 @@ mod pallet { } fn ensure_can_not_dispute_the_same_outcome( - disputes: &[MarketDispute>], - report: &Report, + disputes: &[MarketDispute, BalanceOf>], + report: &Report>, outcome: &OutcomeReport, ) -> DispatchResult { if let Some(last_dispute) = disputes.last() { @@ -252,16 +247,16 @@ mod pallet { } fn get_auto_resolve( - disputes: &[MarketDispute>], + disputes: &[MarketDispute, BalanceOf>], market: &MarketOf, - ) -> Option { + ) -> Option> { disputes.last().map(|last_dispute| { last_dispute.at.saturating_add(market.deadlines.dispute_duration) }) } fn remove_auto_resolve( - disputes: &[MarketDispute>], + disputes: &[MarketDispute, BalanceOf>], market_id: &MarketIdOf, market: &MarketOf, ) -> u32 { @@ -315,7 +310,7 @@ mod pallet { type AccountId = T::AccountId; type Balance = BalanceOf; type NegativeImbalance = NegativeImbalanceOf; - type BlockNumber = T::BlockNumber; + type BlockNumber = BlockNumberFor; type MarketId = MarketIdOf; type Moment = MomentOf; type Origin = T::RuntimeOrigin; diff --git a/zrml/simple-disputes/src/mock.rs b/zrml/simple-disputes/src/mock.rs index 4d1d40cdb..6e6268df3 100644 --- a/zrml/simple-disputes/src/mock.rs +++ b/zrml/simple-disputes/src/mock.rs @@ -24,19 +24,20 @@ use frame_support::{ pallet_prelude::{DispatchError, Weight}, traits::Everything, }; +use frame_system::mocking::MockBlock; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use zeitgeist_primitives::{ constants::mock::{ - BlockHashCount, ExistentialDeposits, GetNativeCurrencyId, MaxDisputes, MaxReserves, - MinimumPeriod, OutcomeBond, OutcomeFactor, SimpleDisputesPalletId, BASE, + BlockHashCount, ExistentialDeposits, GetNativeCurrencyId, MaxDisputes, MaxLocks, + MaxReserves, MinimumPeriod, OutcomeBond, OutcomeFactor, SimpleDisputesPalletId, BASE, }, traits::{DisputeResolutionApi, MarketOfDisputeResolutionApi}, types::{ - AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, CurrencyId, - Hash, Index, MarketId, Moment, UncheckedExtrinsicTest, + AccountIdTest, Amount, Balance, BasicCurrencyAdapter, BlockNumber, CurrencyId, Hash, + MarketId, Moment, }, }; @@ -55,19 +56,14 @@ ord_parameter_types! { } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - AssetManager: orml_currencies::{Call, Pallet, Storage}, - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - MarketCommons: zrml_market_commons::{Pallet, Storage}, - SimpleDisputes: zrml_simple_disputes::{Event, Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, + pub enum Runtime { + AssetManager: orml_currencies, + Balances: pallet_balances, + MarketCommons: zrml_market_commons, + SimpleDisputes: zrml_simple_disputes, + System: frame_system, + Timestamp: pallet_timestamp, + Tokens: orml_tokens, } ); @@ -106,7 +102,7 @@ impl DisputeResolutionApi for NoopResolution { impl crate::Config for Runtime { type Currency = Balances; - type RuntimeEvent = (); + type RuntimeEvent = RuntimeEvent; type DisputeResolution = NoopResolution; type MarketCommons = MarketCommons; type MaxDisputes = MaxDisputes; @@ -120,18 +116,17 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); - type RuntimeEvent = (); + type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -147,9 +142,13 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); - type RuntimeEvent = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); + type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = (); - type MaxLocks = (); + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); @@ -167,7 +166,7 @@ impl orml_tokens::Config for Runtime { type Balance = Balance; type CurrencyId = CurrencyId; type DustRemovalWhitelist = Everything; - type RuntimeEvent = (); + type RuntimeEvent = RuntimeEvent; type ExistentialDeposits = ExistentialDeposits; type MaxLocks = (); type MaxReserves = MaxReserves; @@ -211,7 +210,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/simple-disputes/src/weights.rs b/zrml/simple-disputes/src/weights.rs index bfbc6cc8c..4bc89e83a 100644 --- a/zrml/simple-disputes/src/weights.rs +++ b/zrml/simple-disputes/src/weights.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2023-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -64,34 +64,34 @@ impl WeightInfoZeitgeist for WeightInfo { // Storage: Balances Reserves (r:1 w:1) // Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:2 w:2) fn suggest_outcome(d: u32, r: u32, e: u32) -> Weight { - Weight::from_ref_time(400_160_000) + Weight::from_parts(400_160_000, 0) // Standard Error: 1_302_000 - .saturating_add(Weight::from_ref_time(3_511_000).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(3_511_000, 0).saturating_mul(d.into())) // Standard Error: 69_000 - .saturating_add(Weight::from_ref_time(324_000).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(324_000, 0).saturating_mul(r.into())) // Standard Error: 69_000 - .saturating_add(Weight::from_ref_time(311_000).saturating_mul(e.into())) + .saturating_add(Weight::from_parts(311_000, 0).saturating_mul(e.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } fn on_dispute_weight() -> Weight { - Weight::from_ref_time(0) + Weight::from_all(0) } // Storage: SimpleDisputes Disputes (r:1 w:0) fn on_resolution_weight(d: u32) -> Weight { - Weight::from_ref_time(5_464_000) + Weight::from_parts(5_464_000, 0) // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(210_000).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(210_000, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: SimpleDisputes Disputes (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: System Account (r:1 w:1) fn exchange_weight(d: u32) -> Weight { - Weight::from_ref_time(18_573_000) + Weight::from_parts(18_573_000, 0) // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(19_710_000).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(19_710_000, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(1)) @@ -99,32 +99,32 @@ impl WeightInfoZeitgeist for WeightInfo { } // Storage: SimpleDisputes Disputes (r:1 w:0) fn get_auto_resolve_weight(d: u32) -> Weight { - Weight::from_ref_time(5_535_000) + Weight::from_parts(5_535_000, 0) // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(145_000).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(145_000, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: SimpleDisputes Disputes (r:1 w:0) fn has_failed_weight(d: u32) -> Weight { - Weight::from_ref_time(5_685_000) + Weight::from_parts(5_685_000, 0) // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(117_000).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(117_000, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: SimpleDisputes Disputes (r:1 w:0) fn on_global_dispute_weight(d: u32) -> Weight { - Weight::from_ref_time(5_815_000) + Weight::from_parts(5_815_000, 0) // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(66_000).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(66_000, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) } // Storage: SimpleDisputes Disputes (r:1 w:1) // Storage: Balances Reserves (r:1 w:1) // Storage: System Account (r:1 w:1) fn clear_weight(d: u32) -> Weight { - Weight::from_ref_time(15_958_000) + Weight::from_parts(15_958_000, 0) // Standard Error: 17_000 - .saturating_add(Weight::from_ref_time(13_085_000).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(13_085_000, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/zrml/styx/Cargo.toml b/zrml/styx/Cargo.toml index 22c701802..f2c45f4c2 100644 --- a/zrml/styx/Cargo.toml +++ b/zrml/styx/Cargo.toml @@ -9,7 +9,7 @@ zeitgeist-primitives = { workspace = true } [dev-dependencies] env_logger = { workspace = true } -pallet-balances = { workspace = true, features = ["default"] } +pallet-balances = { workspace = true, features = ["default", "insecure_zero_ed"] } pallet-timestamp = { workspace = true, features = ["default"] } sp-io = { workspace = true, features = ["default"] } zeitgeist-primitives = { workspace = true, features = ["mock", "default"] } @@ -35,6 +35,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-styx" version = "0.5.2" diff --git a/zrml/styx/src/benchmarks.rs b/zrml/styx/src/benchmarks.rs index 86d1dd06a..da88151b8 100644 --- a/zrml/styx/src/benchmarks.rs +++ b/zrml/styx/src/benchmarks.rs @@ -28,10 +28,7 @@ use crate::Config; #[cfg(test)] use crate::Pallet as Styx; use frame_benchmarking::{benchmarks, whitelisted_caller}; -use frame_support::{ - dispatch::UnfilteredDispatchable, - traits::{Currency, EnsureOrigin}, -}; +use frame_support::traits::{Currency, EnsureOrigin, UnfilteredDispatchable}; use frame_system::RawOrigin; use sp_runtime::SaturatedConversion; use zeitgeist_primitives::constants::BASE; diff --git a/zrml/styx/src/lib.rs b/zrml/styx/src/lib.rs index ab86b6baf..300e3b3ed 100644 --- a/zrml/styx/src/lib.rs +++ b/zrml/styx/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2022-2023 Forecasting Technologies LTD. +// Copyright 2022-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -49,7 +49,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); /// Keep track of crossings. Accounts are only able to cross once. diff --git a/zrml/styx/src/mock.rs b/zrml/styx/src/mock.rs index 263c25712..307964602 100644 --- a/zrml/styx/src/mock.rs +++ b/zrml/styx/src/mock.rs @@ -1,4 +1,4 @@ -// Copyright 2023 Forecasting Technologies LTD. +// Copyright 2023-2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -20,14 +20,14 @@ use crate::{self as zrml_styx}; use frame_support::{construct_runtime, ord_parameter_types, traits::Everything}; -use frame_system::EnsureSignedBy; +use frame_system::{mocking::MockBlock, EnsureSignedBy}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use zeitgeist_primitives::{ - constants::mock::{BlockHashCount, MaxReserves, BASE}, - types::{AccountIdTest, Balance, BlockNumber, BlockTest, Hash, Index, UncheckedExtrinsicTest}, + constants::mock::{BlockHashCount, MaxLocks, MaxReserves, BASE}, + types::{AccountIdTest, Balance, Hash}, }; pub const ALICE: AccountIdTest = 0; @@ -40,15 +40,10 @@ ord_parameter_types! { } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsicTest, - { - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - Styx: zrml_styx::{Event, Pallet, Storage}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, + pub enum Runtime { + Balances: pallet_balances, + Styx: zrml_styx, + System: frame_system, } ); @@ -63,18 +58,17 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); @@ -90,9 +84,13 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = (); - type MaxLocks = (); + type MaxHolds = (); + type MaxFreezes = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; type WeightInfo = (); @@ -110,7 +108,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); diff --git a/zrml/styx/src/tests.rs b/zrml/styx/src/tests.rs index dfcc0bf1a..309abcc83 100644 --- a/zrml/styx/src/tests.rs +++ b/zrml/styx/src/tests.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. @@ -18,7 +19,7 @@ #![cfg(test)] use crate::{mock::*, Crossings, Error, Event}; -use frame_support::{assert_noop, assert_ok, error::BadOrigin}; +use frame_support::{assert_noop, assert_ok, error::BadOrigin, traits::fungible::Mutate}; #[test] fn cross_slashes_funds_and_stores_crossing() { @@ -68,7 +69,7 @@ fn set_burn_amount_should_fail_with_unathorized_caller() { fn account_should_not_cross_without_sufficient_funds() { ExtBuilder::default().build().execute_with(|| { frame_system::Pallet::::set_block_number(1); - assert_ok!(Balances::set_balance(RuntimeOrigin::root(), ALICE, 0, 0)); + assert_eq!(Balances::set_balance(&ALICE, 0), 0); assert_noop!( Styx::cross(RuntimeOrigin::signed(ALICE)), Error::::FundDoesNotHaveEnoughFreeBalance diff --git a/zrml/swaps/Cargo.toml b/zrml/swaps/Cargo.toml index a999bf4e6..d8931c188 100644 --- a/zrml/swaps/Cargo.toml +++ b/zrml/swaps/Cargo.toml @@ -63,6 +63,6 @@ try-runtime = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-swaps" version = "0.5.2" diff --git a/zrml/swaps/fuzz/Cargo.toml b/zrml/swaps/fuzz/Cargo.toml index 9490975ad..a7819b250 100644 --- a/zrml/swaps/fuzz/Cargo.toml +++ b/zrml/swaps/fuzz/Cargo.toml @@ -64,7 +64,7 @@ zrml-swaps = { workspace = true, features = ["mock", "default"] } [package] authors = ["Automatically generated"] -edition = "2021" +edition.workspace = true name = "zrml-swaps-fuzz" publish = false version = "0.0.0" diff --git a/zrml/swaps/fuzz/pool_exit.rs b/zrml/swaps/fuzz/pool_exit.rs index 0645a4750..134b40959 100644 --- a/zrml/swaps/fuzz/pool_exit.rs +++ b/zrml/swaps/fuzz/pool_exit.rs @@ -23,7 +23,7 @@ mod utils; use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; use utils::{construct_asset, GeneralPoolData}; -use zeitgeist_primitives::types::{Asset, SerdeWrapper}; +use zeitgeist_primitives::types::Asset; use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: GeneralPoolData| { @@ -40,11 +40,7 @@ fuzz_target!(|data: GeneralPoolData| { let pool_creator = data.pool_creation.origin; let pool_id = data.pool_creation.create_pool(); // to exit a pool, origin also needs to have the pool tokens of the pool that they're exiting - let _ = Currencies::deposit( - Asset::PoolShare(SerdeWrapper(pool_id)), - &pool_creator, - data.pool_amount, - ); + let _ = Currencies::deposit(Asset::PoolShare(pool_id), &pool_creator, data.pool_amount); let _ = Swaps::pool_exit( RuntimeOrigin::signed(data.origin), pool_id, diff --git a/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs b/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs index e86ed4dec..c5a6d3f6d 100644 --- a/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs +++ b/zrml/swaps/fuzz/pool_exit_with_exact_asset_amount.rs @@ -23,7 +23,7 @@ mod utils; use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; use utils::{construct_asset, ExactAssetAmountData}; -use zeitgeist_primitives::types::{Asset, SerdeWrapper}; +use zeitgeist_primitives::types::Asset; use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: ExactAssetAmountData| { @@ -41,11 +41,7 @@ fuzz_target!(|data: ExactAssetAmountData| { let pool_creator = data.pool_creation.origin; let pool_id = data.pool_creation.create_pool(); // to exit a pool, origin also needs to have the pool tokens of the pool that they're exiting - let _ = Currencies::deposit( - Asset::PoolShare(SerdeWrapper(pool_id)), - &pool_creator, - data.pool_amount, - ); + let _ = Currencies::deposit(Asset::PoolShare(pool_id), &pool_creator, data.pool_amount); let _ = Swaps::pool_exit_with_exact_asset_amount( RuntimeOrigin::signed(data.origin), pool_id, diff --git a/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs b/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs index 2fd939c78..145e959ff 100644 --- a/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs +++ b/zrml/swaps/fuzz/pool_exit_with_exact_pool_amount.rs @@ -23,7 +23,7 @@ mod utils; use libfuzzer_sys::fuzz_target; use orml_traits::currency::MultiCurrency; use utils::{construct_asset, ExactAmountData}; -use zeitgeist_primitives::types::{Asset, SerdeWrapper}; +use zeitgeist_primitives::types::Asset; use zrml_swaps::mock::{Currencies, ExtBuilder, RuntimeOrigin, Swaps}; fuzz_target!(|data: ExactAmountData| { @@ -41,11 +41,7 @@ fuzz_target!(|data: ExactAmountData| { let pool_creator = data.pool_creation.origin; let pool_id = data.pool_creation.create_pool(); // to exit a pool, origin also needs to have the pool tokens of the pool that they're exiting - let _ = Currencies::deposit( - Asset::PoolShare(SerdeWrapper(pool_id)), - &pool_creator, - data.pool_amount, - ); + let _ = Currencies::deposit(Asset::PoolShare(pool_id), &pool_creator, data.pool_amount); let _ = Swaps::pool_exit_with_exact_pool_amount( RuntimeOrigin::signed(data.origin), pool_id, diff --git a/zrml/swaps/fuzz/utils.rs b/zrml/swaps/fuzz/utils.rs index eaf3f17fe..c3e1084f9 100644 --- a/zrml/swaps/fuzz/utils.rs +++ b/zrml/swaps/fuzz/utils.rs @@ -29,7 +29,7 @@ use zeitgeist_primitives::{ MaxAssets, MaxSwapFee, MaxTotalWeight, MaxWeight, MinAssets, MinWeight, BASE, CENT, }, traits::Swaps as SwapsTrait, - types::{Asset, PoolId, ScalarPosition, SerdeWrapper}, + types::{Asset, PoolId, ScalarPosition}, }; use zrml_swaps::mock::Swaps; @@ -43,7 +43,7 @@ pub fn construct_asset(seed: (u8, u128, u16)) -> Asset { if seed1 % 2 == 0 { ScalarPosition::Long } else { ScalarPosition::Short }; Asset::ScalarOutcome(seed0, scalar_position) } - 2 => Asset::PoolShare(SerdeWrapper(seed0)), + 2 => Asset::PoolShare(seed0), _ => Asset::Ztg, } } diff --git a/zrml/swaps/rpc/Cargo.toml b/zrml/swaps/rpc/Cargo.toml index 178f5ddd5..ec05f2a59 100644 --- a/zrml/swaps/rpc/Cargo.toml +++ b/zrml/swaps/rpc/Cargo.toml @@ -9,6 +9,6 @@ zrml-swaps-runtime-api = { workspace = true, features = ["default"] } [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-swaps-rpc" version = "0.5.2" diff --git a/zrml/swaps/rpc/src/lib.rs b/zrml/swaps/rpc/src/lib.rs index 4cad2388f..5d4ae403c 100644 --- a/zrml/swaps/rpc/src/lib.rs +++ b/zrml/swaps/rpc/src/lib.rs @@ -30,10 +30,7 @@ use jsonrpsee::{ use parity_scale_codec::{Codec, MaxEncodedLen}; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; -use sp_runtime::{ - generic::BlockId, - traits::{Block as BlockT, MaybeDisplay, MaybeFromStr, NumberFor}, -}; +use sp_runtime::traits::{Block as BlockT, MaybeDisplay, MaybeFromStr, NumberFor}; use zeitgeist_primitives::types::{Asset, SerdeWrapper}; pub use zrml_swaps_runtime_api::SwapsApi as SwapsRuntimeApi; @@ -125,11 +122,8 @@ where at: Option<::Hash>, ) -> RpcResult>> { let api = self.client.runtime_api(); - let at = BlockId::hash(at.unwrap_or_else(|| - //if the block hash is not supplied assume the best block - self.client.info().best_hash)); - - let res = api.pool_shares_id(&at, pool_id).map_err(|e| { + let hash = at.unwrap_or_else(|| self.client.info().best_hash); + let res = api.pool_shares_id(hash, pool_id).map_err(|e| { CallError::Custom(ErrorObject::owned( Error::RuntimeError.into(), "Unable to get pool shares identifier.", @@ -145,11 +139,8 @@ where at: Option<::Hash>, ) -> RpcResult { let api = self.client.runtime_api(); - let at = BlockId::hash(at.unwrap_or_else(|| - //if the block hash is not supplied assume the best block - self.client.info().best_hash)); - - let res = api.pool_account_id(&at, &pool_id).map_err(|e| { + let hash = at.unwrap_or_else(|| self.client.info().best_hash); + let res = api.pool_account_id(hash, &pool_id).map_err(|e| { CallError::Custom(ErrorObject::owned( Error::RuntimeError.into(), "Unable to get pool account identifier.", @@ -169,9 +160,9 @@ where at: Option<::Hash>, ) -> RpcResult> { let api = self.client.runtime_api(); - let at = BlockId::hash(at.unwrap_or_else(|| self.client.info().best_hash)); + let hash = at.unwrap_or_else(|| self.client.info().best_hash); let res = - api.get_spot_price(&at, &pool_id, &asset_in, &asset_out, with_fees).map_err(|e| { + api.get_spot_price(hash, &pool_id, &asset_in, &asset_out, with_fees).map_err(|e| { CallError::Custom(ErrorObject::owned( Error::RuntimeError.into(), "Unable to get spot price.", @@ -192,10 +183,14 @@ where let api = self.client.runtime_api(); blocks .into_iter() - .map(|block| { - let hash = BlockId::number(block); + .map(|block_number| { + let hash = self + .client + .hash(block_number) + .unwrap_or(Some(self.client.info().best_hash)) + .unwrap_or(self.client.info().best_hash); let res = api - .get_spot_price(&hash, &pool_id, &asset_in, &asset_out, with_fees) + .get_spot_price(hash, &pool_id, &asset_in, &asset_out, with_fees) .map_err(|e| { CallError::Custom(ErrorObject::owned( Error::RuntimeError.into(), diff --git a/zrml/swaps/runtime-api/Cargo.toml b/zrml/swaps/runtime-api/Cargo.toml index cd99f4a9d..2e102db34 100644 --- a/zrml/swaps/runtime-api/Cargo.toml +++ b/zrml/swaps/runtime-api/Cargo.toml @@ -16,6 +16,6 @@ std = [ [package] authors = ["Zeitgeist PM "] -edition = "2021" +edition.workspace = true name = "zrml-swaps-runtime-api" version = "0.5.2" diff --git a/zrml/swaps/src/benchmarks.rs b/zrml/swaps/src/benchmarks.rs index 55f125067..6c32fb53d 100644 --- a/zrml/swaps/src/benchmarks.rs +++ b/zrml/swaps/src/benchmarks.rs @@ -30,7 +30,8 @@ use super::*; #[cfg(test)] use crate::Pallet as Swaps; use crate::{types::PoolStatus, AssetOf, Config, Event, MAX_IN_RATIO, MAX_OUT_RATIO}; -use frame_benchmarking::{benchmarks, vec, whitelisted_caller, Vec}; +use alloc::{vec, vec::Vec}; +use frame_benchmarking::{benchmarks, whitelisted_caller}; use frame_support::traits::Get; use frame_system::RawOrigin; use orml_traits::MultiCurrency; diff --git a/zrml/swaps/src/fixed.rs b/zrml/swaps/src/fixed.rs index aa1aec648..607155a87 100644 --- a/zrml/swaps/src/fixed.rs +++ b/zrml/swaps/src/fixed.rs @@ -22,7 +22,7 @@ // balancer-core repository // . -use frame_support::dispatch::DispatchError; +use sp_runtime::DispatchError; use zeitgeist_primitives::{ constants::BASE, math::{ @@ -175,8 +175,9 @@ pub fn bpow_approx(base: u128, exp: u128) -> Result { #[cfg(test)] mod tests { use super::*; - use frame_support::{assert_err, dispatch::DispatchError}; + use frame_support::assert_err; use more_asserts::assert_le; + use sp_runtime::DispatchError; #[test] fn bpow_has_minimum_set_of_correct_values() { diff --git a/zrml/swaps/src/lib.rs b/zrml/swaps/src/lib.rs index af2880d61..f07f4bdd5 100644 --- a/zrml/swaps/src/lib.rs +++ b/zrml/swaps/src/lib.rs @@ -58,12 +58,13 @@ mod pallet { use alloc::{collections::btree_map::BTreeMap, vec, vec::Vec}; use core::marker::PhantomData; use frame_support::{ - dispatch::Weight, ensure, pallet_prelude::{OptionQuery, StorageMap, StorageValue, ValueQuery}, require_transactional, traits::{Get, IsType, StorageVersion}, - transactional, Blake2_128Concat, PalletError, PalletId, Parameter, + transactional, + weights::Weight, + Blake2_128Concat, PalletError, PalletId, Parameter, }; use frame_system::{ensure_signed, pallet_prelude::OriginFor}; use orml_traits::MultiCurrency; @@ -81,7 +82,7 @@ mod pallet { fixed::FixedMul, }, traits::{PoolSharesId, Swaps}, - types::{PoolId, SerdeWrapper}, + types::PoolId, }; /// The current storage version. @@ -366,7 +367,7 @@ mod pallet { + MaybeSerializeDeserialize + Ord + TypeInfo - + PoolSharesId>; + + PoolSharesId; type MultiCurrency: MultiCurrency; @@ -564,7 +565,6 @@ mod pallet { #[pallet::pallet] #[pallet::storage_version(STORAGE_VERSION)] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(PhantomData); #[pallet::storage] @@ -1092,7 +1092,7 @@ mod pallet { } pub(crate) fn pool_shares_id(pool_id: PoolId) -> AssetOf { - T::Asset::pool_shares_id(SerdeWrapper(pool_id)) + T::Asset::pool_shares_id(pool_id) } pub fn pool_by_id(pool_id: PoolId) -> Result, DispatchError> diff --git a/zrml/swaps/src/math.rs b/zrml/swaps/src/math.rs index 64b4d9606..8abf6b4d4 100644 --- a/zrml/swaps/src/math.rs +++ b/zrml/swaps/src/math.rs @@ -25,7 +25,7 @@ #![allow(clippy::let_and_return)] use crate::fixed::bpow; -use frame_support::dispatch::DispatchError; +use sp_runtime::DispatchError; use zeitgeist_primitives::{ constants::BASE, math::{ diff --git a/zrml/swaps/src/mock.rs b/zrml/swaps/src/mock.rs index 324d4b7da..ab18e5464 100644 --- a/zrml/swaps/src/mock.rs +++ b/zrml/swaps/src/mock.rs @@ -33,10 +33,11 @@ use frame_support::{ construct_runtime, parameter_types, traits::{Contains, Everything}, }; +use frame_system::mocking::MockBlock; use orml_traits::parameter_type_with_key; use sp_runtime::{ - testing::Header, traits::{AccountIdConversion, BlakeTwo256, IdentityLookup}, + BuildStorage, }; use zeitgeist_primitives::{ constants::mock::{ @@ -45,8 +46,8 @@ use zeitgeist_primitives::{ BASE, }, types::{ - AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, BlockNumber, BlockTest, - CurrencyId, Hash, Index, MarketId, Moment, PoolId, SerdeWrapper, UncheckedExtrinsicTest, + AccountIdTest, Amount, Asset, Balance, BasicCurrencyAdapter, CurrencyId, Hash, MarketId, + Moment, PoolId, SerdeWrapper, UncheckedExtrinsicTest, }, }; @@ -77,18 +78,13 @@ parameter_types! { } construct_runtime!( - pub enum Runtime - where - Block = BlockTest, - NodeBlock = BlockTest, - UncheckedExtrinsic = UncheckedExtrinsic, - { - Balances: pallet_balances::{Call, Config, Event, Pallet, Storage}, - Currencies: orml_currencies::{Pallet}, - Swaps: zrml_swaps::{Call, Event, Pallet}, - System: frame_system::{Call, Config, Event, Pallet, Storage}, - Timestamp: pallet_timestamp::{Pallet}, - Tokens: orml_tokens::{Config, Event, Pallet, Storage}, + pub enum Runtime { + Balances: pallet_balances, + Currencies: orml_currencies, + Swaps: zrml_swaps, + System: frame_system, + Timestamp: pallet_timestamp, + Tokens: orml_tokens, } ); @@ -111,27 +107,26 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountIdTest; type BaseCallFilter = Everything; + type Block = MockBlock; type BlockHashCount = BlockHashCount; type BlockLength = (); - type BlockNumber = BlockNumber; type BlockWeights = (); type RuntimeCall = RuntimeCall; type DbWeight = (); type RuntimeEvent = RuntimeEvent; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; - type Index = Index; type Lookup = IdentityLookup; + type Nonce = u64; type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); type OnNewAccount = (); - type OnSetCode = (); type RuntimeOrigin = RuntimeOrigin; type PalletInfo = PalletInfo; type SS58Prefix = (); type SystemWeightInfo = (); type Version = (); + type OnSetCode = (); } impl orml_currencies::Config for Runtime { @@ -194,8 +189,12 @@ impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type DustRemoval = (); + type FreezeIdentifier = (); + type RuntimeHoldReason = (); type RuntimeEvent = RuntimeEvent; type ExistentialDeposit = ExistentialDeposit; + type MaxHolds = (); + type MaxFreezes = (); type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; @@ -230,7 +229,7 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { let mut storage = - frame_system::GenesisConfig::default().build_storage::().unwrap(); + frame_system::GenesisConfig::::default().build_storage().unwrap(); // see the logs in tests when using `RUST_LOG=debug cargo test -- --nocapture` let _ = env_logger::builder().is_test(true).try_init(); @@ -243,8 +242,10 @@ impl ExtBuilder { } } +type Block = MockBlock; + sp_api::mock_impl_runtime_apis! { - impl zrml_swaps_runtime_api::SwapsApi, PoolId, AccountIdTest, Balance, MarketId> + impl zrml_swaps_runtime_api::SwapsApi, PoolId, AccountIdTest, Balance, MarketId> for Runtime { fn get_spot_price( @@ -261,7 +262,7 @@ sp_api::mock_impl_runtime_apis! { } fn pool_shares_id(pool_id: PoolId) -> Asset> { - Asset::PoolShare(SerdeWrapper(pool_id)) + Asset::PoolShare(pool_id) } } } diff --git a/zrml/swaps/src/tests.rs b/zrml/swaps/src/tests.rs index b5e3e264e..ef05cb25f 100644 --- a/zrml/swaps/src/tests.rs +++ b/zrml/swaps/src/tests.rs @@ -24,6 +24,8 @@ #![cfg(all(feature = "mock", test))] #![allow(clippy::too_many_arguments)] +// TODO(#1328): Remove after rustc nightly-2024-04-22 +#![allow(clippy::duplicated_attributes)] use crate::{ events::{CommonPoolEventParams, PoolAssetEvent, PoolAssetsEvent, SwapEvent}, From 142df8569fe2915631f96f039cc534eb989ac1b9 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Mon, 8 Jul 2024 21:37:43 +0200 Subject: [PATCH 3/7] Update versions to v0.5.3 --- Cargo.lock | 46 +++++++++---------- macros/Cargo.toml | 2 +- node/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- runtime/battery-station/Cargo.toml | 2 +- runtime/common/Cargo.toml | 2 +- runtime/zeitgeist/Cargo.toml | 2 +- zrml/authorized/Cargo.toml | 2 +- zrml/court/Cargo.toml | 2 +- zrml/global-disputes/Cargo.toml | 2 +- zrml/hybrid-router/Cargo.toml | 2 +- zrml/liquidity-mining/Cargo.toml | 2 +- zrml/market-commons/Cargo.toml | 2 +- zrml/neo-swaps/Cargo.toml | 2 +- zrml/orderbook/Cargo.toml | 2 +- zrml/parimutuel/Cargo.toml | 2 +- zrml/prediction-markets/Cargo.toml | 2 +- .../prediction-markets/runtime-api/Cargo.toml | 2 +- zrml/rikiddo/Cargo.toml | 2 +- zrml/simple-disputes/Cargo.toml | 2 +- zrml/styx/Cargo.toml | 2 +- zrml/swaps/Cargo.toml | 2 +- zrml/swaps/rpc/Cargo.toml | 2 +- zrml/swaps/runtime-api/Cargo.toml | 2 +- 24 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0970a374..279e2b189 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -788,7 +788,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "battery-station-runtime" -version = "0.5.2" +version = "0.5.3" dependencies = [ "cfg-if", "common-runtime", @@ -1449,7 +1449,7 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "common-runtime" -version = "0.5.2" +version = "0.5.3" dependencies = [ "cfg-if", "cumulus-pallet-xcmp-queue", @@ -14833,11 +14833,11 @@ dependencies = [ [[package]] name = "zeitgeist-macros" -version = "0.5.2" +version = "0.5.3" [[package]] name = "zeitgeist-node" -version = "0.5.2" +version = "0.5.3" dependencies = [ "battery-station-runtime", "cfg-if", @@ -14931,7 +14931,7 @@ dependencies = [ [[package]] name = "zeitgeist-primitives" -version = "0.5.2" +version = "0.5.3" dependencies = [ "arbitrary", "fixed", @@ -14954,7 +14954,7 @@ dependencies = [ [[package]] name = "zeitgeist-runtime" -version = "0.5.2" +version = "0.5.3" dependencies = [ "cfg-if", "common-runtime", @@ -15104,7 +15104,7 @@ dependencies = [ [[package]] name = "zrml-authorized" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-benchmarking", @@ -15122,7 +15122,7 @@ dependencies = [ [[package]] name = "zrml-court" -version = "0.5.2" +version = "0.5.3" dependencies = [ "arrayvec 0.7.4", "env_logger 0.10.2", @@ -15149,7 +15149,7 @@ dependencies = [ [[package]] name = "zrml-global-disputes" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-benchmarking", @@ -15171,7 +15171,7 @@ dependencies = [ [[package]] name = "zrml-hybrid-router" -version = "0.5.2" +version = "0.5.3" dependencies = [ "cfg-if", "env_logger 0.10.2", @@ -15210,7 +15210,7 @@ dependencies = [ [[package]] name = "zrml-liquidity-mining" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-benchmarking", @@ -15230,7 +15230,7 @@ dependencies = [ [[package]] name = "zrml-market-commons" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-support", @@ -15249,7 +15249,7 @@ dependencies = [ [[package]] name = "zrml-neo-swaps" -version = "0.5.2" +version = "0.5.3" dependencies = [ "cfg-if", "env_logger 0.10.2", @@ -15293,7 +15293,7 @@ dependencies = [ [[package]] name = "zrml-orderbook" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-benchmarking", @@ -15328,7 +15328,7 @@ dependencies = [ [[package]] name = "zrml-parimutuel" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-benchmarking", @@ -15351,7 +15351,7 @@ dependencies = [ [[package]] name = "zrml-prediction-markets" -version = "0.5.2" +version = "0.5.3" dependencies = [ "cfg-if", "env_logger 0.10.2", @@ -15403,7 +15403,7 @@ dependencies = [ [[package]] name = "zrml-prediction-markets-runtime-api" -version = "0.5.2" +version = "0.5.3" dependencies = [ "parity-scale-codec", "sp-api", @@ -15412,7 +15412,7 @@ dependencies = [ [[package]] name = "zrml-rikiddo" -version = "0.5.2" +version = "0.5.3" dependencies = [ "arbitrary", "cfg-if", @@ -15446,7 +15446,7 @@ dependencies = [ [[package]] name = "zrml-simple-disputes" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-benchmarking", @@ -15467,7 +15467,7 @@ dependencies = [ [[package]] name = "zrml-styx" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-benchmarking", @@ -15484,7 +15484,7 @@ dependencies = [ [[package]] name = "zrml-swaps" -version = "0.5.2" +version = "0.5.3" dependencies = [ "env_logger 0.10.2", "frame-benchmarking", @@ -15527,7 +15527,7 @@ dependencies = [ [[package]] name = "zrml-swaps-rpc" -version = "0.5.2" +version = "0.5.3" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -15540,7 +15540,7 @@ dependencies = [ [[package]] name = "zrml-swaps-runtime-api" -version = "0.5.2" +version = "0.5.3" dependencies = [ "parity-scale-codec", "sp-api", diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 903bd3b33..64b219445 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -2,4 +2,4 @@ authors = ["Zeitgeist PM "] edition.workspace = true name = "zeitgeist-macros" -version = "0.5.2" +version = "0.5.3" diff --git a/node/Cargo.toml b/node/Cargo.toml index 22907791d..2067dac5f 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -188,7 +188,7 @@ description = "An evolving blockchain for prediction markets and futarchy." edition.workspace = true homepage = "https://zeitgeist.pm" name = "zeitgeist-node" -version = "0.5.2" +version = "0.5.3" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 1b9efa03f..ae559d519 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -39,4 +39,4 @@ std = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zeitgeist-primitives" -version = "0.5.2" +version = "0.5.3" diff --git a/runtime/battery-station/Cargo.toml b/runtime/battery-station/Cargo.toml index 6db5c534f..9d12fc821 100644 --- a/runtime/battery-station/Cargo.toml +++ b/runtime/battery-station/Cargo.toml @@ -432,7 +432,7 @@ force-debug = ["sp-debug-derive/force-debug"] authors = ["Zeitgeist PM "] edition.workspace = true name = "battery-station-runtime" -version = "0.5.2" +version = "0.5.3" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 0f4fd47f0..19d5eb756 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -80,7 +80,7 @@ std = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "common-runtime" -version = "0.5.2" +version = "0.5.3" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime/zeitgeist/Cargo.toml b/runtime/zeitgeist/Cargo.toml index dbf7ce3f9..f02b27715 100644 --- a/runtime/zeitgeist/Cargo.toml +++ b/runtime/zeitgeist/Cargo.toml @@ -422,7 +422,7 @@ force-debug = ["sp-debug-derive/force-debug"] authors = ["Zeitgeist PM "] edition.workspace = true name = "zeitgeist-runtime" -version = "0.5.2" +version = "0.5.3" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/zrml/authorized/Cargo.toml b/zrml/authorized/Cargo.toml index aa6655625..4a2a3728d 100644 --- a/zrml/authorized/Cargo.toml +++ b/zrml/authorized/Cargo.toml @@ -39,4 +39,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-authorized" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/court/Cargo.toml b/zrml/court/Cargo.toml index cc79a5433..12ffa1d20 100644 --- a/zrml/court/Cargo.toml +++ b/zrml/court/Cargo.toml @@ -49,4 +49,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-court" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/global-disputes/Cargo.toml b/zrml/global-disputes/Cargo.toml index b828dc30e..5dff6bfb8 100644 --- a/zrml/global-disputes/Cargo.toml +++ b/zrml/global-disputes/Cargo.toml @@ -47,4 +47,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-global-disputes" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/hybrid-router/Cargo.toml b/zrml/hybrid-router/Cargo.toml index 6ff10558e..38899d9cf 100644 --- a/zrml/hybrid-router/Cargo.toml +++ b/zrml/hybrid-router/Cargo.toml @@ -94,4 +94,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-hybrid-router" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/liquidity-mining/Cargo.toml b/zrml/liquidity-mining/Cargo.toml index 9f6886add..e0d684b27 100644 --- a/zrml/liquidity-mining/Cargo.toml +++ b/zrml/liquidity-mining/Cargo.toml @@ -42,4 +42,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-liquidity-mining" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/market-commons/Cargo.toml b/zrml/market-commons/Cargo.toml index 5ce9fd31d..20101e801 100644 --- a/zrml/market-commons/Cargo.toml +++ b/zrml/market-commons/Cargo.toml @@ -34,4 +34,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-market-commons" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/neo-swaps/Cargo.toml b/zrml/neo-swaps/Cargo.toml index f6873dbf1..b4c3eca3b 100644 --- a/zrml/neo-swaps/Cargo.toml +++ b/zrml/neo-swaps/Cargo.toml @@ -103,4 +103,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-neo-swaps" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/orderbook/Cargo.toml b/zrml/orderbook/Cargo.toml index f8d5e482c..3c6855bb5 100644 --- a/zrml/orderbook/Cargo.toml +++ b/zrml/orderbook/Cargo.toml @@ -57,4 +57,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-orderbook" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/parimutuel/Cargo.toml b/zrml/parimutuel/Cargo.toml index e05998b66..bdc45496f 100644 --- a/zrml/parimutuel/Cargo.toml +++ b/zrml/parimutuel/Cargo.toml @@ -46,4 +46,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-parimutuel" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/prediction-markets/Cargo.toml b/zrml/prediction-markets/Cargo.toml index ae4574460..bbbf67b87 100644 --- a/zrml/prediction-markets/Cargo.toml +++ b/zrml/prediction-markets/Cargo.toml @@ -96,4 +96,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-prediction-markets" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/prediction-markets/runtime-api/Cargo.toml b/zrml/prediction-markets/runtime-api/Cargo.toml index 4e914db2e..2b9698de4 100644 --- a/zrml/prediction-markets/runtime-api/Cargo.toml +++ b/zrml/prediction-markets/runtime-api/Cargo.toml @@ -15,4 +15,4 @@ std = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-prediction-markets-runtime-api" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/rikiddo/Cargo.toml b/zrml/rikiddo/Cargo.toml index f6187b517..49f497771 100644 --- a/zrml/rikiddo/Cargo.toml +++ b/zrml/rikiddo/Cargo.toml @@ -44,4 +44,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-rikiddo" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/simple-disputes/Cargo.toml b/zrml/simple-disputes/Cargo.toml index 271a019f4..2d3ca8a22 100644 --- a/zrml/simple-disputes/Cargo.toml +++ b/zrml/simple-disputes/Cargo.toml @@ -42,4 +42,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-simple-disputes" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/styx/Cargo.toml b/zrml/styx/Cargo.toml index f2c45f4c2..524904d2e 100644 --- a/zrml/styx/Cargo.toml +++ b/zrml/styx/Cargo.toml @@ -37,4 +37,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-styx" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/swaps/Cargo.toml b/zrml/swaps/Cargo.toml index d8931c188..be3e44330 100644 --- a/zrml/swaps/Cargo.toml +++ b/zrml/swaps/Cargo.toml @@ -65,4 +65,4 @@ try-runtime = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-swaps" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/swaps/rpc/Cargo.toml b/zrml/swaps/rpc/Cargo.toml index ec05f2a59..ca1ea8299 100644 --- a/zrml/swaps/rpc/Cargo.toml +++ b/zrml/swaps/rpc/Cargo.toml @@ -11,4 +11,4 @@ zrml-swaps-runtime-api = { workspace = true, features = ["default"] } authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-swaps-rpc" -version = "0.5.2" +version = "0.5.3" diff --git a/zrml/swaps/runtime-api/Cargo.toml b/zrml/swaps/runtime-api/Cargo.toml index 2e102db34..93589b717 100644 --- a/zrml/swaps/runtime-api/Cargo.toml +++ b/zrml/swaps/runtime-api/Cargo.toml @@ -18,4 +18,4 @@ std = [ authors = ["Zeitgeist PM "] edition.workspace = true name = "zrml-swaps-runtime-api" -version = "0.5.2" +version = "0.5.3" From 13f736cb881a02814bf19f98f83156884fe7da37 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Tue, 23 Jul 2024 14:55:57 +0200 Subject: [PATCH 4/7] Fix Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index feb781af6..c4b4241c1 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ try-runtime-upgrade-zeitgeist: @$(MAKE) TRYRUNTIME_URL="wss://zeitgeist-rpc.dwellir.com:443" \ RUNTIME_PATH="./target/release/wbuild/zeitgeist-runtime/zeitgeist_runtime.compact.compressed.wasm" \ -- \ - -execute--try-runtime + --execute-try-runtime build: SKIP_WASM_BUILD= cargo build From 80151eda2a173f411eb61d5963532ae3698f5fb8 Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Wed, 24 Jul 2024 09:38:26 +0200 Subject: [PATCH 5/7] Change endpoint of integration tests --- integration-tests/configs/zeitgeist.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/integration-tests/configs/zeitgeist.yml b/integration-tests/configs/zeitgeist.yml index db262ed48..fd886a6e6 100644 --- a/integration-tests/configs/zeitgeist.yml +++ b/integration-tests/configs/zeitgeist.yml @@ -1,6 +1,4 @@ -# endpoint: wss://main.rpc.zeitgeist.pm/ws -endpoint: wss://zeitgeist-rpc.dwellir.com -# endpoint: wss://zeitgeist.api.onfinality.io/public-ws +endpoint: wss://main.rpc.zeitgeist.pm/ws mock-signature-host: true db: ./tmp/ztg_db_mba.sqlite # wasm-override: zeitgeist-runtime.compact.compressed.wasm @@ -26,4 +24,4 @@ import-storage: Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY] AuthorFilter: EligibleRatio: 100 - EligibleCount: 100 \ No newline at end of file + EligibleCount: 100 From 5df4a1c4ccdae19d49aedfe0c868a59d8f67207e Mon Sep 17 00:00:00 2001 From: Malte Kliemann Date: Wed, 24 Jul 2024 09:38:40 +0200 Subject: [PATCH 6/7] Fix copyright notices --- zrml/swaps/fuzz/pool_join.rs | 1 + zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs | 1 + zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs | 1 + zrml/swaps/fuzz/swap_exact_amount_in.rs | 1 + zrml/swaps/fuzz/swap_exact_amount_out.rs | 1 + 5 files changed, 5 insertions(+) diff --git a/zrml/swaps/fuzz/pool_join.rs b/zrml/swaps/fuzz/pool_join.rs index 27023affa..e3153bf58 100644 --- a/zrml/swaps/fuzz/pool_join.rs +++ b/zrml/swaps/fuzz/pool_join.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs b/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs index 677b5a5a6..a95d8c6db 100644 --- a/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs +++ b/zrml/swaps/fuzz/pool_join_with_exact_asset_amount.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs b/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs index a1574b749..a06915703 100644 --- a/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs +++ b/zrml/swaps/fuzz/pool_join_with_exact_pool_amount.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/fuzz/swap_exact_amount_in.rs b/zrml/swaps/fuzz/swap_exact_amount_in.rs index 60a594cc4..1771c7b14 100644 --- a/zrml/swaps/fuzz/swap_exact_amount_in.rs +++ b/zrml/swaps/fuzz/swap_exact_amount_in.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. diff --git a/zrml/swaps/fuzz/swap_exact_amount_out.rs b/zrml/swaps/fuzz/swap_exact_amount_out.rs index 05ca45474..b254fe8e7 100644 --- a/zrml/swaps/fuzz/swap_exact_amount_out.rs +++ b/zrml/swaps/fuzz/swap_exact_amount_out.rs @@ -1,3 +1,4 @@ +// Copyright 2024 Forecasting Technologies LTD. // Copyright 2021-2022 Zeitgeist PM LLC. // // This file is part of Zeitgeist. From 12fc56c3b6064a7430412730d08238ec037aa928 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 25 Jul 2024 10:10:12 +0000 Subject: [PATCH 7/7] Run benchmarks --- .../src/weights/cumulus_pallet_xcmp_queue.rs | 28 +- runtime/common/src/weights/frame_system.rs | 91 +- runtime/common/src/weights/orml_currencies.rs | 82 +- runtime/common/src/weights/orml_tokens.rs | 88 +- .../src/weights/pallet_author_inherent.rs | 36 +- .../src/weights/pallet_author_mapping.rs | 98 +- .../src/weights/pallet_author_slot_filter.rs | 12 +- runtime/common/src/weights/pallet_balances.rs | 118 +- runtime/common/src/weights/pallet_bounties.rs | 202 +-- .../common/src/weights/pallet_collective.rs | 340 ++-- .../common/src/weights/pallet_contracts.rs | 1370 ++++++++-------- .../common/src/weights/pallet_democracy.rs | 660 ++++---- runtime/common/src/weights/pallet_identity.rs | 354 ++--- .../common/src/weights/pallet_membership.rs | 210 +-- runtime/common/src/weights/pallet_multisig.rs | 124 +- .../src/weights/pallet_parachain_staking.rs | 1374 +++++++++-------- runtime/common/src/weights/pallet_preimage.rs | 162 +- runtime/common/src/weights/pallet_proxy.rs | 198 +-- .../common/src/weights/pallet_scheduler.rs | 160 +- .../common/src/weights/pallet_timestamp.rs | 24 +- runtime/common/src/weights/pallet_treasury.rs | 128 +- runtime/common/src/weights/pallet_utility.rs | 36 +- runtime/common/src/weights/pallet_vesting.rs | 252 +-- zrml/authorized/src/weights.rs | 88 +- zrml/court/src/weights.rs | 586 +++---- zrml/global-disputes/src/weights.rs | 226 +-- zrml/hybrid-router/src/weights.rs | 124 +- zrml/liquidity-mining/src/weights.rs | 12 +- zrml/neo-swaps/src/weights.rs | 246 +-- zrml/orderbook/src/weights.rs | 74 +- zrml/parimutuel/src/weights.rs | 76 +- zrml/prediction-markets/src/weights.rs | 1051 ++++++------- zrml/styx/src/weights.rs | 26 +- zrml/swaps/src/weights.rs | 272 ++-- 34 files changed, 4472 insertions(+), 4456 deletions(-) diff --git a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs index fd9f8104c..5c21871e7 100644 --- a/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/runtime/common/src/weights/cumulus_pallet_xcmp_queue.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for cumulus_pallet_xcmp_queue //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,25 +52,25 @@ use frame_support::{ /// Weight functions for cumulus_pallet_xcmp_queue (automatically generated) pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::weights::WeightInfo for WeightInfo { - /// Storage: XcmpQueue QueueConfig (r:1 w:1) - /// Proof Skipped: XcmpQueue QueueConfig (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `XcmpQueue::QueueConfig` (r:1 w:1) + /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_config_with_u32() -> Weight { // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `670` - // Minimum execution time: 8_140 nanoseconds. - Weight::from_parts(9_770_000, 670) + // Measured: `142` + // Estimated: `1627` + // Minimum execution time: 11_060 nanoseconds. + Weight::from_parts(11_850_000, 1627) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: XcmpQueue QueueConfig (r:1 w:1) - /// Proof Skipped: XcmpQueue QueueConfig (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `XcmpQueue::QueueConfig` (r:1 w:1) + /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_config_with_weight() -> Weight { // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `670` - // Minimum execution time: 9_680 nanoseconds. - Weight::from_parts(10_780_000, 670) + // Measured: `142` + // Estimated: `1627` + // Minimum execution time: 10_990 nanoseconds. + Weight::from_parts(11_590_000, 1627) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs index 743242b1f..9745d05a4 100644 --- a/runtime/common/src/weights/frame_system.rs +++ b/runtime/common/src/weights/frame_system.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for frame_system //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -57,84 +57,85 @@ impl frame_system::weights::WeightInfo for WeightInfo Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_910 nanoseconds. - Weight::from_parts(13_250_000, 0) - // Standard Error: 1 - .saturating_add(Weight::from_parts(2_749, 0).saturating_mul(b.into())) + // Minimum execution time: 14_690 nanoseconds. + Weight::from_parts(15_620_000, 0) + // Standard Error: 3 + .saturating_add(Weight::from_parts(2_207, 0).saturating_mul(b.into())) } - /// Storage: System Digest (r:1 w:1) - /// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: unknown `0x3a686561707061676573` (r:0 w:1) - /// Proof Skipped: unknown `0x3a686561707061676573` (r:0 w:1) + /// Storage: `System::Digest` (r:1 w:1) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) + /// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) fn set_heap_pages() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `495` - // Minimum execution time: 7_800 nanoseconds. - Weight::from_parts(8_620_000, 495) + // Estimated: `1485` + // Minimum execution time: 9_360 nanoseconds. + Weight::from_parts(10_110_000, 1485) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: System Digest (r:1 w:1) - /// Proof Skipped: System Digest (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: unknown `0x3a636f6465` (r:0 w:1) - /// Proof Skipped: unknown `0x3a636f6465` (r:0 w:1) + /// Storage: `System::Digest` (r:1 w:1) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: UNKNOWN KEY `0x3a636f6465` (r:0 w:1) + /// Proof: UNKNOWN KEY `0x3a636f6465` (r:0 w:1) fn set_code() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `1485` - // Minimum execution time: 84_000_503_000 picoseconds. - Weight::from_parts(87_586_619_000, 1485) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Minimum execution time: 134_361_003 nanoseconds. + Weight::from_parts(137_733_640_000, 1485) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured) + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[0, 1000]`. fn set_storage(i: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_320 nanoseconds. - Weight::from_parts(3_950_000, 0) - // Standard Error: 4_796 - .saturating_add(Weight::from_parts(1_328_378, 0).saturating_mul(i.into())) + // Minimum execution time: 4_480 nanoseconds. + Weight::from_parts(4_680_000, 0) + // Standard Error: 6_558 + .saturating_add(Weight::from_parts(1_695_684, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured) + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `i` is `[0, 1000]`. fn kill_storage(i: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_720 nanoseconds. - Weight::from_parts(3_950_000, 0) - // Standard Error: 4_270 - .saturating_add(Weight::from_parts(1_057_635, 0).saturating_mul(i.into())) + // Minimum execution time: 5_440 nanoseconds. + Weight::from_parts(5_580_000, 0) + // Standard Error: 3_056 + .saturating_add(Weight::from_parts(1_212_696, 0).saturating_mul(i.into())) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) } - /// Storage: Skipped Metadata (r:0 w:0) - /// Proof Skipped: Skipped Metadata (max_values: None, max_size: None, mode: Measured) + /// Storage: `Skipped::Metadata` (r:0 w:0) + /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `p` is `[0, 1000]`. fn kill_prefix(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `46 + p * (69 ±0)` - // Estimated: `51 + p * (70 ±0)` - // Minimum execution time: 8_230 nanoseconds. - Weight::from_parts(8_620_000, 51) - // Standard Error: 8_739 - .saturating_add(Weight::from_parts(2_466_850, 0).saturating_mul(p.into())) + // Measured: `48 + p * (69 ±0)` + // Estimated: `52 + p * (70 ±0)` + // Minimum execution time: 9_840 nanoseconds. + Weight::from_parts(10_450_000, 52) + // Standard Error: 8_838 + .saturating_add(Weight::from_parts(2_581_563, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) } diff --git a/runtime/common/src/weights/orml_currencies.rs b/runtime/common/src/weights/orml_currencies.rs index 6e24034a0..c835e0970 100644 --- a/runtime/common/src/weights/orml_currencies.rs +++ b/runtime/common/src/weights/orml_currencies.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for orml_currencies //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -49,68 +49,64 @@ use frame_support::{traits::Get, weights::Weight}; /// Weight functions for orml_currencies (automatically generated) pub struct WeightInfo(PhantomData); impl orml_currencies::WeightInfo for WeightInfo { - /// Storage: MarketAssets Asset (r:1 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn transfer_non_native_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `1862` - // Estimated: `10503` - // Minimum execution time: 87_580 nanoseconds. - Weight::from_parts(106_781_000, 10503) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `1690` + // Estimated: `6186` + // Minimum execution time: 100_000 nanoseconds. + Weight::from_parts(101_700_000, 6186) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn transfer_native_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `1461` - // Estimated: `2607` - // Minimum execution time: 66_860 nanoseconds. - Weight::from_parts(81_550_000, 2607) + // Measured: `1545` + // Estimated: `3597` + // Minimum execution time: 155_790 nanoseconds. + Weight::from_parts(158_660_000, 3597) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: MarketAssets Asset (r:1 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn update_balance_non_native_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `1470` - // Estimated: `10423` - // Minimum execution time: 62_900 nanoseconds. - Weight::from_parts(76_321_000, 10423) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `1361` + // Estimated: `3597` + // Minimum execution time: 68_300 nanoseconds. + Weight::from_parts(70_270_000, 3597) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn update_balance_native_currency_creating() -> Weight { // Proof Size summary in bytes: // Measured: `1401` - // Estimated: `2607` - // Minimum execution time: 56_990 nanoseconds. - Weight::from_parts(69_680_000, 2607) + // Estimated: `3597` + // Minimum execution time: 73_931 nanoseconds. + Weight::from_parts(86_350_000, 3597) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn update_balance_native_currency_killing() -> Weight { // Proof Size summary in bytes: - // Measured: `1525` - // Estimated: `2607` - // Minimum execution time: 65_630 nanoseconds. - Weight::from_parts(66_850_000, 2607) + // Measured: `1493` + // Estimated: `3597` + // Minimum execution time: 73_620 nanoseconds. + Weight::from_parts(86_350_000, 3597) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/orml_tokens.rs b/runtime/common/src/weights/orml_tokens.rs index 8360b5cb7..55845e706 100644 --- a/runtime/common/src/weights/orml_tokens.rs +++ b/runtime/common/src/weights/orml_tokens.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for orml_tokens //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -49,70 +49,70 @@ use frame_support::{traits::Get, weights::Weight}; /// Weight functions for orml_tokens (automatically generated) pub struct WeightInfo(PhantomData); impl orml_tokens::WeightInfo for WeightInfo { - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1772` - // Estimated: `7803` - // Minimum execution time: 81_170 nanoseconds. - Weight::from_parts(100_570_000, 7803) + // Measured: `1690` + // Estimated: `6186` + // Minimum execution time: 99_750 nanoseconds. + Weight::from_parts(103_250_000, 6186) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn transfer_all() -> Weight { // Proof Size summary in bytes: - // Measured: `1772` - // Estimated: `7803` - // Minimum execution time: 88_531 nanoseconds. - Weight::from_parts(103_920_000, 7803) + // Measured: `1690` + // Estimated: `6186` + // Minimum execution time: 106_030 nanoseconds. + Weight::from_parts(106_950_000, 6186) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: - // Measured: `1596` - // Estimated: `7803` - // Minimum execution time: 70_730 nanoseconds. - Weight::from_parts(80_880_000, 7803) + // Measured: `1546` + // Estimated: `6186` + // Minimum execution time: 81_751 nanoseconds. + Weight::from_parts(97_171_000, 6186) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `1772` - // Estimated: `10410` - // Minimum execution time: 74_610 nanoseconds. - Weight::from_parts(75_690_000, 10410) + // Measured: `1690` + // Estimated: `6204` + // Minimum execution time: 91_060 nanoseconds. + Weight::from_parts(92_591_000, 6204) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn set_balance() -> Weight { // Proof Size summary in bytes: - // Measured: `1394` - // Estimated: `7723` - // Minimum execution time: 55_800 nanoseconds. - Weight::from_parts(69_101_000, 7723) + // Measured: `1361` + // Estimated: `3597` + // Minimum execution time: 68_000 nanoseconds. + Weight::from_parts(69_950_000, 3597) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_author_inherent.rs b/runtime/common/src/weights/pallet_author_inherent.rs index 8b6684d94..5f6f094e1 100644 --- a/runtime/common/src/weights/pallet_author_inherent.rs +++ b/runtime/common/src/weights/pallet_author_inherent.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_author_inherent //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,24 +52,24 @@ use frame_support::{ /// Weight functions for pallet_author_inherent (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_author_inherent::weights::WeightInfo for WeightInfo { - /// Storage: ParachainSystem ValidationData (r:1 w:0) - /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AuthorInherent HighestSlotSeen (r:1 w:1) - /// Proof: AuthorInherent HighestSlotSeen (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: AuthorInherent Author (r:1 w:0) - /// Proof: AuthorInherent Author (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: ParachainStaking SelectedCandidates (r:1 w:0) - /// Proof Skipped: ParachainStaking SelectedCandidates (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AuthorFilter EligibleCount (r:1 w:0) - /// Proof Skipped: AuthorFilter EligibleCount (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) - /// Proof: RandomnessCollectiveFlip RandomMaterial (max_values: Some(1), max_size: Some(2594), added: 3089, mode: MaxEncodedLen) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AuthorInherent::HighestSlotSeen` (r:1 w:1) + /// Proof: `AuthorInherent::HighestSlotSeen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `AuthorInherent::Author` (r:1 w:0) + /// Proof: `AuthorInherent::Author` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::SelectedCandidates` (r:1 w:0) + /// Proof: `ParachainStaking::SelectedCandidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AuthorFilter::EligibleCount` (r:1 w:0) + /// Proof: `AuthorFilter::EligibleCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0) + /// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `MaxEncodedLen`) fn kick_off_authorship_validation() -> Weight { // Proof Size summary in bytes: - // Measured: `605` - // Estimated: `7415` - // Minimum execution time: 33_600 nanoseconds. - Weight::from_parts(39_900_000, 7415) + // Measured: `508` + // Estimated: `4079` + // Minimum execution time: 43_860 nanoseconds. + Weight::from_parts(45_200_000, 4079) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_author_mapping.rs b/runtime/common/src/weights/pallet_author_mapping.rs index 58377ae98..4a0a28a6c 100644 --- a/runtime/common/src/weights/pallet_author_mapping.rs +++ b/runtime/common/src/weights/pallet_author_mapping.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_author_mapping //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,74 +52,76 @@ use frame_support::{ /// Weight functions for pallet_author_mapping (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_author_mapping::weights::WeightInfo for WeightInfo { - /// Storage: AuthorMapping MappingWithDeposit (r:1 w:1) - /// Proof Skipped: AuthorMapping MappingWithDeposit (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: AuthorMapping NimbusLookup (r:0 w:1) - /// Proof Skipped: AuthorMapping NimbusLookup (max_values: None, max_size: None, mode: Measured) + /// Storage: `AuthorMapping::MappingWithDeposit` (r:1 w:1) + /// Proof: `AuthorMapping::MappingWithDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `AuthorMapping::NimbusLookup` (r:0 w:1) + /// Proof: `AuthorMapping::NimbusLookup` (`max_values`: None, `max_size`: None, mode: `Measured`) fn add_association() -> Weight { // Proof Size summary in bytes: - // Measured: `495` - // Estimated: `6072` - // Minimum execution time: 40_210 nanoseconds. - Weight::from_parts(48_940_000, 6072) + // Measured: `430` + // Estimated: `3895` + // Minimum execution time: 60_590 nanoseconds. + Weight::from_parts(61_920_000, 3895) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: AuthorMapping MappingWithDeposit (r:2 w:2) - /// Proof Skipped: AuthorMapping MappingWithDeposit (max_values: None, max_size: None, mode: Measured) - /// Storage: AuthorMapping NimbusLookup (r:0 w:1) - /// Proof Skipped: AuthorMapping NimbusLookup (max_values: None, max_size: None, mode: Measured) + /// Storage: `AuthorMapping::MappingWithDeposit` (r:2 w:2) + /// Proof: `AuthorMapping::MappingWithDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AuthorMapping::NimbusLookup` (r:0 w:1) + /// Proof: `AuthorMapping::NimbusLookup` (`max_values`: None, `max_size`: None, mode: `Measured`) fn update_association() -> Weight { // Proof Size summary in bytes: - // Measured: `440` - // Estimated: `5830` - // Minimum execution time: 30_800 nanoseconds. - Weight::from_parts(37_970_000, 5830) + // Measured: `375` + // Estimated: `6315` + // Minimum execution time: 40_210 nanoseconds. + Weight::from_parts(40_880_000, 6315) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: AuthorMapping MappingWithDeposit (r:1 w:1) - /// Proof Skipped: AuthorMapping MappingWithDeposit (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: AuthorMapping NimbusLookup (r:0 w:1) - /// Proof Skipped: AuthorMapping NimbusLookup (max_values: None, max_size: None, mode: Measured) + /// Storage: `AuthorMapping::MappingWithDeposit` (r:1 w:1) + /// Proof: `AuthorMapping::MappingWithDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `AuthorMapping::NimbusLookup` (r:0 w:1) + /// Proof: `AuthorMapping::NimbusLookup` (`max_values`: None, `max_size`: None, mode: `Measured`) fn clear_association() -> Weight { // Proof Size summary in bytes: - // Measured: `616` - // Estimated: `6314` - // Minimum execution time: 51_150 nanoseconds. - Weight::from_parts(52_690_000, 6314) + // Measured: `519` + // Estimated: `3984` + // Minimum execution time: 62_841 nanoseconds. + Weight::from_parts(63_960_000, 3984) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: AuthorMapping NimbusLookup (r:1 w:1) - /// Proof Skipped: AuthorMapping NimbusLookup (max_values: None, max_size: None, mode: Measured) - /// Storage: AuthorMapping MappingWithDeposit (r:1 w:1) - /// Proof Skipped: AuthorMapping MappingWithDeposit (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `AuthorMapping::NimbusLookup` (r:1 w:1) + /// Proof: `AuthorMapping::NimbusLookup` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AuthorMapping::MappingWithDeposit` (r:1 w:1) + /// Proof: `AuthorMapping::MappingWithDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn remove_keys() -> Weight { // Proof Size summary in bytes: - // Measured: `722` - // Estimated: `9001` - // Minimum execution time: 48_110 nanoseconds. - Weight::from_parts(58_780_000, 9001) + // Measured: `625` + // Estimated: `4090` + // Minimum execution time: 74_860 nanoseconds. + Weight::from_parts(86_720_000, 4090) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: AuthorMapping NimbusLookup (r:1 w:1) - /// Proof Skipped: AuthorMapping NimbusLookup (max_values: None, max_size: None, mode: Measured) - /// Storage: AuthorMapping MappingWithDeposit (r:2 w:2) - /// Proof Skipped: AuthorMapping MappingWithDeposit (max_values: None, max_size: None, mode: Measured) + /// Storage: `AuthorMapping::NimbusLookup` (r:1 w:1) + /// Proof: `AuthorMapping::NimbusLookup` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AuthorMapping::MappingWithDeposit` (r:1 w:1) + /// Proof: `AuthorMapping::MappingWithDeposit` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn set_keys() -> Weight { // Proof Size summary in bytes: - // Measured: `546` - // Estimated: `8517` - // Minimum execution time: 36_950 nanoseconds. - Weight::from_parts(40_320_000, 8517) + // Measured: `498` + // Estimated: `3963` + // Minimum execution time: 65_740 nanoseconds. + Weight::from_parts(67_220_000, 3963) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/common/src/weights/pallet_author_slot_filter.rs b/runtime/common/src/weights/pallet_author_slot_filter.rs index 5ebfc2b03..fd82b90e0 100644 --- a/runtime/common/src/weights/pallet_author_slot_filter.rs +++ b/runtime/common/src/weights/pallet_author_slot_filter.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_author_slot_filter //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,13 +52,13 @@ use frame_support::{ /// Weight functions for pallet_author_slot_filter (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_author_slot_filter::weights::WeightInfo for WeightInfo { - /// Storage: AuthorFilter EligibleCount (r:0 w:1) - /// Proof Skipped: AuthorFilter EligibleCount (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AuthorFilter::EligibleCount` (r:0 w:1) + /// Proof: `AuthorFilter::EligibleCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_eligible() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_500 nanoseconds. - Weight::from_parts(14_590_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 14_051 nanoseconds. + Weight::from_parts(17_150_000, 0).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_balances.rs b/runtime/common/src/weights/pallet_balances.rs index 012c55b91..bc1998a79 100644 --- a/runtime/common/src/weights/pallet_balances.rs +++ b/runtime/common/src/weights/pallet_balances.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_balances //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,96 +52,96 @@ use frame_support::{ /// Weight functions for pallet_balances (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_balances::weights::WeightInfo for WeightInfo { - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn transfer_allow_death() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 58_474_000 picoseconds. - Weight::from_parts(59_117_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `144` + // Estimated: `6204` + // Minimum execution time: 124_529 nanoseconds. + Weight::from_parts(152_609_000, 6204) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn transfer_keep_alive() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 44_629_000 picoseconds. - Weight::from_parts(45_798_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3597` + // Minimum execution time: 78_350 nanoseconds. + Weight::from_parts(79_859_000, 3597) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn force_set_balance_creating() -> Weight { // Proof Size summary in bytes: - // Measured: `174` - // Estimated: `3593` - // Minimum execution time: 16_483_000 picoseconds. - Weight::from_parts(16_939_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `178` + // Estimated: `3597` + // Minimum execution time: 32_330 nanoseconds. + Weight::from_parts(34_300_000, 3597) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn force_set_balance_killing() -> Weight { // Proof Size summary in bytes: - // Measured: `174` - // Estimated: `3593` - // Minimum execution time: 24_638_000 picoseconds. - Weight::from_parts(25_487_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `178` + // Estimated: `3597` + // Minimum execution time: 54_749 nanoseconds. + Weight::from_parts(55_980_000, 3597) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn force_transfer() -> Weight { // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `6196` - // Minimum execution time: 60_041_000 picoseconds. - Weight::from_parts(63_365_000, 6196) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `251` + // Estimated: `8811` + // Minimum execution time: 157_759 nanoseconds. + Weight::from_parts(159_229_000, 8811) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn transfer_all() -> Weight { // Proof Size summary in bytes: // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 54_445_000 picoseconds. - Weight::from_parts(55_623_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Estimated: `3597` + // Minimum execution time: 95_500 nanoseconds. + Weight::from_parts(117_190_000, 3597) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn force_unreserve() -> Weight { // Proof Size summary in bytes: - // Measured: `174` - // Estimated: `3593` - // Minimum execution time: 19_309_000 picoseconds. - Weight::from_parts(19_953_000, 3593) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `178` + // Estimated: `3597` + // Minimum execution time: 38_889 nanoseconds. + Weight::from_parts(39_590_000, 3597) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `System::Account` (r:999 w:999) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `u` is `[1, 1000]`. fn upgrade_accounts(u: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + u * (135 ±0)` - // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 19_362_000 picoseconds. - Weight::from_parts(19_612_000, 990) - // Standard Error: 13_108 - .saturating_add(Weight::from_parts(16_444_591, 0).saturating_mul(u.into())) + // Measured: `0 + u * (139 ±0)` + // Estimated: `990 + u * (2607 ±0)` + // Minimum execution time: 37_620 nanoseconds. + Weight::from_parts(38_079_000, 990) + // Standard Error: 43_476 + .saturating_add(Weight::from_parts(30_483_379, 0).saturating_mul(u.into())) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) - .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) + .saturating_add(Weight::from_parts(0, 2607).saturating_mul(u.into())) } } diff --git a/runtime/common/src/weights/pallet_bounties.rs b/runtime/common/src/weights/pallet_bounties.rs index 6e35f994f..2bed73d9b 100644 --- a/runtime/common/src/weights/pallet_bounties.rs +++ b/runtime/common/src/weights/pallet_bounties.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_bounties //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,162 +52,162 @@ use frame_support::{ /// Weight functions for pallet_bounties (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_bounties::weights::WeightInfo for WeightInfo { - /// Storage: Bounties BountyCount (r:1 w:1) - /// Proof: Bounties BountyCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Bounties BountyDescriptions (r:0 w:1) - /// Proof: Bounties BountyDescriptions (max_values: None, max_size: Some(8206), added: 10681, mode: MaxEncodedLen) - /// Storage: Bounties Bounties (r:0 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) + /// Storage: `Bounties::BountyCount` (r:1 w:1) + /// Proof: `Bounties::BountyCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyDescriptions` (r:0 w:1) + /// Proof: `Bounties::BountyDescriptions` (`max_values`: None, `max_size`: Some(8206), added: 10681, mode: `MaxEncodedLen`) + /// Storage: `Bounties::Bounties` (r:0 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) /// The range of component `d` is `[0, 8192]`. fn propose_bounty(d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `141` - // Estimated: `3106` - // Minimum execution time: 38_100 nanoseconds. - Weight::from_parts(46_943_073, 3106) - // Standard Error: 18 - .saturating_add(Weight::from_parts(1_743, 0).saturating_mul(d.into())) + // Measured: `109` + // Estimated: `3597` + // Minimum execution time: 48_599 nanoseconds. + Weight::from_parts(59_501_858, 3597) + // Standard Error: 84 + .saturating_add(Weight::from_parts(1_905, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) - /// Storage: Bounties BountyApprovals (r:1 w:1) - /// Proof: Bounties BountyApprovals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyApprovals` (r:1 w:1) + /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) fn approve_bounty() -> Weight { // Proof Size summary in bytes: - // Measured: `229` - // Estimated: `3553` - // Minimum execution time: 21_700 nanoseconds. - Weight::from_parts(22_100_000, 3553) + // Measured: `197` + // Estimated: `3646` + // Minimum execution time: 22_950 nanoseconds. + Weight::from_parts(23_720_000, 3646) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) fn propose_curator() -> Weight { // Proof Size summary in bytes: - // Measured: `249` - // Estimated: `2656` - // Minimum execution time: 19_270 nanoseconds. - Weight::from_parts(20_370_000, 2656) + // Measured: `217` + // Estimated: `3646` + // Minimum execution time: 19_669 nanoseconds. + Weight::from_parts(20_580_000, 3646) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn unassign_curator() -> Weight { // Proof Size summary in bytes: - // Measured: `641` - // Estimated: `7870` - // Minimum execution time: 67_520 nanoseconds. - Weight::from_parts(69_530_000, 7870) + // Measured: `545` + // Estimated: `6204` + // Minimum execution time: 82_570 nanoseconds. + Weight::from_parts(96_369_000, 6204) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn accept_curator() -> Weight { // Proof Size summary in bytes: - // Measured: `457` - // Estimated: `5263` - // Minimum execution time: 37_670 nanoseconds. - Weight::from_parts(43_020_000, 5263) + // Measured: `393` + // Estimated: `3646` + // Minimum execution time: 50_850 nanoseconds. + Weight::from_parts(52_270_000, 3646) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) fn award_bounty() -> Weight { // Proof Size summary in bytes: - // Measured: `289` - // Estimated: `2656` - // Minimum execution time: 27_430 nanoseconds. - Weight::from_parts(30_770_000, 2656) + // Measured: `257` + // Estimated: `3646` + // Minimum execution time: 30_299 nanoseconds. + Weight::from_parts(31_340_000, 3646) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) - /// Storage: System Account (r:3 w:3) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Bounties BountyDescriptions (r:0 w:1) - /// Proof: Bounties BountyDescriptions (max_values: None, max_size: Some(8206), added: 10681, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyDescriptions` (r:0 w:1) + /// Proof: `Bounties::BountyDescriptions` (`max_values`: None, `max_size`: Some(8206), added: 10681, mode: `MaxEncodedLen`) fn claim_bounty() -> Weight { // Proof Size summary in bytes: - // Measured: `674` - // Estimated: `10477` - // Minimum execution time: 117_100 nanoseconds. - Weight::from_parts(121_650_000, 10477) + // Measured: `578` + // Estimated: `8811` + // Minimum execution time: 203_930 nanoseconds. + Weight::from_parts(209_029_000, 8811) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Bounties BountyDescriptions (r:0 w:1) - /// Proof: Bounties BountyDescriptions (max_values: None, max_size: Some(8206), added: 10681, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyDescriptions` (r:0 w:1) + /// Proof: `Bounties::BountyDescriptions` (`max_values`: None, `max_size`: Some(8206), added: 10681, mode: `MaxEncodedLen`) fn close_bounty_proposed() -> Weight { // Proof Size summary in bytes: - // Measured: `541` - // Estimated: `7870` - // Minimum execution time: 64_760 nanoseconds. - Weight::from_parts(71_110_000, 7870) + // Measured: `445` + // Estimated: `6204` + // Minimum execution time: 85_390 nanoseconds. + Weight::from_parts(86_110_000, 6204) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) - /// Storage: System Account (r:3 w:3) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Bounties BountyDescriptions (r:0 w:1) - /// Proof: Bounties BountyDescriptions (max_values: None, max_size: Some(8206), added: 10681, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyDescriptions` (r:0 w:1) + /// Proof: `Bounties::BountyDescriptions` (`max_values`: None, `max_size`: Some(8206), added: 10681, mode: `MaxEncodedLen`) fn close_bounty_active() -> Weight { // Proof Size summary in bytes: - // Measured: `818` - // Estimated: `10477` - // Minimum execution time: 90_500 nanoseconds. - Weight::from_parts(92_640_000, 10477) + // Measured: `690` + // Estimated: `8811` + // Minimum execution time: 142_360 nanoseconds. + Weight::from_parts(169_050_000, 8811) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(5)) } - /// Storage: Bounties Bounties (r:1 w:1) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) + /// Storage: `Bounties::Bounties` (r:1 w:1) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) fn extend_bounty_expiry() -> Weight { // Proof Size summary in bytes: - // Measured: `289` - // Estimated: `2656` - // Minimum execution time: 28_930 nanoseconds. - Weight::from_parts(30_041_000, 2656) + // Measured: `257` + // Estimated: `3646` + // Minimum execution time: 34_890 nanoseconds. + Weight::from_parts(37_200_000, 3646) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Bounties BountyApprovals (r:1 w:1) - /// Proof: Bounties BountyApprovals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// Storage: Bounties Bounties (r:100 w:100) - /// Proof: Bounties Bounties (max_values: None, max_size: Some(181), added: 2656, mode: MaxEncodedLen) - /// Storage: System Account (r:200 w:200) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Bounties::BountyApprovals` (r:1 w:1) + /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Bounties::Bounties` (r:100 w:100) + /// Proof: `Bounties::Bounties` (`max_values`: None, `max_size`: Some(181), added: 2656, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:200 w:200) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `b` is `[0, 100]`. fn spend_funds(b: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `98 + b * (357 ±0)` - // Estimated: `897 + b * (7870 ±0)` - // Minimum execution time: 8_040 nanoseconds. - Weight::from_parts(35_582_901, 897) - // Standard Error: 168_907 - .saturating_add(Weight::from_parts(54_930_083, 0).saturating_mul(b.into())) + // Measured: `70 + b * (294 ±0)` + // Estimated: `1887 + b * (5214 ±0)` + // Minimum execution time: 9_110 nanoseconds. + Weight::from_parts(9_920_000, 1887) + // Standard Error: 93_100 + .saturating_add(Weight::from_parts(80_045_614, 0).saturating_mul(b.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(b.into()))) - .saturating_add(Weight::from_parts(0, 7870).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 5214).saturating_mul(b.into())) } } diff --git a/runtime/common/src/weights/pallet_collective.rs b/runtime/common/src/weights/pallet_collective.rs index 61b65f8e0..739622c92 100644 --- a/runtime/common/src/weights/pallet_collective.rs +++ b/runtime/common/src/weights/pallet_collective.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_collective //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,244 +52,246 @@ use frame_support::{ /// Weight functions for pallet_collective (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_collective::weights::WeightInfo for WeightInfo { - /// Storage: AdvisoryCommittee Members (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Proposals (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Voting (r:255 w:255) - /// Proof Skipped: AdvisoryCommittee Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Prime (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Voting` (r:255 w:255) + /// Proof: `AdvisoryCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[0, 100]`. /// The range of component `n` is `[0, 100]`. /// The range of component `p` is `[0, 255]`. fn set_members(m: u32, _n: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + m * (8195 ±0) + p * (3227 ±0)` - // Estimated: `33167 + m * (19751 ±60) + p * (10255 ±23)` - // Minimum execution time: 32_240 nanoseconds. - Weight::from_parts(36_010_000, 33167) - // Standard Error: 331_381 - .saturating_add(Weight::from_parts(24_168_756, 0).saturating_mul(m.into())) - // Standard Error: 130_107 - .saturating_add(Weight::from_parts(16_390_802, 0).saturating_mul(p.into())) + // Measured: `0 + m * (8192 ±0) + p * (3194 ±0)` + // Estimated: `32746 + m * (4970 ±60) + p * (4343 ±23)` + // Minimum execution time: 37_640 nanoseconds. + Weight::from_parts(37_820_000, 32746) + // Standard Error: 342_845 + .saturating_add(Weight::from_parts(25_501_936, 0).saturating_mul(m.into())) + // Standard Error: 134_608 + .saturating_add(Weight::from_parts(18_454_663, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 19751).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 10255).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 4970).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 4343).saturating_mul(p.into())) } - /// Storage: AdvisoryCommittee Members (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. fn execute(b: u32, m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `100 + m * (32 ±0)` - // Estimated: `596 + m * (32 ±0)` - // Minimum execution time: 29_290 nanoseconds. - Weight::from_parts(33_241_053, 596) - // Standard Error: 107 - .saturating_add(Weight::from_parts(2_623, 0).saturating_mul(b.into())) - // Standard Error: 1_108 - .saturating_add(Weight::from_parts(31_802, 0).saturating_mul(m.into())) + // Measured: `68 + m * (32 ±0)` + // Estimated: `1554 + m * (32 ±0)` + // Minimum execution time: 29_810 nanoseconds. + Weight::from_parts(38_342_071, 1554) + // Standard Error: 355 + .saturating_add(Weight::from_parts(2_144, 0).saturating_mul(b.into())) + // Standard Error: 3_667 + .saturating_add(Weight::from_parts(21_795, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } - /// Storage: AdvisoryCommittee Members (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee ProposalOf (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::ProposalOf` (r:1 w:0) + /// Proof: `AdvisoryCommittee::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[1, 100]`. fn propose_execute(b: u32, m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `100 + m * (32 ±0)` - // Estimated: `3172 + m * (64 ±0)` - // Minimum execution time: 32_470 nanoseconds. - Weight::from_parts(36_593_323, 3172) - // Standard Error: 263 - .saturating_add(Weight::from_parts(3_751, 0).saturating_mul(b.into())) - // Standard Error: 2_716 - .saturating_add(Weight::from_parts(50_600, 0).saturating_mul(m.into())) + // Measured: `68 + m * (32 ±0)` + // Estimated: `3534 + m * (32 ±0)` + // Minimum execution time: 34_190 nanoseconds. + Weight::from_parts(41_468_423, 3534) + // Standard Error: 380 + .saturating_add(Weight::from_parts(2_531, 0).saturating_mul(b.into())) + // Standard Error: 3_920 + .saturating_add(Weight::from_parts(67_320, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } - /// Storage: AdvisoryCommittee Members (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee ProposalOf (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Proposals (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee ProposalCount (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee ProposalCount (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Voting (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::ProposalOf` (r:1 w:1) + /// Proof: `AdvisoryCommittee::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::ProposalCount` (r:1 w:1) + /// Proof: `AdvisoryCommittee::ProposalCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Voting` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[2, 100]`. /// The range of component `p` is `[1, 255]`. fn propose_proposed(b: u32, m: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `565 + m * (32 ±0) + p * (33 ±0)` - // Estimated: `6570 + m * (160 ±0) + p * (170 ±0)` - // Minimum execution time: 51_800 nanoseconds. - Weight::from_parts(49_667_053, 6570) - // Standard Error: 666 - .saturating_add(Weight::from_parts(11_053, 0).saturating_mul(b.into())) - // Standard Error: 6_959 - .saturating_add(Weight::from_parts(83_279, 0).saturating_mul(m.into())) - // Standard Error: 2_679 - .saturating_add(Weight::from_parts(254_614, 0).saturating_mul(p.into())) + // Measured: `501 + m * (32 ±0) + p * (33 ±0)` + // Estimated: `3926 + m * (32 ±0) + p * (34 ±0)` + // Minimum execution time: 48_060 nanoseconds. + Weight::from_parts(72_847_338, 3926) + // Standard Error: 1_256 + .saturating_add(Weight::from_parts(326, 0).saturating_mul(b.into())) + // Standard Error: 13_109 + .saturating_add(Weight::from_parts(36_498, 0).saturating_mul(m.into())) + // Standard Error: 5_046 + .saturating_add(Weight::from_parts(378_035, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(Weight::from_parts(0, 160).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 170).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 34).saturating_mul(p.into())) } - /// Storage: AdvisoryCommittee Members (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Voting (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Voting (max_values: None, max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Voting` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[5, 100]`. fn vote(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1240 + m * (64 ±0)` - // Estimated: `5448 + m * (128 ±0)` - // Minimum execution time: 51_250 nanoseconds. - Weight::from_parts(71_287_144, 5448) - // Standard Error: 5_011 - .saturating_add(Weight::from_parts(73_018, 0).saturating_mul(m.into())) + // Measured: `1175 + m * (64 ±0)` + // Estimated: `4639 + m * (64 ±0)` + // Minimum execution time: 53_080 nanoseconds. + Weight::from_parts(73_109_709, 4639) + // Standard Error: 5_086 + .saturating_add(Weight::from_parts(105_322, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 128).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } - /// Storage: AdvisoryCommittee Voting (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Members (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Proposals (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee ProposalOf (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Voting` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::ProposalOf` (r:0 w:1) + /// Proof: `AdvisoryCommittee::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 255]`. fn close_early_disapproved(m: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `683 + m * (64 ±0) + p * (33 ±0)` - // Estimated: `6017 + m * (260 ±0) + p * (136 ±0)` - // Minimum execution time: 48_690 nanoseconds. - Weight::from_parts(55_109_178, 6017) - // Standard Error: 6_245 - .saturating_add(Weight::from_parts(107_851, 0).saturating_mul(m.into())) - // Standard Error: 2_373 - .saturating_add(Weight::from_parts(229_124, 0).saturating_mul(p.into())) + // Measured: `586 + m * (64 ±0) + p * (33 ±0)` + // Estimated: `4006 + m * (65 ±0) + p * (34 ±0)` + // Minimum execution time: 62_949 nanoseconds. + Weight::from_parts(74_028_560, 4006) + // Standard Error: 10_128 + .saturating_add(Weight::from_parts(65_347, 0).saturating_mul(m.into())) + // Standard Error: 3_849 + .saturating_add(Weight::from_parts(290_905, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 260).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 136).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 34).saturating_mul(p.into())) } - /// Storage: AdvisoryCommittee Voting (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Members (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee ProposalOf (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Proposals (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Voting` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::ProposalOf` (r:1 w:1) + /// Proof: `AdvisoryCommittee::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 255]`. fn close_early_approved(b: u32, m: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `926 + b * (1 ±0) + m * (64 ±0) + p * (36 ±0)` - // Estimated: `9916 + b * (4 ±0) + m * (248 ±0) + p * (144 ±0)` - // Minimum execution time: 57_050 nanoseconds. - Weight::from_parts(75_520_068, 9916) - // Standard Error: 794 - .saturating_add(Weight::from_parts(7_735, 0).saturating_mul(b.into())) - // Standard Error: 8_398 - .saturating_add(Weight::from_parts(53_897, 0).saturating_mul(m.into())) - // Standard Error: 3_191 - .saturating_add(Weight::from_parts(306_904, 0).saturating_mul(p.into())) + // Measured: `798 + b * (1 ±0) + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4337 + b * (1 ±0) + m * (62 ±0) + p * (36 ±0)` + // Minimum execution time: 65_450 nanoseconds. + Weight::from_parts(94_281_108, 4337) + // Standard Error: 748 + .saturating_add(Weight::from_parts(10_158, 0).saturating_mul(b.into())) + // Standard Error: 7_910 + .saturating_add(Weight::from_parts(36_894, 0).saturating_mul(m.into())) + // Standard Error: 3_006 + .saturating_add(Weight::from_parts(344_530, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 4).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 248).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 144).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 62).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } - /// Storage: AdvisoryCommittee Voting (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Members (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Prime (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Proposals (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee ProposalOf (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Voting` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Prime` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::ProposalOf` (r:0 w:1) + /// Proof: `AdvisoryCommittee::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 255]`. fn close_disapproved(m: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `703 + m * (64 ±0) + p * (33 ±0)` - // Estimated: `7250 + m * (325 ±0) + p * (170 ±0)` - // Minimum execution time: 46_220 nanoseconds. - Weight::from_parts(62_405_239, 7250) - // Standard Error: 7_440 - .saturating_add(Weight::from_parts(108_767, 0).saturating_mul(m.into())) - // Standard Error: 2_827 - .saturating_add(Weight::from_parts(218_334, 0).saturating_mul(p.into())) + // Measured: `606 + m * (64 ±0) + p * (33 ±0)` + // Estimated: `4026 + m * (65 ±0) + p * (34 ±0)` + // Minimum execution time: 64_390 nanoseconds. + Weight::from_parts(70_683_234, 4026) + // Standard Error: 10_591 + .saturating_add(Weight::from_parts(135_054, 0).saturating_mul(m.into())) + // Standard Error: 4_025 + .saturating_add(Weight::from_parts(307_190, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 325).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 170).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 65).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 34).saturating_mul(p.into())) } - /// Storage: AdvisoryCommittee Voting (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Members (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Prime (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee ProposalOf (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee ProposalOf (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Proposals (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Voting` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Members` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Prime` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::ProposalOf` (r:1 w:1) + /// Proof: `AdvisoryCommittee::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `b` is `[2, 1024]`. /// The range of component `m` is `[4, 100]`. /// The range of component `p` is `[1, 255]`. fn close_approved(b: u32, m: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `946 + b * (1 ±0) + m * (64 ±0) + p * (36 ±0)` - // Estimated: `11505 + b * (5 ±0) + m * (310 ±0) + p * (180 ±0)` - // Minimum execution time: 60_490 nanoseconds. - Weight::from_parts(87_540_688, 11505) - // Standard Error: 865 - .saturating_add(Weight::from_parts(3_430, 0).saturating_mul(b.into())) - // Standard Error: 3_474 - .saturating_add(Weight::from_parts(317_677, 0).saturating_mul(p.into())) + // Measured: `818 + b * (1 ±0) + m * (64 ±0) + p * (36 ±0)` + // Estimated: `4357 + b * (1 ±0) + m * (62 ±0) + p * (36 ±0)` + // Minimum execution time: 85_380 nanoseconds. + Weight::from_parts(91_547_722, 4357) + // Standard Error: 1_298 + .saturating_add(Weight::from_parts(15_683, 0).saturating_mul(b.into())) + // Standard Error: 13_725 + .saturating_add(Weight::from_parts(46_296, 0).saturating_mul(m.into())) + // Standard Error: 5_216 + .saturating_add(Weight::from_parts(377_484, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 5).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 310).saturating_mul(m.into())) - .saturating_add(Weight::from_parts(0, 180).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 1).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 62).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 36).saturating_mul(p.into())) } - /// Storage: AdvisoryCommittee Proposals (r:1 w:1) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Voting (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Voting (max_values: None, max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee ProposalOf (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee ProposalOf (max_values: None, max_size: None, mode: Measured) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:1) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Voting` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Voting` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::ProposalOf` (r:0 w:1) + /// Proof: `AdvisoryCommittee::ProposalOf` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `p` is `[1, 255]`. fn disapprove_proposal(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `258 + p * (32 ±0)` - // Estimated: `1266 + p * (96 ±0)` - // Minimum execution time: 23_361 nanoseconds. - Weight::from_parts(35_532_415, 1266) - // Standard Error: 3_908 - .saturating_add(Weight::from_parts(240_150, 0).saturating_mul(p.into())) + // Measured: `226 + p * (32 ±0)` + // Estimated: `1710 + p * (32 ±0)` + // Minimum execution time: 33_040 nanoseconds. + Weight::from_parts(43_701_252, 1710) + // Standard Error: 2_402 + .saturating_add(Weight::from_parts(300_555, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 96).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 32).saturating_mul(p.into())) } } diff --git a/runtime/common/src/weights/pallet_contracts.rs b/runtime/common/src/weights/pallet_contracts.rs index 2671199f1..46497daef 100644 --- a/runtime/common/src/weights/pallet_contracts.rs +++ b/runtime/common/src/weights/pallet_contracts.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_contracts //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -56,25 +56,25 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Proof: `Contracts::DeletionQueueCounter` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) fn on_process_deletion_queue_batch() -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `1627` - // Minimum execution time: 2_548_000 picoseconds. - Weight::from_parts(2_670_000, 1627).saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `42` + // Estimated: `1527` + // Minimum execution time: 7_430 nanoseconds. + Weight::from_parts(8_400_000, 1527).saturating_add(T::DbWeight::get().reads(1)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `k` is `[0, 1024]`. fn on_initialize_per_trie_key(k: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `451 + k * (69 ±0)` - // Estimated: `441 + k * (70 ±0)` - // Minimum execution time: 13_526_000 picoseconds. - Weight::from_parts(13_902_000, 441) - // Standard Error: 1_058 - .saturating_add(Weight::from_parts(1_274_724, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `351 + k * (69 ±0)` + // Estimated: `341 + k * (70 ±0)` + // Minimum execution time: 23_910 nanoseconds. + Weight::from_parts(24_890_000, 341) + // Standard Error: 3_859 + .saturating_add(Weight::from_parts(2_015_712, 0).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 70).saturating_mul(k.into())) } @@ -83,28 +83,28 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `c` is `[0, 125952]`. fn v9_migration_step(c: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `211 + c * (1 ±0)` - // Estimated: `6149 + c * (1 ±0)` - // Minimum execution time: 8_426_000 picoseconds. - Weight::from_parts(8_591_621, 6149) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_203, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `111 + c * (1 ±0)` + // Estimated: `6049 + c * (1 ±0)` + // Minimum execution time: 20_290 nanoseconds. + Weight::from_parts(18_282_031, 6049) + // Standard Error: 10 + .saturating_add(Weight::from_parts(1_721, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) } /// Storage: `Contracts::ContractInfoOf` (r:2 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) fn v10_migration_step() -> Weight { // Proof Size summary in bytes: - // Measured: `510` - // Estimated: `6450` - // Minimum execution time: 17_008_000 picoseconds. - Weight::from_parts(17_742_000, 6450) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `415` + // Estimated: `6355` + // Minimum execution time: 33_490 nanoseconds. + Weight::from_parts(40_920_000, 6355) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Contracts::DeletionQueue` (r:1 w:1025) /// Proof: `Contracts::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) @@ -113,14 +113,14 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `k` is `[0, 1024]`. fn v11_migration_step(k: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `171 + k * (1 ±0)` - // Estimated: `3635 + k * (1 ±0)` - // Minimum execution time: 3_949_000 picoseconds. - Weight::from_parts(4_062_000, 3635) - // Standard Error: 1_983 - .saturating_add(Weight::from_parts(1_173_197, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `71 + k * (1 ±0)` + // Estimated: `3535 + k * (1 ±0)` + // Minimum execution time: 12_320 nanoseconds. + Weight::from_parts(12_830_000, 3535) + // Standard Error: 8_340 + .saturating_add(Weight::from_parts(2_265_906, 0).saturating_mul(k.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 1).saturating_mul(k.into())) } @@ -129,71 +129,71 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:1 w:1) /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc553022fca90611ba8b7942f8bdb3b97f6580` (r:1 w:1) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:0 w:1) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// The range of component `c` is `[0, 125952]`. fn v12_migration_step(c: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `325 + c * (1 ±0)` - // Estimated: `6263 + c * (1 ±0)` - // Minimum execution time: 17_094_000 picoseconds. - Weight::from_parts(17_338_591, 6263) - // Standard Error: 1 - .saturating_add(Weight::from_parts(436, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `225 + c * (1 ±0)` + // Estimated: `6163 + c * (1 ±0)` + // Minimum execution time: 33_350 nanoseconds. + Weight::from_parts(33_089_795, 6163) + // Standard Error: 12 + .saturating_add(Weight::from_parts(840, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) } /// Storage: `Contracts::ContractInfoOf` (r:2 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) fn v13_migration_step() -> Weight { // Proof Size summary in bytes: - // Measured: `440` - // Estimated: `6380` - // Minimum execution time: 12_704_000 picoseconds. - Weight::from_parts(13_147_000, 6380) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `340` + // Estimated: `6280` + // Minimum execution time: 25_500 nanoseconds. + Weight::from_parts(27_730_000, 6280) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Contracts::CodeInfoOf` (r:2 w:0) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:0) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `Measured`) fn v14_migration_step() -> Weight { // Proof Size summary in bytes: - // Measured: `360` - // Estimated: `6300` - // Minimum execution time: 48_387_000 picoseconds. - Weight::from_parts(50_024_000, 6300) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `212` + // Estimated: `6152` + // Minimum execution time: 90_871 nanoseconds. + Weight::from_parts(101_780_000, 6152) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Contracts::ContractInfoOf` (r:2 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `System::Account` (r:2 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) fn v15_migration_step() -> Weight { // Proof Size summary in bytes: - // Measured: `594` - // Estimated: `6534` - // Minimum execution time: 59_300_000 picoseconds. - Weight::from_parts(61_805_000, 6534) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `499` + // Estimated: `6439` + // Minimum execution time: 154_710 nanoseconds. + Weight::from_parts(167_871_000, 6439) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:1) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) fn migration_noop() -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `1627` - // Minimum execution time: 3_327_000 picoseconds. - Weight::from_parts(3_502_000, 1627) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `42` + // Estimated: `1527` + // Minimum execution time: 9_410 nanoseconds. + Weight::from_parts(10_060_000, 1527) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:1) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) @@ -201,21 +201,21 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:1) fn migrate() -> Weight { // Proof Size summary in bytes: - // Measured: `166` - // Estimated: `3631` - // Minimum execution time: 12_759_000 picoseconds. - Weight::from_parts(13_134_000, 3631) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `66` + // Estimated: `3531` + // Minimum execution time: 29_130 nanoseconds. + Weight::from_parts(33_410_000, 3531) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) fn on_runtime_upgrade_noop() -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `3607` - // Minimum execution time: 4_775_000 picoseconds. - Weight::from_parts(5_084_000, 3607).saturating_add(T::DbWeight::get().reads(1_u64)) + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 15_800 nanoseconds. + Weight::from_parts(17_760_000, 3507).saturating_add(T::DbWeight::get().reads(1)) } /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) @@ -223,10 +223,10 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) fn on_runtime_upgrade_in_progress() -> Weight { // Proof Size summary in bytes: - // Measured: `167` - // Estimated: `3632` - // Minimum execution time: 6_663_000 picoseconds. - Weight::from_parts(6_855_000, 3632).saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `67` + // Estimated: `3532` + // Minimum execution time: 16_710 nanoseconds. + Weight::from_parts(17_820_000, 3532).saturating_add(T::DbWeight::get().reads(2)) } /// Storage: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) /// Proof: UNKNOWN KEY `0x4342193e496fab7ec59d615ed0dc55304e7b9012096b41c4eb3aaf947f6ea429` (r:1 w:0) @@ -234,12 +234,12 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) fn on_runtime_upgrade() -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `3607` - // Minimum execution time: 7_212_000 picoseconds. - Weight::from_parts(7_426_000, 3607) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 21_040 nanoseconds. + Weight::from_parts(21_610_000, 3507) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) @@ -252,20 +252,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `System::EventTopics` (r:2 w:2) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `c` is `[0, 125952]`. fn call_with_code_per_byte(c: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `792` - // Estimated: `6743 + c * (1 ±0)` - // Minimum execution time: 289_557_000 picoseconds. - Weight::from_parts(272_895_652, 6743) - // Standard Error: 80 - .saturating_add(Weight::from_parts(39_917, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `630` + // Estimated: `6582 + c * (1 ±0)` + // Minimum execution time: 609_010 nanoseconds. + Weight::from_parts(724_043_472, 6582) + // Standard Error: 134 + .saturating_add(Weight::from_parts(79_403, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(c.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) @@ -273,7 +273,7 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// Storage: `Balances::Holds` (r:2 w:2) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `Measured`) /// Storage: `System::EventTopics` (r:3 w:3) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Contracts::Nonce` (r:1 w:1) @@ -283,7 +283,7 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::PristineCode` (r:0 w:1) /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) /// The range of component `c` is `[0, 125952]`. @@ -291,18 +291,18 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `s` is `[0, 1048576]`. fn instantiate_with_code(c: u32, i: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `323` - // Estimated: `8747` - // Minimum execution time: 4_671_359_000 picoseconds. - Weight::from_parts(586_523_882, 8747) - // Standard Error: 206 - .saturating_add(Weight::from_parts(115_402, 0).saturating_mul(c.into())) - // Standard Error: 24 - .saturating_add(Weight::from_parts(1_797, 0).saturating_mul(i.into())) - // Standard Error: 24 - .saturating_add(Weight::from_parts(2_046, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) + // Measured: `157` + // Estimated: `8578` + // Minimum execution time: 6_661_655 nanoseconds. + Weight::from_parts(1_301_904_860, 8578) + // Standard Error: 259 + .saturating_add(Weight::from_parts(235_011, 0).saturating_mul(c.into())) + // Standard Error: 31 + .saturating_add(Weight::from_parts(2_771, 0).saturating_mul(i.into())) + // Standard Error: 31 + .saturating_add(Weight::from_parts(2_677, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(10)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) @@ -317,25 +317,25 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `System::EventTopics` (r:2 w:2) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `Measured`) /// The range of component `i` is `[0, 1048576]`. /// The range of component `s` is `[0, 1048576]`. fn instantiate(i: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `560` - // Estimated: `6504` - // Minimum execution time: 2_170_657_000 picoseconds. - Weight::from_parts(369_331_405, 6504) - // Standard Error: 7 - .saturating_add(Weight::from_parts(1_940, 0).saturating_mul(i.into())) - // Standard Error: 7 - .saturating_add(Weight::from_parts(1_858, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(10_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + // Measured: `394` + // Estimated: `6339` + // Minimum execution time: 2_985_696 nanoseconds. + Weight::from_parts(778_974_170, 6339) + // Standard Error: 22 + .saturating_add(Weight::from_parts(2_385, 0).saturating_mul(i.into())) + // Standard Error: 22 + .saturating_add(Weight::from_parts(2_542, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(7)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) @@ -348,24 +348,24 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: `Timestamp::Now` (r:1 w:0) /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `Measured`) /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `System::EventTopics` (r:2 w:2) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) fn call() -> Weight { // Proof Size summary in bytes: - // Measured: `826` - // Estimated: `6766` - // Minimum execution time: 204_287_000 picoseconds. - Weight::from_parts(213_239_000, 6766) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `665` + // Estimated: `6605` + // Minimum execution time: 390_731 nanoseconds. + Weight::from_parts(402_031_000, 6605) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `Measured`) /// Storage: `System::EventTopics` (r:1 w:1) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Contracts::PristineCode` (r:0 w:1) @@ -373,33 +373,33 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `c` is `[0, 125952]`. fn upload_code(c: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `142` - // Estimated: `3607` - // Minimum execution time: 285_434_000 picoseconds. - Weight::from_parts(242_697_648, 3607) - // Standard Error: 128 - .saturating_add(Weight::from_parts(76_087, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `42` + // Estimated: `3507` + // Minimum execution time: 549_251 nanoseconds. + Weight::from_parts(727_042_849, 3507) + // Standard Error: 177 + .saturating_add(Weight::from_parts(155_165, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:1) /// Proof: `Contracts::CodeInfoOf` (`max_values`: None, `max_size`: Some(93), added: 2568, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `Measured`) /// Storage: `System::EventTopics` (r:1 w:1) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Contracts::PristineCode` (r:0 w:1) /// Proof: `Contracts::PristineCode` (`max_values`: None, `max_size`: Some(125988), added: 128463, mode: `Measured`) fn remove_code() -> Weight { // Proof Size summary in bytes: - // Measured: `315` - // Estimated: `3780` - // Minimum execution time: 46_486_000 picoseconds. - Weight::from_parts(48_422_000, 3780) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `212` + // Estimated: `3677` + // Minimum execution time: 83_830 nanoseconds. + Weight::from_parts(87_000_000, 3677) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(4)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) @@ -411,17 +411,17 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) fn set_code() -> Weight { // Proof Size summary in bytes: - // Measured: `552` - // Estimated: `8967` - // Minimum execution time: 37_568_000 picoseconds. - Weight::from_parts(38_589_000, 8967) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + // Measured: `452` + // Estimated: `8867` + // Minimum execution time: 53_370 nanoseconds. + Weight::from_parts(62_960_000, 8867) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(6)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -435,20 +435,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_caller(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `866 + r * (6 ±0)` - // Estimated: `6806 + r * (6 ±0)` - // Minimum execution time: 274_513_000 picoseconds. - Weight::from_parts(288_793_403, 6806) - // Standard Error: 650 - .saturating_add(Weight::from_parts(339_309, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `652 + r * (6 ±0)` + // Estimated: `6592 + r * (6 ±0)` + // Minimum execution time: 516_961 nanoseconds. + Weight::from_parts(594_952_508, 6592) + // Standard Error: 4_197 + .saturating_add(Weight::from_parts(851_782, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1601 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -462,21 +462,21 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_is_contract(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `922 + r * (209 ±0)` - // Estimated: `6826 + r * (2684 ±0)` - // Minimum execution time: 260_096_000 picoseconds. - Weight::from_parts(149_954_322, 6826) - // Standard Error: 5_713 - .saturating_add(Weight::from_parts(3_788_924, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `706 + r * (209 ±0)` + // Estimated: `6608 + r * (2684 ±0)` + // Minimum execution time: 531_401 nanoseconds. + Weight::from_parts(238_319_702, 6608) + // Standard Error: 30_236 + .saturating_add(Weight::from_parts(7_933_474, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1601 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -490,21 +490,21 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_code_hash(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `921 + r * (213 ±0)` - // Estimated: `6830 + r * (2688 ±0)` - // Minimum execution time: 277_496_000 picoseconds. - Weight::from_parts(285_839_000, 6830) - // Standard Error: 10_076 - .saturating_add(Weight::from_parts(4_720_110, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `717 + r * (213 ±0)` + // Estimated: `6619 + r * (2688 ±0)` + // Minimum execution time: 551_671 nanoseconds. + Weight::from_parts(259_560_441, 6619) + // Standard Error: 30_149 + .saturating_add(Weight::from_parts(9_625_003, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 2688).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -518,20 +518,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_own_code_hash(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `873 + r * (6 ±0)` - // Estimated: `6815 + r * (6 ±0)` - // Minimum execution time: 275_655_000 picoseconds. - Weight::from_parts(291_386_528, 6815) - // Standard Error: 898 - .saturating_add(Weight::from_parts(428_765, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `659 + r * (6 ±0)` + // Estimated: `6599 + r * (6 ±0)` + // Minimum execution time: 531_291 nanoseconds. + Weight::from_parts(588_260_613, 6599) + // Standard Error: 5_663 + .saturating_add(Weight::from_parts(1_037_843, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -545,14 +545,14 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_caller_is_origin(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `863 + r * (3 ±0)` - // Estimated: `6804 + r * (3 ±0)` - // Minimum execution time: 260_323_000 picoseconds. - Weight::from_parts(286_371_403, 6804) - // Standard Error: 451 - .saturating_add(Weight::from_parts(183_053, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `649 + r * (3 ±0)` + // Estimated: `6589 + r * (3 ±0)` + // Minimum execution time: 453_161 nanoseconds. + Weight::from_parts(598_392_249, 6589) + // Standard Error: 4_973 + .saturating_add(Weight::from_parts(429_684, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) @@ -570,20 +570,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_caller_is_root(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `753 + r * (3 ±0)` - // Estimated: `6693 + r * (3 ±0)` - // Minimum execution time: 262_974_000 picoseconds. - Weight::from_parts(276_571_502, 6693) - // Standard Error: 527 - .saturating_add(Weight::from_parts(165_364, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `587 + r * (3 ±0)` + // Estimated: `6527 + r * (3 ±0)` + // Minimum execution time: 452_501 nanoseconds. + Weight::from_parts(568_566_069, 6527) + // Standard Error: 4_128 + .saturating_add(Weight::from_parts(397_700, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -597,20 +597,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_address(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `867 + r * (6 ±0)` - // Estimated: `6807 + r * (6 ±0)` - // Minimum execution time: 272_826_000 picoseconds. - Weight::from_parts(290_963_001, 6807) - // Standard Error: 810 - .saturating_add(Weight::from_parts(343_762, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `653 + r * (6 ±0)` + // Estimated: `6593 + r * (6 ±0)` + // Minimum execution time: 537_671 nanoseconds. + Weight::from_parts(606_054_284, 6593) + // Standard Error: 3_762 + .saturating_add(Weight::from_parts(856_259, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -624,20 +624,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_gas_left(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `863 + r * (6 ±0)` - // Estimated: `6806 + r * (6 ±0)` - // Minimum execution time: 277_324_000 picoseconds. - Weight::from_parts(290_872_814, 6806) - // Standard Error: 766 - .saturating_add(Weight::from_parts(371_542, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `649 + r * (6 ±0)` + // Estimated: `6588 + r * (6 ±0)` + // Minimum execution time: 565_321 nanoseconds. + Weight::from_parts(640_947_181, 6588) + // Standard Error: 7_624 + .saturating_add(Weight::from_parts(907_145, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:2 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -651,20 +651,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_balance(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1007 + r * (6 ±0)` - // Estimated: `6931 + r * (6 ±0)` - // Minimum execution time: 274_460_000 picoseconds. - Weight::from_parts(285_748_025, 6931) - // Standard Error: 1_570 - .saturating_add(Weight::from_parts(1_656_237, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `797 + r * (6 ±0)` + // Estimated: `6716 + r * (6 ±0)` + // Minimum execution time: 543_181 nanoseconds. + Weight::from_parts(597_314_979, 6716) + // Standard Error: 4_653 + .saturating_add(Weight::from_parts(3_173_375, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -678,20 +678,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_value_transferred(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `877 + r * (6 ±0)` - // Estimated: `6823 + r * (6 ±0)` - // Minimum execution time: 278_254_000 picoseconds. - Weight::from_parts(283_893_525, 6823) - // Standard Error: 726 - .saturating_add(Weight::from_parts(347_368, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `663 + r * (6 ±0)` + // Estimated: `6603 + r * (6 ±0)` + // Minimum execution time: 533_251 nanoseconds. + Weight::from_parts(644_790_077, 6603) + // Standard Error: 8_131 + .saturating_add(Weight::from_parts(790_937, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -705,20 +705,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_minimum_balance(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `875 + r * (6 ±0)` - // Estimated: `6816 + r * (6 ±0)` - // Minimum execution time: 279_646_000 picoseconds. - Weight::from_parts(292_505_446, 6816) - // Standard Error: 867 - .saturating_add(Weight::from_parts(337_202, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `661 + r * (6 ±0)` + // Estimated: `6601 + r * (6 ±0)` + // Minimum execution time: 549_842 nanoseconds. + Weight::from_parts(631_501_952, 6601) + // Standard Error: 8_046 + .saturating_add(Weight::from_parts(838_569, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -732,20 +732,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_block_number(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `872 + r * (6 ±0)` - // Estimated: `6819 + r * (6 ±0)` - // Minimum execution time: 274_522_000 picoseconds. - Weight::from_parts(295_135_659, 6819) - // Standard Error: 1_052 - .saturating_add(Weight::from_parts(330_788, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `658 + r * (6 ±0)` + // Estimated: `6601 + r * (6 ±0)` + // Minimum execution time: 560_221 nanoseconds. + Weight::from_parts(606_561_904, 6601) + // Standard Error: 6_933 + .saturating_add(Weight::from_parts(847_298, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -759,20 +759,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_now(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `863 + r * (6 ±0)` - // Estimated: `6804 + r * (6 ±0)` - // Minimum execution time: 274_228_000 picoseconds. - Weight::from_parts(289_201_593, 6804) - // Standard Error: 752 - .saturating_add(Weight::from_parts(337_860, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `649 + r * (6 ±0)` + // Estimated: `6589 + r * (6 ±0)` + // Minimum execution time: 548_251 nanoseconds. + Weight::from_parts(633_732_523, 6589) + // Standard Error: 5_610 + .saturating_add(Weight::from_parts(792_725, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -788,20 +788,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_weight_to_fee(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `937 + r * (14 ±0)` - // Estimated: `6872 + r * (14 ±0)` - // Minimum execution time: 277_142_000 picoseconds. - Weight::from_parts(296_736_114, 6872) - // Standard Error: 1_502 - .saturating_add(Weight::from_parts(1_446_663, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `760 + r * (14 ±0)` + // Estimated: `6690 + r * (14 ±0)` + // Minimum execution time: 532_371 nanoseconds. + Weight::from_parts(581_227_315, 6690) + // Standard Error: 5_730 + .saturating_add(Weight::from_parts(2_414_332, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 14).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -815,20 +815,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_input(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `865 + r * (6 ±0)` - // Estimated: `6807 + r * (6 ±0)` - // Minimum execution time: 276_087_000 picoseconds. - Weight::from_parts(287_863_377, 6807) - // Standard Error: 495 - .saturating_add(Weight::from_parts(282_718, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `651 + r * (6 ±0)` + // Estimated: `6591 + r * (6 ±0)` + // Minimum execution time: 536_101 nanoseconds. + Weight::from_parts(623_941_107, 6591) + // Standard Error: 6_907 + .saturating_add(Weight::from_parts(714_895, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -842,19 +842,19 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 1048576]`. fn seal_input_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `869` - // Estimated: `6809` - // Minimum execution time: 277_128_000 picoseconds. - Weight::from_parts(234_478_674, 6809) - // Standard Error: 23 - .saturating_add(Weight::from_parts(1_052, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `655` + // Estimated: `6595` + // Minimum execution time: 500_232 nanoseconds. + Weight::from_parts(677_055_581, 6595) + // Standard Error: 13 + .saturating_add(Weight::from_parts(973, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -868,18 +868,18 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1]`. fn seal_return(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `853 + r * (45 ±0)` - // Estimated: `6793 + r * (45 ±0)` - // Minimum execution time: 251_983_000 picoseconds. - Weight::from_parts(277_986_885, 6793) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 45).saturating_mul(r.into())) + // Measured: `639 + r * (8 ±0)` + // Estimated: `6579 + r * (8 ±0)` + // Minimum execution time: 429_561 nanoseconds. + Weight::from_parts(596_361_538, 6579) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -893,19 +893,19 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 1048576]`. fn seal_return_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `863` - // Estimated: `6810` - // Minimum execution time: 275_108_000 picoseconds. - Weight::from_parts(284_552_708, 6810) - // Standard Error: 0 - .saturating_add(Weight::from_parts(391, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `649` + // Estimated: `6589` + // Minimum execution time: 464_081 nanoseconds. + Weight::from_parts(607_528_707, 6589) + // Standard Error: 13 + .saturating_add(Weight::from_parts(572, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:3 w:3) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:2 w:2) @@ -919,28 +919,28 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: `System::EventTopics` (r:4 w:4) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `Measured`) /// Storage: `Contracts::DeletionQueue` (r:0 w:1) /// Proof: `Contracts::DeletionQueue` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `Measured`) /// The range of component `r` is `[0, 1]`. fn seal_terminate(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2972 + r * (316 ±0)` - // Estimated: `8912 + r * (5266 ±0)` - // Minimum execution time: 281_278_000 picoseconds. - Weight::from_parts(306_800_667, 8912) - // Standard Error: 855_257 - .saturating_add(Weight::from_parts(126_508_132, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `2758 + r * (319 ±0)` + // Estimated: `8698 + r * (5269 ±0)` + // Minimum execution time: 461_342 nanoseconds. + Weight::from_parts(644_397_548, 8698) + // Standard Error: 5_359_824 + .saturating_add(Weight::from_parts(214_364_951, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((7_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((10_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 5266).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 5269).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -956,20 +956,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_random(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `944 + r * (10 ±0)` - // Estimated: `6885 + r * (10 ±0)` - // Minimum execution time: 260_609_000 picoseconds. - Weight::from_parts(287_385_076, 6885) - // Standard Error: 2_754 - .saturating_add(Weight::from_parts(2_057_388, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `730 + r * (10 ±0)` + // Estimated: `6664 + r * (10 ±0)` + // Minimum execution time: 557_592 nanoseconds. + Weight::from_parts(643_614_143, 6664) + // Standard Error: 7_627 + .saturating_add(Weight::from_parts(3_861_613, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -983,20 +983,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_deposit_event(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `863 + r * (10 ±0)` - // Estimated: `6805 + r * (10 ±0)` - // Minimum execution time: 254_770_000 picoseconds. - Weight::from_parts(255_105_647, 6805) - // Standard Error: 5_707 - .saturating_add(Weight::from_parts(3_808_788, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `649 + r * (10 ±0)` + // Estimated: `6589 + r * (10 ±0)` + // Minimum execution time: 521_742 nanoseconds. + Weight::from_parts(588_882_521, 6589) + // Standard Error: 28_311 + .saturating_add(Weight::from_parts(6_923_036, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 10).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1011,24 +1011,24 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 16384]`. fn seal_deposit_event_per_topic_and_byte(t: u32, n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `880 + t * (32 ±0)` - // Estimated: `6825 + t * (2508 ±0)` - // Minimum execution time: 278_200_000 picoseconds. - Weight::from_parts(288_081_493, 6825) - // Standard Error: 97_535 - .saturating_add(Weight::from_parts(3_683_455, 0).saturating_mul(t.into())) - // Standard Error: 27 - .saturating_add(Weight::from_parts(731, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `666 + t * (32 ±0)` + // Estimated: `6607 + t * (2508 ±0)` + // Minimum execution time: 463_732 nanoseconds. + Weight::from_parts(578_639_080, 6607) + // Standard Error: 1_354_623 + .saturating_add(Weight::from_parts(5_024_616, 0).saturating_mul(t.into())) + // Standard Error: 378 + .saturating_add(Weight::from_parts(3_344, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) .saturating_add(Weight::from_parts(0, 2508).saturating_mul(t.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1042,20 +1042,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_debug_message(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `862 + r * (7 ±0)` - // Estimated: `6807 + r * (7 ±0)` - // Minimum execution time: 167_181_000 picoseconds. - Weight::from_parts(178_433_475, 6807) - // Standard Error: 374 - .saturating_add(Weight::from_parts(241_240, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `648 + r * (7 ±0)` + // Estimated: `6588 + r * (7 ±0)` + // Minimum execution time: 304_881 nanoseconds. + Weight::from_parts(342_600_782, 6588) + // Standard Error: 2_764 + .saturating_add(Weight::from_parts(608_660, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 7).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `MaxEncodedLen`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1069,29 +1069,29 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `i` is `[0, 1048576]`. fn seal_debug_message_per_byte(i: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `125813` - // Estimated: `131755` - // Minimum execution time: 434_456_000 picoseconds. - Weight::from_parts(400_940_450, 131755) - // Standard Error: 13 - .saturating_add(Weight::from_parts(1_102, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `125599` + // Estimated: `131539` + // Minimum execution time: 780_312 nanoseconds. + Weight::from_parts(896_977_178, 131539) + // Standard Error: 16 + .saturating_add(Weight::from_parts(1_659, 0).saturating_mul(i.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `r` is `[0, 800]`. fn seal_set_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `924 + r * (292 ±0)` - // Estimated: `925 + r * (293 ±0)` - // Minimum execution time: 277_825_000 picoseconds. - Weight::from_parts(159_688_263, 925) - // Standard Error: 13_610 - .saturating_add(Weight::from_parts(7_145_641, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `702 + r * (292 ±0)` + // Estimated: `706 + r * (293 ±0)` + // Minimum execution time: 586_592 nanoseconds. + Weight::from_parts(253_036_536, 706) + // Standard Error: 71_420 + .saturating_add(Weight::from_parts(14_775_235, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 293).saturating_mul(r.into())) } @@ -1100,28 +1100,26 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 16384]`. fn seal_set_storage_per_new_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1446` - // Estimated: `1429` - // Minimum execution time: 284_745_000 picoseconds. - Weight::from_parts(345_928_316, 1429) - // Standard Error: 70 - .saturating_add(Weight::from_parts(547, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(12_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) + // Measured: `1235` + // Estimated: `1219` + // Minimum execution time: 531_741 nanoseconds. + Weight::from_parts(739_159_889, 1219) + // Standard Error: 753 + .saturating_add(Weight::from_parts(3_069, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(12)) + .saturating_add(T::DbWeight::get().writes(8)) } /// Storage: `Skipped::Metadata` (r:0 w:0) /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `n` is `[0, 16384]`. fn seal_set_storage_per_old_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1252 + n * (1 ±0)` - // Estimated: `1252 + n * (1 ±0)` - // Minimum execution time: 275_328_000 picoseconds. - Weight::from_parts(300_037_010, 1252) - // Standard Error: 32 - .saturating_add(Weight::from_parts(558, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `1038 + n * (1 ±0)` + // Estimated: `1038 + n * (1 ±0)` + // Minimum execution time: 461_381 nanoseconds. + Weight::from_parts(668_619_955, 1038) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1129,15 +1127,15 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 800]`. fn seal_clear_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `920 + r * (288 ±0)` - // Estimated: `926 + r * (289 ±0)` - // Minimum execution time: 273_742_000 picoseconds. - Weight::from_parts(169_430_806, 926) - // Standard Error: 11_821 - .saturating_add(Weight::from_parts(6_927_074, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `702 + r * (288 ±0)` + // Estimated: `706 + r * (289 ±0)` + // Minimum execution time: 530_462 nanoseconds. + Weight::from_parts(246_522_459, 706) + // Standard Error: 60_816 + .saturating_add(Weight::from_parts(14_261_381, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 289).saturating_mul(r.into())) } @@ -1146,14 +1144,12 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 16384]`. fn seal_clear_storage_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1248 + n * (1 ±0)` - // Estimated: `1248 + n * (1 ±0)` - // Minimum execution time: 275_167_000 picoseconds. - Weight::from_parts(301_883_655, 1248) - // Standard Error: 35 - .saturating_add(Weight::from_parts(4, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `1034 + n * (1 ±0)` + // Estimated: `1034 + n * (1 ±0)` + // Minimum execution time: 497_492 nanoseconds. + Weight::from_parts(718_153_644, 1034) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1161,15 +1157,15 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 800]`. fn seal_get_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `920 + r * (296 ±0)` - // Estimated: `922 + r * (297 ±0)` - // Minimum execution time: 274_628_000 picoseconds. - Weight::from_parts(195_255_092, 922) - // Standard Error: 9_109 - .saturating_add(Weight::from_parts(5_707_060, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `698 + r * (296 ±0)` + // Estimated: `707 + r * (297 ±0)` + // Minimum execution time: 573_902 nanoseconds. + Weight::from_parts(567_343_326, 707) + // Standard Error: 38_899 + .saturating_add(Weight::from_parts(11_221_016, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 297).saturating_mul(r.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1177,14 +1173,12 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 16384]`. fn seal_get_storage_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1264 + n * (1 ±0)` - // Estimated: `1264 + n * (1 ±0)` - // Minimum execution time: 274_202_000 picoseconds. - Weight::from_parts(296_440_752, 1264) - // Standard Error: 38 - .saturating_add(Weight::from_parts(1_010, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `1050 + n * (1 ±0)` + // Estimated: `1050 + n * (1 ±0)` + // Minimum execution time: 484_782 nanoseconds. + Weight::from_parts(686_750_011, 1050) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1192,15 +1186,15 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 800]`. fn seal_contains_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `931 + r * (288 ±0)` - // Estimated: `928 + r * (289 ±0)` - // Minimum execution time: 274_123_000 picoseconds. - Weight::from_parts(193_280_535, 928) - // Standard Error: 9_264 - .saturating_add(Weight::from_parts(5_548_039, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `705 + r * (288 ±0)` + // Estimated: `709 + r * (289 ±0)` + // Minimum execution time: 505_512 nanoseconds. + Weight::from_parts(509_064_085, 709) + // Standard Error: 34_162 + .saturating_add(Weight::from_parts(10_705_915, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 289).saturating_mul(r.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1208,14 +1202,12 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 16384]`. fn seal_contains_storage_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1251 + n * (1 ±0)` - // Estimated: `1251 + n * (1 ±0)` - // Minimum execution time: 276_425_000 picoseconds. - Weight::from_parts(300_521_806, 1251) - // Standard Error: 36 - .saturating_add(Weight::from_parts(83, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `1037 + n * (1 ±0)` + // Estimated: `1037 + n * (1 ±0)` + // Minimum execution time: 459_192 nanoseconds. + Weight::from_parts(669_131_393, 1037) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Skipped::Metadata` (r:0 w:0) @@ -1223,15 +1215,15 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 800]`. fn seal_take_storage(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `913 + r * (296 ±0)` - // Estimated: `918 + r * (297 ±0)` - // Minimum execution time: 264_860_000 picoseconds. - Weight::from_parts(191_561_777, 918) - // Standard Error: 10_678 - .saturating_add(Weight::from_parts(6_895_457, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `699 + r * (296 ±0)` + // Estimated: `706 + r * (297 ±0)` + // Minimum execution time: 509_522 nanoseconds. + Weight::from_parts(352_464_662, 706) + // Standard Error: 55_958 + .saturating_add(Weight::from_parts(14_145_333, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 297).saturating_mul(r.into())) } @@ -1240,20 +1232,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 16384]`. fn seal_take_storage_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1265 + n * (1 ±0)` - // Estimated: `1265 + n * (1 ±0)` - // Minimum execution time: 282_501_000 picoseconds. - Weight::from_parts(303_351_919, 1265) - // Standard Error: 37 - .saturating_add(Weight::from_parts(643, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `1051 + n * (1 ±0)` + // Estimated: `1051 + n * (1 ±0)` + // Minimum execution time: 484_042 nanoseconds. + Weight::from_parts(682_363_864, 1051) + // Standard Error: 597 + .saturating_add(Weight::from_parts(1_036, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1602 w:1601) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1267,22 +1259,22 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_transfer(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1415 + r * (45 ±0)` - // Estimated: `7307 + r * (2520 ±0)` - // Minimum execution time: 273_198_000 picoseconds. - Weight::from_parts(179_673_238, 7307) - // Standard Error: 34_990 - .saturating_add(Weight::from_parts(38_468_091, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) + // Measured: `1233 + r * (45 ±0)` + // Estimated: `7124 + r * (2520 ±0)` + // Minimum execution time: 561_581 nanoseconds. + Weight::from_parts(441_046_359, 7124) + // Standard Error: 99_108 + .saturating_add(Weight::from_parts(71_874_739, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2520).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:801 w:801) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:2 w:0) @@ -1296,22 +1288,22 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 800]`. fn seal_call(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1260 + r * (245 ±0)` - // Estimated: `9440 + r * (2721 ±0)` - // Minimum execution time: 283_869_000 picoseconds. - Weight::from_parts(288_374_000, 9440) - // Standard Error: 137_512 - .saturating_add(Weight::from_parts(248_206_665, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) + // Measured: `684 + r * (245 ±0)` + // Estimated: `8943 + r * (2721 ±0)` + // Minimum execution time: 485_332 nanoseconds. + Weight::from_parts(535_912_000, 8943) + // Standard Error: 786_881 + .saturating_add(Weight::from_parts(537_702_187, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2721).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:736 w:0) @@ -1326,21 +1318,21 @@ impl pallet_contracts::weights::WeightInfo for WeightIn fn seal_delegate_call(r: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0 + r * (576 ±0)` - // Estimated: `6812 + r * (2637 ±3)` - // Minimum execution time: 257_577_000 picoseconds. - Weight::from_parts(277_310_000, 6812) - // Standard Error: 150_204 - .saturating_add(Weight::from_parts(249_943_483, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Estimated: `6598 + r * (2637 ±3)` + // Minimum execution time: 536_731 nanoseconds. + Weight::from_parts(550_162_000, 6598) + // Standard Error: 688_612 + .saturating_add(Weight::from_parts(537_876_786, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2637).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:3 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:2 w:2) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:2 w:0) @@ -1355,24 +1347,24 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `c` is `[0, 1048576]`. fn seal_call_per_transfer_clone_byte(t: u32, c: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1307 + t * (277 ±0)` - // Estimated: `12197 + t * (5227 ±0)` - // Minimum execution time: 471_081_000 picoseconds. - Weight::from_parts(79_081_122, 12197) - // Standard Error: 11_777_790 - .saturating_add(Weight::from_parts(357_425_411, 0).saturating_mul(t.into())) + // Measured: `1093 + t * (285 ±0)` + // Estimated: `11983 + t * (5235 ±0)` + // Minimum execution time: 945_443 nanoseconds. + Weight::from_parts(938_213_161, 11983) + // Standard Error: 12_269_613 + .saturating_add(Weight::from_parts(54_663_055, 0).saturating_mul(t.into())) // Standard Error: 17 - .saturating_add(Weight::from_parts(1_111, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(13_u64)) + .saturating_add(Weight::from_parts(1_114, 0).saturating_mul(c.into())) + .saturating_add(T::DbWeight::get().reads(13)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(t.into()))) - .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(T::DbWeight::get().writes(6)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(t.into()))) - .saturating_add(Weight::from_parts(0, 5227).saturating_mul(t.into())) + .saturating_add(Weight::from_parts(0, 5235).saturating_mul(t.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:802 w:802) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:801 w:801) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:801 w:800) @@ -1386,26 +1378,26 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: `System::EventTopics` (r:803 w:803) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:800 w:800) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `Measured`) /// The range of component `r` is `[1, 800]`. fn seal_instantiate(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1278 + r * (255 ±0)` - // Estimated: `9620 + r * (2731 ±0)` - // Minimum execution time: 672_742_000 picoseconds. - Weight::from_parts(680_025_000, 9620) - // Standard Error: 313_642 - .saturating_add(Weight::from_parts(388_311_259, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(11_u64)) + // Measured: `1118 + r * (255 ±0)` + // Estimated: `9443 + r * (2731 ±0)` + // Minimum execution time: 1_267_695 nanoseconds. + Weight::from_parts(1_289_974_000, 9443) + // Standard Error: 991_189 + .saturating_add(Weight::from_parts(801_216_526, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(11)) .saturating_add(T::DbWeight::get().reads((6_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(7_u64)) + .saturating_add(T::DbWeight::get().writes(7)) .saturating_add(T::DbWeight::get().writes((5_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2731).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:3 w:3) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:2 w:2) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:2 w:1) @@ -1419,30 +1411,32 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// Storage: `System::EventTopics` (r:4 w:4) /// Proof: `System::EventTopics` (`max_values`: None, `max_size`: None, mode: `Measured`) /// Storage: `Balances::Holds` (r:1 w:1) - /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(85), added: 2560, mode: `Measured`) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `Measured`) /// The range of component `t` is `[0, 1]`. /// The range of component `i` is `[0, 983040]`. /// The range of component `s` is `[0, 983040]`. fn seal_instantiate_per_transfer_input_salt_byte(t: u32, i: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1303 + t * (104 ±0)` - // Estimated: `12211 + t * (2549 ±1)` - // Minimum execution time: 2_733_870_000 picoseconds. - Weight::from_parts(1_001_793_458, 12211) - // Standard Error: 12 - .saturating_add(Weight::from_parts(1_963, 0).saturating_mul(i.into())) - // Standard Error: 12 - .saturating_add(Weight::from_parts(2_060, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(16_u64)) + // Measured: `1051 + t * (145 ±0)` + // Estimated: `11964 + t * (2591 ±2)` + // Minimum execution time: 3_219_401 nanoseconds. + Weight::from_parts(976_837_163, 11964) + // Standard Error: 15_942_531 + .saturating_add(Weight::from_parts(200_805_198, 0).saturating_mul(t.into())) + // Standard Error: 25 + .saturating_add(Weight::from_parts(2_489, 0).saturating_mul(i.into())) + // Standard Error: 25 + .saturating_add(Weight::from_parts(2_552, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(16)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(t.into()))) - .saturating_add(T::DbWeight::get().writes(11_u64)) + .saturating_add(T::DbWeight::get().writes(11)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(t.into()))) - .saturating_add(Weight::from_parts(0, 2549).saturating_mul(t.into())) + .saturating_add(Weight::from_parts(0, 2591).saturating_mul(t.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1456,20 +1450,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_hash_sha2_256(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `862 + r * (8 ±0)` - // Estimated: `6801 + r * (8 ±0)` - // Minimum execution time: 272_658_000 picoseconds. - Weight::from_parts(282_717_645, 6801) - // Standard Error: 517 - .saturating_add(Weight::from_parts(400_604, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `648 + r * (8 ±0)` + // Estimated: `6588 + r * (8 ±0)` + // Minimum execution time: 535_012 nanoseconds. + Weight::from_parts(570_533_334, 6588) + // Standard Error: 3_285 + .saturating_add(Weight::from_parts(896_964, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1483,19 +1477,19 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 1048576]`. fn seal_hash_sha2_256_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `870` - // Estimated: `6808` - // Minimum execution time: 260_969_000 picoseconds. - Weight::from_parts(265_206_847, 6808) - // Standard Error: 2 - .saturating_add(Weight::from_parts(1_134, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `656` + // Estimated: `6596` + // Minimum execution time: 544_862 nanoseconds. + Weight::from_parts(587_166_184, 6596) + // Standard Error: 12 + .saturating_add(Weight::from_parts(1_449, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1509,20 +1503,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_hash_keccak_256(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `864 + r * (8 ±0)` - // Estimated: `6806 + r * (8 ±0)` - // Minimum execution time: 262_351_000 picoseconds. - Weight::from_parts(286_974_296, 6806) - // Standard Error: 514 - .saturating_add(Weight::from_parts(802_363, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `650 + r * (8 ±0)` + // Estimated: `6590 + r * (8 ±0)` + // Minimum execution time: 474_112 nanoseconds. + Weight::from_parts(627_816_943, 6590) + // Standard Error: 5_383 + .saturating_add(Weight::from_parts(1_409_976, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1536,19 +1530,19 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 1048576]`. fn seal_hash_keccak_256_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `872` - // Estimated: `6814` - // Minimum execution time: 276_907_000 picoseconds. - Weight::from_parts(277_928_418, 6814) - // Standard Error: 1 - .saturating_add(Weight::from_parts(3_410, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `658` + // Estimated: `6598` + // Minimum execution time: 479_872 nanoseconds. + Weight::from_parts(635_482_819, 6598) + // Standard Error: 13 + .saturating_add(Weight::from_parts(4_874, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1562,20 +1556,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_hash_blake2_256(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `864 + r * (8 ±0)` - // Estimated: `6808 + r * (8 ±0)` - // Minimum execution time: 263_660_000 picoseconds. - Weight::from_parts(285_665_916, 6808) - // Standard Error: 527 - .saturating_add(Weight::from_parts(480_457, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `650 + r * (8 ±0)` + // Estimated: `6593 + r * (8 ±0)` + // Minimum execution time: 488_072 nanoseconds. + Weight::from_parts(616_223_306, 6593) + // Standard Error: 5_696 + .saturating_add(Weight::from_parts(970_036, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1589,19 +1583,19 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 1048576]`. fn seal_hash_blake2_256_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `872` - // Estimated: `6813` - // Minimum execution time: 262_071_000 picoseconds. - Weight::from_parts(270_115_341, 6813) - // Standard Error: 1 - .saturating_add(Weight::from_parts(1_254, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `658` + // Estimated: `6598` + // Minimum execution time: 542_302 nanoseconds. + Weight::from_parts(613_680_368, 6598) + // Standard Error: 14 + .saturating_add(Weight::from_parts(1_964, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1615,20 +1609,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_hash_blake2_128(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `864 + r * (8 ±0)` - // Estimated: `6805 + r * (8 ±0)` - // Minimum execution time: 265_568_000 picoseconds. - Weight::from_parts(285_791_811, 6805) - // Standard Error: 559 - .saturating_add(Weight::from_parts(505_330, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `650 + r * (8 ±0)` + // Estimated: `6590 + r * (8 ±0)` + // Minimum execution time: 461_662 nanoseconds. + Weight::from_parts(648_493_086, 6590) + // Standard Error: 4_593 + .saturating_add(Weight::from_parts(920_179, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1642,19 +1636,19 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 1048576]`. fn seal_hash_blake2_128_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `872` - // Estimated: `6811` - // Minimum execution time: 271_336_000 picoseconds. - Weight::from_parts(272_829_313, 6811) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_252, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `658` + // Estimated: `6598` + // Minimum execution time: 551_902 nanoseconds. + Weight::from_parts(622_414_265, 6598) + // Standard Error: 15 + .saturating_add(Weight::from_parts(1_982, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1668,20 +1662,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `n` is `[0, 125697]`. fn seal_sr25519_verify_per_byte(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `997 + n * (1 ±0)` - // Estimated: `6934 + n * (1 ±0)` - // Minimum execution time: 351_146_000 picoseconds. - Weight::from_parts(355_368_323, 6934) - // Standard Error: 14 - .saturating_add(Weight::from_parts(6_155, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `783 + n * (1 ±0)` + // Estimated: `6720 + n * (1 ±0)` + // Minimum execution time: 679_592 nanoseconds. + Weight::from_parts(693_747_758, 6720) + // Standard Error: 44 + .saturating_add(Weight::from_parts(10_020, 0).saturating_mul(n.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1695,20 +1689,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 160]`. fn seal_sr25519_verify(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `807 + r * (112 ±0)` - // Estimated: `6748 + r * (112 ±0)` - // Minimum execution time: 277_250_000 picoseconds. - Weight::from_parts(346_490_114, 6748) - // Standard Error: 14_654 - .saturating_add(Weight::from_parts(56_127_492, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `589 + r * (112 ±0)` + // Estimated: `6534 + r * (112 ±0)` + // Minimum execution time: 561_292 nanoseconds. + Weight::from_parts(640_027_829, 6534) + // Standard Error: 86_043 + .saturating_add(Weight::from_parts(103_095_748, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 112).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1722,20 +1716,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 160]`. fn seal_ecdsa_recover(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `907 + r * (76 ±0)` - // Estimated: `6801 + r * (77 ±0)` - // Minimum execution time: 272_697_000 picoseconds. - Weight::from_parts(345_385_667, 6801) - // Standard Error: 14_226 - .saturating_add(Weight::from_parts(46_037_637, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `693 + r * (76 ±0)` + // Estimated: `6587 + r * (77 ±0)` + // Minimum execution time: 547_652 nanoseconds. + Weight::from_parts(660_814_171, 6587) + // Standard Error: 61_313 + .saturating_add(Weight::from_parts(77_704_263, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 77).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1749,20 +1743,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 160]`. fn seal_ecdsa_to_eth_address(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `877 + r * (42 ±0)` - // Estimated: `6816 + r * (42 ±0)` - // Minimum execution time: 271_800_000 picoseconds. - Weight::from_parts(314_891_136, 6816) - // Standard Error: 9_762 - .saturating_add(Weight::from_parts(11_949_979, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `663 + r * (42 ±0)` + // Estimated: `6602 + r * (42 ±0)` + // Minimum execution time: 441_102 nanoseconds. + Weight::from_parts(581_365_341, 6602) + // Standard Error: 30_378 + .saturating_add(Weight::from_parts(16_916_864, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 42).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1536 w:1536) @@ -1777,21 +1771,21 @@ impl pallet_contracts::weights::WeightInfo for WeightIn fn seal_set_code_hash(r: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0 + r * (965 ±0)` - // Estimated: `6807 + r * (3090 ±10)` - // Minimum execution time: 274_238_000 picoseconds. - Weight::from_parts(278_034_000, 6807) - // Standard Error: 77_011 - .saturating_add(Weight::from_parts(27_627_005, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Estimated: `6593 + r * (3090 ±10)` + // Minimum execution time: 478_301 nanoseconds. + Weight::from_parts(532_962_000, 6593) + // Standard Error: 169_896 + .saturating_add(Weight::from_parts(57_252_995, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 3090).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:33 w:32) @@ -1805,22 +1799,22 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 32]`. fn add_delegate_dependency(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `928 + r * (131 ±0)` - // Estimated: `6878 + r * (2606 ±0)` - // Minimum execution time: 271_519_000 picoseconds. - Weight::from_parts(292_726_476, 6878) - // Standard Error: 23_870 - .saturating_add(Weight::from_parts(6_695_172, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `715 + r * (131 ±0)` + // Estimated: `6664 + r * (2606 ±0)` + // Minimum execution time: 520_780 nanoseconds. + Weight::from_parts(656_546_733, 6664) + // Standard Error: 303_992 + .saturating_add(Weight::from_parts(14_603_365, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2606).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `MaxEncodedLen`) /// Storage: `Contracts::CodeInfoOf` (r:33 w:32) @@ -1834,22 +1828,22 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 32]`. fn remove_delegate_dependency(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `969 + r * (183 ±0)` + // Measured: `754 + r * (183 ±0)` // Estimated: `129453 + r * (2568 ±0)` - // Minimum execution time: 274_675_000 picoseconds. - Weight::from_parts(293_727_489, 129453) - // Standard Error: 23_160 - .saturating_add(Weight::from_parts(5_895_043, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Minimum execution time: 530_861 nanoseconds. + Weight::from_parts(726_049_331, 129453) + // Standard Error: 338_829 + .saturating_add(Weight::from_parts(8_606_108, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2568).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1863,20 +1857,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_reentrance_count(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `858 + r * (3 ±0)` - // Estimated: `6804 + r * (3 ±0)` - // Minimum execution time: 253_330_000 picoseconds. - Weight::from_parts(281_079_564, 6804) - // Standard Error: 378 - .saturating_add(Weight::from_parts(180_655, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `644 + r * (3 ±0)` + // Estimated: `6584 + r * (3 ±0)` + // Minimum execution time: 468_541 nanoseconds. + Weight::from_parts(626_524_887, 6584) + // Standard Error: 4_710 + .saturating_add(Weight::from_parts(393_620, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1890,20 +1884,20 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_account_reentrance_count(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2109 + r * (39 ±0)` - // Estimated: `7899 + r * (40 ±0)` - // Minimum execution time: 276_552_000 picoseconds. - Weight::from_parts(368_521_088, 7899) - // Standard Error: 2_310 - .saturating_add(Weight::from_parts(318_129, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(Weight::from_parts(0, 40).saturating_mul(r.into())) + // Measured: `1382 + r * (39 ±0)` + // Estimated: `7282 + r * (39 ±0)` + // Minimum execution time: 542_420 nanoseconds. + Weight::from_parts(717_598_356, 7282) + // Standard Error: 4_053 + .saturating_add(Weight::from_parts(553_534, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(3)) + .saturating_add(Weight::from_parts(0, 39).saturating_mul(r.into())) } /// Storage: `Contracts::MigrationInProgress` (r:1 w:0) /// Proof: `Contracts::MigrationInProgress` (`max_values`: Some(1), `max_size`: Some(1026), added: 1521, mode: `Measured`) /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `Measured`) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `Measured`) /// Storage: `Contracts::ContractInfoOf` (r:1 w:1) /// Proof: `Contracts::ContractInfoOf` (`max_values`: None, `max_size`: Some(1795), added: 4270, mode: `Measured`) /// Storage: `Contracts::CodeInfoOf` (r:1 w:0) @@ -1919,14 +1913,14 @@ impl pallet_contracts::weights::WeightInfo for WeightIn /// The range of component `r` is `[0, 1600]`. fn seal_instantiation_nonce(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `861 + r * (3 ±0)` - // Estimated: `6801 + r * (3 ±0)` - // Minimum execution time: 258_953_000 picoseconds. - Weight::from_parts(288_222_836, 6801) - // Standard Error: 367 - .saturating_add(Weight::from_parts(152_842, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `647 + r * (3 ±0)` + // Estimated: `6587 + r * (3 ±0)` + // Minimum execution time: 534_052 nanoseconds. + Weight::from_parts(647_781_638, 6587) + // Standard Error: 6_129 + .saturating_add(Weight::from_parts(327_893, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(Weight::from_parts(0, 3).saturating_mul(r.into())) } /// The range of component `r` is `[0, 5000]`. @@ -1934,9 +1928,9 @@ impl pallet_contracts::weights::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 1_476_000 picoseconds. - Weight::from_parts(2_119_717, 0) - // Standard Error: 28 - .saturating_add(Weight::from_parts(9_805, 0).saturating_mul(r.into())) + // Minimum execution time: 3_760 nanoseconds. + Weight::from_parts(6_262_561, 0) + // Standard Error: 74 + .saturating_add(Weight::from_parts(22_284, 0).saturating_mul(r.into())) } } diff --git a/runtime/common/src/weights/pallet_democracy.rs b/runtime/common/src/weights/pallet_democracy.rs index 78f1f7ee1..100de6939 100644 --- a/runtime/common/src/weights/pallet_democracy.rs +++ b/runtime/common/src/weights/pallet_democracy.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_democracy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,448 +52,448 @@ use frame_support::{ /// Weight functions for pallet_democracy (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_democracy::weights::WeightInfo for WeightInfo { - /// Storage: Democracy PublicPropCount (r:1 w:1) - /// Proof: Democracy PublicPropCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Democracy PublicProps (r:1 w:1) - /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) - /// Storage: Democracy Blacklist (r:1 w:0) - /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen) - /// Storage: Democracy DepositOf (r:0 w:1) - /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) + /// Storage: `Democracy::PublicPropCount` (r:1 w:1) + /// Proof: `Democracy::PublicPropCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Democracy::PublicProps` (r:1 w:1) + /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`) + /// Storage: `Democracy::Blacklist` (r:1 w:0) + /// Proof: `Democracy::Blacklist` (`max_values`: None, `max_size`: Some(3242), added: 5717, mode: `MaxEncodedLen`) + /// Storage: `Democracy::DepositOf` (r:0 w:1) + /// Proof: `Democracy::DepositOf` (`max_values`: None, `max_size`: Some(3230), added: 5705, mode: `MaxEncodedLen`) fn propose() -> Weight { // Proof Size summary in bytes: - // Measured: `4801` + // Measured: `4772` // Estimated: `18187` - // Minimum execution time: 49_339_000 picoseconds. - Weight::from_parts(50_942_000, 18187) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Minimum execution time: 94_250 nanoseconds. + Weight::from_parts(106_040_000, 18187) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Democracy DepositOf (r:1 w:1) - /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) + /// Storage: `Democracy::DepositOf` (r:1 w:1) + /// Proof: `Democracy::DepositOf` (`max_values`: None, `max_size`: Some(3230), added: 5705, mode: `MaxEncodedLen`) fn second() -> Weight { // Proof Size summary in bytes: - // Measured: `3556` + // Measured: `3527` // Estimated: `6695` - // Minimum execution time: 43_291_000 picoseconds. - Weight::from_parts(44_856_000, 6695) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 79_460 nanoseconds. + Weight::from_parts(83_551_000, 6695) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) - /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) + /// Storage: `Democracy::VotingOf` (r:1 w:1) + /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3799), added: 6274, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn vote_new() -> Weight { // Proof Size summary in bytes: - // Measured: `3470` - // Estimated: `7260` - // Minimum execution time: 61_890_000 picoseconds. - Weight::from_parts(63_626_000, 7260) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `3415` + // Estimated: `7264` + // Minimum execution time: 119_831 nanoseconds. + Weight::from_parts(125_030_000, 7264) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) - /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) + /// Storage: `Democracy::VotingOf` (r:1 w:1) + /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3799), added: 6274, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn vote_existing() -> Weight { // Proof Size summary in bytes: - // Measured: `3492` - // Estimated: `7260` - // Minimum execution time: 67_802_000 picoseconds. - Weight::from_parts(69_132_000, 7260) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `3437` + // Estimated: `7264` + // Minimum execution time: 98_820 nanoseconds. + Weight::from_parts(131_651_000, 7264) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) - /// Storage: Democracy Cancellations (r:1 w:1) - /// Proof: Democracy Cancellations (max_values: None, max_size: Some(33), added: 2508, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:1 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) + /// Storage: `Democracy::Cancellations` (r:1 w:1) + /// Proof: `Democracy::Cancellations` (`max_values`: None, `max_size`: Some(33), added: 2508, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:1 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn emergency_cancel() -> Weight { // Proof Size summary in bytes: - // Measured: `366` - // Estimated: `3666` - // Minimum execution time: 25_757_000 picoseconds. - Weight::from_parts(27_226_000, 3666) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `341` + // Estimated: `3674` + // Minimum execution time: 52_690 nanoseconds. + Weight::from_parts(54_040_000, 3674) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Democracy PublicProps (r:1 w:1) - /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) - /// Storage: Democracy DepositOf (r:1 w:1) - /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:3 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) - /// Storage: Democracy NextExternal (r:1 w:1) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) - /// Storage: Democracy Blacklist (r:0 w:1) - /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen) + /// Storage: `Democracy::PublicProps` (r:1 w:1) + /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`) + /// Storage: `Democracy::DepositOf` (r:1 w:1) + /// Proof: `Democracy::DepositOf` (`max_values`: None, `max_size`: Some(3230), added: 5705, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:3 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) + /// Storage: `Democracy::NextExternal` (r:1 w:1) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) + /// Storage: `Democracy::Blacklist` (r:0 w:1) + /// Proof: `Democracy::Blacklist` (`max_values`: None, `max_size`: Some(3242), added: 5717, mode: `MaxEncodedLen`) fn blacklist() -> Weight { // Proof Size summary in bytes: - // Measured: `5910` + // Measured: `6171` // Estimated: `18187` - // Minimum execution time: 113_060_000 picoseconds. - Weight::from_parts(114_813_000, 18187) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) + // Minimum execution time: 214_781 nanoseconds. + Weight::from_parts(226_251_000, 18187) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(8)) } - /// Storage: Democracy NextExternal (r:1 w:1) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) - /// Storage: Democracy Blacklist (r:1 w:0) - /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen) + /// Storage: `Democracy::NextExternal` (r:1 w:1) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) + /// Storage: `Democracy::Blacklist` (r:1 w:0) + /// Proof: `Democracy::Blacklist` (`max_values`: None, `max_size`: Some(3242), added: 5717, mode: `MaxEncodedLen`) fn external_propose() -> Weight { // Proof Size summary in bytes: - // Measured: `3416` - // Estimated: `6703` - // Minimum execution time: 13_413_000 picoseconds. - Weight::from_parts(13_794_000, 6703) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `3387` + // Estimated: `6707` + // Minimum execution time: 28_680 nanoseconds. + Weight::from_parts(29_660_000, 6707) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy NextExternal (r:0 w:1) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) + /// Storage: `Democracy::NextExternal` (r:0 w:1) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) fn external_propose_majority() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_213_000 picoseconds. - Weight::from_parts(3_429_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 6_580 nanoseconds. + Weight::from_parts(7_150_000, 0).saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy NextExternal (r:0 w:1) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) + /// Storage: `Democracy::NextExternal` (r:0 w:1) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) fn external_propose_default() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_280_000 picoseconds. - Weight::from_parts(3_389_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 6_760 nanoseconds. + Weight::from_parts(7_100_000, 0).saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy NextExternal (r:1 w:1) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumCount (r:1 w:1) - /// Proof: Democracy ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:1 w:2) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumInfoOf (r:0 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) + /// Storage: `Democracy::NextExternal` (r:1 w:1) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumCount` (r:1 w:1) + /// Proof: `Democracy::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:1 w:2) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumInfoOf` (r:0 w:1) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) fn fast_track() -> Weight { // Proof Size summary in bytes: - // Measured: `286` + // Measured: `253` // Estimated: `3518` - // Minimum execution time: 28_142_000 picoseconds. - Weight::from_parts(28_862_000, 3518) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) + // Minimum execution time: 54_810 nanoseconds. + Weight::from_parts(55_750_000, 3518) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(5)) } - /// Storage: Democracy NextExternal (r:1 w:1) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) - /// Storage: Democracy Blacklist (r:1 w:1) - /// Proof: Democracy Blacklist (max_values: None, max_size: Some(3238), added: 5713, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:1 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Democracy::NextExternal` (r:1 w:1) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) + /// Storage: `Democracy::Blacklist` (r:1 w:1) + /// Proof: `Democracy::Blacklist` (`max_values`: None, `max_size`: Some(3242), added: 5717, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:1 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn veto_external() -> Weight { // Proof Size summary in bytes: - // Measured: `3519` - // Estimated: `6703` - // Minimum execution time: 32_395_000 picoseconds. - Weight::from_parts(33_617_000, 6703) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `3490` + // Estimated: `6707` + // Minimum execution time: 59_521 nanoseconds. + Weight::from_parts(60_930_000, 6707) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Democracy PublicProps (r:1 w:1) - /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) - /// Storage: Democracy DepositOf (r:1 w:1) - /// Proof: Democracy DepositOf (max_values: None, max_size: Some(3230), added: 5705, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:1 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Democracy::PublicProps` (r:1 w:1) + /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`) + /// Storage: `Democracy::DepositOf` (r:1 w:1) + /// Proof: `Democracy::DepositOf` (`max_values`: None, `max_size`: Some(3230), added: 5705, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:1 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn cancel_proposal() -> Weight { // Proof Size summary in bytes: - // Measured: `5821` + // Measured: `6074` // Estimated: `18187` - // Minimum execution time: 92_255_000 picoseconds. - Weight::from_parts(93_704_000, 18187) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Minimum execution time: 186_500 nanoseconds. + Weight::from_parts(203_851_000, 18187) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(5)) } - /// Storage: Democracy MetadataOf (r:1 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumInfoOf (r:0 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) + /// Storage: `Democracy::MetadataOf` (r:1 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumInfoOf` (r:0 w:1) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) fn cancel_referendum() -> Weight { // Proof Size summary in bytes: - // Measured: `271` + // Measured: `238` // Estimated: `3518` - // Minimum execution time: 19_623_000 picoseconds. - Weight::from_parts(20_545_000, 3518) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Minimum execution time: 40_041 nanoseconds. + Weight::from_parts(41_300_000, 3518) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Democracy LowestUnbaked (r:1 w:1) - /// Proof: Democracy LowestUnbaked (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumCount (r:1 w:0) - /// Proof: Democracy ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumInfoOf (r:99 w:0) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) + /// Storage: `Democracy::LowestUnbaked` (r:1 w:1) + /// Proof: `Democracy::LowestUnbaked` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumCount` (r:1 w:0) + /// Proof: `Democracy::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumInfoOf` (r:99 w:0) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `244 + r * (86 ±0)` - // Estimated: `1489 + r * (2676 ±0)` - // Minimum execution time: 7_032_000 picoseconds. - Weight::from_parts(7_931_421, 1489) - // Standard Error: 7_395 - .saturating_add(Weight::from_parts(3_236_964, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `211 + r * (94 ±0)` + // Estimated: `1489 + r * (2684 ±0)` + // Minimum execution time: 15_640 nanoseconds. + Weight::from_parts(16_300_000, 1489) + // Standard Error: 24_194 + .saturating_add(Weight::from_parts(6_717_090, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) } - /// Storage: Democracy LowestUnbaked (r:1 w:1) - /// Proof: Democracy LowestUnbaked (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumCount (r:1 w:0) - /// Proof: Democracy ReferendumCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Democracy LastTabledWasExternal (r:1 w:0) - /// Proof: Democracy LastTabledWasExternal (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) - /// Storage: Democracy NextExternal (r:1 w:0) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) - /// Storage: Democracy PublicProps (r:1 w:0) - /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumInfoOf (r:99 w:0) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) + /// Storage: `Democracy::LowestUnbaked` (r:1 w:1) + /// Proof: `Democracy::LowestUnbaked` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumCount` (r:1 w:0) + /// Proof: `Democracy::ReferendumCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Democracy::LastTabledWasExternal` (r:1 w:0) + /// Proof: `Democracy::LastTabledWasExternal` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) + /// Storage: `Democracy::NextExternal` (r:1 w:0) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) + /// Storage: `Democracy::PublicProps` (r:1 w:0) + /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumInfoOf` (r:99 w:0) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `244 + r * (86 ±0)` - // Estimated: `18187 + r * (2676 ±0)` - // Minimum execution time: 10_524_000 picoseconds. - Weight::from_parts(10_369_064, 18187) - // Standard Error: 8_385 - .saturating_add(Weight::from_parts(3_242_334, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `211 + r * (94 ±0)` + // Estimated: `18187 + r * (2684 ±0)` + // Minimum execution time: 21_570 nanoseconds. + Weight::from_parts(21_702_657, 18187) + // Standard Error: 27_834 + .saturating_add(Weight::from_parts(6_702_723, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) } - /// Storage: Democracy VotingOf (r:3 w:3) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumInfoOf (r:99 w:99) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: `Democracy::VotingOf` (r:3 w:3) + /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3799), added: 6274, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumInfoOf` (r:99 w:99) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 99]`. fn delegate(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `830 + r * (108 ±0)` - // Estimated: `19800 + r * (2676 ±0)` - // Minimum execution time: 46_106_000 picoseconds. - Weight::from_parts(48_936_654, 19800) - // Standard Error: 8_879 - .saturating_add(Weight::from_parts(4_708_141, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `779 + r * (116 ±0)` + // Estimated: `19812 + r * (2684 ±0)` + // Minimum execution time: 77_540 nanoseconds. + Weight::from_parts(78_180_523, 19812) + // Standard Error: 62_728 + .saturating_add(Weight::from_parts(8_933_951, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(4_u64)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) } - /// Storage: Democracy VotingOf (r:2 w:2) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) - /// Storage: Democracy ReferendumInfoOf (r:99 w:99) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) + /// Storage: `Democracy::VotingOf` (r:2 w:2) + /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3799), added: 6274, mode: `MaxEncodedLen`) + /// Storage: `Democracy::ReferendumInfoOf` (r:99 w:99) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `493 + r * (108 ±0)` - // Estimated: `13530 + r * (2676 ±0)` - // Minimum execution time: 21_078_000 picoseconds. - Weight::from_parts(22_732_737, 13530) - // Standard Error: 7_969 - .saturating_add(Weight::from_parts(4_626_458, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) + // Measured: `468 + r * (116 ±0)` + // Estimated: `13538 + r * (2684 ±0)` + // Minimum execution time: 42_001 nanoseconds. + Weight::from_parts(44_467_605, 13538) + // Standard Error: 42_007 + .saturating_add(Weight::from_parts(8_358_722, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(r.into()))) - .saturating_add(Weight::from_parts(0, 2676).saturating_mul(r.into())) + .saturating_add(Weight::from_parts(0, 2684).saturating_mul(r.into())) } - /// Storage: Democracy PublicProps (r:0 w:1) - /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) + /// Storage: `Democracy::PublicProps` (r:0 w:1) + /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`) fn clear_public_proposals() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_229_000 picoseconds. - Weight::from_parts(3_415_000, 0).saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 6_970 nanoseconds. + Weight::from_parts(7_250_000, 0).saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `Democracy::VotingOf` (r:1 w:1) + /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3799), added: 6274, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `563` - // Estimated: `7260` - // Minimum execution time: 25_735_000 picoseconds. - Weight::from_parts(41_341_468, 7260) - // Standard Error: 3_727 - .saturating_add(Weight::from_parts(94_755, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `500` + // Estimated: `7264` + // Minimum execution time: 46_810 nanoseconds. + Weight::from_parts(73_459_464, 7264) + // Standard Error: 9_303 + .saturating_add(Weight::from_parts(355_260, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `Democracy::VotingOf` (r:1 w:1) + /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3799), added: 6274, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `564 + r * (22 ±0)` - // Estimated: `7260` - // Minimum execution time: 36_233_000 picoseconds. - Weight::from_parts(39_836_017, 7260) - // Standard Error: 1_791 - .saturating_add(Weight::from_parts(132_158, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(4_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) + // Measured: `501 + r * (22 ±0)` + // Estimated: `7264` + // Minimum execution time: 57_700 nanoseconds. + Weight::from_parts(73_683_809, 7264) + // Standard Error: 10_335 + .saturating_add(Weight::from_parts(391_304, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) - /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) + /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) + /// Storage: `Democracy::VotingOf` (r:1 w:1) + /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3799), added: 6274, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `728 + r * (26 ±0)` - // Estimated: `7260` - // Minimum execution time: 16_081_000 picoseconds. - Weight::from_parts(19_624_101, 7260) - // Standard Error: 1_639 - .saturating_add(Weight::from_parts(133_630, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `707 + r * (26 ±0)` + // Estimated: `7264` + // Minimum execution time: 32_310 nanoseconds. + Weight::from_parts(42_608_741, 7264) + // Standard Error: 8_632 + .saturating_add(Weight::from_parts(320_539, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) - /// Storage: Democracy VotingOf (r:1 w:1) - /// Proof: Democracy VotingOf (max_values: None, max_size: Some(3795), added: 6270, mode: MaxEncodedLen) + /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:1) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) + /// Storage: `Democracy::VotingOf` (r:1 w:1) + /// Proof: `Democracy::VotingOf` (`max_values`: None, `max_size`: Some(3799), added: 6274, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `728 + r * (26 ±0)` - // Estimated: `7260` - // Minimum execution time: 15_634_000 picoseconds. - Weight::from_parts(19_573_407, 7260) - // Standard Error: 1_790 - .saturating_add(Weight::from_parts(139_707, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `707 + r * (26 ±0)` + // Estimated: `7264` + // Minimum execution time: 27_850 nanoseconds. + Weight::from_parts(38_259_109, 7264) + // Standard Error: 6_531 + .saturating_add(Weight::from_parts(367_033, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Democracy NextExternal (r:1 w:0) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) - /// Storage: Preimage StatusFor (r:1 w:0) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:0 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Democracy::NextExternal` (r:1 w:0) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:0) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:0 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn set_external_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `356` + // Measured: `323` // Estimated: `3556` - // Minimum execution time: 18_344_000 picoseconds. - Weight::from_parts(18_727_000, 3556) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 37_840 nanoseconds. + Weight::from_parts(38_590_000, 3556) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy NextExternal (r:1 w:0) - /// Proof: Democracy NextExternal (max_values: Some(1), max_size: Some(132), added: 627, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:1 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Democracy::NextExternal` (r:1 w:0) + /// Proof: `Democracy::NextExternal` (`max_values`: Some(1), `max_size`: Some(132), added: 627, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:1 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn clear_external_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `286` + // Measured: `253` // Estimated: `3518` - // Minimum execution time: 16_497_000 picoseconds. - Weight::from_parts(16_892_000, 3518) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 34_190 nanoseconds. + Weight::from_parts(35_360_000, 3518) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy PublicProps (r:1 w:0) - /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) - /// Storage: Preimage StatusFor (r:1 w:0) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:0 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Democracy::PublicProps` (r:1 w:0) + /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`) + /// Storage: `Preimage::StatusFor` (r:1 w:0) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:0 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn set_proposal_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `4888` + // Measured: `4855` // Estimated: `18187` - // Minimum execution time: 39_517_000 picoseconds. - Weight::from_parts(40_632_000, 18187) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 79_700 nanoseconds. + Weight::from_parts(93_760_000, 18187) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy PublicProps (r:1 w:0) - /// Proof: Democracy PublicProps (max_values: Some(1), max_size: Some(16702), added: 17197, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:1 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Democracy::PublicProps` (r:1 w:0) + /// Proof: `Democracy::PublicProps` (`max_values`: Some(1), `max_size`: Some(16702), added: 17197, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:1 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn clear_proposal_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `4822` + // Measured: `4789` // Estimated: `18187` - // Minimum execution time: 37_108_000 picoseconds. - Weight::from_parts(37_599_000, 18187) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 77_470 nanoseconds. + Weight::from_parts(88_080_000, 18187) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Preimage StatusFor (r:1 w:0) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:0 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:0) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:0 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn set_referendum_metadata() -> Weight { // Proof Size summary in bytes: // Measured: `144` // Estimated: `3556` - // Minimum execution time: 13_997_000 picoseconds. - Weight::from_parts(14_298_000, 3556) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 29_750 nanoseconds. + Weight::from_parts(30_401_000, 3556) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// Proof: Democracy ReferendumInfoOf (max_values: None, max_size: Some(201), added: 2676, mode: MaxEncodedLen) - /// Storage: Democracy MetadataOf (r:1 w:1) - /// Proof: Democracy MetadataOf (max_values: None, max_size: Some(53), added: 2528, mode: MaxEncodedLen) + /// Storage: `Democracy::ReferendumInfoOf` (r:1 w:0) + /// Proof: `Democracy::ReferendumInfoOf` (`max_values`: None, `max_size`: Some(209), added: 2684, mode: `MaxEncodedLen`) + /// Storage: `Democracy::MetadataOf` (r:1 w:1) + /// Proof: `Democracy::MetadataOf` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) fn clear_referendum_metadata() -> Weight { // Proof Size summary in bytes: - // Measured: `302` - // Estimated: `3666` - // Minimum execution time: 18_122_000 picoseconds. - Weight::from_parts(18_655_000, 3666) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `273` + // Estimated: `3674` + // Minimum execution time: 38_380 nanoseconds. + Weight::from_parts(39_540_000, 3674) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/runtime/common/src/weights/pallet_identity.rs b/runtime/common/src/weights/pallet_identity.rs index 2aa7b79ab..b375f700e 100644 --- a/runtime/common/src/weights/pallet_identity.rs +++ b/runtime/common/src/weights/pallet_identity.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_identity //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,284 +52,288 @@ use frame_support::{ /// Weight functions for pallet_identity (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_identity::weights::WeightInfo for WeightInfo { - /// Storage: Identity Registrars (r:1 w:1) - /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(457), added: 952, mode: MaxEncodedLen) + /// Storage: `Identity::Registrars` (r:1 w:1) + /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(457), added: 952, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 7]`. - fn add_registrar(_r: u32) -> Weight { + fn add_registrar(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `64 + r * (57 ±0)` - // Estimated: `952` - // Minimum execution time: 20_160 nanoseconds. - Weight::from_parts(25_433_606, 952) + // Measured: `32 + r * (57 ±0)` + // Estimated: `1942` + // Minimum execution time: 21_660 nanoseconds. + Weight::from_parts(25_850_328, 1942) + // Standard Error: 29_962 + .saturating_add(Weight::from_parts(896_959, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity IdentityOf (r:1 w:1) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 8]`. /// The range of component `x` is `[0, 64]`. - fn set_identity(_r: u32, x: u32) -> Weight { + fn set_identity(r: u32, x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `474 + r * (5 ±0)` - // Estimated: `7313` - // Minimum execution time: 25_740 nanoseconds. - Weight::from_parts(54_428_048, 7313) - // Standard Error: 11_438 - .saturating_add(Weight::from_parts(664_046, 0).saturating_mul(x.into())) + // Measured: `442 + r * (5 ±0)` + // Estimated: `8303` + // Minimum execution time: 39_640 nanoseconds. + Weight::from_parts(60_315_640, 8303) + // Standard Error: 144_124 + .saturating_add(Weight::from_parts(609_509, 0).saturating_mul(r.into())) + // Standard Error: 16_740 + .saturating_add(Weight::from_parts(1_085_375, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity IdentityOf (r:1 w:0) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) - /// Storage: Identity SubsOf (r:1 w:1) - /// Proof: Identity SubsOf (max_values: None, max_size: Some(2106), added: 4581, mode: MaxEncodedLen) - /// Storage: Identity SuperOf (r:64 w:64) - /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityOf` (r:1 w:0) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) + /// Storage: `Identity::SubsOf` (r:1 w:1) + /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(2106), added: 4581, mode: `MaxEncodedLen`) + /// Storage: `Identity::SuperOf` (r:64 w:64) + /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 64]`. fn set_subs_new(s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `101` - // Estimated: `11894 + s * (2589 ±0)` - // Minimum execution time: 14_240 nanoseconds. - Weight::from_parts(38_930_175, 11894) - // Standard Error: 40_523 - .saturating_add(Weight::from_parts(4_824_524, 0).saturating_mul(s.into())) + // Estimated: `8303 + s * (2589 ±0)` + // Minimum execution time: 19_750 nanoseconds. + Weight::from_parts(46_888_139, 8303) + // Standard Error: 63_869 + .saturating_add(Weight::from_parts(6_537_301, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) .saturating_add(Weight::from_parts(0, 2589).saturating_mul(s.into())) } - /// Storage: Identity IdentityOf (r:1 w:0) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) - /// Storage: Identity SubsOf (r:1 w:1) - /// Proof: Identity SubsOf (max_values: None, max_size: Some(2106), added: 4581, mode: MaxEncodedLen) - /// Storage: Identity SuperOf (r:0 w:64) - /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityOf` (r:1 w:0) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) + /// Storage: `Identity::SubsOf` (r:1 w:1) + /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(2106), added: 4581, mode: `MaxEncodedLen`) + /// Storage: `Identity::SuperOf` (r:0 w:64) + /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 64]`. fn set_subs_old(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `226 + p * (32 ±0)` - // Estimated: `11894` - // Minimum execution time: 16_560 nanoseconds. - Weight::from_parts(33_071_959, 11894) - // Standard Error: 19_437 - .saturating_add(Weight::from_parts(2_080_950, 0).saturating_mul(p.into())) + // Measured: `194 + p * (32 ±0)` + // Estimated: `8303` + // Minimum execution time: 19_190 nanoseconds. + Weight::from_parts(51_774_753, 8303) + // Standard Error: 31_886 + .saturating_add(Weight::from_parts(2_750_438, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) } - /// Storage: Identity SubsOf (r:1 w:1) - /// Proof: Identity SubsOf (max_values: None, max_size: Some(2106), added: 4581, mode: MaxEncodedLen) - /// Storage: Identity IdentityOf (r:1 w:1) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) - /// Storage: Identity SuperOf (r:0 w:64) - /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: `Identity::SubsOf` (r:1 w:1) + /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(2106), added: 4581, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) + /// Storage: `Identity::SuperOf` (r:0 w:64) + /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 8]`. /// The range of component `s` is `[0, 64]`. /// The range of component `x` is `[0, 64]`. - fn clear_identity(r: u32, s: u32, x: u32) -> Weight { + fn clear_identity(_r: u32, s: u32, x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `535 + r * (5 ±0) + s * (32 ±0) + x * (66 ±0)` - // Estimated: `11894` - // Minimum execution time: 58_640 nanoseconds. - Weight::from_parts(48_246_140, 11894) - // Standard Error: 182_255 - .saturating_add(Weight::from_parts(387_308, 0).saturating_mul(r.into())) - // Standard Error: 21_222 - .saturating_add(Weight::from_parts(1_997_948, 0).saturating_mul(s.into())) - // Standard Error: 21_222 - .saturating_add(Weight::from_parts(265_450, 0).saturating_mul(x.into())) + // Measured: `471 + r * (5 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `8303` + // Minimum execution time: 94_821 nanoseconds. + Weight::from_parts(81_296_022, 8303) + // Standard Error: 17_279 + .saturating_add(Weight::from_parts(2_529_084, 0).saturating_mul(s.into())) + // Standard Error: 17_279 + .saturating_add(Weight::from_parts(530_119, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } - /// Storage: Identity Registrars (r:1 w:0) - /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(457), added: 952, mode: MaxEncodedLen) - /// Storage: Identity IdentityOf (r:1 w:1) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) + /// Storage: `Identity::Registrars` (r:1 w:0) + /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(457), added: 952, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 8]`. /// The range of component `x` is `[0, 64]`. fn request_judgement(_r: u32, x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `431 + r * (57 ±0) + x * (66 ±0)` - // Estimated: `8265` - // Minimum execution time: 41_030 nanoseconds. - Weight::from_parts(60_905_120, 8265) - // Standard Error: 11_458 - .saturating_add(Weight::from_parts(668_303, 0).saturating_mul(x.into())) + // Measured: `367 + r * (57 ±0) + x * (66 ±0)` + // Estimated: `8303` + // Minimum execution time: 51_290 nanoseconds. + Weight::from_parts(71_825_285, 8303) + // Standard Error: 20_454 + .saturating_add(Weight::from_parts(1_158_768, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity IdentityOf (r:1 w:1) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 8]`. /// The range of component `x` is `[0, 64]`. fn cancel_request(r: u32, x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `430 + x * (66 ±0)` - // Estimated: `7313` - // Minimum execution time: 37_480 nanoseconds. - Weight::from_parts(43_853_453, 7313) - // Standard Error: 105_132 - .saturating_add(Weight::from_parts(224_903, 0).saturating_mul(r.into())) - // Standard Error: 12_211 - .saturating_add(Weight::from_parts(728_184, 0).saturating_mul(x.into())) + // Measured: `398 + x * (66 ±0)` + // Estimated: `8303` + // Minimum execution time: 49_660 nanoseconds. + Weight::from_parts(56_328_193, 8303) + // Standard Error: 104_321 + .saturating_add(Weight::from_parts(615_177, 0).saturating_mul(r.into())) + // Standard Error: 12_117 + .saturating_add(Weight::from_parts(1_058_625, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity Registrars (r:1 w:1) - /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(457), added: 952, mode: MaxEncodedLen) + /// Storage: `Identity::Registrars` (r:1 w:1) + /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(457), added: 952, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 7]`. fn set_fee(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `121 + r * (57 ±0)` - // Estimated: `952` - // Minimum execution time: 13_030 nanoseconds. - Weight::from_parts(14_794_208, 952) - // Standard Error: 28_452 - .saturating_add(Weight::from_parts(499_504, 0).saturating_mul(r.into())) + // Measured: `89 + r * (57 ±0)` + // Estimated: `1942` + // Minimum execution time: 14_930 nanoseconds. + Weight::from_parts(19_021_487, 1942) + // Standard Error: 27_494 + .saturating_add(Weight::from_parts(355_592, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity Registrars (r:1 w:1) - /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(457), added: 952, mode: MaxEncodedLen) + /// Storage: `Identity::Registrars` (r:1 w:1) + /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(457), added: 952, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 7]`. fn set_account_id(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `121 + r * (57 ±0)` - // Estimated: `952` - // Minimum execution time: 10_610 nanoseconds. - Weight::from_parts(14_237_318, 952) - // Standard Error: 19_699 - .saturating_add(Weight::from_parts(124_020, 0).saturating_mul(r.into())) + // Measured: `89 + r * (57 ±0)` + // Estimated: `1942` + // Minimum execution time: 14_111 nanoseconds. + Weight::from_parts(16_435_082, 1942) + // Standard Error: 17_735 + .saturating_add(Weight::from_parts(343_164, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity Registrars (r:1 w:1) - /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(457), added: 952, mode: MaxEncodedLen) + /// Storage: `Identity::Registrars` (r:1 w:1) + /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(457), added: 952, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 7]`. fn set_fields(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `121 + r * (57 ±0)` - // Estimated: `952` - // Minimum execution time: 10_390 nanoseconds. - Weight::from_parts(14_604_605, 952) - // Standard Error: 17_396 - .saturating_add(Weight::from_parts(10_750, 0).saturating_mul(r.into())) + // Measured: `89 + r * (57 ±0)` + // Estimated: `1942` + // Minimum execution time: 13_630 nanoseconds. + Weight::from_parts(17_450_843, 1942) + // Standard Error: 19_433 + .saturating_add(Weight::from_parts(358_031, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity Registrars (r:1 w:0) - /// Proof: Identity Registrars (max_values: Some(1), max_size: Some(457), added: 952, mode: MaxEncodedLen) - /// Storage: Identity IdentityOf (r:1 w:1) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) + /// Storage: `Identity::Registrars` (r:1 w:0) + /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(457), added: 952, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 7]`. /// The range of component `x` is `[0, 64]`. fn provide_judgement(_r: u32, x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `509 + r * (57 ±0) + x * (66 ±0)` - // Estimated: `8265` - // Minimum execution time: 32_650 nanoseconds. - Weight::from_parts(48_622_386, 8265) - // Standard Error: 15_117 - .saturating_add(Weight::from_parts(1_066_351, 0).saturating_mul(x.into())) + // Measured: `445 + r * (57 ±0) + x * (66 ±0)` + // Estimated: `8303` + // Minimum execution time: 43_850 nanoseconds. + Weight::from_parts(74_007_290, 8303) + // Standard Error: 14_509 + .saturating_add(Weight::from_parts(1_470_246, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity SubsOf (r:1 w:1) - /// Proof: Identity SubsOf (max_values: None, max_size: Some(2106), added: 4581, mode: MaxEncodedLen) - /// Storage: Identity IdentityOf (r:1 w:1) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Identity SuperOf (r:0 w:64) - /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: `Identity::SubsOf` (r:1 w:1) + /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(2106), added: 4581, mode: `MaxEncodedLen`) + /// Storage: `Identity::IdentityOf` (r:1 w:1) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Identity::SuperOf` (r:0 w:64) + /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 8]`. /// The range of component `s` is `[0, 64]`. /// The range of component `x` is `[0, 64]`. fn kill_identity(r: u32, s: u32, x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `954 + r * (5 ±0) + s * (32 ±0) + x * (66 ±0)` - // Estimated: `17108` - // Minimum execution time: 76_120 nanoseconds. - Weight::from_parts(58_672_057, 17108) - // Standard Error: 176_813 - .saturating_add(Weight::from_parts(404_857, 0).saturating_mul(r.into())) - // Standard Error: 20_588 - .saturating_add(Weight::from_parts(2_097_548, 0).saturating_mul(s.into())) - // Standard Error: 20_588 - .saturating_add(Weight::from_parts(421_199, 0).saturating_mul(x.into())) + // Measured: `826 + r * (5 ±0) + s * (32 ±0) + x * (66 ±0)` + // Estimated: `8303` + // Minimum execution time: 126_141 nanoseconds. + Weight::from_parts(85_217_639, 8303) + // Standard Error: 167_129 + .saturating_add(Weight::from_parts(2_032_971, 0).saturating_mul(r.into())) + // Standard Error: 19_461 + .saturating_add(Weight::from_parts(2_770_065, 0).saturating_mul(s.into())) + // Standard Error: 19_461 + .saturating_add(Weight::from_parts(654_970, 0).saturating_mul(x.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) } - /// Storage: Identity IdentityOf (r:1 w:0) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) - /// Storage: Identity SuperOf (r:1 w:1) - /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: Identity SubsOf (r:1 w:1) - /// Proof: Identity SubsOf (max_values: None, max_size: Some(2106), added: 4581, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityOf` (r:1 w:0) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) + /// Storage: `Identity::SuperOf` (r:1 w:1) + /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) + /// Storage: `Identity::SubsOf` (r:1 w:1) + /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(2106), added: 4581, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 63]`. fn add_sub(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `355 + s * (41 ±0)` - // Estimated: `14483` - // Minimum execution time: 38_690 nanoseconds. - Weight::from_parts(51_610_989, 14483) - // Standard Error: 10_821 - .saturating_add(Weight::from_parts(141_693, 0).saturating_mul(s.into())) + // Measured: `323 + s * (41 ±0)` + // Estimated: `8303` + // Minimum execution time: 53_400 nanoseconds. + Weight::from_parts(67_814_141, 8303) + // Standard Error: 14_324 + .saturating_add(Weight::from_parts(312_244, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Identity IdentityOf (r:1 w:0) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) - /// Storage: Identity SuperOf (r:1 w:1) - /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityOf` (r:1 w:0) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) + /// Storage: `Identity::SuperOf` (r:1 w:1) + /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) /// The range of component `s` is `[1, 64]`. fn rename_sub(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `464 + s * (7 ±0)` - // Estimated: `9902` - // Minimum execution time: 19_930 nanoseconds. - Weight::from_parts(27_289_143, 9902) - // Standard Error: 4_266 - .saturating_add(Weight::from_parts(23_773, 0).saturating_mul(s.into())) + // Measured: `432 + s * (7 ±0)` + // Estimated: `8303` + // Minimum execution time: 22_360 nanoseconds. + Weight::from_parts(32_328_919, 8303) + // Standard Error: 5_763 + .saturating_add(Weight::from_parts(96_628, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Identity IdentityOf (r:1 w:0) - /// Proof: Identity IdentityOf (max_values: None, max_size: Some(4838), added: 7313, mode: MaxEncodedLen) - /// Storage: Identity SuperOf (r:1 w:1) - /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: Identity SubsOf (r:1 w:1) - /// Proof: Identity SubsOf (max_values: None, max_size: Some(2106), added: 4581, mode: MaxEncodedLen) + /// Storage: `Identity::IdentityOf` (r:1 w:0) + /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(4838), added: 7313, mode: `MaxEncodedLen`) + /// Storage: `Identity::SuperOf` (r:1 w:1) + /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) + /// Storage: `Identity::SubsOf` (r:1 w:1) + /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(2106), added: 4581, mode: `MaxEncodedLen`) /// The range of component `s` is `[1, 64]`. fn remove_sub(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `544 + s * (39 ±0)` - // Estimated: `14483` - // Minimum execution time: 44_120 nanoseconds. - Weight::from_parts(55_480_947, 14483) - // Standard Error: 10_276 - .saturating_add(Weight::from_parts(74_281, 0).saturating_mul(s.into())) + // Measured: `480 + s * (39 ±0)` + // Estimated: `8303` + // Minimum execution time: 53_400 nanoseconds. + Weight::from_parts(72_889_969, 8303) + // Standard Error: 13_786 + .saturating_add(Weight::from_parts(142_340, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Identity SuperOf (r:1 w:1) - /// Proof: Identity SuperOf (max_values: None, max_size: Some(114), added: 2589, mode: MaxEncodedLen) - /// Storage: Identity SubsOf (r:1 w:1) - /// Proof: Identity SubsOf (max_values: None, max_size: Some(2106), added: 4581, mode: MaxEncodedLen) + /// Storage: `Identity::SuperOf` (r:1 w:1) + /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) + /// Storage: `Identity::SubsOf` (r:1 w:1) + /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(2106), added: 4581, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 63]`. fn quit_sub(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `469 + s * (42 ±0)` - // Estimated: `7170` - // Minimum execution time: 30_280 nanoseconds. - Weight::from_parts(37_281_308, 7170) - // Standard Error: 7_323 - .saturating_add(Weight::from_parts(156_189, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `583 + s * (42 ±0)` + // Estimated: `5571` + // Minimum execution time: 43_830 nanoseconds. + Weight::from_parts(58_683_464, 5571) + // Standard Error: 11_129 + .saturating_add(Weight::from_parts(198_809, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_membership.rs b/runtime/common/src/weights/pallet_membership.rs index a5e298a66..27fe60aad 100644 --- a/runtime/common/src/weights/pallet_membership.rs +++ b/runtime/common/src/weights/pallet_membership.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_membership //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,151 +52,151 @@ use frame_support::{ /// Weight functions for pallet_membership (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_membership::weights::WeightInfo for WeightInfo { - /// Storage: AdvisoryCommitteeMembership Members (r:1 w:1) - /// Proof: AdvisoryCommitteeMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Proposals (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Members (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Prime (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommitteeMembership::Members` (r:1 w:1) + /// Proof: `AdvisoryCommitteeMembership::Members` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Members` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[1, 99]`. fn add_member(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `237 + m * (64 ±0)` - // Estimated: `4900 + m * (192 ±0)` - // Minimum execution time: 25_400 nanoseconds. - Weight::from_parts(32_228_880, 4900) - // Standard Error: 4_601 - .saturating_add(Weight::from_parts(86_582, 0).saturating_mul(m.into())) + // Measured: `173 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 28_891 nanoseconds. + Weight::from_parts(38_624_052, 4687) + // Standard Error: 4_114 + .saturating_add(Weight::from_parts(92_160, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } - /// Storage: AdvisoryCommitteeMembership Members (r:1 w:1) - /// Proof: AdvisoryCommitteeMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Proposals (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommitteeMembership Prime (r:1 w:0) - /// Proof: AdvisoryCommitteeMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Members (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Prime (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommitteeMembership::Members` (r:1 w:1) + /// Proof: `AdvisoryCommitteeMembership::Members` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommitteeMembership::Prime` (r:1 w:0) + /// Proof: `AdvisoryCommitteeMembership::Prime` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Members` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[2, 100]`. fn remove_member(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `341 + m * (64 ±0)` - // Estimated: `5739 + m * (192 ±0)` - // Minimum execution time: 33_480 nanoseconds. - Weight::from_parts(40_243_522, 5739) - // Standard Error: 5_034 - .saturating_add(Weight::from_parts(47_094, 0).saturating_mul(m.into())) + // Measured: `277 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 34_980 nanoseconds. + Weight::from_parts(45_466_871, 4687) + // Standard Error: 5_162 + .saturating_add(Weight::from_parts(49_436, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } - /// Storage: AdvisoryCommitteeMembership Members (r:1 w:1) - /// Proof: AdvisoryCommitteeMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Proposals (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommitteeMembership Prime (r:1 w:0) - /// Proof: AdvisoryCommitteeMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Members (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Prime (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommitteeMembership::Members` (r:1 w:1) + /// Proof: `AdvisoryCommitteeMembership::Members` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommitteeMembership::Prime` (r:1 w:0) + /// Proof: `AdvisoryCommitteeMembership::Prime` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Members` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[2, 100]`. fn swap_member(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `341 + m * (64 ±0)` - // Estimated: `5739 + m * (192 ±0)` - // Minimum execution time: 30_070 nanoseconds. - Weight::from_parts(39_888_985, 5739) - // Standard Error: 5_667 - .saturating_add(Weight::from_parts(60_568, 0).saturating_mul(m.into())) + // Measured: `277 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 34_110 nanoseconds. + Weight::from_parts(44_605_700, 4687) + // Standard Error: 5_689 + .saturating_add(Weight::from_parts(80_800, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } - /// Storage: AdvisoryCommitteeMembership Members (r:1 w:1) - /// Proof: AdvisoryCommitteeMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Proposals (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommitteeMembership Prime (r:1 w:0) - /// Proof: AdvisoryCommitteeMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Members (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Prime (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommitteeMembership::Members` (r:1 w:1) + /// Proof: `AdvisoryCommitteeMembership::Members` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommitteeMembership::Prime` (r:1 w:0) + /// Proof: `AdvisoryCommitteeMembership::Prime` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Members` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[1, 100]`. fn reset_member(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `341 + m * (64 ±0)` - // Estimated: `5739 + m * (192 ±0)` - // Minimum execution time: 32_460 nanoseconds. - Weight::from_parts(38_375_533, 5739) - // Standard Error: 6_339 - .saturating_add(Weight::from_parts(275_877, 0).saturating_mul(m.into())) + // Measured: `277 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 38_531 nanoseconds. + Weight::from_parts(44_370_362, 4687) + // Standard Error: 6_660 + .saturating_add(Weight::from_parts(307_146, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } - /// Storage: AdvisoryCommitteeMembership Members (r:1 w:1) - /// Proof: AdvisoryCommitteeMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Proposals (r:1 w:0) - /// Proof Skipped: AdvisoryCommittee Proposals (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommitteeMembership Prime (r:1 w:1) - /// Proof: AdvisoryCommitteeMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Members (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Members (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: AdvisoryCommittee Prime (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommitteeMembership::Members` (r:1 w:1) + /// Proof: `AdvisoryCommitteeMembership::Members` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Proposals` (r:1 w:0) + /// Proof: `AdvisoryCommittee::Proposals` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommitteeMembership::Prime` (r:1 w:1) + /// Proof: `AdvisoryCommitteeMembership::Prime` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Members` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Members` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `AdvisoryCommittee::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[1, 100]`. fn change_key(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `341 + m * (64 ±0)` - // Estimated: `5739 + m * (192 ±0)` - // Minimum execution time: 34_170 nanoseconds. - Weight::from_parts(41_592_825, 5739) - // Standard Error: 5_454 - .saturating_add(Weight::from_parts(46_054, 0).saturating_mul(m.into())) + // Measured: `277 + m * (64 ±0)` + // Estimated: `4687 + m * (64 ±0)` + // Minimum execution time: 33_720 nanoseconds. + Weight::from_parts(46_240_091, 4687) + // Standard Error: 6_117 + .saturating_add(Weight::from_parts(77_038, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(Weight::from_parts(0, 192).saturating_mul(m.into())) + .saturating_add(Weight::from_parts(0, 64).saturating_mul(m.into())) } - /// Storage: AdvisoryCommitteeMembership Members (r:1 w:0) - /// Proof: AdvisoryCommitteeMembership Members (max_values: Some(1), max_size: Some(3202), added: 3697, mode: MaxEncodedLen) - /// Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) - /// Proof: AdvisoryCommitteeMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Prime (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommitteeMembership::Members` (r:1 w:0) + /// Proof: `AdvisoryCommitteeMembership::Members` (`max_values`: Some(1), `max_size`: Some(3202), added: 3697, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommitteeMembership::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommitteeMembership::Prime` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[1, 100]`. fn set_prime(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `136 + m * (32 ±0)` - // Estimated: `3833 + m * (32 ±0)` - // Minimum execution time: 14_610 nanoseconds. - Weight::from_parts(17_594_663, 3833) - // Standard Error: 2_314 - .saturating_add(Weight::from_parts(27_614, 0).saturating_mul(m.into())) + // Measured: `104 + m * (32 ±0)` + // Estimated: `4687 + m * (32 ±0)` + // Minimum execution time: 15_210 nanoseconds. + Weight::from_parts(20_320_551, 4687) + // Standard Error: 2_763 + .saturating_add(Weight::from_parts(38_801, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 32).saturating_mul(m.into())) } - /// Storage: AdvisoryCommitteeMembership Prime (r:0 w:1) - /// Proof: AdvisoryCommitteeMembership Prime (max_values: Some(1), max_size: Some(32), added: 527, mode: MaxEncodedLen) - /// Storage: AdvisoryCommittee Prime (r:0 w:1) - /// Proof Skipped: AdvisoryCommittee Prime (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `AdvisoryCommitteeMembership::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommitteeMembership::Prime` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `AdvisoryCommittee::Prime` (r:0 w:1) + /// Proof: `AdvisoryCommittee::Prime` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `m` is `[1, 100]`. fn clear_prime(m: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_300 nanoseconds. - Weight::from_parts(6_149_799, 0) - // Standard Error: 750 - .saturating_add(Weight::from_parts(8_021, 0).saturating_mul(m.into())) + // Minimum execution time: 5_590 nanoseconds. + Weight::from_parts(7_678_557, 0) + // Standard Error: 899 + .saturating_add(Weight::from_parts(1_667, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_multisig.rs b/runtime/common/src/weights/pallet_multisig.rs index ed3df3103..208529d4c 100644 --- a/runtime/common/src/weights/pallet_multisig.rs +++ b/runtime/common/src/weights/pallet_multisig.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_multisig //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -57,103 +57,103 @@ impl pallet_multisig::weights::WeightInfo for WeightInf // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 17_140 nanoseconds. - Weight::from_parts(20_613_290, 0) - // Standard Error: 23 - .saturating_add(Weight::from_parts(989, 0).saturating_mul(z.into())) + // Minimum execution time: 23_740 nanoseconds. + Weight::from_parts(33_203_659, 0) + // Standard Error: 31 + .saturating_add(Weight::from_parts(1_068, 0).saturating_mul(z.into())) } - /// Storage: Multisig Multisigs (r:1 w:1) - /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3350), added: 5825, mode: MaxEncodedLen) + /// Storage: `Multisig::Multisigs` (r:1 w:1) + /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3350), added: 5825, mode: `MaxEncodedLen`) /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_create(s: u32, z: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `373 + s * (1 ±0)` - // Estimated: `5825` - // Minimum execution time: 48_190 nanoseconds. - Weight::from_parts(55_141_032, 5825) - // Standard Error: 6_415 - .saturating_add(Weight::from_parts(20_531, 0).saturating_mul(s.into())) - // Standard Error: 62 - .saturating_add(Weight::from_parts(2_645, 0).saturating_mul(z.into())) + // Measured: `275 + s * (1 ±0)` + // Estimated: `6815` + // Minimum execution time: 70_790 nanoseconds. + Weight::from_parts(75_902_643, 6815) + // Standard Error: 8_192 + .saturating_add(Weight::from_parts(219_592, 0).saturating_mul(s.into())) + // Standard Error: 80 + .saturating_add(Weight::from_parts(2_091, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Multisig Multisigs (r:1 w:1) - /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3350), added: 5825, mode: MaxEncodedLen) + /// Storage: `Multisig::Multisigs` (r:1 w:1) + /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3350), added: 5825, mode: `MaxEncodedLen`) /// The range of component `s` is `[3, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_approve(s: u32, z: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `317` - // Estimated: `5825` - // Minimum execution time: 35_200 nanoseconds. - Weight::from_parts(34_539_686, 5825) - // Standard Error: 5_214 - .saturating_add(Weight::from_parts(83_803, 0).saturating_mul(s.into())) - // Standard Error: 51 - .saturating_add(Weight::from_parts(2_652, 0).saturating_mul(z.into())) + // Measured: `252` + // Estimated: `6815` + // Minimum execution time: 49_710 nanoseconds. + Weight::from_parts(41_381_547, 6815) + // Standard Error: 6_063 + .saturating_add(Weight::from_parts(306_390, 0).saturating_mul(s.into())) + // Standard Error: 59 + .saturating_add(Weight::from_parts(2_114, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Multisig Multisigs (r:1 w:1) - /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3350), added: 5825, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Multisig::Multisigs` (r:1 w:1) + /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3350), added: 5825, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `s` is `[2, 100]`. /// The range of component `z` is `[0, 10000]`. fn as_multi_complete(s: u32, z: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `459 + s * (33 ±0)` - // Estimated: `8432` - // Minimum execution time: 55_860 nanoseconds. - Weight::from_parts(56_804_266, 8432) - // Standard Error: 7_150 - .saturating_add(Weight::from_parts(95_888, 0).saturating_mul(s.into())) - // Standard Error: 70 - .saturating_add(Weight::from_parts(2_628, 0).saturating_mul(z.into())) + // Measured: `362 + s * (33 ±0)` + // Estimated: `6815` + // Minimum execution time: 84_521 nanoseconds. + Weight::from_parts(86_035_413, 6815) + // Standard Error: 6_863 + .saturating_add(Weight::from_parts(285_220, 0).saturating_mul(s.into())) + // Standard Error: 67 + .saturating_add(Weight::from_parts(2_030, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Multisig Multisigs (r:1 w:1) - /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3350), added: 5825, mode: MaxEncodedLen) + /// Storage: `Multisig::Multisigs` (r:1 w:1) + /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3350), added: 5825, mode: `MaxEncodedLen`) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `377 + s * (1 ±0)` - // Estimated: `5825` - // Minimum execution time: 38_691 nanoseconds. - Weight::from_parts(50_725_622, 5825) - // Standard Error: 6_195 - .saturating_add(Weight::from_parts(48_095, 0).saturating_mul(s.into())) + // Measured: `279 + s * (1 ±0)` + // Estimated: `6815` + // Minimum execution time: 53_560 nanoseconds. + Weight::from_parts(68_219_543, 6815) + // Standard Error: 8_990 + .saturating_add(Weight::from_parts(280_934, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Multisig Multisigs (r:1 w:1) - /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3350), added: 5825, mode: MaxEncodedLen) + /// Storage: `Multisig::Multisigs` (r:1 w:1) + /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3350), added: 5825, mode: `MaxEncodedLen`) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_approve(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `317` - // Estimated: `5825` - // Minimum execution time: 26_740 nanoseconds. - Weight::from_parts(32_958_938, 5825) - // Standard Error: 4_854 - .saturating_add(Weight::from_parts(77_200, 0).saturating_mul(s.into())) + // Measured: `252` + // Estimated: `6815` + // Minimum execution time: 37_020 nanoseconds. + Weight::from_parts(43_487_688, 6815) + // Standard Error: 6_367 + .saturating_add(Weight::from_parts(160_508, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Multisig Multisigs (r:1 w:1) - /// Proof: Multisig Multisigs (max_values: None, max_size: Some(3350), added: 5825, mode: MaxEncodedLen) + /// Storage: `Multisig::Multisigs` (r:1 w:1) + /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3350), added: 5825, mode: `MaxEncodedLen`) /// The range of component `s` is `[2, 100]`. fn cancel_as_multi(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `525 + s * (1 ±0)` - // Estimated: `5825` - // Minimum execution time: 41_640 nanoseconds. - Weight::from_parts(51_559_888, 5825) - // Standard Error: 7_083 - .saturating_add(Weight::from_parts(65_557, 0).saturating_mul(s.into())) + // Measured: `428 + s * (1 ±0)` + // Estimated: `6815` + // Minimum execution time: 62_651 nanoseconds. + Weight::from_parts(68_545_202, 6815) + // Standard Error: 8_112 + .saturating_add(Weight::from_parts(200_729, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_parachain_staking.rs b/runtime/common/src/weights/pallet_parachain_staking.rs index 788b12083..705889f4a 100644 --- a/runtime/common/src/weights/pallet_parachain_staking.rs +++ b/runtime/common/src/weights/pallet_parachain_staking.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_parachain_staking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,820 +52,830 @@ use frame_support::{ /// Weight functions for pallet_parachain_staking (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_parachain_staking::weights::WeightInfo for WeightInfo { - /// Storage: ParachainStaking InflationConfig (r:1 w:1) - /// Proof Skipped: ParachainStaking InflationConfig (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `ParachainStaking::InflationConfig` (r:1 w:1) + /// Proof: `ParachainStaking::InflationConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_staking_expectations() -> Weight { // Proof Size summary in bytes: // Measured: `88` // Estimated: `1573` - // Minimum execution time: 15_889_000 picoseconds. - Weight::from_parts(16_404_000, 1573) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 20_920 nanoseconds. + Weight::from_parts(22_131_000, 1573) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: ParachainStaking InflationConfig (r:1 w:1) - /// Proof Skipped: ParachainStaking InflationConfig (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `ParachainStaking::InflationConfig` (r:1 w:1) + /// Proof: `ParachainStaking::InflationConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_inflation() -> Weight { // Proof Size summary in bytes: // Measured: `88` // Estimated: `1573` - // Minimum execution time: 44_509_000 picoseconds. - Weight::from_parts(45_011_000, 1573) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 66_631 nanoseconds. + Weight::from_parts(70_110_000, 1573) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: ParachainStaking ParachainBondInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking ParachainBondInfo (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `ParachainStaking::ParachainBondInfo` (r:1 w:1) + /// Proof: `ParachainStaking::ParachainBondInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_parachain_bond_account() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `1491` - // Minimum execution time: 14_675_000 picoseconds. - Weight::from_parts(15_094_000, 1491) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `21` + // Estimated: `1506` + // Minimum execution time: 17_950 nanoseconds. + Weight::from_parts(22_380_000, 1506) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: ParachainStaking ParachainBondInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking ParachainBondInfo (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `ParachainStaking::ParachainBondInfo` (r:1 w:1) + /// Proof: `ParachainStaking::ParachainBondInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_parachain_bond_reserve_percent() -> Weight { // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `1491` - // Minimum execution time: 13_898_000 picoseconds. - Weight::from_parts(14_492_000, 1491) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Measured: `21` + // Estimated: `1506` + // Minimum execution time: 21_690 nanoseconds. + Weight::from_parts(22_390_000, 1506) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: ParachainStaking TotalSelected (r:1 w:1) - /// Proof Skipped: ParachainStaking TotalSelected (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `ParachainStaking::TotalSelected` (r:1 w:1) + /// Proof: `ParachainStaking::TotalSelected` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_total_selected() -> Weight { // Proof Size summary in bytes: // Measured: `28` // Estimated: `1513` - // Minimum execution time: 15_666_000 picoseconds. - Weight::from_parts(15_939_000, 1513) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + // Minimum execution time: 21_490 nanoseconds. + Weight::from_parts(24_350_000, 1513) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: ParachainStaking CollatorCommission (r:1 w:1) - /// Proof Skipped: ParachainStaking CollatorCommission (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `ParachainStaking::CollatorCommission` (r:1 w:1) + /// Proof: `ParachainStaking::CollatorCommission` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_collator_commission() -> Weight { // Proof Size summary in bytes: // Measured: `27` // Estimated: `1512` - // Minimum execution time: 13_997_000 picoseconds. - Weight::from_parts(14_320_000, 1512) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: ParachainStaking TotalSelected (r:1 w:0) - /// Proof Skipped: ParachainStaking TotalSelected (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking InflationConfig (r:1 w:1) - /// Proof Skipped: ParachainStaking InflationConfig (max_values: Some(1), max_size: None, mode: Measured) + // Minimum execution time: 19_440 nanoseconds. + Weight::from_parts(21_970_000, 1512) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ParachainStaking::TotalSelected` (r:1 w:0) + /// Proof: `ParachainStaking::TotalSelected` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::InflationConfig` (r:1 w:1) + /// Proof: `ParachainStaking::InflationConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn set_blocks_per_round() -> Weight { // Proof Size summary in bytes: // Measured: `116` // Estimated: `1601` - // Minimum execution time: 48_389_000 picoseconds. - Weight::from_parts(49_554_000, 1601) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegatorState (r:1 w:0) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:0 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking BottomDelegations (r:0 w:1) - /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) + // Minimum execution time: 86_860 nanoseconds. + Weight::from_parts(87_851_000, 1601) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:0) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:0 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::BottomDelegations` (r:0 w:1) + /// Proof: `ParachainStaking::BottomDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `x` is `[3, 200]`. fn join_candidates(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1421 + x * (38 ±0)` - // Estimated: `4752 + x * (41 ±0)` - // Minimum execution time: 76_742_000 picoseconds. - Weight::from_parts(88_864_511, 4752) - // Standard Error: 2_004 - .saturating_add(Weight::from_parts(88_538, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - .saturating_add(Weight::from_parts(0, 41).saturating_mul(x.into())) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `1212 + x * (52 ±0)` + // Estimated: `4764 + x * (53 ±0)` + // Minimum execution time: 94_680 nanoseconds. + Weight::from_parts(129_865_953, 4764) + // Standard Error: 7_461 + .saturating_add(Weight::from_parts(293_951, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(Weight::from_parts(0, 53).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[3, 200]`. fn schedule_leave_candidates(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `702 + x * (37 ±0)` - // Estimated: `4060 + x * (38 ±0)` - // Minimum execution time: 27_238_000 picoseconds. - Weight::from_parts(34_109_750, 4060) - // Standard Error: 1_116 - .saturating_add(Weight::from_parts(62_292, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 38).saturating_mul(x.into())) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegatorState (r:349 w:349) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: Balances Locks (r:350 w:350) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:350 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: System Account (r:350 w:350) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking BottomDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `769 + x * (49 ±0)` + // Estimated: `4109 + x * (50 ±0)` + // Minimum execution time: 32_620 nanoseconds. + Weight::from_parts(54_251_947, 4109) + // Standard Error: 5_751 + .saturating_add(Weight::from_parts(273_039, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 50).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AutoCompoundingDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::AutoCompoundingDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegatorState` (r:349 w:349) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:350 w:350) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:350 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:350 w:350) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::BottomDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::BottomDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[2, 350]`. fn execute_leave_candidates_worst_case(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1157 + x * (431 ±0)` - // Estimated: `4696 + x * (3762 ±0)` - // Minimum execution time: 141_946_000 picoseconds. - Weight::from_parts(144_961_000, 4696) - // Standard Error: 79_832 - .saturating_add(Weight::from_parts(49_060_154, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `283 + x * (530 ±0)` + // Estimated: `4888 + x * (3774 ±0)` + // Minimum execution time: 147_651 nanoseconds. + Weight::from_parts(181_751_000, 4888) + // Standard Error: 291_873 + .saturating_add(Weight::from_parts(76_847_404, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) - .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(T::DbWeight::get().writes(5)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into()))) - .saturating_add(Weight::from_parts(0, 3762).saturating_mul(x.into())) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegatorState (r:349 w:349) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: Balances Locks (r:350 w:350) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:350 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: System Account (r:350 w:350) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking BottomDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + .saturating_add(Weight::from_parts(0, 3774).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AutoCompoundingDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::AutoCompoundingDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegatorState` (r:349 w:349) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:350 w:350) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:350 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:350 w:350) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::BottomDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::BottomDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[2, 350]`. /// The range of component `y` is `[2, 350]`. fn execute_leave_candidates_ideal(x: u32, _y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1149 + x * (431 ±0)` - // Estimated: `4696 + x * (3762 ±0)` - // Minimum execution time: 133_121_000 picoseconds. - Weight::from_parts(134_388_000, 4696) - // Standard Error: 34_256 - .saturating_add(Weight::from_parts(50_828_386, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(5_u64)) + // Measured: `277 + x * (531 ±0)` + // Estimated: `4888 + x * (3774 ±0)` + // Minimum execution time: 187_621 nanoseconds. + Weight::from_parts(202_610_000, 4888) + // Standard Error: 155_800 + .saturating_add(Weight::from_parts(80_277_630, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) - .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(T::DbWeight::get().writes(5)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into()))) - .saturating_add(Weight::from_parts(0, 3762).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 3774).saturating_mul(x.into())) } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[3, 200]`. fn cancel_leave_candidates(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `670 + x * (37 ±0)` - // Estimated: `4028 + x * (38 ±0)` - // Minimum execution time: 25_910_000 picoseconds. - Weight::from_parts(32_465_127, 4028) - // Standard Error: 1_064 - .saturating_add(Weight::from_parts(60_655, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 38).saturating_mul(x.into())) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `725 + x * (49 ±0)` + // Estimated: `4065 + x * (50 ±0)` + // Minimum execution time: 36_000 nanoseconds. + Weight::from_parts(58_253_070, 4065) + // Standard Error: 6_431 + .saturating_add(Weight::from_parts(249_533, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 50).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[1, 200]`. fn go_offline(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `567 + x * (38 ±0)` - // Estimated: `3968 + x * (39 ±0)` - // Minimum execution time: 24_471_000 picoseconds. - Weight::from_parts(30_875_133, 3968) - // Standard Error: 1_124 - .saturating_add(Weight::from_parts(66_032, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 39).saturating_mul(x.into())) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `638 + x * (49 ±0)` + // Estimated: `4024 + x * (50 ±0)` + // Minimum execution time: 28_620 nanoseconds. + Weight::from_parts(47_266_699, 4024) + // Standard Error: 5_762 + .saturating_add(Weight::from_parts(268_069, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 50).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[1, 200]`. fn go_online(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `531 + x * (38 ±0)` - // Estimated: `3932 + x * (39 ±0)` - // Minimum execution time: 24_249_000 picoseconds. - Weight::from_parts(30_765_292, 3932) - // Standard Error: 1_181 - .saturating_add(Weight::from_parts(65_935, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 39).saturating_mul(x.into())) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) + // Measured: `590 + x * (49 ±0)` + // Estimated: `3976 + x * (50 ±0)` + // Minimum execution time: 32_720 nanoseconds. + Weight::from_parts(48_255_063, 3976) + // Standard Error: 6_033 + .saturating_add(Weight::from_parts(271_498, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 50).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[1, 200]`. fn candidate_bond_more(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1270 + x * (42 ±0)` - // Estimated: `4752 + x * (44 ±0)` - // Minimum execution time: 68_720_000 picoseconds. - Weight::from_parts(79_722_709, 4752) - // Standard Error: 2_059 - .saturating_add(Weight::from_parts(113_832, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 44).saturating_mul(x.into())) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) + // Measured: `1522 + x * (52 ±0)` + // Estimated: `4764 + x * (54 ±0)` + // Minimum execution time: 72_710 nanoseconds. + Weight::from_parts(113_926_751, 4764) + // Standard Error: 8_405 + .saturating_add(Weight::from_parts(297_196, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(Weight::from_parts(0, 54).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) fn schedule_candidate_bond_less() -> Weight { // Proof Size summary in bytes: - // Measured: `171` - // Estimated: `3636` - // Minimum execution time: 21_049_000 picoseconds. - Weight::from_parts(21_735_000, 3636) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + // Measured: `184` + // Estimated: `3649` + // Minimum execution time: 29_320 nanoseconds. + Weight::from_parts(30_880_000, 3649) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[1, 200]`. fn execute_candidate_bond_less(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1322 + x * (42 ±0)` - // Estimated: `4752 + x * (43 ±0)` - // Minimum execution time: 71_996_000 picoseconds. - Weight::from_parts(80_620_929, 4752) - // Standard Error: 1_363 - .saturating_add(Weight::from_parts(94_580, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) - } - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - fn cancel_candidate_bond_less() -> Weight { - // Proof Size summary in bytes: - // Measured: `191` - // Estimated: `3656` - // Minimum execution time: 18_991_000 picoseconds. - Weight::from_parts(19_491_000, 3656) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } + // Measured: `1538 + x * (52 ±0)` + // Estimated: `4764 + x * (54 ±0)` + // Minimum execution time: 87_930 nanoseconds. + Weight::from_parts(120_669_992, 4764) + // Standard Error: 7_625 + .saturating_add(Weight::from_parts(230_828, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(Weight::from_parts(0, 54).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[1, 200]`. fn set_candidate_bond_to_zero(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1322 + x * (42 ±0)` - // Estimated: `4752 + x * (43 ±0)` - // Minimum execution time: 71_996_000 picoseconds. - Weight::from_parts(80_620_929, 4752) - // Standard Error: 1_363 - .saturating_add(Weight::from_parts(94_580, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) - .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) - } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `1518 + x * (52 ±0)` + // Estimated: `4764 + x * (54 ±0)` + // Minimum execution time: 69_960 nanoseconds. + Weight::from_parts(106_259_917, 4764) + // Standard Error: 8_305 + .saturating_add(Weight::from_parts(269_671, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(Weight::from_parts(0, 54).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn cancel_candidate_bond_less() -> Weight { + // Proof Size summary in bytes: + // Measured: `204` + // Estimated: `3669` + // Minimum execution time: 26_380 nanoseconds. + Weight::from_parts(31_890_000, 3669) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[3, 100]`. /// The range of component `y` is `[2, 300]`. fn delegate(x: u32, y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2479 + x * (79 ±0) + y * (38 ±0)` - // Estimated: `5723 + x * (81 ±0) + y * (39 ±0)` - // Minimum execution time: 120_061_000 picoseconds. - Weight::from_parts(111_894_468, 5723) - // Standard Error: 1_320 - .saturating_add(Weight::from_parts(135_446, 0).saturating_mul(x.into())) - // Standard Error: 433 - .saturating_add(Weight::from_parts(41_110, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - .saturating_add(Weight::from_parts(0, 81).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 39).saturating_mul(y.into())) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) + // Measured: `2215 + x * (103 ±0) + y * (52 ±0)` + // Estimated: `5422 + x * (106 ±0) + y * (53 ±0)` + // Minimum execution time: 162_160 nanoseconds. + Weight::from_parts(184_112_627, 5422) + // Standard Error: 15_255 + .saturating_add(Weight::from_parts(329_277, 0).saturating_mul(x.into())) + // Standard Error: 5_004 + .saturating_add(Weight::from_parts(132_709, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(Weight::from_parts(0, 106).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 53).saturating_mul(y.into())) + } + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `x` is `[0, 349]`. fn schedule_revoke_delegation(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `566 + x * (42 ±0)` - // Estimated: `4012 + x * (43 ±0)` - // Minimum execution time: 25_479_000 picoseconds. - Weight::from_parts(35_344_986, 4012) - // Standard Error: 803 - .saturating_add(Weight::from_parts(60_212, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `688 + x * (54 ±0)` + // Estimated: `4097 + x * (54 ±0)` + // Minimum execution time: 37_670 nanoseconds. + Weight::from_parts(62_885_317, 4097) + // Standard Error: 3_441 + .saturating_add(Weight::from_parts(168_223, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 54).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:0) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[0, 349]`. fn delegator_bond_more(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1996 + x * (79 ±0)` - // Estimated: `5428 + x * (79 ±0)` - // Minimum execution time: 90_985_000 picoseconds. - Weight::from_parts(111_258_553, 5428) - // Standard Error: 1_580 - .saturating_add(Weight::from_parts(109_354, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(7_u64)) - .saturating_add(Weight::from_parts(0, 79).saturating_mul(x.into())) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) + // Measured: `2052 + x * (103 ±0)` + // Estimated: `5592 + x * (102 ±0)` + // Minimum execution time: 97_960 nanoseconds. + Weight::from_parts(163_346_210, 5592) + // Standard Error: 8_012 + .saturating_add(Weight::from_parts(371_428, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(Weight::from_parts(0, 102).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `x` is `[0, 349]`. fn schedule_delegator_bond_less(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `566 + x * (42 ±0)` - // Estimated: `4012 + x * (43 ±0)` - // Minimum execution time: 25_784_000 picoseconds. - Weight::from_parts(35_792_924, 4012) - // Standard Error: 793 - .saturating_add(Weight::from_parts(60_874, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:0) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `688 + x * (54 ±0)` + // Estimated: `4097 + x * (54 ±0)` + // Minimum execution time: 33_520 nanoseconds. + Weight::from_parts(66_292_397, 4097) + // Standard Error: 3_862 + .saturating_add(Weight::from_parts(178_224, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 54).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::AutoCompoundingDelegations` (r:1 w:0) + /// Proof: `ParachainStaking::AutoCompoundingDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn execute_revoke_delegation() -> Weight { // Proof Size summary in bytes: - // Measured: `964` - // Estimated: `4752` - // Minimum execution time: 113_086_000 picoseconds. - Weight::from_parts(115_421_000, 4752) - .saturating_add(T::DbWeight::get().reads(10_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking BottomDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `1053` + // Estimated: `4764` + // Minimum execution time: 153_161 nanoseconds. + Weight::from_parts(188_110_000, 4764) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(8)) + } + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::AutoCompoundingDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::AutoCompoundingDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::BottomDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::BottomDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn execute_delegator_revoke_delegation_worst() -> Weight { // Proof Size summary in bytes: - // Measured: `37308` - // Estimated: `40773` - // Minimum execution time: 179_325_000 picoseconds. - Weight::from_parts(182_100_000, 40773) - .saturating_add(T::DbWeight::get().reads(11_u64)) - .saturating_add(T::DbWeight::get().writes(10_u64)) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking BottomDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `50108` + // Estimated: `53573` + // Minimum execution time: 326_631 nanoseconds. + Weight::from_parts(360_401_000, 53573) + .saturating_add(T::DbWeight::get().reads(11)) + .saturating_add(T::DbWeight::get().writes(10)) + } + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::BottomDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::BottomDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn execute_delegator_bond_less_worst() -> Weight { // Proof Size summary in bytes: - // Measured: `29930` - // Estimated: `33395` - // Minimum execution time: 150_818_000 picoseconds. - Weight::from_parts(152_294_000, 33395) - .saturating_add(T::DbWeight::get().reads(10_u64)) - .saturating_add(T::DbWeight::get().writes(9_u64)) - } - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) + // Measured: `38517` + // Estimated: `41982` + // Minimum execution time: 276_161 nanoseconds. + Weight::from_parts(318_081_000, 41982) + .saturating_add(T::DbWeight::get().reads(10)) + .saturating_add(T::DbWeight::get().writes(9)) + } + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `x` is `[0, 349]`. fn cancel_delegation_request(x: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `663 + x * (42 ±0)` - // Estimated: `4092 + x * (43 ±0)` - // Minimum execution time: 30_062_000 picoseconds. - Weight::from_parts(37_242_991, 4092) - // Standard Error: 767 - .saturating_add(Weight::from_parts(62_995, 0).saturating_mul(x.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) - .saturating_add(Weight::from_parts(0, 43).saturating_mul(x.into())) - } - /// Storage: ParachainStaking Points (r:1 w:0) - /// Proof Skipped: ParachainStaking Points (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking Staked (r:1 w:1) - /// Proof Skipped: ParachainStaking Staked (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking InflationConfig (r:1 w:0) - /// Proof Skipped: ParachainStaking InflationConfig (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking ParachainBondInfo (r:1 w:0) - /// Proof Skipped: ParachainStaking ParachainBondInfo (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking CollatorCommission (r:1 w:0) - /// Proof Skipped: ParachainStaking CollatorCommission (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking DelayedPayouts (r:0 w:1) - /// Proof Skipped: ParachainStaking DelayedPayouts (max_values: None, max_size: None, mode: Measured) + // Measured: `728 + x * (54 ±0)` + // Estimated: `4143 + x * (55 ±0)` + // Minimum execution time: 41_060 nanoseconds. + Weight::from_parts(73_879_404, 4143) + // Standard Error: 3_549 + .saturating_add(Weight::from_parts(157_397, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(Weight::from_parts(0, 55).saturating_mul(x.into())) + } + /// Storage: `ParachainStaking::Points` (r:1 w:0) + /// Proof: `ParachainStaking::Points` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Staked` (r:1 w:1) + /// Proof: `ParachainStaking::Staked` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::InflationConfig` (r:1 w:0) + /// Proof: `ParachainStaking::InflationConfig` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::ParachainBondInfo` (r:1 w:0) + /// Proof: `ParachainStaking::ParachainBondInfo` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::CollatorCommission` (r:1 w:0) + /// Proof: `ParachainStaking::CollatorCommission` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelayedPayouts` (r:0 w:1) + /// Proof: `ParachainStaking::DelayedPayouts` (`max_values`: None, `max_size`: None, mode: `Measured`) fn prepare_staking_payouts() -> Weight { // Proof Size summary in bytes: - // Measured: `380` - // Estimated: `3845` - // Minimum execution time: 48_260_000 picoseconds. - Weight::from_parts(49_856_000, 3845) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(3_u64)) - } - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:0) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) + // Measured: `344` + // Estimated: `3809` + // Minimum execution time: 65_741 nanoseconds. + Weight::from_parts(80_170_000, 3809) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:0) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:0) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `y` is `[0, 100]`. fn get_rewardable_delegators(y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `73 + y * (36 ±0)` - // Estimated: `3537 + y * (36 ±0)` - // Minimum execution time: 8_183_000 picoseconds. - Weight::from_parts(10_416_160, 3537) - // Standard Error: 780 - .saturating_add(Weight::from_parts(44_865, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(y.into())) - } - /// Storage: ParachainStaking TotalSelected (r:1 w:0) - /// Proof Skipped: ParachainStaking TotalSelected (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:0) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:51 w:0) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:51 w:0) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:51 w:0) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:51 w:0) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking SelectedCandidates (r:0 w:1) - /// Proof Skipped: ParachainStaking SelectedCandidates (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking AtStake (r:0 w:51) - /// Proof Skipped: ParachainStaking AtStake (max_values: None, max_size: None, mode: Measured) + // Measured: `86 + y * (48 ±0)` + // Estimated: `3550 + y * (48 ±0)` + // Minimum execution time: 9_040 nanoseconds. + Weight::from_parts(14_932_628, 3550) + // Standard Error: 2_867 + .saturating_add(Weight::from_parts(188_808, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(Weight::from_parts(0, 48).saturating_mul(y.into())) + } + /// Storage: `ParachainStaking::TotalSelected` (r:1 w:0) + /// Proof: `ParachainStaking::TotalSelected` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:0) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidateInfo` (r:51 w:0) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:51 w:0) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:51 w:0) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AutoCompoundingDelegations` (r:51 w:0) + /// Proof: `ParachainStaking::AutoCompoundingDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::SelectedCandidates` (r:0 w:1) + /// Proof: `ParachainStaking::SelectedCandidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AtStake` (r:0 w:51) + /// Proof: `ParachainStaking::AtStake` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `x` is `[0, 50]`. /// The range of component `y` is `[0, 100]`. fn select_top_candidates(x: u32, y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + x * (3816 ±0) + y * (1800 ±0)` - // Estimated: `3730 + x * (3975 ±39) + y * (639 ±19)` - // Minimum execution time: 31_870_000 picoseconds. - Weight::from_parts(32_158_000, 3730) - // Standard Error: 51_554 - .saturating_add(Weight::from_parts(22_540_635, 0).saturating_mul(x.into())) - // Standard Error: 25_709 - .saturating_add(Weight::from_parts(957_745, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(6_u64)) + // Measured: `0 + x * (5058 ±0) + y * (2400 ±0)` + // Estimated: `3778 + x * (4440 ±53) + y * (851 ±26)` + // Minimum execution time: 42_360 nanoseconds. + Weight::from_parts(43_100_000, 3778) + // Standard Error: 213_932 + .saturating_add(Weight::from_parts(37_938_792, 0).saturating_mul(x.into())) + // Standard Error: 106_682 + .saturating_add(Weight::from_parts(3_271_060, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(x.into()))) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x.into()))) - .saturating_add(Weight::from_parts(0, 3975).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 639).saturating_mul(y.into())) - } - /// Storage: System Account (r:349 w:349) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking DelegatorState (r:349 w:349) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: Balances Locks (r:349 w:349) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:349 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking BottomDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) + .saturating_add(Weight::from_parts(0, 4440).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 851).saturating_mul(y.into())) + } + /// Storage: `System::Account` (r:349 w:349) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::DelegatorState` (r:349 w:349) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:0) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:349 w:349) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:349 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::BottomDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::BottomDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `x` is `[0, 349]`. /// The range of component `y` is `[0, 349]`. /// The range of component `z` is `[0, 349]`. fn pay_one_collator_reward_best(x: u32, y: u32, z: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + x * (395 ±0) + y * (156 ±0) + z * (41 ±0)` - // Estimated: `125757 + x * (2591 ±19) + y * (2234 ±19) + z * (28 ±0)` - // Minimum execution time: 459_000 picoseconds. - Weight::from_parts(472_000, 125757) - // Standard Error: 685_607 - .saturating_add(Weight::from_parts(74_007_162, 0).saturating_mul(x.into())) - // Standard Error: 685_607 - .saturating_add(Weight::from_parts(43_825_857, 0).saturating_mul(y.into())) + // Measured: `0 + x * (483 ±0) + y * (206 ±0) + z * (53 ±0)` + // Estimated: `151958 + x * (2607 ±2) + y * (2241 ±2) + z * (37 ±1)` + // Minimum execution time: 650 nanoseconds. + Weight::from_parts(710_000, 151958) + // Standard Error: 1_305_281 + .saturating_add(Weight::from_parts(117_137_166, 0).saturating_mul(x.into())) + // Standard Error: 1_305_281 + .saturating_add(Weight::from_parts(68_635_248, 0).saturating_mul(y.into())) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(y.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(x.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(y.into()))) - .saturating_add(Weight::from_parts(0, 2591).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 2234).saturating_mul(y.into())) - .saturating_add(Weight::from_parts(0, 28).saturating_mul(z.into())) - } - /// Storage: ParachainStaking DelayedPayouts (r:1 w:0) - /// Proof Skipped: ParachainStaking DelayedPayouts (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking Points (r:1 w:0) - /// Proof Skipped: ParachainStaking Points (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AtStake (r:2 w:1) - /// Proof Skipped: ParachainStaking AtStake (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AwardedPts (r:1 w:1) - /// Proof Skipped: ParachainStaking AwardedPts (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:0) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: MoonbeamOrbiters OrbiterPerRound (r:1 w:0) - /// Proof Skipped: MoonbeamOrbiters OrbiterPerRound (max_values: None, max_size: None, mode: Measured) - /// Storage: System Account (r:301 w:301) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + .saturating_add(Weight::from_parts(0, 2607).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 2241).saturating_mul(y.into())) + .saturating_add(Weight::from_parts(0, 37).saturating_mul(z.into())) + } + /// Storage: `ParachainStaking::DelayedPayouts` (r:1 w:0) + /// Proof: `ParachainStaking::DelayedPayouts` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Points` (r:1 w:0) + /// Proof: `ParachainStaking::Points` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AtStake` (r:2 w:1) + /// Proof: `ParachainStaking::AtStake` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AwardedPts` (r:1 w:1) + /// Proof: `ParachainStaking::AwardedPts` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:0) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `System::Account` (r:301 w:301) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `y` is `[0, 300]`. fn pay_one_collator_reward(y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1208 + y * (160 ±0)` - // Estimated: `6978 + y * (2591 ±0)` - // Minimum execution time: 65_428_000 picoseconds. - Weight::from_parts(68_535_135, 6978) - // Standard Error: 6_093 - .saturating_add(Weight::from_parts(25_186_464, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Measured: `389 + y * (187 ±0)` + // Estimated: `6323 + y * (2607 ±0)` + // Minimum execution time: 95_210 nanoseconds. + Weight::from_parts(46_188_313, 6323) + // Standard Error: 130_487 + .saturating_add(Weight::from_parts(32_991_381, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(y.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(y.into()))) - .saturating_add(Weight::from_parts(0, 2591).saturating_mul(y.into())) + .saturating_add(Weight::from_parts(0, 2607).saturating_mul(y.into())) } fn base_on_initialize() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_024_000 picoseconds. - Weight::from_parts(2_168_000, 0) + // Minimum execution time: 2_400 nanoseconds. + Weight::from_parts(2_630_000, 0) } - /// Storage: ParachainStaking DelegatorState (r:1 w:0) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:0) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AutoCompoundingDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::AutoCompoundingDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) /// The range of component `x` is `[0, 300]`. /// The range of component `y` is `[0, 100]`. fn set_auto_compound(x: u32, y: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `671 + x * (22 ±0) + y * (36 ±0)` - // Estimated: `4027 + x * (23 ±0) + y * (36 ±0)` - // Minimum execution time: 34_494_000 picoseconds. - Weight::from_parts(33_677_881, 4027) - // Standard Error: 278 - .saturating_add(Weight::from_parts(45_734, 0).saturating_mul(x.into())) - // Standard Error: 833 - .saturating_add(Weight::from_parts(39_753, 0).saturating_mul(y.into())) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - .saturating_add(Weight::from_parts(0, 23).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 36).saturating_mul(y.into())) - } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking DelegatorState (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking BottomDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:1 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `655 + x * (34 ±0) + y * (48 ±0)` + // Estimated: `3997 + x * (35 ±0) + y * (49 ±0)` + // Minimum execution time: 64_941 nanoseconds. + Weight::from_parts(68_368_754, 3997) + // Standard Error: 2_390 + .saturating_add(Weight::from_parts(117_516, 0).saturating_mul(x.into())) + // Standard Error: 7_155 + .saturating_add(Weight::from_parts(96_794, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + .saturating_add(Weight::from_parts(0, 35).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 49).saturating_mul(y.into())) + } + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::DelegatorState` (r:1 w:1) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AutoCompoundingDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::AutoCompoundingDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::BottomDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::BottomDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) /// The range of component `x` is `[0, 350]`. /// The range of component `y` is `[0, 349]`. /// The range of component `z` is `[0, 99]`. fn delegate_with_auto_compound(x: u32, y: u32, z: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + x * (60 ±0) + y * (21 ±0) + z * (78 ±0)` - // Estimated: `26253 + x * (44 ±0) + y * (19 ±0) + z * (76 ±1)` - // Minimum execution time: 130_103_000 picoseconds. - Weight::from_parts(116_616_415, 26253) - // Standard Error: 1_141 - .saturating_add(Weight::from_parts(117_041, 0).saturating_mul(x.into())) - // Standard Error: 4_030 - .saturating_add(Weight::from_parts(178_483, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(8_u64)) - .saturating_add(Weight::from_parts(0, 44).saturating_mul(x.into())) - .saturating_add(Weight::from_parts(0, 19).saturating_mul(y.into())) - .saturating_add(Weight::from_parts(0, 76).saturating_mul(z.into())) - } - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: ParachainStaking DelegatorState (r:2 w:2) - /// Proof Skipped: ParachainStaking DelegatorState (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AutoCompoundingDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking AutoCompoundingDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking TopDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking TopDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking BottomDelegations (r:1 w:1) - /// Proof Skipped: ParachainStaking BottomDelegations (max_values: None, max_size: None, mode: Measured) - /// Storage: Balances Locks (r:2 w:2) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: Balances Freezes (r:2 w:0) - /// Proof: Balances Freezes (max_values: None, max_size: Some(37), added: 2512, mode: MaxEncodedLen) - /// Storage: ParachainStaking DelegationScheduledRequests (r:1 w:1) - /// Proof Skipped: ParachainStaking DelegationScheduledRequests (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking Total (r:1 w:1) - /// Proof Skipped: ParachainStaking Total (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `0 + x * (84 ±0) + y * (33 ±0) + z * (114 ±0)` + // Estimated: `34219 + x * (61 ±0) + y * (31 ±0) + z * (105 ±1)` + // Minimum execution time: 188_241 nanoseconds. + Weight::from_parts(167_789_565, 34219) + // Standard Error: 5_366 + .saturating_add(Weight::from_parts(290_539, 0).saturating_mul(x.into())) + // Standard Error: 5_380 + .saturating_add(Weight::from_parts(46_897, 0).saturating_mul(y.into())) + // Standard Error: 18_948 + .saturating_add(Weight::from_parts(324_903, 0).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(8)) + .saturating_add(Weight::from_parts(0, 61).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 31).saturating_mul(y.into())) + .saturating_add(Weight::from_parts(0, 105).saturating_mul(z.into())) + } + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::DelegatorState` (r:2 w:2) + /// Proof: `ParachainStaking::DelegatorState` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AutoCompoundingDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::AutoCompoundingDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TopDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::TopDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::BottomDelegations` (r:1 w:1) + /// Proof: `ParachainStaking::BottomDelegations` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Balances::Locks` (r:2 w:2) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:2 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `ParachainStaking::DelegationScheduledRequests` (r:1 w:1) + /// Proof: `ParachainStaking::DelegationScheduledRequests` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::Total` (r:1 w:1) + /// Proof: `ParachainStaking::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn delegate_with_auto_compound_worst() -> Weight { // Proof Size summary in bytes: - // Measured: `48167` - // Estimated: `54107` - // Minimum execution time: 276_584_000 picoseconds. - Weight::from_parts(279_594_000, 54107) - .saturating_add(T::DbWeight::get().reads(15_u64)) - .saturating_add(T::DbWeight::get().writes(13_u64)) + // Measured: `63204` + // Estimated: `69144` + // Minimum execution time: 467_031 nanoseconds. + Weight::from_parts(515_911_000, 69144) + .saturating_add(T::DbWeight::get().reads(15)) + .saturating_add(T::DbWeight::get().writes(13)) } - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn mint_collator_reward() -> Weight { // Proof Size summary in bytes: - // Measured: `128` - // Estimated: `3581` - // Minimum execution time: 28_741_000 picoseconds. - Weight::from_parts(29_344_000, 3581) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) - } - /// Storage: ParachainStaking EnableMarkingOffline (r:1 w:0) - /// Proof Skipped: ParachainStaking EnableMarkingOffline (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking TotalSelected (r:1 w:0) - /// Proof Skipped: ParachainStaking TotalSelected (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking SelectedCandidates (r:1 w:0) - /// Proof Skipped: ParachainStaking SelectedCandidates (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainStaking AtStake (r:2 w:0) - /// Proof Skipped: ParachainStaking AtStake (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking AwardedPts (r:2 w:0) - /// Proof Skipped: ParachainStaking AwardedPts (max_values: None, max_size: None, mode: Measured) - /// Storage: MoonbeamOrbiters OrbiterPerRound (r:1 w:0) - /// Proof Skipped: MoonbeamOrbiters OrbiterPerRound (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidateInfo (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidateInfo (max_values: None, max_size: None, mode: Measured) - /// Storage: ParachainStaking CandidatePool (r:1 w:1) - /// Proof Skipped: ParachainStaking CandidatePool (max_values: Some(1), max_size: None, mode: Measured) + // Measured: `107` + // Estimated: `3597` + // Minimum execution time: 33_540 nanoseconds. + Weight::from_parts(34_680_000, 3597) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `ParachainStaking::EnableMarkingOffline` (r:1 w:0) + /// Proof: `ParachainStaking::EnableMarkingOffline` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::TotalSelected` (r:1 w:0) + /// Proof: `ParachainStaking::TotalSelected` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::SelectedCandidates` (r:1 w:0) + /// Proof: `ParachainStaking::SelectedCandidates` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AtStake` (r:1 w:0) + /// Proof: `ParachainStaking::AtStake` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::AwardedPts` (r:1 w:0) + /// Proof: `ParachainStaking::AwardedPts` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidateInfo` (r:1 w:1) + /// Proof: `ParachainStaking::CandidateInfo` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `ParachainStaking::CandidatePool` (r:1 w:1) + /// Proof: `ParachainStaking::CandidatePool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) fn notify_inactive_collator() -> Weight { // Proof Size summary in bytes: - // Measured: `11494` - // Estimated: `17434` - // Minimum execution time: 41_130_000 picoseconds. - Weight::from_parts(41_130_000, 0) - .saturating_add(Weight::from_parts(0, 17434)) - .saturating_add(T::DbWeight::get().reads(10_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + // Measured: `14976` + // Estimated: `18441` + // Minimum execution time: 123_950 nanoseconds. + Weight::from_parts(154_121_000, 18441) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/runtime/common/src/weights/pallet_preimage.rs b/runtime/common/src/weights/pallet_preimage.rs index 8fedc5045..873dd954a 100644 --- a/runtime/common/src/weights/pallet_preimage.rs +++ b/runtime/common/src/weights/pallet_preimage.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_preimage //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,156 +52,156 @@ use frame_support::{ /// Weight functions for pallet_preimage (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_preimage::weights::WeightInfo for WeightInfo { - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Preimage PreimageFor (r:0 w:1) - /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Preimage::PreimageFor` (r:0 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `179` - // Estimated: `2566` - // Minimum execution time: 46_570 nanoseconds. - Weight::from_parts(47_640_000, 2566) - // Standard Error: 4 - .saturating_add(Weight::from_parts(2_961, 0).saturating_mul(s.into())) + // Measured: `147` + // Estimated: `3556` + // Minimum execution time: 57_781 nanoseconds. + Weight::from_parts(58_050_000, 3556) + // Standard Error: 3 + .saturating_add(Weight::from_parts(2_854, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Preimage PreimageFor (r:0 w:1) - /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Preimage::PreimageFor` (r:0 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 25_630 nanoseconds. - Weight::from_parts(27_760_000, 2566) + // Estimated: `3556` + // Minimum execution time: 32_980 nanoseconds. + Weight::from_parts(33_530_000, 3556) // Standard Error: 4 - .saturating_add(Weight::from_parts(2_967, 0).saturating_mul(s.into())) + .saturating_add(Weight::from_parts(2_819, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Preimage PreimageFor (r:0 w:1) - /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Preimage::PreimageFor` (r:0 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32) -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 24_550 nanoseconds. - Weight::from_parts(27_741_000, 2566) + // Estimated: `3556` + // Minimum execution time: 36_560 nanoseconds. + Weight::from_parts(37_361_000, 3556) // Standard Error: 4 - .saturating_add(Weight::from_parts(2_990, 0).saturating_mul(s.into())) + .saturating_add(Weight::from_parts(2_844, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Preimage PreimageFor (r:0 w:1) - /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Preimage::PreimageFor` (r:0 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) fn unnote_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `357` - // Estimated: `2566` - // Minimum execution time: 59_490 nanoseconds. - Weight::from_parts(69_030_000, 2566) + // Measured: `293` + // Estimated: `3556` + // Minimum execution time: 88_750 nanoseconds. + Weight::from_parts(91_651_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Preimage PreimageFor (r:0 w:1) - /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Preimage::PreimageFor` (r:0 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) fn unnote_no_deposit_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `144` - // Estimated: `2566` - // Minimum execution time: 45_150 nanoseconds. - Weight::from_parts(52_960_000, 2566) + // Estimated: `3556` + // Minimum execution time: 54_850 nanoseconds. + Weight::from_parts(56_380_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn request_preimage() -> Weight { // Proof Size summary in bytes: - // Measured: `220` - // Estimated: `2566` - // Minimum execution time: 40_950 nanoseconds. - Weight::from_parts(43_730_000, 2566) + // Measured: `188` + // Estimated: `3556` + // Minimum execution time: 48_240 nanoseconds. + Weight::from_parts(54_141_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn request_no_deposit_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `144` - // Estimated: `2566` - // Minimum execution time: 26_900 nanoseconds. - Weight::from_parts(31_590_000, 2566) + // Estimated: `3556` + // Minimum execution time: 33_901 nanoseconds. + Weight::from_parts(38_760_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn request_unnoted_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `42` - // Estimated: `2566` - // Minimum execution time: 29_690 nanoseconds. - Weight::from_parts(34_591_000, 2566) + // Estimated: `3556` + // Minimum execution time: 42_190 nanoseconds. + Weight::from_parts(43_881_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn request_requested_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 14_440 nanoseconds. - Weight::from_parts(18_710_000, 2566) + // Estimated: `3556` + // Minimum execution time: 21_480 nanoseconds. + Weight::from_parts(23_090_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) - /// Storage: Preimage PreimageFor (r:0 w:1) - /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) + /// Storage: `Preimage::PreimageFor` (r:0 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`) fn unrequest_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `144` - // Estimated: `2566` - // Minimum execution time: 43_490 nanoseconds. - Weight::from_parts(48_550_000, 2566) + // Estimated: `3556` + // Minimum execution time: 53_370 nanoseconds. + Weight::from_parts(62_590_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn unrequest_unnoted_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 14_000 nanoseconds. - Weight::from_parts(17_720_000, 2566) + // Estimated: `3556` + // Minimum execution time: 22_580 nanoseconds. + Weight::from_parts(23_320_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) fn unrequest_multi_referenced_preimage() -> Weight { // Proof Size summary in bytes: // Measured: `106` - // Estimated: `2566` - // Minimum execution time: 14_260 nanoseconds. - Weight::from_parts(17_310_000, 2566) + // Estimated: `3556` + // Minimum execution time: 22_870 nanoseconds. + Weight::from_parts(24_080_000, 3556) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_proxy.rs b/runtime/common/src/weights/pallet_proxy.rs index 28942d025..0128c6373 100644 --- a/runtime/common/src/weights/pallet_proxy.rs +++ b/runtime/common/src/weights/pallet_proxy.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_proxy //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,156 +52,162 @@ use frame_support::{ /// Weight functions for pallet_proxy (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_proxy::weights::WeightInfo for WeightInfo { - /// Storage: Proxy Proxies (r:1 w:0) - /// Proof: Proxy Proxies (max_values: None, max_size: Some(1369), added: 3844, mode: MaxEncodedLen) + /// Storage: `Proxy::Proxies` (r:1 w:0) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1369), added: 3844, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. fn proxy(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `122 + p * (41 ±0)` - // Estimated: `3844` - // Minimum execution time: 21_120 nanoseconds. - Weight::from_parts(25_838_411, 3844) - // Standard Error: 10_663 - .saturating_add(Weight::from_parts(154_975, 0).saturating_mul(p.into())) + // Measured: `90 + p * (41 ±0)` + // Estimated: `4834` + // Minimum execution time: 24_460 nanoseconds. + Weight::from_parts(31_916_739, 4834) + // Standard Error: 10_449 + .saturating_add(Weight::from_parts(119_468, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) } - /// Storage: Proxy Proxies (r:1 w:0) - /// Proof: Proxy Proxies (max_values: None, max_size: Some(1369), added: 3844, mode: MaxEncodedLen) - /// Storage: Proxy Announcements (r:1 w:1) - /// Proof: Proxy Announcements (max_values: None, max_size: Some(2361), added: 4836, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Proxy::Proxies` (r:1 w:0) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1369), added: 3844, mode: `MaxEncodedLen`) + /// Storage: `Proxy::Announcements` (r:1 w:1) + /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2361), added: 4836, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn proxy_announced(a: u32, _p: u32) -> Weight { + fn proxy_announced(a: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `521 + a * (72 ±0) + p * (41 ±0)` - // Estimated: `11287` - // Minimum execution time: 47_870 nanoseconds. - Weight::from_parts(64_203_809, 11287) - // Standard Error: 16_966 - .saturating_add(Weight::from_parts(103_726, 0).saturating_mul(a.into())) + // Measured: `425 + a * (72 ±0) + p * (41 ±0)` + // Estimated: `5826` + // Minimum execution time: 59_630 nanoseconds. + Weight::from_parts(68_853_256, 5826) + // Standard Error: 14_552 + .saturating_add(Weight::from_parts(556_375, 0).saturating_mul(a.into())) + // Standard Error: 15_035 + .saturating_add(Weight::from_parts(200_681, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Proxy Announcements (r:1 w:1) - /// Proof: Proxy Announcements (max_values: None, max_size: Some(2361), added: 4836, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Proxy::Announcements` (r:1 w:1) + /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2361), added: 4836, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn remove_announcement(a: u32, _p: u32) -> Weight { + fn remove_announcement(a: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `404 + a * (72 ±0)` - // Estimated: `7443` - // Minimum execution time: 28_880 nanoseconds. - Weight::from_parts(39_031_523, 7443) - // Standard Error: 11_187 - .saturating_add(Weight::from_parts(148_230, 0).saturating_mul(a.into())) + // Measured: `340 + a * (72 ±0)` + // Estimated: `5826` + // Minimum execution time: 39_230 nanoseconds. + Weight::from_parts(47_915_752, 5826) + // Standard Error: 11_282 + .saturating_add(Weight::from_parts(370_639, 0).saturating_mul(a.into())) + // Standard Error: 11_656 + .saturating_add(Weight::from_parts(89_877, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Proxy Announcements (r:1 w:1) - /// Proof: Proxy Announcements (max_values: None, max_size: Some(2361), added: 4836, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Proxy::Announcements` (r:1 w:1) + /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2361), added: 4836, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn reject_announcement(a: u32, _p: u32) -> Weight { + fn reject_announcement(a: u32, p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `404 + a * (72 ±0)` - // Estimated: `7443` - // Minimum execution time: 27_891 nanoseconds. - Weight::from_parts(39_270_464, 7443) - // Standard Error: 12_225 - .saturating_add(Weight::from_parts(160_797, 0).saturating_mul(a.into())) + // Measured: `340 + a * (72 ±0)` + // Estimated: `5826` + // Minimum execution time: 39_380 nanoseconds. + Weight::from_parts(50_472_779, 5826) + // Standard Error: 10_655 + .saturating_add(Weight::from_parts(341_751, 0).saturating_mul(a.into())) + // Standard Error: 11_009 + .saturating_add(Weight::from_parts(1_588, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Proxy Proxies (r:1 w:0) - /// Proof: Proxy Proxies (max_values: None, max_size: Some(1369), added: 3844, mode: MaxEncodedLen) - /// Storage: Proxy Announcements (r:1 w:1) - /// Proof: Proxy Announcements (max_values: None, max_size: Some(2361), added: 4836, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Proxy::Proxies` (r:1 w:0) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1369), added: 3844, mode: `MaxEncodedLen`) + /// Storage: `Proxy::Announcements` (r:1 w:1) + /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2361), added: 4836, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 31]`. /// The range of component `p` is `[1, 31]`. - fn announce(a: u32, p: u32) -> Weight { + fn announce(a: u32, _p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `449 + a * (72 ±0) + p * (41 ±0)` - // Estimated: `11287` - // Minimum execution time: 40_190 nanoseconds. - Weight::from_parts(49_900_553, 11287) - // Standard Error: 16_800 - .saturating_add(Weight::from_parts(219_080, 0).saturating_mul(a.into())) - // Standard Error: 17_358 - .saturating_add(Weight::from_parts(146_779, 0).saturating_mul(p.into())) + // Measured: `353 + a * (72 ±0) + p * (41 ±0)` + // Estimated: `5826` + // Minimum execution time: 54_760 nanoseconds. + Weight::from_parts(76_162_735, 5826) + // Standard Error: 17_467 + .saturating_add(Weight::from_parts(198_517, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Proxy Proxies (r:1 w:1) - /// Proof: Proxy Proxies (max_values: None, max_size: Some(1369), added: 3844, mode: MaxEncodedLen) + /// Storage: `Proxy::Proxies` (r:1 w:1) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1369), added: 3844, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. fn add_proxy(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `122 + p * (41 ±0)` - // Estimated: `3844` - // Minimum execution time: 29_420 nanoseconds. - Weight::from_parts(39_127_927, 3844) - // Standard Error: 12_097 - .saturating_add(Weight::from_parts(129_823, 0).saturating_mul(p.into())) + // Measured: `90 + p * (41 ±0)` + // Estimated: `4834` + // Minimum execution time: 38_410 nanoseconds. + Weight::from_parts(51_454_716, 4834) + // Standard Error: 18_577 + .saturating_add(Weight::from_parts(108_813, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Proxy Proxies (r:1 w:1) - /// Proof: Proxy Proxies (max_values: None, max_size: Some(1369), added: 3844, mode: MaxEncodedLen) + /// Storage: `Proxy::Proxies` (r:1 w:1) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1369), added: 3844, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. fn remove_proxy(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `122 + p * (41 ±0)` - // Estimated: `3844` - // Minimum execution time: 29_990 nanoseconds. - Weight::from_parts(40_424_160, 3844) - // Standard Error: 11_438 - .saturating_add(Weight::from_parts(50_007, 0).saturating_mul(p.into())) + // Measured: `90 + p * (41 ±0)` + // Estimated: `4834` + // Minimum execution time: 39_900 nanoseconds. + Weight::from_parts(49_203_091, 4834) + // Standard Error: 14_073 + .saturating_add(Weight::from_parts(142_433, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Proxy Proxies (r:1 w:1) - /// Proof: Proxy Proxies (max_values: None, max_size: Some(1369), added: 3844, mode: MaxEncodedLen) + /// Storage: `Proxy::Proxies` (r:1 w:1) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1369), added: 3844, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. fn remove_proxies(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `122 + p * (41 ±0)` - // Estimated: `3844` - // Minimum execution time: 23_350 nanoseconds. - Weight::from_parts(31_893_850, 3844) - // Standard Error: 10_014 - .saturating_add(Weight::from_parts(18_034, 0).saturating_mul(p.into())) + // Measured: `90 + p * (41 ±0)` + // Estimated: `4834` + // Minimum execution time: 35_010 nanoseconds. + Weight::from_parts(44_812_883, 4834) + // Standard Error: 16_380 + .saturating_add(Weight::from_parts(230_872, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Proxy Proxies (r:1 w:1) - /// Proof: Proxy Proxies (max_values: None, max_size: Some(1369), added: 3844, mode: MaxEncodedLen) + /// Storage: `Proxy::Proxies` (r:1 w:1) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1369), added: 3844, mode: `MaxEncodedLen`) /// The range of component `p` is `[1, 31]`. fn create_pure(_p: u32) -> Weight { // Proof Size summary in bytes: // Measured: `102` - // Estimated: `3844` - // Minimum execution time: 31_170 nanoseconds. - Weight::from_parts(41_446_203, 3844) + // Estimated: `4834` + // Minimum execution time: 40_930 nanoseconds. + Weight::from_parts(55_446_660, 4834) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Proxy Proxies (r:1 w:1) - /// Proof: Proxy Proxies (max_values: None, max_size: Some(1369), added: 3844, mode: MaxEncodedLen) + /// Storage: `Proxy::Proxies` (r:1 w:1) + /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1369), added: 3844, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 30]`. - fn kill_pure(_p: u32) -> Weight { + fn kill_pure(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `163 + p * (41 ±0)` - // Estimated: `3844` - // Minimum execution time: 25_500 nanoseconds. - Weight::from_parts(34_599_406, 3844) + // Measured: `131 + p * (41 ±0)` + // Estimated: `4834` + // Minimum execution time: 35_620 nanoseconds. + Weight::from_parts(47_395_705, 4834) + // Standard Error: 20_099 + .saturating_add(Weight::from_parts(283_385, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/runtime/common/src/weights/pallet_scheduler.rs b/runtime/common/src/weights/pallet_scheduler.rs index 1f38b550c..8e2c4c2db 100644 --- a/runtime/common/src/weights/pallet_scheduler.rs +++ b/runtime/common/src/weights/pallet_scheduler.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_scheduler //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,28 +52,28 @@ use frame_support::{ /// Weight functions for pallet_scheduler (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_scheduler::weights::WeightInfo for WeightInfo { - /// Storage: Scheduler IncompleteSince (r:1 w:1) - /// Proof: Scheduler IncompleteSince (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: `Scheduler::IncompleteSince` (r:1 w:1) + /// Proof: `Scheduler::IncompleteSince` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn service_agendas_base() -> Weight { // Proof Size summary in bytes: // Measured: `35` - // Estimated: `503` - // Minimum execution time: 6_220 nanoseconds. - Weight::from_parts(6_910_000, 503) + // Estimated: `1493` + // Minimum execution time: 8_110 nanoseconds. + Weight::from_parts(9_030_000, 1493) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(10667), added: 13142, mode: MaxEncodedLen) - /// The range of component `s` is `[0, 50]`. + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(109074), added: 111549, mode: `MaxEncodedLen`) + /// The range of component `s` is `[0, 512]`. fn service_agenda_base(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `114 + s * (181 ±0)` - // Estimated: `13142` - // Minimum execution time: 5_390 nanoseconds. - Weight::from_parts(15_743_204, 13142) - // Standard Error: 9_341 - .saturating_add(Weight::from_parts(563_979, 0).saturating_mul(s.into())) + // Measured: `85 + s * (181 ±0)` + // Estimated: `112539` + // Minimum execution time: 7_470 nanoseconds. + Weight::from_parts(11_212_129, 112539) + // Standard Error: 3_304 + .saturating_add(Weight::from_parts(800_049, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -81,115 +81,115 @@ impl pallet_scheduler::weights::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 7_580 nanoseconds. - Weight::from_parts(7_830_000, 0) + // Minimum execution time: 10_490 nanoseconds. + Weight::from_parts(11_100_000, 0) } - /// Storage: Preimage PreimageFor (r:1 w:1) - /// Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: Measured) - /// Storage: Preimage StatusFor (r:1 w:1) - /// Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen) + /// Storage: `Preimage::PreimageFor` (r:1 w:1) + /// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`) + /// Storage: `Preimage::StatusFor` (r:1 w:1) + /// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`) /// The range of component `s` is `[128, 4194304]`. fn service_task_fetched(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `211 + s * (1 ±0)` - // Estimated: `5252 + s * (1 ±0)` - // Minimum execution time: 31_820 nanoseconds. - Weight::from_parts(32_290_000, 5252) - // Standard Error: 4 - .saturating_add(Weight::from_parts(2_145, 0).saturating_mul(s.into())) + // Measured: `179 + s * (1 ±0)` + // Estimated: `3644 + s * (1 ±0)` + // Minimum execution time: 40_180 nanoseconds. + Weight::from_parts(40_931_000, 3644) + // Standard Error: 6 + .saturating_add(Weight::from_parts(2_085, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into())) } - /// Storage: Scheduler Lookup (r:0 w:1) - /// Proof: Scheduler Lookup (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) + /// Storage: `Scheduler::Lookup` (r:0 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) fn service_task_named() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_570 nanoseconds. - Weight::from_parts(11_580_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 13_691 nanoseconds. + Weight::from_parts(14_670_000, 0).saturating_add(T::DbWeight::get().writes(1)) } fn service_task_periodic() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 8_180 nanoseconds. - Weight::from_parts(8_610_000, 0) + // Minimum execution time: 12_010 nanoseconds. + Weight::from_parts(13_100_000, 0) } fn execute_dispatch_signed() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_730 nanoseconds. - Weight::from_parts(3_870_000, 0) + // Minimum execution time: 5_730 nanoseconds. + Weight::from_parts(6_090_000, 0) } fn execute_dispatch_unsigned() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_610 nanoseconds. - Weight::from_parts(3_730_000, 0) + // Minimum execution time: 5_640 nanoseconds. + Weight::from_parts(6_031_000, 0) } - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(10667), added: 13142, mode: MaxEncodedLen) - /// The range of component `s` is `[0, 49]`. + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(109074), added: 111549, mode: `MaxEncodedLen`) + /// The range of component `s` is `[0, 511]`. fn schedule(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `114 + s * (181 ±0)` - // Estimated: `13142` - // Minimum execution time: 23_370 nanoseconds. - Weight::from_parts(33_098_986, 13142) - // Standard Error: 12_003 - .saturating_add(Weight::from_parts(605_404, 0).saturating_mul(s.into())) + // Measured: `85 + s * (181 ±0)` + // Estimated: `112539` + // Minimum execution time: 25_240 nanoseconds. + Weight::from_parts(42_440_477, 112539) + // Standard Error: 4_722 + .saturating_add(Weight::from_parts(841_906, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(10667), added: 13142, mode: MaxEncodedLen) - /// Storage: Scheduler Lookup (r:0 w:1) - /// Proof: Scheduler Lookup (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// The range of component `s` is `[1, 50]`. + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(109074), added: 111549, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Lookup` (r:0 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// The range of component `s` is `[1, 512]`. fn cancel(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `114 + s * (181 ±0)` - // Estimated: `13142` - // Minimum execution time: 25_350 nanoseconds. - Weight::from_parts(26_437_367, 13142) - // Standard Error: 14_878 - .saturating_add(Weight::from_parts(1_022_676, 0).saturating_mul(s.into())) + // Measured: `85 + s * (181 ±0)` + // Estimated: `112539` + // Minimum execution time: 34_300 nanoseconds. + Weight::from_parts(35_524_030, 112539) + // Standard Error: 4_784 + .saturating_add(Weight::from_parts(1_270_424, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Scheduler Lookup (r:1 w:1) - /// Proof: Scheduler Lookup (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(10667), added: 13142, mode: MaxEncodedLen) - /// The range of component `s` is `[0, 49]`. + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(109074), added: 111549, mode: `MaxEncodedLen`) + /// The range of component `s` is `[0, 511]`. fn schedule_named(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `297 + s * (189 ±0)` - // Estimated: `15669` - // Minimum execution time: 24_030 nanoseconds. - Weight::from_parts(40_010_187, 15669) - // Standard Error: 15_936 - .saturating_add(Weight::from_parts(699_125, 0).saturating_mul(s.into())) + // Measured: `601 + s * (182 ±0)` + // Estimated: `112539` + // Minimum execution time: 36_031 nanoseconds. + Weight::from_parts(58_246_502, 112539) + // Standard Error: 4_269 + .saturating_add(Weight::from_parts(833_968, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Scheduler Lookup (r:1 w:1) - /// Proof: Scheduler Lookup (max_values: None, max_size: Some(52), added: 2527, mode: MaxEncodedLen) - /// Storage: Scheduler Agenda (r:1 w:1) - /// Proof: Scheduler Agenda (max_values: None, max_size: Some(10667), added: 13142, mode: MaxEncodedLen) - /// The range of component `s` is `[1, 50]`. + /// Storage: `Scheduler::Lookup` (r:1 w:1) + /// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) + /// Storage: `Scheduler::Agenda` (r:1 w:1) + /// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(109074), added: 111549, mode: `MaxEncodedLen`) + /// The range of component `s` is `[1, 512]`. fn cancel_named(s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `321 + s * (189 ±0)` - // Estimated: `15669` - // Minimum execution time: 30_030 nanoseconds. - Weight::from_parts(36_715_188, 15669) - // Standard Error: 17_393 - .saturating_add(Weight::from_parts(1_024_734, 0).saturating_mul(s.into())) + // Measured: `717 + s * (181 ±0)` + // Estimated: `112539` + // Minimum execution time: 43_840 nanoseconds. + Weight::from_parts(42_474_452, 112539) + // Standard Error: 5_508 + .saturating_add(Weight::from_parts(1_280_085, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/runtime/common/src/weights/pallet_timestamp.rs b/runtime/common/src/weights/pallet_timestamp.rs index 0e3264b94..fb781d3ef 100644 --- a/runtime/common/src/weights/pallet_timestamp.rs +++ b/runtime/common/src/weights/pallet_timestamp.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_timestamp //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,16 +52,16 @@ use frame_support::{ /// Weight functions for pallet_timestamp (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_timestamp::weights::WeightInfo for WeightInfo { - /// Storage: Timestamp Now (r:1 w:1) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Aura CurrentSlot (r:1 w:0) - /// Proof: Aura CurrentSlot (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: `Timestamp::Now` (r:1 w:1) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Aura::CurrentSlot` (r:1 w:0) + /// Proof: `Aura::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) fn set() -> Weight { // Proof Size summary in bytes: - // Measured: `289` - // Estimated: `1006` - // Minimum execution time: 23_750 nanoseconds. - Weight::from_parts(28_020_000, 1006) + // Measured: `256` + // Estimated: `1493` + // Minimum execution time: 27_830 nanoseconds. + Weight::from_parts(28_710_000, 1493) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,7 +69,7 @@ impl pallet_timestamp::weights::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `128` // Estimated: `0` - // Minimum execution time: 9_100 nanoseconds. - Weight::from_parts(9_390_000, 0) + // Minimum execution time: 10_771 nanoseconds. + Weight::from_parts(11_610_000, 0) } } diff --git a/runtime/common/src/weights/pallet_treasury.rs b/runtime/common/src/weights/pallet_treasury.rs index 31af5a972..348dad587 100644 --- a/runtime/common/src/weights/pallet_treasury.rs +++ b/runtime/common/src/weights/pallet_treasury.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_treasury //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,99 +52,97 @@ use frame_support::{ /// Weight functions for pallet_treasury (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_treasury::weights::WeightInfo for WeightInfo { - /// Storage: Treasury ProposalCount (r:1 w:1) - /// Proof: Treasury ProposalCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:0 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + /// Storage: `Treasury::ProposalCount` (r:1 w:1) + /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:0 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) fn spend() -> Weight { // Proof Size summary in bytes: - // Measured: `80` - // Estimated: `1396` - // Minimum execution time: 24_670 nanoseconds. - Weight::from_parts(30_100_000, 1396) + // Measured: `42` + // Estimated: `1887` + // Minimum execution time: 30_290 nanoseconds. + Weight::from_parts(31_230_000, 1887) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Treasury ProposalCount (r:1 w:1) - /// Proof: Treasury ProposalCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:0 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + /// Storage: `Treasury::ProposalCount` (r:1 w:1) + /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:0 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) fn propose_spend() -> Weight { // Proof Size summary in bytes: - // Measured: `217` - // Estimated: `499` - // Minimum execution time: 38_110 nanoseconds. - Weight::from_parts(38_800_000, 499) + // Measured: `147` + // Estimated: `1489` + // Minimum execution time: 54_400 nanoseconds. + Weight::from_parts(55_751_000, 1489) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Treasury Proposals (r:1 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Treasury::Proposals` (r:1 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn reject_proposal() -> Weight { // Proof Size summary in bytes: - // Measured: `583` - // Estimated: `7797` - // Minimum execution time: 50_470 nanoseconds. - Weight::from_parts(59_770_000, 7797) + // Measured: `449` + // Estimated: `6204` + // Minimum execution time: 83_171 nanoseconds. + Weight::from_parts(84_411_000, 6204) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Treasury Proposals (r:1 w:0) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) + /// Storage: `Treasury::Proposals` (r:1 w:0) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 99]`. fn approve_proposal(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `538 + p * (8 ±0)` - // Estimated: `3480` - // Minimum execution time: 17_940 nanoseconds. - Weight::from_parts(25_751_614, 3480) - // Standard Error: 3_529 - .saturating_add(Weight::from_parts(33_921, 0).saturating_mul(p.into())) + // Measured: `469 + p * (8 ±0)` + // Estimated: `3573` + // Minimum execution time: 19_540 nanoseconds. + Weight::from_parts(28_185_198, 3573) + // Standard Error: 4_990 + .saturating_add(Weight::from_parts(218_022, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) fn remove_approval() -> Weight { // Proof Size summary in bytes: - // Measured: `165` - // Estimated: `897` - // Minimum execution time: 12_680 nanoseconds. - Weight::from_parts(12_950_000, 897) + // Measured: `127` + // Estimated: `1887` + // Minimum execution time: 19_670 nanoseconds. + Weight::from_parts(21_080_000, 1887) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: System Account (r:201 w:201) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Treasury Deactivated (r:1 w:1) - /// Proof: Treasury Deactivated (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Balances InactiveIssuance (r:1 w:1) - /// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:100 w:100) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: Bounties BountyApprovals (r:1 w:1) - /// Proof: Bounties BountyApprovals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) + /// Storage: `System::Account` (r:201 w:201) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Deactivated` (r:1 w:1) + /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:100 w:100) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyApprovals` (r:1 w:1) + /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 100]`. fn on_initialize_proposals(p: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `421 + p * (318 ±0)` - // Estimated: `5423 + p * (7797 ±0)` - // Minimum execution time: 56_770 nanoseconds. - Weight::from_parts(85_622_030, 5423) - // Standard Error: 190_622 - .saturating_add(Weight::from_parts(48_399_356, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(5)) + // Measured: `320 + p * (255 ±0)` + // Estimated: `3597 + p * (5214 ±0)` + // Minimum execution time: 100_551 nanoseconds. + Weight::from_parts(51_119_356, 3597) + // Standard Error: 140_974 + .saturating_add(Weight::from_parts(78_423_136, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 7797).saturating_mul(p.into())) + .saturating_add(Weight::from_parts(0, 5214).saturating_mul(p.into())) } } diff --git a/runtime/common/src/weights/pallet_utility.rs b/runtime/common/src/weights/pallet_utility.rs index 4623af16b..1260a1d5f 100644 --- a/runtime/common/src/weights/pallet_utility.rs +++ b/runtime/common/src/weights/pallet_utility.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_utility //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -57,43 +57,43 @@ impl pallet_utility::weights::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_850 nanoseconds. - Weight::from_parts(64_007_522, 0) - // Standard Error: 19_728 - .saturating_add(Weight::from_parts(6_558_888, 0).saturating_mul(c.into())) + // Minimum execution time: 13_410 nanoseconds. + Weight::from_parts(6_269_119, 0) + // Standard Error: 10_761 + .saturating_add(Weight::from_parts(8_693_574, 0).saturating_mul(c.into())) } fn as_derivative() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 6_810 nanoseconds. - Weight::from_parts(9_330_000, 0) + // Minimum execution time: 9_320 nanoseconds. + Weight::from_parts(9_770_000, 0) } /// The range of component `c` is `[0, 1000]`. fn batch_all(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_390 nanoseconds. - Weight::from_parts(16_446_792, 0) - // Standard Error: 19_995 - .saturating_add(Weight::from_parts(6_975_821, 0).saturating_mul(c.into())) + // Minimum execution time: 13_930 nanoseconds. + Weight::from_parts(14_440_000, 0) + // Standard Error: 5_656 + .saturating_add(Weight::from_parts(9_027_117, 0).saturating_mul(c.into())) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 12_260 nanoseconds. - Weight::from_parts(12_760_000, 0) + // Minimum execution time: 17_380 nanoseconds. + Weight::from_parts(18_100_000, 0) } /// The range of component `c` is `[0, 1000]`. fn force_batch(c: u32) -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_790 nanoseconds. - Weight::from_parts(86_897_110, 0) - // Standard Error: 19_414 - .saturating_add(Weight::from_parts(6_578_542, 0).saturating_mul(c.into())) + // Minimum execution time: 13_720 nanoseconds. + Weight::from_parts(15_689_569, 0) + // Standard Error: 11_844 + .saturating_add(Weight::from_parts(8_654_402, 0).saturating_mul(c.into())) } } diff --git a/runtime/common/src/weights/pallet_vesting.rs b/runtime/common/src/weights/pallet_vesting.rs index 1cf788469..d6516c58b 100644 --- a/runtime/common/src/weights/pallet_vesting.rs +++ b/runtime/common/src/weights/pallet_vesting.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for pallet_vesting //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -52,162 +52,184 @@ use frame_support::{ /// Weight functions for pallet_vesting (automatically generated) pub struct WeightInfo(PhantomData); impl pallet_vesting::weights::WeightInfo for WeightInfo { - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1169), added: 3644, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1169), added: 3644, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[1, 28]`. fn vest_locked(l: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `438 + l * (25 ±0) + s * (40 ±0)` - // Estimated: `7418` - // Minimum execution time: 38_560 nanoseconds. - Weight::from_parts(45_516_515, 7418) - // Standard Error: 8_687 - .saturating_add(Weight::from_parts(94_777, 0).saturating_mul(l.into())) - // Standard Error: 15_456 - .saturating_add(Weight::from_parts(72_036, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `343 + l * (25 ±0) + s * (40 ±0)` + // Estimated: `4764` + // Minimum execution time: 52_331 nanoseconds. + Weight::from_parts(63_401_606, 4764) + // Standard Error: 7_177 + .saturating_add(Weight::from_parts(89_197, 0).saturating_mul(l.into())) + // Standard Error: 12_769 + .saturating_add(Weight::from_parts(417_041, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1169), added: 3644, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1169), added: 3644, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[1, 28]`. fn vest_unlocked(l: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `438 + l * (25 ±0) + s * (40 ±0)` - // Estimated: `7418` - // Minimum execution time: 37_590 nanoseconds. - Weight::from_parts(47_544_266, 7418) - // Standard Error: 9_000 - .saturating_add(Weight::from_parts(42_206, 0).saturating_mul(l.into())) - // Standard Error: 16_013 - .saturating_add(Weight::from_parts(26_886, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `343 + l * (25 ±0) + s * (40 ±0)` + // Estimated: `4764` + // Minimum execution time: 57_360 nanoseconds. + Weight::from_parts(73_584_234, 4764) + // Standard Error: 8_211 + .saturating_add(Weight::from_parts(143_468, 0).saturating_mul(l.into())) + // Standard Error: 14_609 + .saturating_add(Weight::from_parts(179_456, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1169), added: 3644, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1169), added: 3644, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[1, 28]`. fn vest_other_locked(l: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `577 + l * (25 ±0) + s * (40 ±0)` - // Estimated: `10025` - // Minimum execution time: 43_891 nanoseconds. - Weight::from_parts(46_799_315, 10025) - // Standard Error: 9_698 - .saturating_add(Weight::from_parts(146_827, 0).saturating_mul(l.into())) - // Standard Error: 17_255 - .saturating_add(Weight::from_parts(168_808, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `450 + l * (25 ±0) + s * (40 ±0)` + // Estimated: `4764` + // Minimum execution time: 56_870 nanoseconds. + Weight::from_parts(72_384_891, 4764) + // Standard Error: 9_374 + .saturating_add(Weight::from_parts(122_312, 0).saturating_mul(l.into())) + // Standard Error: 16_679 + .saturating_add(Weight::from_parts(242_036, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1169), added: 3644, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1169), added: 3644, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[1, 28]`. - fn vest_other_unlocked(l: u32, _s: u32) -> Weight { + fn vest_other_unlocked(l: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `577 + l * (25 ±0) + s * (40 ±0)` - // Estimated: `10025` - // Minimum execution time: 43_400 nanoseconds. - Weight::from_parts(53_527_221, 10025) - // Standard Error: 11_915 - .saturating_add(Weight::from_parts(74_224, 0).saturating_mul(l.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `450 + l * (25 ±0) + s * (40 ±0)` + // Estimated: `4764` + // Minimum execution time: 62_670 nanoseconds. + Weight::from_parts(76_824_460, 4764) + // Standard Error: 10_041 + .saturating_add(Weight::from_parts(113_179, 0).saturating_mul(l.into())) + // Standard Error: 17_865 + .saturating_add(Weight::from_parts(310_811, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1169), added: 3644, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1169), added: 3644, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[0, 27]`. - fn vested_transfer(l: u32, _s: u32) -> Weight { + fn vested_transfer(l: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `648 + l * (25 ±0) + s * (40 ±0)` - // Estimated: `10025` - // Minimum execution time: 62_280 nanoseconds. - Weight::from_parts(78_476_850, 10025) - // Standard Error: 14_571 - .saturating_add(Weight::from_parts(40_756, 0).saturating_mul(l.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `521 + l * (25 ±0) + s * (40 ±0)` + // Estimated: `4764` + // Minimum execution time: 112_320 nanoseconds. + Weight::from_parts(141_803_727, 4764) + // Standard Error: 14_957 + .saturating_add(Weight::from_parts(98_436, 0).saturating_mul(l.into())) + // Standard Error: 26_611 + .saturating_add(Weight::from_parts(306_207, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1169), added: 3644, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1169), added: 3644, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[0, 27]`. - fn force_vested_transfer(l: u32, _s: u32) -> Weight { + fn force_vested_transfer(l: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `787 + l * (25 ±0) + s * (40 ±0)` - // Estimated: `12632` - // Minimum execution time: 66_730 nanoseconds. - Weight::from_parts(80_474_489, 12632) - // Standard Error: 14_395 - .saturating_add(Weight::from_parts(142_000, 0).saturating_mul(l.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `628 + l * (25 ±0) + s * (40 ±0)` + // Estimated: `6204` + // Minimum execution time: 116_570 nanoseconds. + Weight::from_parts(145_862_858, 6204) + // Standard Error: 12_694 + .saturating_add(Weight::from_parts(134_468, 0).saturating_mul(l.into())) + // Standard Error: 22_586 + .saturating_add(Weight::from_parts(306_294, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1169), added: 3644, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1169), added: 3644, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[2, 28]`. fn not_unlocking_merge_schedules(l: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `575 + l * (25 ±0) + s * (40 ±0)` - // Estimated: `10025` - // Minimum execution time: 44_740 nanoseconds. - Weight::from_parts(52_534_350, 10025) - // Standard Error: 10_550 - .saturating_add(Weight::from_parts(25_678, 0).saturating_mul(l.into())) - // Standard Error: 19_484 - .saturating_add(Weight::from_parts(180_277, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `448 + l * (25 ±0) + s * (40 ±0)` + // Estimated: `4764` + // Minimum execution time: 61_260 nanoseconds. + Weight::from_parts(78_432_635, 4764) + // Standard Error: 9_780 + .saturating_add(Weight::from_parts(95_506, 0).saturating_mul(l.into())) + // Standard Error: 18_061 + .saturating_add(Weight::from_parts(186_973, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1169), added: 3644, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Vesting::Vesting` (r:1 w:1) + /// Proof: `Vesting::Vesting` (`max_values`: None, `max_size`: Some(1169), added: 3644, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 49]`. /// The range of component `s` is `[2, 28]`. fn unlocking_merge_schedules(l: u32, s: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `575 + l * (25 ±0) + s * (40 ±0)` - // Estimated: `10025` - // Minimum execution time: 45_250 nanoseconds. - Weight::from_parts(54_174_621, 10025) - // Standard Error: 11_352 - .saturating_add(Weight::from_parts(118_094, 0).saturating_mul(l.into())) - // Standard Error: 20_964 - .saturating_add(Weight::from_parts(25_682, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `448 + l * (25 ±0) + s * (40 ±0)` + // Estimated: `4764` + // Minimum execution time: 64_750 nanoseconds. + Weight::from_parts(82_374_991, 4764) + // Standard Error: 9_563 + .saturating_add(Weight::from_parts(94_770, 0).saturating_mul(l.into())) + // Standard Error: 17_661 + .saturating_add(Weight::from_parts(283_509, 0).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } } diff --git a/zrml/authorized/src/weights.rs b/zrml/authorized/src/weights.rs index 13d00c1be..8372f608f 100644 --- a/zrml/authorized/src/weights.rs +++ b/zrml/authorized/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_authorized //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -63,34 +63,34 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_authorized (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerDisputeBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:1 w:1) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerDisputeBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerDisputeBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) /// The range of component `m` is `[1, 63]`. fn authorize_market_outcome_first_report(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `854 + m * (22 ±0)` - // Estimated: `9208` - // Minimum execution time: 40_270 nanoseconds. - Weight::from_parts(52_925_446, 9208) - // Standard Error: 9_823 - .saturating_add(Weight::from_parts(6_925, 0).saturating_mul(m.into())) + // Measured: `757 + m * (22 ±0)` + // Estimated: `4507` + // Minimum execution time: 42_950 nanoseconds. + Weight::from_parts(52_839_698, 4507) + // Standard Error: 11_853 + .saturating_add(Weight::from_parts(236_800, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:1 w:1) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn authorize_market_outcome_existing_report() -> Weight { // Proof Size summary in bytes: - // Measured: `577` - // Estimated: `5677` - // Minimum execution time: 35_410 nanoseconds. - Weight::from_parts(36_251_000, 5677) + // Measured: `561` + // Estimated: `4159` + // Minimum execution time: 39_960 nanoseconds. + Weight::from_parts(48_520_000, 4159) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -98,17 +98,17 @@ impl WeightInfoZeitgeist for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 340 nanoseconds. - Weight::from_parts(440_000, 0) + // Minimum execution time: 470 nanoseconds. + Weight::from_parts(550_000, 0) } - /// Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:1 w:1) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn on_resolution_weight() -> Weight { // Proof Size summary in bytes: // Measured: `217` - // Estimated: `2524` - // Minimum execution time: 10_190 nanoseconds. - Weight::from_parts(12_490_000, 2524) + // Estimated: `3514` + // Minimum execution time: 10_960 nanoseconds. + Weight::from_parts(13_300_000, 3514) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -116,39 +116,39 @@ impl WeightInfoZeitgeist for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_720 nanoseconds. - Weight::from_parts(3_440_000, 0) + // Minimum execution time: 3_590 nanoseconds. + Weight::from_parts(3_880_000, 0) } - /// Storage: Authorized AuthorizedOutcomeReports (r:1 w:0) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:1 w:0) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn get_auto_resolve_weight() -> Weight { // Proof Size summary in bytes: // Measured: `217` - // Estimated: `2524` - // Minimum execution time: 9_550 nanoseconds. - Weight::from_parts(11_820_000, 2524).saturating_add(T::DbWeight::get().reads(1)) + // Estimated: `3514` + // Minimum execution time: 9_940 nanoseconds. + Weight::from_parts(12_081_000, 3514).saturating_add(T::DbWeight::get().reads(1)) } fn has_failed_weight() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 320 nanoseconds. - Weight::from_parts(400_000, 0) + // Minimum execution time: 600 nanoseconds. + Weight::from_parts(630_000, 0) } fn on_global_dispute_weight() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 300 nanoseconds. - Weight::from_parts(380_000, 0) + // Minimum execution time: 500 nanoseconds. + Weight::from_parts(540_000, 0) } - /// Storage: Authorized AuthorizedOutcomeReports (r:0 w:1) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:0 w:1) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn clear_weight() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_510 nanoseconds. - Weight::from_parts(3_060_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 3_690 nanoseconds. + Weight::from_parts(3_880_000, 0).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/court/src/weights.rs b/zrml/court/src/weights.rs index 078b9d1ea..ba7c73a28 100644 --- a/zrml/court/src/weights.rs +++ b/zrml/court/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_court //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -74,424 +74,432 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_court (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: Court CourtPool (r:1 w:1) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) - /// Storage: Court Participants (r:1 w:1) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `Court::CourtPool` (r:1 w:1) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:1 w:1) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `j` is `[0, 999]`. fn join_court(j: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1179 + j * (96 ±0)` - // Estimated: `102997` - // Minimum execution time: 49_610 nanoseconds. - Weight::from_parts(51_968_323, 102997) - // Standard Error: 1_183 - .saturating_add(Weight::from_parts(157_814, 0).saturating_mul(j.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `1082 + j * (96 ±0)` + // Estimated: `97487` + // Minimum execution time: 70_120 nanoseconds. + Weight::from_parts(104_617_890, 97487) + // Standard Error: 1_533 + .saturating_add(Weight::from_parts(169_978, 0).saturating_mul(j.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Court CourtPool (r:1 w:1) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) - /// Storage: Court Participants (r:6 w:1) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `Court::CourtPool` (r:1 w:1) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:6 w:1) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `j` is `[5, 999]`. /// The range of component `d` is `[1, 5]`. fn delegate(j: u32, d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + j * (98 ±0) + d * (683 ±0)` - // Estimated: `102997 + d * (2726 ±0)` - // Minimum execution time: 82_510 nanoseconds. - Weight::from_parts(48_425_156, 102997) - // Standard Error: 1_128 - .saturating_add(Weight::from_parts(204_131, 0).saturating_mul(j.into())) - // Standard Error: 244_957 - .saturating_add(Weight::from_parts(9_230_967, 0).saturating_mul(d.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `0 + d * (651 ±0) + j * (98 ±0)` + // Estimated: `97487 + d * (2726 ±0)` + // Minimum execution time: 111_671 nanoseconds. + Weight::from_parts(91_977_310, 97487) + // Standard Error: 1_492 + .saturating_add(Weight::from_parts(225_927, 0).saturating_mul(j.into())) + // Standard Error: 323_881 + .saturating_add(Weight::from_parts(14_144_892, 0).saturating_mul(d.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 2726).saturating_mul(d.into())) } - /// Storage: Court Participants (r:1 w:1) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Court CourtPool (r:1 w:1) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) + /// Storage: `Court::Participants` (r:1 w:1) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtPool` (r:1 w:1) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) /// The range of component `j` is `[0, 999]`. fn prepare_exit_court(j: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1117 + j * (96 ±0)` - // Estimated: `99223` - // Minimum execution time: 34_180 nanoseconds. - Weight::from_parts(38_897_220, 99223) - // Standard Error: 848 - .saturating_add(Weight::from_parts(135_091, 0).saturating_mul(j.into())) + // Measured: `1020 + j * (96 ±0)` + // Estimated: `97487` + // Minimum execution time: 39_270 nanoseconds. + Weight::from_parts(70_821_465, 97487) + // Standard Error: 1_114 + .saturating_add(Weight::from_parts(134_246, 0).saturating_mul(j.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Court Participants (r:1 w:1) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `Court::Participants` (r:1 w:1) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn exit_court_remove() -> Weight { // Proof Size summary in bytes: - // Measured: `307` - // Estimated: `6500` - // Minimum execution time: 43_340 nanoseconds. - Weight::from_parts(52_540_000, 6500) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `276` + // Estimated: `4764` + // Minimum execution time: 72_321 nanoseconds. + Weight::from_parts(74_920_000, 4764) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Court Participants (r:1 w:1) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `Court::Participants` (r:1 w:1) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) fn exit_court_set() -> Weight { // Proof Size summary in bytes: - // Measured: `307` - // Estimated: `6500` - // Minimum execution time: 40_611 nanoseconds. - Weight::from_parts(50_010_000, 6500) - .saturating_add(T::DbWeight::get().reads(2)) + // Measured: `276` + // Estimated: `4764` + // Minimum execution time: 60_241 nanoseconds. + Weight::from_parts(61_800_000, 4764) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Court Courts (r:1 w:0) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) + /// Storage: `Court::Courts` (r:1 w:0) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) /// The range of component `d` is `[1, 510]`. fn vote(d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `484 + d * (53 ±0)` - // Estimated: `155273` - // Minimum execution time: 54_120 nanoseconds. - Weight::from_parts(65_086_980, 155273) - // Standard Error: 1_797 - .saturating_add(Weight::from_parts(174_008, 0).saturating_mul(d.into())) + // Measured: `387 + d * (53 ±0)` + // Estimated: `153439` + // Minimum execution time: 75_670 nanoseconds. + Weight::from_parts(82_899_200, 153439) + // Standard Error: 1_081 + .saturating_add(Weight::from_parts(168_916, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Court CourtIdToMarketId (r:1 w:0) - /// Proof: Court CourtIdToMarketId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Court Participants (r:1 w:0) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Court Courts (r:1 w:0) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) + /// Storage: `Court::CourtIdToMarketId` (r:1 w:0) + /// Proof: `Court::CourtIdToMarketId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:1 w:0) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:1 w:0) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) /// The range of component `d` is `[1, 510]`. fn denounce_vote(d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1625 + d * (53 ±0)` - // Estimated: `163681` - // Minimum execution time: 58_060 nanoseconds. - Weight::from_parts(77_818_158, 163681) - // Standard Error: 2_836 - .saturating_add(Weight::from_parts(208_984, 0).saturating_mul(d.into())) + // Measured: `1496 + d * (53 ±0)` + // Estimated: `153439` + // Minimum execution time: 72_850 nanoseconds. + Weight::from_parts(122_229_287, 153439) + // Standard Error: 2_413 + .saturating_add(Weight::from_parts(214_002, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Court CourtIdToMarketId (r:1 w:0) - /// Proof: Court CourtIdToMarketId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Court Participants (r:1 w:0) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Court Courts (r:1 w:0) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) + /// Storage: `Court::CourtIdToMarketId` (r:1 w:0) + /// Proof: `Court::CourtIdToMarketId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:1 w:0) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:1 w:0) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) /// The range of component `d` is `[1, 510]`. fn reveal_vote(d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2195 + d * (53 ±0)` - // Estimated: `163681` - // Minimum execution time: 95_291 nanoseconds. - Weight::from_parts(113_379_389, 163681) - // Standard Error: 2_305 - .saturating_add(Weight::from_parts(167_661, 0).saturating_mul(d.into())) + // Measured: `2034 + d * (53 ±0)` + // Estimated: `153439` + // Minimum execution time: 123_340 nanoseconds. + Weight::from_parts(143_162_366, 153439) + // Standard Error: 1_630 + .saturating_add(Weight::from_parts(166_050, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Court Courts (r:1 w:1) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court CourtIdToMarketId (r:1 w:0) - /// Proof: Court CourtIdToMarketId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) - /// Storage: Court CourtPool (r:1 w:1) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) - /// Storage: Court SelectionNonce (r:1 w:1) - /// Proof: Court SelectionNonce (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) - /// Proof: RandomnessCollectiveFlip RandomMaterial (max_values: Some(1), max_size: Some(2594), added: 3089, mode: MaxEncodedLen) - /// Storage: Court Participants (r:347 w:343) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Court RequestBlock (r:1 w:0) - /// Proof: Court RequestBlock (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:2 w:2) - /// Proof: PredictionMarkets MarketIdsPerDisputeBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + /// Storage: `Court::Courts` (r:1 w:1) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtIdToMarketId` (r:1 w:0) + /// Proof: `Court::CourtIdToMarketId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtPool` (r:1 w:1) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectionNonce` (r:1 w:1) + /// Proof: `Court::SelectionNonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0) + /// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:347 w:343) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Court::RequestBlock` (r:1 w:0) + /// Proof: `Court::RequestBlock` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerDisputeBlock` (r:2 w:2) + /// Proof: `PredictionMarkets::MarketIdsPerDisputeBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) /// The range of component `j` is `[255, 1000]`. /// The range of component `a` is `[0, 2]`. /// The range of component `r` is `[0, 62]`. /// The range of component `f` is `[0, 62]`. fn appeal(j: u32, a: u32, _r: u32, _f: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `929 + j * (153 ±0) + a * (27536 ±0) + r * (16 ±0) + f * (16 ±0)` - // Estimated: `539453 + j * (194 ±3) + a * (318078 ±1_049)` - // Minimum execution time: 3_930_223 nanoseconds. - Weight::from_parts(4_460_615_000, 539453) - // Standard Error: 100_366 - .saturating_add(Weight::from_parts(7_622_232, 0).saturating_mul(j.into())) - // Standard Error: 34_944_607 - .saturating_add(Weight::from_parts(5_013_268_130, 0).saturating_mul(a.into())) + // Measured: `0 + a * (24688 ±0) + f * (16 ±0) + j * (149 ±0) + r * (16 ±0)` + // Estimated: `268138 + a * (318078 ±1_049) + j * (194 ±3)` + // Minimum execution time: 5_533_132 nanoseconds. + Weight::from_parts(6_091_374_000, 268138) + // Standard Error: 119_001 + .saturating_add(Weight::from_parts(10_513_554, 0).saturating_mul(j.into())) + // Standard Error: 41_432_880 + .saturating_add(Weight::from_parts(6_976_024_571, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((127_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(100)) .saturating_add(T::DbWeight::get().writes((117_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 194).saturating_mul(j.into())) .saturating_add(Weight::from_parts(0, 318078).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 194).saturating_mul(j.into())) } - /// Storage: Court Courts (r:1 w:1) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) - /// Storage: Court Participants (r:510 w:510) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: System Account (r:511 w:510) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Court::Courts` (r:1 w:1) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:510 w:510) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:511 w:510) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `d` is `[5, 510]`. fn reassign_court_stakes(d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1044 + d * (587 ±0)` - // Estimated: `157880 + d * (5333 ±0)` - // Minimum execution time: 153_091 nanoseconds. - Weight::from_parts(185_300_000, 157880) - // Standard Error: 140_663 - .saturating_add(Weight::from_parts(69_219_929, 0).saturating_mul(d.into())) + // Measured: `947 + d * (523 ±0)` + // Estimated: `153439 + d * (2726 ±0)` + // Minimum execution time: 203_641 nanoseconds. + Weight::from_parts(249_281_000, 153439) + // Standard Error: 171_943 + .saturating_add(Weight::from_parts(126_319_071, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(d.into()))) - .saturating_add(Weight::from_parts(0, 5333).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 2726).saturating_mul(d.into())) } - /// Storage: Court YearlyInflation (r:0 w:1) - /// Proof: Court YearlyInflation (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + /// Storage: `Court::YearlyInflation` (r:0 w:1) + /// Proof: `Court::YearlyInflation` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) fn set_inflation() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 15_140 nanoseconds. - Weight::from_parts(18_380_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 19_400 nanoseconds. + Weight::from_parts(20_320_000, 0).saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Court YearlyInflation (r:1 w:0) - /// Proof: Court YearlyInflation (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Court CourtPool (r:1 w:0) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) - /// Storage: System Account (r:999 w:999) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Court::YearlyInflation` (r:1 w:0) + /// Proof: `Court::YearlyInflation` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtPool` (r:1 w:0) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:999 w:999) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `j` is `[1, 1000]`. fn handle_inflation(j: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + j * (243 ±0)` - // Estimated: `72996 + j * (2607 ±0)` - // Minimum execution time: 33_280 nanoseconds. - Weight::from_parts(34_480_000, 72996) - // Standard Error: 9_174 - .saturating_add(Weight::from_parts(19_968_654, 0).saturating_mul(j.into())) + // Measured: `0 + j * (235 ±0)` + // Estimated: `97487 + j * (2607 ±0)` + // Minimum execution time: 54_890 nanoseconds. + Weight::from_parts(55_571_000, 97487) + // Standard Error: 42_436 + .saturating_add(Weight::from_parts(34_908_020, 0).saturating_mul(j.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(j.into()))) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(j.into()))) .saturating_add(Weight::from_parts(0, 2607).saturating_mul(j.into())) } - /// Storage: Court CourtPool (r:1 w:1) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) - /// Storage: Court SelectionNonce (r:1 w:1) - /// Proof: Court SelectionNonce (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) - /// Proof: RandomnessCollectiveFlip RandomMaterial (max_values: Some(1), max_size: Some(2594), added: 3089, mode: MaxEncodedLen) - /// Storage: Court Participants (r:240 w:236) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) + /// Storage: `Court::CourtPool` (r:1 w:1) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectionNonce` (r:1 w:1) + /// Proof: `Court::SelectionNonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0) + /// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:240 w:236) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 3]`. fn select_participants(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `114768 + a * (16253 ±0)` - // Estimated: `175425 + a * (136685 ±1_677)` - // Minimum execution time: 1_761_346 nanoseconds. - Weight::from_parts(1_588_336_592, 175425) - // Standard Error: 49_849_271 - .saturating_add(Weight::from_parts(3_297_691_181, 0).saturating_mul(a.into())) + // Measured: `113583 + a * (14765 ±0)` + // Estimated: `97487 + a * (136685 ±1_677)` + // Minimum execution time: 2_334_927 nanoseconds. + Weight::from_parts(2_046_084_164, 97487) + // Standard Error: 61_887_211 + .saturating_add(Weight::from_parts(4_470_109_395, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(31)) .saturating_add(T::DbWeight::get().reads((50_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(26)) .saturating_add(T::DbWeight::get().writes((50_u64).saturating_mul(a.into()))) .saturating_add(Weight::from_parts(0, 136685).saturating_mul(a.into())) } - /// Storage: Court NextCourtId (r:1 w:1) - /// Proof: Court NextCourtId (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Court CourtPool (r:1 w:1) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) - /// Storage: Court SelectionNonce (r:1 w:1) - /// Proof: Court SelectionNonce (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: RandomnessCollectiveFlip RandomMaterial (r:1 w:0) - /// Proof: RandomnessCollectiveFlip RandomMaterial (max_values: Some(1), max_size: Some(2594), added: 3089, mode: MaxEncodedLen) - /// Storage: Court Participants (r:31 w:31) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Court RequestBlock (r:1 w:0) - /// Proof: Court RequestBlock (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerDisputeBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:0 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) - /// Storage: Court CourtIdToMarketId (r:0 w:1) - /// Proof: Court CourtIdToMarketId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court MarketIdToCourtId (r:0 w:1) - /// Proof: Court MarketIdToCourtId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court Courts (r:0 w:1) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) + /// Storage: `Court::NextCourtId` (r:1 w:1) + /// Proof: `Court::NextCourtId` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtPool` (r:1 w:1) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectionNonce` (r:1 w:1) + /// Proof: `Court::SelectionNonce` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `RandomnessCollectiveFlip::RandomMaterial` (r:1 w:0) + /// Proof: `RandomnessCollectiveFlip::RandomMaterial` (`max_values`: Some(1), `max_size`: Some(2594), added: 3089, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:31 w:31) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Court::RequestBlock` (r:1 w:0) + /// Proof: `Court::RequestBlock` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerDisputeBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerDisputeBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:0 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtIdToMarketId` (r:0 w:1) + /// Proof: `Court::CourtIdToMarketId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::MarketIdToCourtId` (r:0 w:1) + /// Proof: `Court::MarketIdToCourtId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:0 w:1) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) /// The range of component `j` is `[31, 1000]`. /// The range of component `r` is `[0, 62]`. fn on_dispute(j: u32, r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `6220 + j * (104 ±0) + r * (16 ±0)` - // Estimated: `181024 + j * (8 ±0) + r * (25 ±4)` - // Minimum execution time: 307_741 nanoseconds. - Weight::from_parts(414_864_557, 181024) - // Standard Error: 3_471 - .saturating_add(Weight::from_parts(252_484, 0).saturating_mul(j.into())) - // Standard Error: 53_808 - .saturating_add(Weight::from_parts(293_295, 0).saturating_mul(r.into())) + // Measured: `5181 + j * (104 ±0) + r * (16 ±0)` + // Estimated: `97487 + j * (8 ±0) + r * (25 ±4)` + // Minimum execution time: 458_771 nanoseconds. + Weight::from_parts(545_196_348, 97487) + // Standard Error: 5_074 + .saturating_add(Weight::from_parts(344_054, 0).saturating_mul(j.into())) + // Standard Error: 78_650 + .saturating_add(Weight::from_parts(727_968, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(34)) .saturating_add(T::DbWeight::get().writes(36)) .saturating_add(Weight::from_parts(0, 8).saturating_mul(j.into())) .saturating_add(Weight::from_parts(0, 25).saturating_mul(r.into())) } - /// Storage: Court MarketIdToCourtId (r:1 w:0) - /// Proof: Court MarketIdToCourtId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court Courts (r:1 w:1) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:0) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) - /// Storage: Court CourtIdToMarketId (r:1 w:0) - /// Proof: Court CourtIdToMarketId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Court Participants (r:510 w:510) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) + /// Storage: `Court::MarketIdToCourtId` (r:1 w:0) + /// Proof: `Court::MarketIdToCourtId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:1 w:1) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:0) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtIdToMarketId` (r:1 w:0) + /// Proof: `Court::CourtIdToMarketId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:510 w:510) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) /// The range of component `d` is `[1, 510]`. fn on_resolution(d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `1019 + d * (256 ±0)` - // Estimated: `163470 + d * (2726 ±0)` - // Minimum execution time: 48_260 nanoseconds. - Weight::from_parts(57_730_000, 163470) - // Standard Error: 21_662 - .saturating_add(Weight::from_parts(7_738_635, 0).saturating_mul(d.into())) + // Measured: `890 + d * (224 ±0)` + // Estimated: `153439 + d * (2726 ±0)` + // Minimum execution time: 73_910 nanoseconds. + Weight::from_parts(77_041_000, 153439) + // Standard Error: 27_015 + .saturating_add(Weight::from_parts(10_592_807, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 2726).saturating_mul(d.into())) } - /// Storage: Court MarketIdToCourtId (r:1 w:0) - /// Proof: Court MarketIdToCourtId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court Courts (r:1 w:0) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:4 w:4) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: System Account (r:4 w:4) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Court::MarketIdToCourtId` (r:1 w:0) + /// Proof: `Court::MarketIdToCourtId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:1 w:0) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:4 w:4) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:4 w:4) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 4]`. fn exchange(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `453 + a * (352 ±0)` - // Estimated: `5339 + a * (6331 ±0)` - // Minimum execution time: 15_140 nanoseconds. - Weight::from_parts(20_515_445, 5339) - // Standard Error: 205_998 - .saturating_add(Weight::from_parts(37_613_284, 0).saturating_mul(a.into())) + // Measured: `388 + a * (320 ±0)` + // Estimated: `3814 + a * (3724 ±0)` + // Minimum execution time: 24_510 nanoseconds. + Weight::from_parts(34_027_716, 3814) + // Standard Error: 193_772 + .saturating_add(Weight::from_parts(45_190_549, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 6331).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 3724).saturating_mul(a.into())) } - /// Storage: Court MarketIdToCourtId (r:1 w:0) - /// Proof: Court MarketIdToCourtId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court Courts (r:1 w:0) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) + /// Storage: `Court::MarketIdToCourtId` (r:1 w:0) + /// Proof: `Court::MarketIdToCourtId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:1 w:0) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) fn get_auto_resolve() -> Weight { // Proof Size summary in bytes: - // Measured: `423` - // Estimated: `5339` - // Minimum execution time: 12_640 nanoseconds. - Weight::from_parts(15_900_000, 5339).saturating_add(T::DbWeight::get().reads(2)) + // Measured: `391` + // Estimated: `3814` + // Minimum execution time: 19_370 nanoseconds. + Weight::from_parts(22_610_000, 3814).saturating_add(T::DbWeight::get().reads(2)) } - /// Storage: Court MarketIdToCourtId (r:1 w:0) - /// Proof: Court MarketIdToCourtId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court CourtPool (r:1 w:0) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) - /// Storage: Court Courts (r:1 w:0) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court CourtIdToMarketId (r:1 w:0) - /// Proof: Court CourtIdToMarketId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) + /// Storage: `Court::MarketIdToCourtId` (r:1 w:0) + /// Proof: `Court::MarketIdToCourtId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtPool` (r:1 w:0) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:1 w:0) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtIdToMarketId` (r:1 w:0) + /// Proof: `Court::CourtIdToMarketId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) fn has_failed() -> Weight { // Proof Size summary in bytes: - // Measured: `3982` - // Estimated: `107518` - // Minimum execution time: 38_350 nanoseconds. - Weight::from_parts(49_300_000, 107518).saturating_add(T::DbWeight::get().reads(5)) + // Measured: `3854` + // Estimated: `97487` + // Minimum execution time: 59_860 nanoseconds. + Weight::from_parts(71_241_000, 97487).saturating_add(T::DbWeight::get().reads(5)) } - /// Storage: Court MarketIdToCourtId (r:1 w:0) - /// Proof: Court MarketIdToCourtId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court Courts (r:1 w:1) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) - /// Storage: Court Participants (r:510 w:510) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) + /// Storage: `Court::MarketIdToCourtId` (r:1 w:0) + /// Proof: `Court::MarketIdToCourtId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:1 w:1) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:510 w:510) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) /// The range of component `a` is `[0, 4]`. /// The range of component `d` is `[1, 510]`. fn on_global_dispute(_a: u32, d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `519 + a * (66 ±0) + d * (256 ±0)` - // Estimated: `157788 + d * (2726 ±0)` - // Minimum execution time: 32_990 nanoseconds. - Weight::from_parts(151_250_645, 157788) - // Standard Error: 30_049 - .saturating_add(Weight::from_parts(7_774_671, 0).saturating_mul(d.into())) + // Measured: `422 + a * (66 ±0) + d * (224 ±0)` + // Estimated: `153439 + d * (2726 ±0)` + // Minimum execution time: 49_460 nanoseconds. + Weight::from_parts(53_661_000, 153439) + // Standard Error: 16_081 + .saturating_add(Weight::from_parts(10_876_738, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(d.into()))) .saturating_add(Weight::from_parts(0, 2726).saturating_mul(d.into())) } - /// Storage: Court MarketIdToCourtId (r:1 w:0) - /// Proof: Court MarketIdToCourtId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) - /// Storage: Court Participants (r:510 w:510) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: Court Courts (r:0 w:1) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) + /// Storage: `Court::MarketIdToCourtId` (r:1 w:0) + /// Proof: `Court::MarketIdToCourtId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:510 w:510) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:0 w:1) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) /// The range of component `d` is `[1, 510]`. fn clear(d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `432 + d * (256 ±0)` - // Estimated: `154964 + d * (2726 ±0)` - // Minimum execution time: 26_200 nanoseconds. - Weight::from_parts(32_380_000, 154964) - // Standard Error: 15_021 - .saturating_add(Weight::from_parts(7_510_395, 0).saturating_mul(d.into())) + // Measured: `367 + d * (224 ±0)` + // Estimated: `153439 + d * (2726 ±0)` + // Minimum execution time: 47_960 nanoseconds. + Weight::from_parts(51_290_000, 153439) + // Standard Error: 19_628 + .saturating_add(Weight::from_parts(10_330_139, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(2)) diff --git a/zrml/global-disputes/src/weights.rs b/zrml/global-disputes/src/weights.rs index 3b7541a1f..fa1ce5cd6 100644 --- a/zrml/global-disputes/src/weights.rs +++ b/zrml/global-disputes/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_global_disputes //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -62,165 +62,173 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_global_disputes (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:1) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: GlobalDisputes Outcomes (r:1 w:1) - /// Proof: GlobalDisputes Outcomes (max_values: None, max_size: Some(395), added: 2870, mode: MaxEncodedLen) - /// Storage: GlobalDisputes Locks (r:1 w:1) - /// Proof: GlobalDisputes Locks (max_values: None, max_size: Some(1641), added: 4116, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:1) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::Outcomes` (r:1 w:1) + /// Proof: `GlobalDisputes::Outcomes` (`max_values`: None, `max_size`: Some(395), added: 2870, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::Locks` (r:1 w:1) + /// Proof: `GlobalDisputes::Locks` (`max_values`: None, `max_size`: Some(1641), added: 4116, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) /// The range of component `o` is `[2, 10]`. /// The range of component `v` is `[0, 49]`. - fn vote_on_outcome(o: u32, v: u32) -> Weight { + fn vote_on_outcome(_o: u32, v: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `581 + o * (33 ±0) + v * (32 ±0)` - // Estimated: `13631` - // Minimum execution time: 58_630 nanoseconds. - Weight::from_parts(70_092_958, 13631) - // Standard Error: 73_330 - .saturating_add(Weight::from_parts(356_105, 0).saturating_mul(o.into())) - // Standard Error: 12_896 - .saturating_add(Weight::from_parts(114_716, 0).saturating_mul(v.into())) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `452 + o * (33 ±0) + v * (32 ±0)` + // Estimated: `5106` + // Minimum execution time: 82_530 nanoseconds. + Weight::from_parts(126_323_142, 5106) + // Standard Error: 22_453 + .saturating_add(Weight::from_parts(322_465, 0).saturating_mul(v.into())) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: GlobalDisputes Locks (r:1 w:1) - /// Proof: GlobalDisputes Locks (max_values: None, max_size: Some(1641), added: 4116, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:50 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `GlobalDisputes::Locks` (r:1 w:1) + /// Proof: `GlobalDisputes::Locks` (`max_values`: None, `max_size`: Some(1641), added: 4116, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:50 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 50]`. /// The range of component `o` is `[1, 10]`. fn unlock_vote_balance_set(l: u32, o: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + l * (467 ±0) + o * (1600 ±0)` - // Estimated: `10497 + l * (2871 ±0)` - // Minimum execution time: 38_041 nanoseconds. - Weight::from_parts(46_882_976, 10497) - // Standard Error: 47_099 - .saturating_add(Weight::from_parts(4_725_103, 0).saturating_mul(l.into())) - // Standard Error: 247_202 - .saturating_add(Weight::from_parts(890_884, 0).saturating_mul(o.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `0 + l * (435 ±0) + o * (1600 ±0)` + // Estimated: `5106 + l * (2871 ±0)` + // Minimum execution time: 56_730 nanoseconds. + Weight::from_parts(51_193_349, 5106) + // Standard Error: 54_481 + .saturating_add(Weight::from_parts(5_744_146, 0).saturating_mul(l.into())) + // Standard Error: 285_947 + .saturating_add(Weight::from_parts(1_940_891, 0).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(Weight::from_parts(0, 2871).saturating_mul(l.into())) } - /// Storage: GlobalDisputes Locks (r:1 w:1) - /// Proof: GlobalDisputes Locks (max_values: None, max_size: Some(1641), added: 4116, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:50 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `GlobalDisputes::Locks` (r:1 w:1) + /// Proof: `GlobalDisputes::Locks` (`max_values`: None, `max_size`: Some(1641), added: 4116, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:50 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `Balances::Locks` (r:1 w:1) + /// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`) + /// Storage: `Balances::Freezes` (r:1 w:0) + /// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(65), added: 2540, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `l` is `[0, 50]`. /// The range of component `o` is `[1, 10]`. - fn unlock_vote_balance_remove(l: u32, _o: u32) -> Weight { + fn unlock_vote_balance_remove(l: u32, o: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `0 + l * (451 ±0) + o * (1600 ±0)` - // Estimated: `10497 + l * (2871 ±0)` - // Minimum execution time: 38_470 nanoseconds. - Weight::from_parts(55_026_649, 10497) - // Standard Error: 45_140 - .saturating_add(Weight::from_parts(4_559_687, 0).saturating_mul(l.into())) - .saturating_add(T::DbWeight::get().reads(3)) + // Measured: `0 + l * (419 ±0) + o * (1600 ±0)` + // Estimated: `5106 + l * (2871 ±0)` + // Minimum execution time: 63_810 nanoseconds. + Weight::from_parts(41_027_507, 5106) + // Standard Error: 59_734 + .saturating_add(Weight::from_parts(5_838_666, 0).saturating_mul(l.into())) + // Standard Error: 313_522 + .saturating_add(Weight::from_parts(1_959_676, 0).saturating_mul(o.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(l.into()))) - .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(Weight::from_parts(0, 2871).saturating_mul(l.into())) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:1) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: GlobalDisputes Outcomes (r:1 w:1) - /// Proof: GlobalDisputes Outcomes (max_values: None, max_size: Some(395), added: 2870, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:1) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::Outcomes` (r:1 w:1) + /// Proof: `GlobalDisputes::Outcomes` (`max_values`: None, `max_size`: Some(395), added: 2870, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `w` is `[1, 10]`. - fn add_vote_outcome(_w: u32) -> Weight { + fn add_vote_outcome(w: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `690 + w * (32 ±0)` - // Estimated: `11501` - // Minimum execution time: 69_591 nanoseconds. - Weight::from_parts(88_511_398, 11501) + // Measured: `680 + w * (32 ±0)` + // Estimated: `4159` + // Minimum execution time: 106_460 nanoseconds. + Weight::from_parts(145_681_201, 4159) + // Standard Error: 153_921 + .saturating_add(Weight::from_parts(432_081, 0).saturating_mul(w.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: GlobalDisputes Outcomes (r:1 w:0) - /// Proof: GlobalDisputes Outcomes (max_values: None, max_size: Some(395), added: 2870, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: System Account (r:11 w:11) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `GlobalDisputes::Outcomes` (r:1 w:0) + /// Proof: `GlobalDisputes::Outcomes` (`max_values`: None, `max_size`: Some(395), added: 2870, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:11 w:11) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `o` is `[1, 10]`. fn reward_outcome_owner_shared_possession(o: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `561 + o * (41 ±0)` - // Estimated: `8574 + o * (2790 ±20)` - // Minimum execution time: 77_830 nanoseconds. - Weight::from_parts(63_317_800, 8574) - // Standard Error: 328_030 - .saturating_add(Weight::from_parts(36_970_797, 0).saturating_mul(o.into())) + // Measured: `464 + o * (41 ±0)` + // Estimated: `3861 + o * (2790 ±20)` + // Minimum execution time: 127_700 nanoseconds. + Weight::from_parts(94_671_964, 3861) + // Standard Error: 784_808 + .saturating_add(Weight::from_parts(78_157_454, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(o.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(o.into()))) .saturating_add(Weight::from_parts(0, 2790).saturating_mul(o.into())) } - /// Storage: GlobalDisputes Outcomes (r:1 w:0) - /// Proof: GlobalDisputes Outcomes (max_values: None, max_size: Some(395), added: 2870, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `GlobalDisputes::Outcomes` (r:1 w:0) + /// Proof: `GlobalDisputes::Outcomes` (`max_values`: None, `max_size`: Some(395), added: 2870, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn reward_outcome_owner_paid_possession() -> Weight { // Proof Size summary in bytes: - // Measured: `608` - // Estimated: `10955` - // Minimum execution time: 78_530 nanoseconds. - Weight::from_parts(95_780_000, 10955) + // Measured: `511` + // Estimated: `6204` + // Minimum execution time: 155_170 nanoseconds. + Weight::from_parts(156_761_000, 6204) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:1) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: GlobalDisputes Outcomes (r:250 w:249) - /// Proof: GlobalDisputes Outcomes (max_values: None, max_size: Some(395), added: 2870, mode: MaxEncodedLen) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:1) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::Outcomes` (r:250 w:249) + /// Proof: `GlobalDisputes::Outcomes` (`max_values`: None, `max_size`: Some(395), added: 2870, mode: `MaxEncodedLen`) /// The range of component `k` is `[2, 248]`. /// The range of component `o` is `[1, 10]`. fn purge_outcomes(k: u32, _o: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `480 + k * (122 ±0) + o * (32 ±0)` - // Estimated: `8611 + k * (2870 ±0)` - // Minimum execution time: 96_590 nanoseconds. - Weight::from_parts(16_892_762, 8611) - // Standard Error: 75_754 - .saturating_add(Weight::from_parts(21_079_551, 0).saturating_mul(k.into())) + // Measured: `385 + k * (90 ±0) + o * (32 ±0)` + // Estimated: `6730 + k * (2870 ±0)` + // Minimum execution time: 82_060 nanoseconds. + Weight::from_parts(95_131_000, 6730) + // Standard Error: 32_542 + .saturating_add(Weight::from_parts(12_152_119, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) .saturating_add(Weight::from_parts(0, 2870).saturating_mul(k.into())) } - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: GlobalDisputes Outcomes (r:250 w:249) - /// Proof: GlobalDisputes Outcomes (max_values: None, max_size: Some(395), added: 2870, mode: MaxEncodedLen) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::Outcomes` (r:250 w:249) + /// Proof: `GlobalDisputes::Outcomes` (`max_values`: None, `max_size`: Some(395), added: 2870, mode: `MaxEncodedLen`) /// The range of component `k` is `[2, 248]`. /// The range of component `o` is `[1, 10]`. fn refund_vote_fees(k: u32, _o: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `480 + k * (122 ±0) + o * (32 ±0)` - // Estimated: `8611 + k * (2870 ±0)` - // Minimum execution time: 89_620 nanoseconds. - Weight::from_parts(90_779_105, 8611) - // Standard Error: 72_050 - .saturating_add(Weight::from_parts(20_636_324, 0).saturating_mul(k.into())) + // Measured: `385 + k * (90 ±0) + o * (32 ±0)` + // Estimated: `6730 + k * (2870 ±0)` + // Minimum execution time: 77_700 nanoseconds. + Weight::from_parts(78_360_000, 6730) + // Standard Error: 31_180 + .saturating_add(Weight::from_parts(12_401_094, 0).saturating_mul(k.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(k.into()))) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/zrml/hybrid-router/src/weights.rs b/zrml/hybrid-router/src/weights.rs index f039ad7d6..999a531dd 100644 --- a/zrml/hybrid-router/src/weights.rs +++ b/zrml/hybrid-router/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_hybrid_router //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -56,86 +56,82 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_hybrid_router (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Orderbook Orders (r:10 w:11) - /// Proof: Orderbook Orders (max_values: None, max_size: Some(142), added: 2617, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: System Account (r:12 w:12) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:16 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:27 w:27) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:16 w:16) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Tokens Reserves (r:10 w:10) - /// Proof: Tokens Reserves (max_values: None, max_size: Some(1276), added: 3751, mode: MaxEncodedLen) - /// Storage: Orderbook NextOrderId (r:1 w:1) - /// Proof: Orderbook NextOrderId (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Orderbook::Orders` (r:10 w:11) + /// Proof: `Orderbook::Orders` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:12 w:12) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:27 w:27) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:16 w:16) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Reserves` (r:10 w:10) + /// Proof: `Tokens::Reserves` (`max_values`: None, `max_size`: Some(1276), added: 3751, mode: `MaxEncodedLen`) + /// Storage: `Orderbook::NextOrderId` (r:1 w:1) + /// Proof: `Orderbook::NextOrderId` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 16]`. /// The range of component `o` is `[0, 10]`. fn buy(n: u32, o: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `3097 + n * (198 ±0) + o * (607 ±0)` - // Estimated: `162435 + o * (11573 ±0) + n * (7816 ±0)` - // Minimum execution time: 862_753 nanoseconds. - Weight::from_parts(972_983_000, 162435) - // Standard Error: 1_585_660 - .saturating_add(Weight::from_parts(55_371_618, 0).saturating_mul(n.into())) - // Standard Error: 2_600_574 - .saturating_add(Weight::from_parts(639_976_872, 0).saturating_mul(o.into())) + // Measured: `1249 + n * (166 ±0) + o * (497 ±0)` + // Estimated: `148211 + n * (2598 ±1) + o * (3751 ±0)` + // Minimum execution time: 1_142_494 nanoseconds. + Weight::from_parts(1_189_864_000, 148211) + // Standard Error: 1_897_660 + .saturating_add(Weight::from_parts(53_552_640, 0).saturating_mul(n.into())) + // Standard Error: 3_112_272 + .saturating_add(Weight::from_parts(857_125_320, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(o.into()))) .saturating_add(T::DbWeight::get().writes(7)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(o.into()))) - .saturating_add(Weight::from_parts(0, 11573).saturating_mul(o.into())) - .saturating_add(Weight::from_parts(0, 7816).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 2598).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 3751).saturating_mul(o.into())) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:10 w:0) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:21 w:21) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: Orderbook Orders (r:10 w:11) - /// Proof: Orderbook Orders (max_values: None, max_size: Some(142), added: 2617, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: System Account (r:12 w:12) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:10 w:10) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:10 w:10) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: Orderbook NextOrderId (r:1 w:1) - /// Proof: Orderbook NextOrderId (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Tokens Reserves (r:1 w:1) - /// Proof: Tokens Reserves (max_values: None, max_size: Some(1276), added: 3751, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:21 w:21) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Orderbook::Orders` (r:10 w:11) + /// Proof: `Orderbook::Orders` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:12 w:12) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:10 w:10) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:10 w:10) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `Orderbook::NextOrderId` (r:1 w:1) + /// Proof: `Orderbook::NextOrderId` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Reserves` (r:1 w:1) + /// Proof: `Tokens::Reserves` (`max_values`: None, `max_size`: Some(1276), added: 3751, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 10]`. /// The range of component `o` is `[0, 10]`. fn sell(n: u32, o: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `3238 + n * (196 ±0) + o * (418 ±0)` - // Estimated: `162462 + n * (7816 ±0) + o * (11546 ±0)` - // Minimum execution time: 718_572 nanoseconds. - Weight::from_parts(797_512_000, 162462) - // Standard Error: 2_580_820 - .saturating_add(Weight::from_parts(76_885_200, 0).saturating_mul(n.into())) - // Standard Error: 2_652_710 - .saturating_add(Weight::from_parts(541_861_257, 0).saturating_mul(o.into())) + // Measured: `1325 + n * (164 ±0) + o * (339 ±0)` + // Estimated: `148211 + n * (2598 ±2) + o * (3724 ±0)` + // Minimum execution time: 952_124 nanoseconds. + Weight::from_parts(1_009_864_000, 148211) + // Standard Error: 3_101_578 + .saturating_add(Weight::from_parts(83_265_420, 0).saturating_mul(n.into())) + // Standard Error: 3_187_974 + .saturating_add(Weight::from_parts(690_772_212, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(o.into()))) .saturating_add(T::DbWeight::get().writes(7)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(o.into()))) - .saturating_add(Weight::from_parts(0, 7816).saturating_mul(n.into())) - .saturating_add(Weight::from_parts(0, 11546).saturating_mul(o.into())) + .saturating_add(Weight::from_parts(0, 2598).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 3724).saturating_mul(o.into())) } } diff --git a/zrml/liquidity-mining/src/weights.rs b/zrml/liquidity-mining/src/weights.rs index 07dc1385b..d643d61dc 100644 --- a/zrml/liquidity-mining/src/weights.rs +++ b/zrml/liquidity-mining/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_liquidity_mining //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-24`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -55,13 +55,13 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_liquidity_mining (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: LiquidityMining PerBlockIncentive (r:0 w:1) - /// Proof: LiquidityMining PerBlockIncentive (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: `LiquidityMining::PerBlockIncentive` (r:0 w:1) + /// Proof: `LiquidityMining::PerBlockIncentive` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) fn set_per_block_distribution() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 5_170 nanoseconds. - Weight::from_parts(6_020_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 5_180 nanoseconds. + Weight::from_parts(6_820_000, 0).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/neo-swaps/src/weights.rs b/zrml/neo-swaps/src/weights.rs index d6c42e513..97c8413c4 100644 --- a/zrml/neo-swaps/src/weights.rs +++ b/zrml/neo-swaps/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_neo_swaps //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -62,176 +62,182 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_neo_swaps (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: System Account (r:3 w:3) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:129 w:129) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:128 w:128) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:129 w:129) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:128 w:128) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 128]`. fn buy(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2779 + n * (195 ±0)` - // Estimated: `160807 + n * (7816 ±0)` - // Minimum execution time: 428_751 nanoseconds. - Weight::from_parts(509_169_321, 160807) - // Standard Error: 101_370 - .saturating_add(Weight::from_parts(22_542_800, 0).saturating_mul(n.into())) + // Measured: `1283 + n * (163 ±0)` + // Estimated: `148211 + n * (2598 ±0)` + // Minimum execution time: 585_102 nanoseconds. + Weight::from_parts(580_456_240, 148211) + // Standard Error: 101_265 + .saturating_add(Weight::from_parts(27_359_358, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(5)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7816).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 2598).saturating_mul(n.into())) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Storage: Tokens Accounts (r:129 w:129) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:3 w:3) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:128 w:128) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:129 w:129) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:3 w:3) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:128 w:128) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 128]`. fn sell(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2941 + n * (195 ±0)` - // Estimated: `160807 + n * (7816 ±0)` - // Minimum execution time: 326_051 nanoseconds. - Weight::from_parts(337_913_110, 160807) - // Standard Error: 142_558 - .saturating_add(Weight::from_parts(32_232_119, 0).saturating_mul(n.into())) + // Measured: `1414 + n * (163 ±0)` + // Estimated: `148211 + n * (2598 ±0)` + // Minimum execution time: 468_861 nanoseconds. + Weight::from_parts(414_696_511, 148211) + // Standard Error: 95_356 + .saturating_add(Weight::from_parts(38_051_885, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(5)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7816).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 2598).saturating_mul(n.into())) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Storage: Tokens Accounts (r:256 w:256) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:256 w:256) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 128]`. fn join_in_place(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `140908 + n * (261 ±0)` - // Estimated: `152995 + n * (7896 ±0)` - // Minimum execution time: 589_352 nanoseconds. - Weight::from_parts(858_161_799, 152995) - // Standard Error: 235_846 - .saturating_add(Weight::from_parts(44_925_839, 0).saturating_mul(n.into())) + // Measured: `139311 + n * (197 ±0)` + // Estimated: `148211 + n * (5196 ±0)` + // Minimum execution time: 595_362 nanoseconds. + Weight::from_parts(440_618_005, 148211) + // Standard Error: 273_538 + .saturating_add(Weight::from_parts(47_025_592, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7896).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into())) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Storage: Tokens Accounts (r:256 w:256) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:256 w:256) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 128]`. fn join_reassigned(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `140704 + n * (261 ±0)` - // Estimated: `152995 + n * (7896 ±0)` - // Minimum execution time: 740_802 nanoseconds. - Weight::from_parts(942_736_689, 152995) - // Standard Error: 226_172 - .saturating_add(Weight::from_parts(45_144_685, 0).saturating_mul(n.into())) + // Measured: `139107 + n * (197 ±0)` + // Estimated: `148211 + n * (5196 ±0)` + // Minimum execution time: 622_432 nanoseconds. + Weight::from_parts(473_601_406, 148211) + // Standard Error: 298_264 + .saturating_add(Weight::from_parts(47_682_394, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7896).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into())) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Storage: Tokens Accounts (r:256 w:256) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:256 w:256) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 128]`. fn join_leaf(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `140709 + n * (261 ±0)` - // Estimated: `152995 + n * (7896 ±0)` - // Minimum execution time: 1_033_663 nanoseconds. - Weight::from_parts(1_158_427_570, 152995) - // Standard Error: 290_258 - .saturating_add(Weight::from_parts(46_834_860, 0).saturating_mul(n.into())) + // Measured: `138611 + n * (197 ±0)` + // Estimated: `148211 + n * (5196 ±0)` + // Minimum execution time: 582_132 nanoseconds. + Weight::from_parts(546_913_207, 148211) + // Standard Error: 277_416 + .saturating_add(Weight::from_parts(46_923_622, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7896).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into())) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Storage: Tokens Accounts (r:256 w:256) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:256 w:256) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 128]`. fn exit(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `140805 + n * (261 ±0)` - // Estimated: `152995 + n * (7896 ±0)` - // Minimum execution time: 1_059_013 nanoseconds. - Weight::from_parts(1_416_870_118, 152995) - // Standard Error: 282_123 - .saturating_add(Weight::from_parts(43_510_065, 0).saturating_mul(n.into())) + // Measured: `139208 + n * (197 ±0)` + // Estimated: `148211 + n * (5196 ±0)` + // Minimum execution time: 623_772 nanoseconds. + Weight::from_parts(514_882_760, 148211) + // Standard Error: 282_318 + .saturating_add(Weight::from_parts(45_943_935, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7896).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into())) } - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn withdraw_fees() -> Weight { // Proof Size summary in bytes: - // Measured: `139317` - // Estimated: `152435` - // Minimum execution time: 908_593 nanoseconds. - Weight::from_parts(1_062_393_000, 152435) + // Measured: `137756` + // Estimated: `148211` + // Minimum execution time: 595_752 nanoseconds. + Weight::from_parts(668_402_000, 148211) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Storage: Tokens Accounts (r:256 w:256) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:256 w:256) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `n` is `[2, 128]`. fn deploy_pool(n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2155 + n * (113 ±0)` - // Estimated: `152995 + n * (7896 ±0)` - // Minimum execution time: 219_501 nanoseconds. - Weight::from_parts(170_782_454, 152995) - // Standard Error: 183_769 - .saturating_add(Weight::from_parts(45_425_037, 0).saturating_mul(n.into())) + // Measured: `611 + n * (81 ±0)` + // Estimated: `148211 + n * (5196 ±0)` + // Minimum execution time: 205_881 nanoseconds. + Weight::from_parts(123_014_022, 148211) + // Standard Error: 170_483 + .saturating_add(Weight::from_parts(55_591_115, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7896).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into())) } } diff --git a/zrml/orderbook/src/weights.rs b/zrml/orderbook/src/weights.rs index 420e8ea95..a7d39b51d 100644 --- a/zrml/orderbook/src/weights.rs +++ b/zrml/orderbook/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_orderbook //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -57,51 +57,53 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_orderbook (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: Orderbook Orders (r:1 w:1) - /// Proof: Orderbook Orders (max_values: None, max_size: Some(142), added: 2617, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + /// Storage: `Orderbook::Orders` (r:1 w:1) + /// Proof: `Orderbook::Orders` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) fn remove_order() -> Weight { // Proof Size summary in bytes: - // Measured: `283` - // Estimated: `6341` - // Minimum execution time: 45_181 nanoseconds. - Weight::from_parts(55_640_000, 6341) + // Measured: `251` + // Estimated: `4714` + // Minimum execution time: 62_030 nanoseconds. + Weight::from_parts(71_670_000, 4714) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Orderbook Orders (r:1 w:1) - /// Proof: Orderbook Orders (max_values: None, max_size: Some(142), added: 2617, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:1 w:0) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:2 w:2) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) + /// Storage: `Orderbook::Orders` (r:1 w:1) + /// Proof: `Orderbook::Orders` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) fn fill_order() -> Weight { // Proof Size summary in bytes: - // Measured: `1206` - // Estimated: `20011` - // Minimum execution time: 130_771 nanoseconds. - Weight::from_parts(159_941_000, 20011) - .saturating_add(T::DbWeight::get().reads(7)) + // Measured: `970` + // Estimated: `6186` + // Minimum execution time: 150_301 nanoseconds. + Weight::from_parts(155_560_000, 6186) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Storage: Orderbook NextOrderId (r:1 w:1) - /// Proof: Orderbook NextOrderId (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: Orderbook Orders (r:0 w:1) - /// Proof: Orderbook Orders (max_values: None, max_size: Some(142), added: 2617, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Orderbook::NextOrderId` (r:1 w:1) + /// Proof: `Orderbook::NextOrderId` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `Orderbook::Orders` (r:0 w:1) + /// Proof: `Orderbook::Orders` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`) fn place_order() -> Weight { // Proof Size summary in bytes: - // Measured: `426` - // Estimated: `10102` - // Minimum execution time: 71_630 nanoseconds. - Weight::from_parts(72_740_000, 10102) - .saturating_add(T::DbWeight::get().reads(4)) + // Measured: `318` + // Estimated: `4714` + // Minimum execution time: 70_520 nanoseconds. + Weight::from_parts(72_130_000, 4714) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } } diff --git a/zrml/parimutuel/src/weights.rs b/zrml/parimutuel/src/weights.rs index 490bcdb54..a74a641f3 100644 --- a/zrml/parimutuel/src/weights.rs +++ b/zrml/parimutuel/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_parimutuel //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -57,54 +57,54 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_parimutuel (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) fn buy() -> Weight { // Proof Size summary in bytes: - // Measured: `1815` - // Estimated: `10876` - // Minimum execution time: 134_190 nanoseconds. - Weight::from_parts(155_681_000, 10876) + // Measured: `390` + // Estimated: `4159` + // Minimum execution time: 165_850 nanoseconds. + Weight::from_parts(167_061_000, 4159) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(678), added: 3153, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn claim_rewards() -> Weight { // Proof Size summary in bytes: - // Measured: `2312` - // Estimated: `10876` - // Minimum execution time: 127_580 nanoseconds. - Weight::from_parts(180_511_000, 10876) + // Measured: `790` + // Estimated: `4159` + // Minimum execution time: 142_031 nanoseconds. + Weight::from_parts(163_081_000, 4159) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(678), added: 3153, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:2 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:1 w:1) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:2 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn claim_refunds() -> Weight { // Proof Size summary in bytes: - // Measured: `2312` - // Estimated: `13394` - // Minimum execution time: 119_110 nanoseconds. - Weight::from_parts(132_660_000, 13394) + // Measured: `790` + // Estimated: `6026` + // Minimum execution time: 146_230 nanoseconds. + Weight::from_parts(150_261_000, 6026) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/zrml/prediction-markets/src/weights.rs b/zrml/prediction-markets/src/weights.rs index fb9b4d4cc..41e2737fc 100644 --- a/zrml/prediction-markets/src/weights.rs +++ b/zrml/prediction-markets/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_prediction_markets //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -89,727 +89,688 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_prediction_markets (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// The range of component `c` is `[0, 63]`. fn admin_move_market_to_closed(_c: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `726 + c * (16 ±0)` - // Estimated: `7195` - // Minimum execution time: 47_010 nanoseconds. - Weight::from_parts(62_466_368, 7195) + // Measured: `662 + c * (16 ±0)` + // Estimated: `4515` + // Minimum execution time: 49_510 nanoseconds. + Weight::from_parts(67_994_214, 4515) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerReportBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerReportBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerReportBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 63]`. - fn admin_move_market_to_resolved_scalar_reported(r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `772 + r * (16 ±0)` - // Estimated: `10408` - // Minimum execution time: 84_500 nanoseconds. - Weight::from_parts(116_294_372, 10408) - // Standard Error: 15_139 - .saturating_add(Weight::from_parts(22_900, 0).saturating_mul(r.into())) + fn admin_move_market_to_resolved_scalar_reported(_r: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `708 + r * (16 ±0)` + // Estimated: `4714` + // Minimum execution time: 101_380 nanoseconds. + Weight::from_parts(141_575_488, 4714) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerReportBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:63 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:63 w:63) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerReportBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerReportBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 63]`. fn admin_move_market_to_resolved_categorical_reported(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `17743 + r * (16 ±0)` - // Estimated: `420008` - // Minimum execution time: 977_573 nanoseconds. - Weight::from_parts(1_233_328_742, 420008) - // Standard Error: 144_771 - .saturating_add(Weight::from_parts(164_049, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(131)) - .saturating_add(T::DbWeight::get().writes(67)) - } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerDisputeBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:2 w:2) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + // Measured: `664 + r * (16 ±0)` + // Estimated: `4714` + // Minimum execution time: 101_461 nanoseconds. + Weight::from_parts(135_739_374, 4714) + // Standard Error: 24_998 + .saturating_add(Weight::from_parts(33_913, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:1 w:1) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerDisputeBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerDisputeBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:2 w:2) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 63]`. - fn admin_move_market_to_resolved_scalar_disputed(_r: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `1369 + r * (16 ±0)` - // Estimated: `22134` - // Minimum execution time: 141_201 nanoseconds. - Weight::from_parts(193_086_493, 22134) + fn admin_move_market_to_resolved_scalar_disputed(r: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `1240 + r * (16 ±0)` + // Estimated: `8438` + // Minimum execution time: 179_161 nanoseconds. + Weight::from_parts(233_307_766, 8438) + // Standard Error: 44_850 + .saturating_add(Weight::from_parts(267_513, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(6)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerDisputeBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:2 w:2) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:63 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:63 w:63) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:1 w:1) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerDisputeBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerDisputeBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:2 w:2) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 63]`. fn admin_move_market_to_resolved_categorical_disputed(_r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `18325 + r * (16 ±0)` - // Estimated: `431734` - // Minimum execution time: 1_027_543 nanoseconds. - Weight::from_parts(1_303_716_166, 431734) - .saturating_add(T::DbWeight::get().reads(135)) - .saturating_add(T::DbWeight::get().writes(70)) - } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsForEdit (r:1 w:0) - /// Proof: PredictionMarkets MarketIdsForEdit (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:64 w:64) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + // Measured: `1181 + r * (16 ±0)` + // Estimated: `8438` + // Minimum execution time: 177_800 nanoseconds. + Weight::from_parts(238_334_645, 8438) + .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsForEdit` (r:1 w:0) + /// Proof: `PredictionMarkets::MarketIdsForEdit` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) fn approve_market() -> Weight { // Proof Size summary in bytes: - // Measured: `672` - // Estimated: `183216` - // Minimum execution time: 578_002 nanoseconds. - Weight::from_parts(751_902_000, 183216) - .saturating_add(T::DbWeight::get().reads(67)) - .saturating_add(T::DbWeight::get().writes(66)) - } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsForEdit (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + // Measured: `564` + // Estimated: `4714` + // Minimum execution time: 71_920 nanoseconds. + Weight::from_parts(87_730_000, 4714) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsForEdit` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsForEdit` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `r` is `[0, 1024]`. fn request_edit(r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `535` - // Estimated: `6692` - // Minimum execution time: 26_710 nanoseconds. - Weight::from_parts(35_866_931, 6692) - // Standard Error: 339 - .saturating_add(Weight::from_parts(1_624, 0).saturating_mul(r.into())) + // Measured: `503` + // Estimated: `4515` + // Minimum execution time: 29_490 nanoseconds. + Weight::from_parts(37_974_205, 4515) + // Standard Error: 425 + .saturating_add(Weight::from_parts(2_637, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:64 w:64) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:64 w:64) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) /// The range of component `a` is `[2, 64]`. fn buy_complete_set(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `595 + a * (265 ±0)` - // Estimated: `5774 + a * (5292 ±0)` - // Minimum execution time: 116_930 nanoseconds. - Weight::from_parts(94_849_694, 5774) - // Standard Error: 124_185 - .saturating_add(Weight::from_parts(24_826_280, 0).saturating_mul(a.into())) + // Measured: `538` + // Estimated: `4159 + a * (2598 ±0)` + // Minimum execution time: 144_410 nanoseconds. + Weight::from_parts(103_677_076, 4159) + // Standard Error: 92_821 + .saturating_add(Weight::from_parts(28_850_139, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 5292).saturating_mul(a.into())) - } - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: MarketCommons MarketCounter (r:1 w:1) - /// Proof: MarketCommons MarketCounter (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:64 w:64) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:0 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) + .saturating_add(Weight::from_parts(0, 2598).saturating_mul(a.into())) + } + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::MarketCounter` (r:1 w:1) + /// Proof: `MarketCommons::MarketCounter` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:0 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) /// The range of component `m` is `[0, 63]`. fn create_market(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `240 + m * (16 ±0)` - // Estimated: `8263` - // Minimum execution time: 55_550 nanoseconds. - Weight::from_parts(74_259_340, 8263) - // Standard Error: 7_534 - .saturating_add(Weight::from_parts(63_015, 0).saturating_mul(m.into())) + // Measured: `208 + m * (16 ±0)` + // Estimated: `4714` + // Minimum execution time: 74_090 nanoseconds. + Weight::from_parts(96_846_263, 4714) + // Standard Error: 18_347 + .saturating_add(Weight::from_parts(102_037, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: PredictionMarkets MarketIdsForEdit (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsForEdit (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: `PredictionMarkets::MarketIdsForEdit` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsForEdit` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// The range of component `m` is `[0, 63]`. fn edit_market(_m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `735 + m * (16 ±0)` - // Estimated: `10706` - // Minimum execution time: 53_490 nanoseconds. - Weight::from_parts(75_146_182, 10706) + // Measured: `687 + m * (16 ±0)` + // Estimated: `4515` + // Minimum execution time: 63_690 nanoseconds. + Weight::from_parts(84_684_176, 4515) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:1) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: Court MarketIdToCourtId (r:1 w:0) - /// Proof: Court MarketIdToCourtId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court CourtPool (r:1 w:0) - /// Proof: Court CourtPool (max_values: Some(1), max_size: Some(96002), added: 96497, mode: MaxEncodedLen) - /// Storage: Court Courts (r:1 w:1) - /// Proof: Court Courts (max_values: None, max_size: Some(349), added: 2824, mode: MaxEncodedLen) - /// Storage: Court CourtIdToMarketId (r:1 w:0) - /// Proof: Court CourtIdToMarketId (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: Court SelectedDraws (r:1 w:1) - /// Proof: Court SelectedDraws (max_values: None, max_size: Some(149974), added: 152449, mode: MaxEncodedLen) - /// Storage: Court Participants (r:31 w:31) - /// Proof: Court Participants (max_values: None, max_size: Some(251), added: 2726, mode: MaxEncodedLen) - /// Storage: GlobalDisputes Outcomes (r:1 w:1) - /// Proof: GlobalDisputes Outcomes (max_values: None, max_size: Some(395), added: 2870, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerDisputeBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:1) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `Court::MarketIdToCourtId` (r:1 w:0) + /// Proof: `Court::MarketIdToCourtId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtPool` (r:1 w:0) + /// Proof: `Court::CourtPool` (`max_values`: Some(1), `max_size`: Some(96002), added: 96497, mode: `MaxEncodedLen`) + /// Storage: `Court::Courts` (r:1 w:1) + /// Proof: `Court::Courts` (`max_values`: None, `max_size`: Some(349), added: 2824, mode: `MaxEncodedLen`) + /// Storage: `Court::CourtIdToMarketId` (r:1 w:0) + /// Proof: `Court::CourtIdToMarketId` (`max_values`: None, `max_size`: Some(40), added: 2515, mode: `MaxEncodedLen`) + /// Storage: `Court::SelectedDraws` (r:1 w:1) + /// Proof: `Court::SelectedDraws` (`max_values`: None, `max_size`: Some(149974), added: 152449, mode: `MaxEncodedLen`) + /// Storage: `Court::Participants` (r:31 w:31) + /// Proof: `Court::Participants` (`max_values`: None, `max_size`: Some(251), added: 2726, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::Outcomes` (r:1 w:1) + /// Proof: `GlobalDisputes::Outcomes` (`max_values`: None, `max_size`: Some(395), added: 2870, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerDisputeBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerDisputeBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) /// The range of component `m` is `[1, 64]`. /// The range of component `n` is `[1, 64]`. fn start_global_dispute(m: u32, n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `10022 + m * (16 ±0)` - // Estimated: `353731` - // Minimum execution time: 320_101 nanoseconds. - Weight::from_parts(392_505_353, 353731) - // Standard Error: 43_508 - .saturating_add(Weight::from_parts(186_891, 0).saturating_mul(m.into())) - // Standard Error: 43_508 - .saturating_add(Weight::from_parts(73_177, 0).saturating_mul(n.into())) + // Measured: `8805 + m * (16 ±0)` + // Estimated: `153439` + // Minimum execution time: 381_092 nanoseconds. + Weight::from_parts(467_180_792, 153439) + // Standard Error: 63_125 + .saturating_add(Weight::from_parts(569_392, 0).saturating_mul(m.into())) + // Standard Error: 63_125 + .saturating_add(Weight::from_parts(507_292, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(40)) .saturating_add(T::DbWeight::get().writes(36)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) fn dispute_authorized() -> Weight { // Proof Size summary in bytes: - // Measured: `642` - // Estimated: `6891` - // Minimum execution time: 44_220 nanoseconds. - Weight::from_parts(59_390_000, 6891) + // Measured: `610` + // Estimated: `4714` + // Minimum execution time: 54_360 nanoseconds. + Weight::from_parts(67_401_000, 4714) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) - /// Proof: PredictionMarkets MarketIdsForEdit (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsForEdit` (r:0 w:1) + /// Proof: `PredictionMarkets::MarketIdsForEdit` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) fn handle_expired_advised_market() -> Weight { // Proof Size summary in bytes: - // Measured: `555` - // Estimated: `6891` - // Minimum execution time: 77_490 nanoseconds. - Weight::from_parts(79_210_000, 6891) + // Measured: `523` + // Estimated: `4714` + // Minimum execution time: 94_720 nanoseconds. + Weight::from_parts(97_491_000, 4714) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:63 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:63 w:63) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) fn internal_resolve_categorical_reported() -> Weight { // Proof Size summary in bytes: - // Measured: `17613` - // Estimated: `416491` - // Minimum execution time: 994_903 nanoseconds. - Weight::from_parts(1_206_524_000, 416491) - .saturating_add(T::DbWeight::get().reads(130)) - .saturating_add(T::DbWeight::get().writes(66)) - } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:63 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:63 w:63) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) + // Measured: `566` + // Estimated: `4714` + // Minimum execution time: 76_380 nanoseconds. + Weight::from_parts(111_071_000, 4714) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:1 w:1) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn internal_resolve_categorical_disputed() -> Weight { // Proof Size summary in bytes: - // Measured: `17939` - // Estimated: `421886` - // Minimum execution time: 1_024_403 nanoseconds. - Weight::from_parts(1_238_704_000, 421886) - .saturating_add(T::DbWeight::get().reads(132)) - .saturating_add(T::DbWeight::get().writes(67)) - } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + // Measured: `859` + // Estimated: `4714` + // Minimum execution time: 137_721 nanoseconds. + Weight::from_parts(170_280_000, 4714) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) fn internal_resolve_scalar_reported() -> Weight { // Proof Size summary in bytes: - // Measured: `642` - // Estimated: `6891` - // Minimum execution time: 68_250 nanoseconds. - Weight::from_parts(83_570_000, 6891) + // Measured: `610` + // Estimated: `4714` + // Minimum execution time: 93_531 nanoseconds. + Weight::from_parts(113_090_000, 4714) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: GlobalDisputes GlobalDisputesInfo (r:1 w:0) - /// Proof: GlobalDisputes GlobalDisputesInfo (max_values: None, max_size: Some(396), added: 2871, mode: MaxEncodedLen) - /// Storage: Authorized AuthorizedOutcomeReports (r:1 w:1) - /// Proof: Authorized AuthorizedOutcomeReports (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `GlobalDisputes::GlobalDisputesInfo` (r:1 w:0) + /// Proof: `GlobalDisputes::GlobalDisputesInfo` (`max_values`: None, `max_size`: Some(396), added: 2871, mode: `MaxEncodedLen`) + /// Storage: `Authorized::AuthorizedOutcomeReports` (r:1 w:1) + /// Proof: `Authorized::AuthorizedOutcomeReports` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) fn internal_resolve_scalar_disputed() -> Weight { // Proof Size summary in bytes: - // Measured: `983` - // Estimated: `12286` - // Minimum execution time: 118_200 nanoseconds. - Weight::from_parts(144_091_000, 12286) + // Measured: `918` + // Estimated: `4714` + // Minimum execution time: 169_591 nanoseconds. + Weight::from_parts(177_071_000, 4714) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: PredictionMarkets LastTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets LastTimeFrame (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseBlock (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerReportBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerDisputeBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::LastTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::LastTimeFrame` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseBlock` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerReportBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerReportBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerDisputeBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerDisputeBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) fn on_initialize_resolve_overhead() -> Weight { // Proof Size summary in bytes: // Measured: `79` - // Estimated: `15090` - // Minimum execution time: 27_990 nanoseconds. - Weight::from_parts(34_200_000, 15090) + // Estimated: `4515` + // Minimum execution time: 39_860 nanoseconds. + Weight::from_parts(41_071_000, 4515) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(5)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:1 w:1) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) fn redeem_shares_categorical() -> Weight { // Proof Size summary in bytes: - // Measured: `3910` - // Estimated: `94450` - // Minimum execution time: 163_190 nanoseconds. - Weight::from_parts(168_670_000, 94450) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) + // Measured: `1982` + // Estimated: `4159` + // Minimum execution time: 182_581 nanoseconds. + Weight::from_parts(199_601_000, 4159) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:2 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:2 w:2) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:2 w:2) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) fn redeem_shares_scalar() -> Weight { // Proof Size summary in bytes: - // Measured: `1750` - // Estimated: `102260` - // Minimum execution time: 174_740 nanoseconds. - Weight::from_parts(235_220_000, 102260) - .saturating_add(T::DbWeight::get().reads(10)) - .saturating_add(T::DbWeight::get().writes(6)) + // Measured: `1097` + // Estimated: `6186` + // Minimum execution time: 208_291 nanoseconds. + Weight::from_parts(216_581_000, 6186) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsForEdit (r:0 w:1) - /// Proof: PredictionMarkets MarketIdsForEdit (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsForEdit` (r:0 w:1) + /// Proof: `PredictionMarkets::MarketIdsForEdit` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `c` is `[0, 63]`. /// The range of component `r` is `[0, 1024]`. fn reject_market(c: u32, r: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `659 + c * (16 ±0)` - // Estimated: `10416` - // Minimum execution time: 87_590 nanoseconds. - Weight::from_parts(116_270_405, 10416) - // Standard Error: 10_421 - .saturating_add(Weight::from_parts(33_746, 0).saturating_mul(c.into())) - // Standard Error: 645 - .saturating_add(Weight::from_parts(2_262, 0).saturating_mul(r.into())) + // Measured: `595 + c * (16 ±0)` + // Estimated: `4714` + // Minimum execution time: 110_180 nanoseconds. + Weight::from_parts(142_314_814, 4714) + // Standard Error: 19_758 + .saturating_add(Weight::from_parts(67_136, 0).saturating_mul(c.into())) + // Standard Error: 1_224 + .saturating_add(Weight::from_parts(3_548, 0).saturating_mul(r.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerReportBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerReportBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerReportBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) /// The range of component `m` is `[0, 63]`. fn report_market_with_dispute_mechanism(m: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `732` - // Estimated: `7187` - // Minimum execution time: 42_990 nanoseconds. - Weight::from_parts(56_207_943, 7187) - // Standard Error: 7_812 - .saturating_add(Weight::from_parts(6_290, 0).saturating_mul(m.into())) + // Measured: `700` + // Estimated: `4507` + // Minimum execution time: 46_240 nanoseconds. + Weight::from_parts(58_820_442, 4507) + // Standard Error: 8_559 + .saturating_add(Weight::from_parts(99_053, 0).saturating_mul(m.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: AssetRouter DestroyAssets (r:1 w:1) - /// Proof: AssetRouter DestroyAssets (max_values: Some(1), max_size: Some(40962), added: 41457, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:2 w:0) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:2 w:2) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: AssetRouter IndestructibleAssets (r:1 w:0) - /// Proof: AssetRouter IndestructibleAssets (max_values: Some(1), max_size: Some(38914), added: 39409, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) fn report_trusted_market() -> Weight { // Proof Size summary in bytes: - // Measured: `1369` - // Estimated: `98193` - // Minimum execution time: 146_430 nanoseconds. - Weight::from_parts(179_401_000, 98193) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(5)) + // Measured: `522` + // Estimated: `4714` + // Minimum execution time: 125_670 nanoseconds. + Weight::from_parts(143_950_000, 4714) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: MarketCommons Markets (r:1 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:64 w:64) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:64 w:64) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) /// The range of component `a` is `[2, 64]`. fn sell_complete_set(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `756 + a * (373 ±0)` - // Estimated: `5774 + a * (5292 ±0)` - // Minimum execution time: 147_940 nanoseconds. - Weight::from_parts(89_827_511, 5774) - // Standard Error: 219_441 - .saturating_add(Weight::from_parts(42_430_954, 0).saturating_mul(a.into())) + // Measured: `745 + a * (129 ±0)` + // Estimated: `4159 + a * (2598 ±0)` + // Minimum execution time: 203_561 nanoseconds. + Weight::from_parts(110_138_971, 4159) + // Standard Error: 201_807 + .saturating_add(Weight::from_parts(40_363_141, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(1)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 5292).saturating_mul(a.into())) - } - /// Storage: PredictionMarkets MarketIdsPerCloseBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseBlock (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:62 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + .saturating_add(Weight::from_parts(0, 2598).saturating_mul(a.into())) + } + /// Storage: `PredictionMarkets::MarketIdsPerCloseBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseBlock` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:62 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `b` is `[1, 31]`. /// The range of component `f` is `[1, 31]`. fn market_status_manager(b: u32, f: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2539 + b * (345 ±0) + f * (347 ±0)` - // Estimated: `7050 + b * (3167 ±0) + f * (3167 ±0)` - // Minimum execution time: 232_361 nanoseconds. - Weight::from_parts(89_001_117, 7050) - // Standard Error: 82_419 - .saturating_add(Weight::from_parts(6_613_776, 0).saturating_mul(b.into())) - // Standard Error: 82_419 - .saturating_add(Weight::from_parts(6_927_874, 0).saturating_mul(f.into())) + // Measured: `2475 + b * (312 ±0) + f * (314 ±0)` + // Estimated: `4515 + b * (3169 ±0) + f * (3169 ±0)` + // Minimum execution time: 215_570 nanoseconds. + Weight::from_parts(66_665_567, 4515) + // Standard Error: 89_121 + .saturating_add(Weight::from_parts(6_873_569, 0).saturating_mul(b.into())) + // Standard Error: 89_121 + .saturating_add(Weight::from_parts(6_645_077, 0).saturating_mul(f.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(f.into()))) .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 3167).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 3167).saturating_mul(f.into())) - } - /// Storage: PredictionMarkets MarketIdsPerReportBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerReportBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:62 w:0) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerDisputeBlock (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerDisputeBlock (max_values: None, max_size: Some(1042), added: 3517, mode: MaxEncodedLen) + .saturating_add(Weight::from_parts(0, 3169).saturating_mul(b.into())) + .saturating_add(Weight::from_parts(0, 3169).saturating_mul(f.into())) + } + /// Storage: `PredictionMarkets::MarketIdsPerReportBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerReportBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:62 w:0) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerDisputeBlock` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerDisputeBlock` (`max_values`: None, `max_size`: Some(1042), added: 3517, mode: `MaxEncodedLen`) /// The range of component `r` is `[1, 31]`. /// The range of component `d` is `[1, 31]`. fn market_resolution_manager(r: u32, d: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `2483 + r * (345 ±0) + d * (347 ±0)` - // Estimated: `7034 + r * (3167 ±0) + d * (3167 ±0)` - // Minimum execution time: 232_451 nanoseconds. - Weight::from_parts(84_083_353, 7034) - // Standard Error: 70_931 - .saturating_add(Weight::from_parts(6_584_415, 0).saturating_mul(r.into())) - // Standard Error: 70_931 - .saturating_add(Weight::from_parts(6_864_391, 0).saturating_mul(d.into())) + // Measured: `2419 + d * (314 ±0) + r * (312 ±0)` + // Estimated: `4507 + d * (3169 ±0) + r * (3169 ±0)` + // Minimum execution time: 205_081 nanoseconds. + Weight::from_parts(68_553_721, 4507) + // Standard Error: 64_199 + .saturating_add(Weight::from_parts(6_565_695, 0).saturating_mul(r.into())) + // Standard Error: 64_199 + .saturating_add(Weight::from_parts(6_336_678, 0).saturating_mul(d.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(d.into()))) .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 3167).saturating_mul(r.into())) - .saturating_add(Weight::from_parts(0, 3167).saturating_mul(d.into())) - } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:2 w:2) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + .saturating_add(Weight::from_parts(0, 3169).saturating_mul(d.into())) + .saturating_add(Weight::from_parts(0, 3169).saturating_mul(r.into())) + } + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:2 w:2) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. fn schedule_early_close_as_authority(o: u32, n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `747 + o * (16 ±0)` - // Estimated: `10706` - // Minimum execution time: 51_230 nanoseconds. - Weight::from_parts(61_363_456, 10706) - // Standard Error: 13_970 - .saturating_add(Weight::from_parts(50_244, 0).saturating_mul(o.into())) - // Standard Error: 13_970 - .saturating_add(Weight::from_parts(62_184, 0).saturating_mul(n.into())) + // Measured: `699 + o * (16 ±0)` + // Estimated: `8040` + // Minimum execution time: 55_540 nanoseconds. + Weight::from_parts(73_241_162, 8040) + // Standard Error: 11_376 + .saturating_add(Weight::from_parts(65_723, 0).saturating_mul(o.into())) + // Standard Error: 11_376 + .saturating_add(Weight::from_parts(22_491, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:2 w:2) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:2 w:2) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. - fn schedule_early_close_after_dispute(o: u32, n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `970 + o * (16 ±0)` - // Estimated: `14430` - // Minimum execution time: 96_271 nanoseconds. - Weight::from_parts(119_475_237, 14430) - // Standard Error: 22_292 - .saturating_add(Weight::from_parts(90_541, 0).saturating_mul(o.into())) - // Standard Error: 22_292 - .saturating_add(Weight::from_parts(12_780, 0).saturating_mul(n.into())) + fn schedule_early_close_after_dispute(o: u32, _n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `922 + o * (16 ±0)` + // Estimated: `8040` + // Minimum execution time: 114_820 nanoseconds. + Weight::from_parts(160_073_439, 8040) + // Standard Error: 21_783 + .saturating_add(Weight::from_parts(19_546, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:2 w:2) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:2 w:2) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. fn schedule_early_close_as_market_creator(o: u32, n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `808 + o * (16 ±0)` - // Estimated: `14430` - // Minimum execution time: 74_650 nanoseconds. - Weight::from_parts(92_510_070, 14430) - // Standard Error: 11_870 - .saturating_add(Weight::from_parts(29_343, 0).saturating_mul(o.into())) - // Standard Error: 11_870 - .saturating_add(Weight::from_parts(37_672, 0).saturating_mul(n.into())) + // Measured: `760 + o * (16 ±0)` + // Estimated: `8040` + // Minimum execution time: 85_480 nanoseconds. + Weight::from_parts(113_426_839, 8040) + // Standard Error: 16_262 + .saturating_add(Weight::from_parts(49_062, 0).saturating_mul(o.into())) + // Standard Error: 16_262 + .saturating_add(Weight::from_parts(65_277, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:2 w:2) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:2 w:2) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. fn dispute_early_close(o: u32, n: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `924 + o * (16 ±0) + n * (16 ±0)` - // Estimated: `14430` - // Minimum execution time: 71_610 nanoseconds. - Weight::from_parts(86_696_361, 14430) - // Standard Error: 13_050 - .saturating_add(Weight::from_parts(59_792, 0).saturating_mul(o.into())) - // Standard Error: 13_050 - .saturating_add(Weight::from_parts(64_792, 0).saturating_mul(n.into())) + // Measured: `844 + n * (16 ±0) + o * (16 ±0)` + // Estimated: `8040` + // Minimum execution time: 81_770 nanoseconds. + Weight::from_parts(108_899_102, 8040) + // Standard Error: 15_462 + .saturating_add(Weight::from_parts(49_011, 0).saturating_mul(o.into())) + // Standard Error: 15_462 + .saturating_add(Weight::from_parts(53_793, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:2 w:2) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:2 w:2) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `o` is `[0, 63]`. /// The range of component `n` is `[0, 63]`. - fn reject_early_close_after_authority(o: u32, n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `814 + o * (16 ±0) + n * (16 ±0)` - // Estimated: `10706` - // Minimum execution time: 55_950 nanoseconds. - Weight::from_parts(70_714_615, 10706) - // Standard Error: 14_905 - .saturating_add(Weight::from_parts(63_828, 0).saturating_mul(o.into())) - // Standard Error: 14_905 - .saturating_add(Weight::from_parts(40_198, 0).saturating_mul(n.into())) + fn reject_early_close_after_authority(_o: u32, _n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `734 + n * (16 ±0) + o * (16 ±0)` + // Estimated: `8040` + // Minimum execution time: 61_400 nanoseconds. + Weight::from_parts(84_625_166, 8040) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) fn reject_early_close_after_dispute() -> Weight { // Proof Size summary in bytes: - // Measured: `688` - // Estimated: `6891` - // Minimum execution time: 69_480 nanoseconds. - Weight::from_parts(88_480_000, 6891) + // Measured: `656` + // Estimated: `4714` + // Minimum execution time: 106_910 nanoseconds. + Weight::from_parts(108_350_000, 4714) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) /// The range of component `c` is `[0, 63]`. - fn close_trusted_market(_c: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `725 + c * (16 ±0)` - // Estimated: `7195` - // Minimum execution time: 47_610 nanoseconds. - Weight::from_parts(61_392_473, 7195) + fn close_trusted_market(c: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `661 + c * (16 ±0)` + // Estimated: `4515` + // Minimum execution time: 50_730 nanoseconds. + Weight::from_parts(67_122_433, 4515) + // Standard Error: 11_418 + .saturating_add(Weight::from_parts(43_916, 0).saturating_mul(c.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: Balances Reserves (r:1 w:1) - /// Proof: Balances Reserves (max_values: None, max_size: Some(1249), added: 3724, mode: MaxEncodedLen) - /// Storage: MarketCommons MarketCounter (r:1 w:1) - /// Proof: MarketCommons MarketCounter (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: MarketAssets Asset (r:64 w:64) - /// Proof: MarketAssets Asset (max_values: None, max_size: Some(225), added: 2700, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) - /// Storage: MarketAssets Account (r:128 w:128) - /// Proof: MarketAssets Account (max_values: None, max_size: Some(117), added: 2592, mode: MaxEncodedLen) - /// Storage: NeoSwaps Pools (r:1 w:1) - /// Proof: NeoSwaps Pools (max_values: None, max_size: Some(144746), added: 147221, mode: MaxEncodedLen) - /// Storage: MarketCommons Markets (r:0 w:1) - /// Proof: MarketCommons Markets (max_values: None, max_size: Some(692), added: 3167, mode: MaxEncodedLen) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Balances::Reserves` (r:1 w:1) + /// Proof: `Balances::Reserves` (`max_values`: None, `max_size`: Some(1249), added: 3724, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::MarketCounter` (r:1 w:1) + /// Proof: `MarketCommons::MarketCounter` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:128 w:128) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:64 w:64) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `NeoSwaps::Pools` (r:1 w:1) + /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`) + /// Storage: `MarketCommons::Markets` (r:0 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) /// The range of component `m` is `[0, 63]`. /// The range of component `n` is `[2, 64]`. - fn create_market_and_deploy_pool(_m: u32, n: u32) -> Weight { - // Proof Size summary in bytes: - // Measured: `371 + m * (16 ±0)` - // Estimated: `160698 + n * (7884 ±0)` - // Minimum execution time: 320_281 nanoseconds. - Weight::from_parts(232_994_984, 160698) - // Standard Error: 231_500 - .saturating_add(Weight::from_parts(73_326_774, 0).saturating_mul(n.into())) + fn create_market_and_deploy_pool(m: u32, n: u32) -> Weight { + // Proof Size summary in bytes: + // Measured: `378 + m * (16 ±0)` + // Estimated: `148211 + n * (5196 ±0)` + // Minimum execution time: 433_231 nanoseconds. + Weight::from_parts(186_531_666, 148211) + // Standard Error: 230_950 + .saturating_add(Weight::from_parts(2_641_351, 0).saturating_mul(m.into())) + // Standard Error: 234_410 + .saturating_add(Weight::from_parts(73_779_839, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(n.into()))) .saturating_add(T::DbWeight::get().writes(7)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 7884).saturating_mul(n.into())) - } - /// Storage: MarketCommons Markets (r:1 w:1) - /// Storage: Timestamp Now (r:1 w:0) - /// Proof: Timestamp Now (max_values: Some(1), max_size: Some(8), added: 503, mode: MaxEncodedLen) - /// Storage: PredictionMarkets MarketIdsPerCloseTimeFrame (r:1 w:1) - /// Proof: PredictionMarkets MarketIdsPerCloseTimeFrame (max_values: None, max_size: Some(1050), added: 3525, mode: MaxEncodedLen) + .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into())) + } + /// Storage: `MarketCommons::Markets` (r:1 w:1) + /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (r:1 w:1) + /// Proof: `PredictionMarkets::MarketIdsPerCloseTimeFrame` (`max_values`: None, `max_size`: Some(1050), added: 3525, mode: `MaxEncodedLen`) /// The range of component `o` is `[1, 63]`. fn manually_close_market(o: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `710 + o * (16 ±0)` - // Estimated: `7195` - // Minimum execution time: 45_710 nanoseconds. - Weight::from_parts(57_406_653, 7195) - // Standard Error: 9_276 - .saturating_add(Weight::from_parts(73_233, 0).saturating_mul(o.into())) + // Measured: `646 + o * (16 ±0)` + // Estimated: `4515` + // Minimum execution time: 50_480 nanoseconds. + Weight::from_parts(66_870_921, 4515) + // Standard Error: 11_179 + .saturating_add(Weight::from_parts(13_067, 0).saturating_mul(o.into())) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/zrml/styx/src/weights.rs b/zrml/styx/src/weights.rs index d2e6fefb4..7f4c71dc8 100644 --- a/zrml/styx/src/weights.rs +++ b/zrml/styx/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_styx //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -56,26 +56,26 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_styx (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: Styx Crossings (r:1 w:1) - /// Proof: Styx Crossings (max_values: None, max_size: Some(48), added: 2523, mode: MaxEncodedLen) - /// Storage: Styx BurnAmount (r:1 w:0) - /// Proof: Styx BurnAmount (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: `Styx::Crossings` (r:1 w:1) + /// Proof: `Styx::Crossings` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) + /// Storage: `Styx::BurnAmount` (r:1 w:0) + /// Proof: `Styx::BurnAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) fn cross() -> Weight { // Proof Size summary in bytes: // Measured: `76` - // Estimated: `3034` - // Minimum execution time: 42_280 nanoseconds. - Weight::from_parts(43_340_000, 3034) + // Estimated: `3513` + // Minimum execution time: 53_470 nanoseconds. + Weight::from_parts(54_700_000, 3513) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Styx BurnAmount (r:0 w:1) - /// Proof: Styx BurnAmount (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) + /// Storage: `Styx::BurnAmount` (r:0 w:1) + /// Proof: `Styx::BurnAmount` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) fn set_burn_amount() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 13_360 nanoseconds. - Weight::from_parts(14_110_000, 0).saturating_add(T::DbWeight::get().writes(1)) + // Minimum execution time: 14_570 nanoseconds. + Weight::from_parts(15_410_000, 0).saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/zrml/swaps/src/weights.rs b/zrml/swaps/src/weights.rs index 554d3505d..3a94e79cc 100644 --- a/zrml/swaps/src/weights.rs +++ b/zrml/swaps/src/weights.rs @@ -19,10 +19,10 @@ //! Autogenerated weights for zrml_swaps //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: `2024-04-15`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: `2024-07-25`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor` -//! EXECUTION: `Some(Wasm)`, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` // Executed Command: // ./target/production/zeitgeist @@ -65,193 +65,193 @@ pub trait WeightInfoZeitgeist { /// Weight functions for zrml_swaps (automatically generated) pub struct WeightInfo(PhantomData); impl WeightInfoZeitgeist for WeightInfo { - /// Storage: Swaps Pools (r:1 w:0) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:131 w:131) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:0) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:131 w:131) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `a` is `[2, 65]`. fn pool_exit(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `957 + a * (176 ±0)` - // Estimated: `16477 + a * (7896 ±0)` - // Minimum execution time: 162_820 nanoseconds. - Weight::from_parts(122_679_185, 16477) - // Standard Error: 178_424 - .saturating_add(Weight::from_parts(47_099_181, 0).saturating_mul(a.into())) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) + // Measured: `753 + a * (144 ±0)` + // Estimated: `7044 + a * (5196 ±0)` + // Minimum execution time: 183_541 nanoseconds. + Weight::from_parts(96_285_356, 7044) + // Standard Error: 252_865 + .saturating_add(Weight::from_parts(52_212_929, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(4)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 7896).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 5196).saturating_mul(a.into())) } - /// Storage: Swaps Pools (r:1 w:0) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:0) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn pool_exit_with_exact_asset_amount() -> Weight { // Proof Size summary in bytes: - // Measured: `5655` - // Estimated: `24373` - // Minimum execution time: 127_140 nanoseconds. - Weight::from_parts(156_601_000, 24373) - .saturating_add(T::DbWeight::get().reads(8)) + // Measured: `5419` + // Estimated: `8784` + // Minimum execution time: 167_471 nanoseconds. + Weight::from_parts(188_981_000, 8784) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Swaps Pools (r:1 w:0) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:0) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn pool_exit_with_exact_pool_amount() -> Weight { // Proof Size summary in bytes: - // Measured: `5655` - // Estimated: `24373` - // Minimum execution time: 127_670 nanoseconds. - Weight::from_parts(155_520_000, 24373) - .saturating_add(T::DbWeight::get().reads(8)) + // Measured: `5419` + // Estimated: `8784` + // Minimum execution time: 144_390 nanoseconds. + Weight::from_parts(208_540_000, 8784) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Swaps Pools (r:1 w:0) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:131 w:131) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:0) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:131 w:131) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) /// The range of component `a` is `[2, 65]`. fn pool_join(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `835 + a * (289 ±0)` - // Estimated: `13870 + a * (7896 ±0)` - // Minimum execution time: 115_110 nanoseconds. - Weight::from_parts(79_330_150, 13870) - // Standard Error: 110_208 - .saturating_add(Weight::from_parts(32_859_066, 0).saturating_mul(a.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) + // Measured: `662 + a * (225 ±0)` + // Estimated: `7044 + a * (5196 ±0)` + // Minimum execution time: 120_061 nanoseconds. + Weight::from_parts(111_747_674, 7044) + // Standard Error: 226_096 + .saturating_add(Weight::from_parts(38_098_845, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 7896).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 5196).saturating_mul(a.into())) } - /// Storage: Swaps Pools (r:1 w:0) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:0) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) fn pool_join_with_exact_asset_amount() -> Weight { // Proof Size summary in bytes: - // Measured: `6338` - // Estimated: `21766` - // Minimum execution time: 111_461 nanoseconds. - Weight::from_parts(138_571_000, 21766) - .saturating_add(T::DbWeight::get().reads(7)) + // Measured: `6101` + // Estimated: `8784` + // Minimum execution time: 157_271 nanoseconds. + Weight::from_parts(174_021_000, 8784) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Swaps Pools (r:1 w:0) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:1 w:1) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:3 w:3) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:0) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:1 w:1) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:3 w:3) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) fn pool_join_with_exact_pool_amount() -> Weight { // Proof Size summary in bytes: - // Measured: `6338` - // Estimated: `21766` - // Minimum execution time: 107_820 nanoseconds. - Weight::from_parts(131_030_000, 21766) - .saturating_add(T::DbWeight::get().reads(7)) + // Measured: `6101` + // Estimated: `8784` + // Minimum execution time: 142_221 nanoseconds. + Weight::from_parts(160_941_000, 8784) + .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Swaps Pools (r:1 w:0) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:0) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:4) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn swap_exact_amount_in() -> Weight { // Proof Size summary in bytes: - // Measured: `5253` - // Estimated: `24453` - // Minimum execution time: 179_090 nanoseconds. - Weight::from_parts(219_440_000, 24453) - .saturating_add(T::DbWeight::get().reads(8)) + // Measured: `4984` + // Estimated: `11382` + // Minimum execution time: 233_881 nanoseconds. + Weight::from_parts(249_260_000, 11382) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Swaps Pools (r:1 w:0) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:4 w:4) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:0) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:0) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:4 w:4) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) fn swap_exact_amount_out() -> Weight { // Proof Size summary in bytes: - // Measured: `5253` - // Estimated: `24453` - // Minimum execution time: 180_160 nanoseconds. - Weight::from_parts(218_621_000, 24453) - .saturating_add(T::DbWeight::get().reads(8)) + // Measured: `4984` + // Estimated: `11382` + // Minimum execution time: 192_100 nanoseconds. + Weight::from_parts(240_390_000, 11382) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(4)) } - /// Storage: Swaps Pools (r:1 w:1) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:1) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) /// The range of component `a` is `[2, 65]`. fn open_pool(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `168 + a * (54 ±0)` - // Estimated: `6054` - // Minimum execution time: 18_010 nanoseconds. - Weight::from_parts(24_025_251, 6054) - // Standard Error: 5_601 - .saturating_add(Weight::from_parts(344_175, 0).saturating_mul(a.into())) + // Measured: `136 + a * (54 ±0)` + // Estimated: `7044` + // Minimum execution time: 20_900 nanoseconds. + Weight::from_parts(31_093_447, 7044) + // Standard Error: 10_657 + .saturating_add(Weight::from_parts(518_245, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Swaps Pools (r:1 w:1) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:1) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) /// The range of component `a` is `[2, 65]`. fn close_pool(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `168 + a * (54 ±0)` - // Estimated: `6054` - // Minimum execution time: 15_560 nanoseconds. - Weight::from_parts(21_271_791, 6054) - // Standard Error: 4_190 - .saturating_add(Weight::from_parts(199_418, 0).saturating_mul(a.into())) + // Measured: `136 + a * (54 ±0)` + // Estimated: `7044` + // Minimum execution time: 18_400 nanoseconds. + Weight::from_parts(24_417_157, 7044) + // Standard Error: 7_470 + .saturating_add(Weight::from_parts(383_035, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Swaps Pools (r:1 w:1) - /// Proof: Swaps Pools (max_values: None, max_size: Some(3579), added: 6054, mode: MaxEncodedLen) - /// Storage: Tokens Accounts (r:65 w:65) - /// Proof: Tokens Accounts (max_values: None, max_size: Some(123), added: 2598, mode: MaxEncodedLen) - /// Storage: Tokens TotalIssuance (r:65 w:65) - /// Proof: Tokens TotalIssuance (max_values: None, max_size: Some(43), added: 2518, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(132), added: 2607, mode: MaxEncodedLen) + /// Storage: `Swaps::Pools` (r:1 w:1) + /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`) + /// Storage: `Tokens::Accounts` (r:65 w:65) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`) + /// Storage: `Tokens::TotalIssuance` (r:65 w:65) + /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`) /// The range of component `a` is `[2, 65]`. fn destroy_pool(a: u32) -> Weight { // Proof Size summary in bytes: - // Measured: `678 + a * (214 ±0)` - // Estimated: `8661 + a * (7816 ±0)` - // Minimum execution time: 96_981 nanoseconds. - Weight::from_parts(68_984_475, 8661) - // Standard Error: 122_585 - .saturating_add(Weight::from_parts(29_342_794, 0).saturating_mul(a.into())) + // Measured: `505 + a * (182 ±0)` + // Estimated: `7044 + a * (2598 ±0)` + // Minimum execution time: 108_320 nanoseconds. + Weight::from_parts(41_690_862, 7044) + // Standard Error: 183_188 + .saturating_add(Weight::from_parts(35_118_993, 0).saturating_mul(a.into())) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into()))) .saturating_add(T::DbWeight::get().writes(2)) .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) - .saturating_add(Weight::from_parts(0, 7816).saturating_mul(a.into())) + .saturating_add(Weight::from_parts(0, 2598).saturating_mul(a.into())) } }