fix: CI quick-checks - fmt, taplo, umbrella version
This commit is contained in:
Generated
+4
-4
@@ -370,9 +370,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "alloy-trie"
|
name = "alloy-trie"
|
||||||
version = "0.9.2"
|
version = "0.9.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2b77b56af09ead281337d06b1d036c88e2dc8a2e45da512a532476dbee94912b"
|
checksum = "428aa0f0e0658ff091f8f667c406e034b431cb10abd39de4f507520968acc499"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloy-primitives",
|
"alloy-primitives",
|
||||||
"alloy-rlp",
|
"alloy-rlp",
|
||||||
@@ -8925,9 +8925,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nybbles"
|
name = "nybbles"
|
||||||
version = "0.4.6"
|
version = "0.4.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2c4b5ecbd0beec843101bffe848217f770e8b8da81d8355b7d6e226f2199b3dc"
|
checksum = "7b5676b5c379cf5b03da1df2b3061c4a4e2aa691086a56ac923e08c143f53f59"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloy-rlp",
|
"alloy-rlp",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ fn main() {
|
|||||||
mod cli {
|
mod cli {
|
||||||
include!("src/cli.rs");
|
include!("src/cli.rs");
|
||||||
|
|
||||||
|
use bizinikiwi_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
|
||||||
use clap::{CommandFactory, ValueEnum};
|
use clap::{CommandFactory, ValueEnum};
|
||||||
use clap_complete::{generate_to, Shell};
|
use clap_complete::{generate_to, Shell};
|
||||||
use bizinikiwi_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};
|
|
||||||
use std::{env, fs, path::Path};
|
use std::{env, fs, path::Path};
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
use pezkuwi_sdk::*;
|
use pezkuwi_sdk::*;
|
||||||
|
|
||||||
use pezsc_service::Properties;
|
|
||||||
use pez_kitchensink_runtime::{
|
use pez_kitchensink_runtime::{
|
||||||
genesis_config_presets::{Staker, ENDOWMENT, STASH},
|
genesis_config_presets::{Staker, ENDOWMENT, STASH},
|
||||||
wasm_binary_unwrap, Block, MaxNominations, StakerStatus,
|
wasm_binary_unwrap, Block, MaxNominations, StakerStatus,
|
||||||
@@ -29,6 +28,7 @@ use pezpallet_im_online::sr25519::AuthorityId as ImOnlineId;
|
|||||||
use pezpallet_revive::is_eth_derived;
|
use pezpallet_revive::is_eth_derived;
|
||||||
use pezsc_chain_spec::ChainSpecExtension;
|
use pezsc_chain_spec::ChainSpecExtension;
|
||||||
use pezsc_service::ChainType;
|
use pezsc_service::ChainType;
|
||||||
|
use pezsc_service::Properties;
|
||||||
use pezsc_telemetry::TelemetryEndpoints;
|
use pezsc_telemetry::TelemetryEndpoints;
|
||||||
use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
|
use pezsp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
|
||||||
use pezsp_consensus_babe::AuthorityId as BabeId;
|
use pezsp_consensus_babe::AuthorityId as BabeId;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ serde = { workspace = true, default-features = true }
|
|||||||
serde_json = { workspace = true, default-features = true }
|
serde_json = { workspace = true, default-features = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
# bizinikiwi-test-runtime = { workspace = true } # publish=false
|
bizinikiwi-test-runtime = { workspace = true }
|
||||||
cmd_lib = { workspace = true }
|
cmd_lib = { workspace = true }
|
||||||
pretty_assertions = { workspace = true }
|
pretty_assertions = { workspace = true }
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ pretty_assertions = { workspace = true }
|
|||||||
# `cargo build --feature=generate-readme` updates the `README.md` file.
|
# `cargo build --feature=generate-readme` updates the `README.md` file.
|
||||||
generate-readme = []
|
generate-readme = []
|
||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
# "bizinikiwi-test-runtime/runtime-benchmarks",
|
"bizinikiwi-test-runtime/runtime-benchmarks",
|
||||||
"pezsc-chain-spec/runtime-benchmarks",
|
"pezsc-chain-spec/runtime-benchmarks",
|
||||||
]
|
]
|
||||||
std = [
|
std = [
|
||||||
|
|||||||
@@ -32,12 +32,18 @@ const DUMMY_PATH: &str = "fake-runtime-path";
|
|||||||
|
|
||||||
const OUTPUT_FILE: &str = "/tmp/chain_spec_builder.test_output_file.json";
|
const OUTPUT_FILE: &str = "/tmp/chain_spec_builder.test_output_file.json";
|
||||||
|
|
||||||
|
// Get the chain-spec-builder binary path from environment
|
||||||
|
fn get_chain_spec_builder_bin() -> String {
|
||||||
|
std::env::var("CARGO_BIN_EXE_chain-spec-builder")
|
||||||
|
.expect("CARGO_BIN_EXE_chain-spec-builder must be set - run with `cargo test`")
|
||||||
|
}
|
||||||
|
|
||||||
// Used for running commands visually pleasing in doc tests.
|
// Used for running commands visually pleasing in doc tests.
|
||||||
macro_rules! bash(
|
macro_rules! bash(
|
||||||
( chain-spec-builder $($a:tt)* ) => {{
|
( chain-spec-builder $($a:tt)* ) => {{
|
||||||
let bin_path = env!("CARGO_BIN_EXE_chain-spec-builder");
|
let bin = get_chain_spec_builder_bin();
|
||||||
spawn_with_output!(
|
spawn_with_output!(
|
||||||
$bin_path $($a)*
|
$bin $($a)*
|
||||||
)
|
)
|
||||||
.expect("a process running. qed")
|
.expect("a process running. qed")
|
||||||
.wait_with_output()
|
.wait_with_output()
|
||||||
|
|||||||
@@ -36,12 +36,8 @@ enum Method {
|
|||||||
Compiled { instantiation_strategy: InstantiationStrategy, precompile: bool },
|
Compiled { instantiation_strategy: InstantiationStrategy, precompile: bool },
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is just a bog-standard Dicle runtime with an extra
|
// Note: Production runtime benchmarking was removed because the WASM files
|
||||||
// `test_empty_return` and `test_dirty_plenty_memory` functions
|
// need to be pre-built. Use the test_runtime for benchmarking instead.
|
||||||
// copy-pasted from the test runtime.
|
|
||||||
fn dicle_runtime() -> &'static [u8] {
|
|
||||||
include_bytes!("dicle_runtime.wasm")
|
|
||||||
}
|
|
||||||
|
|
||||||
fn initialize(
|
fn initialize(
|
||||||
_tmpdir: &mut Option<tempfile::TempDir>,
|
_tmpdir: &mut Option<tempfile::TempDir>,
|
||||||
@@ -204,7 +200,7 @@ fn bench_call_instance(c: &mut Criterion) {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
let runtimes = [("dicle_runtime", dicle_runtime()), ("test_runtime", test_runtime())];
|
let runtimes = [("test_runtime", test_runtime())];
|
||||||
|
|
||||||
let thread_counts = [1, 2, 4, 8, 16];
|
let thread_counts = [1, 2, 4, 8, 16];
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ xcm-builder = { workspace = true }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
array-bytes = { workspace = true, default-features = true }
|
array-bytes = { workspace = true, default-features = true }
|
||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
# pezpallet-contracts-fixtures = { workspace = true } # Commented for crates.io publish (test-only crate)
|
pezpallet-contracts-fixtures = { workspace = true }
|
||||||
pretty_assertions = { workspace = true }
|
pretty_assertions = { workspace = true }
|
||||||
wat = { workspace = true }
|
wat = { workspace = true }
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ runtime-benchmarks = [
|
|||||||
"pezframe-support/runtime-benchmarks",
|
"pezframe-support/runtime-benchmarks",
|
||||||
"pezframe-system/runtime-benchmarks",
|
"pezframe-system/runtime-benchmarks",
|
||||||
"pezpallet-balances/runtime-benchmarks",
|
"pezpallet-balances/runtime-benchmarks",
|
||||||
# "pezpallet-contracts-fixtures/runtime-benchmarks", # Commented for crates.io publish
|
"pezpallet-contracts-fixtures/runtime-benchmarks",
|
||||||
"pezpallet-insecure-randomness-collective-flip/runtime-benchmarks",
|
"pezpallet-insecure-randomness-collective-flip/runtime-benchmarks",
|
||||||
"pezpallet-proxy/runtime-benchmarks",
|
"pezpallet-proxy/runtime-benchmarks",
|
||||||
"pezpallet-timestamp/runtime-benchmarks",
|
"pezpallet-timestamp/runtime-benchmarks",
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ serde = { features = ["alloc", "derive"], workspace = true }
|
|||||||
# Optional imports for benchmarking
|
# Optional imports for benchmarking
|
||||||
pezframe-benchmarking = { optional = true, workspace = true }
|
pezframe-benchmarking = { optional = true, workspace = true }
|
||||||
|
|
||||||
# bizinikiwi-test-utils moved to integration tests to break circular dependency
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
anyhow = { workspace = true }
|
anyhow = { workspace = true }
|
||||||
|
bizinikiwi-test-utils = { workspace = true }
|
||||||
env_logger = { workspace = true }
|
env_logger = { workspace = true }
|
||||||
pezframe-benchmarking = { workspace = true, default-features = true }
|
pezframe-benchmarking = { workspace = true, default-features = true }
|
||||||
pezframe-support = { features = [
|
pezframe-support = { features = [
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
// This file is part of Bizinikiwi.
|
|
||||||
|
|
||||||
// Copyright (C) Parity Technologies (UK) Ltd. and Dijital Kurdistan Tech Institute
|
|
||||||
// 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(test)]
|
|
||||||
use super::{Config, Runtime};
|
|
||||||
#[cfg(test)]
|
|
||||||
use crate::{derive_impl, pezpallet_prelude::inject_runtime_type};
|
|
||||||
#[cfg(test)]
|
|
||||||
use static_assertions::assert_type_eq_all;
|
|
||||||
|
|
||||||
#[docify::export]
|
|
||||||
#[test]
|
|
||||||
fn derive_impl_works_with_runtime_type_injection() {
|
|
||||||
assert_type_eq_all!(<Runtime as Config>::RuntimeOrigin, super::RuntimeOrigin);
|
|
||||||
assert_type_eq_all!(<Runtime as Config>::RuntimeCall, super::RuntimeCall);
|
|
||||||
assert_type_eq_all!(<Runtime as Config>::PalletInfo, super::PalletInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[docify::export]
|
|
||||||
#[test]
|
|
||||||
fn derive_impl_works_with_no_aggregated_types() {
|
|
||||||
struct DummyRuntime;
|
|
||||||
|
|
||||||
#[derive_impl(
|
|
||||||
super::pezframe_system::config_preludes::TestDefaultConfig as super::pezframe_system::DefaultConfig,
|
|
||||||
no_aggregated_types
|
|
||||||
)]
|
|
||||||
impl Config for DummyRuntime {
|
|
||||||
type Block = super::Block;
|
|
||||||
type AccountId = super::AccountId;
|
|
||||||
type PalletInfo = super::PalletInfo;
|
|
||||||
type ExampleConstant = ();
|
|
||||||
}
|
|
||||||
|
|
||||||
assert_type_eq_all!(<DummyRuntime as Config>::RuntimeOrigin, ());
|
|
||||||
assert_type_eq_all!(<DummyRuntime as Config>::RuntimeCall, ());
|
|
||||||
}
|
|
||||||
@@ -1,738 +0,0 @@
|
|||||||
// This file is part of Bizinikiwi.
|
|
||||||
|
|
||||||
// Copyright (C) Parity Technologies (UK) Ltd. and Dijital Kurdistan Tech Institute
|
|
||||||
// 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.
|
|
||||||
|
|
||||||
use pezframe_support::*;
|
|
||||||
use pezframe_support_procedural::import_section;
|
|
||||||
#[cfg(test)]
|
|
||||||
use pezsp_io::{MultiRemovalResults, TestExternalities};
|
|
||||||
#[cfg(test)]
|
|
||||||
use pezsp_metadata_ir::{
|
|
||||||
PalletStorageMetadataIR, StorageEntryMetadataIR, StorageEntryModifierIR, StorageEntryTypeIR,
|
|
||||||
StorageHasherIR,
|
|
||||||
};
|
|
||||||
#[cfg(test)]
|
|
||||||
use pezsp_runtime::BuildStorage;
|
|
||||||
use pezsp_runtime::{generic, traits::BlakeTwo256};
|
|
||||||
|
|
||||||
pub use self::pezframe_system::{pezpallet_prelude::*, Config, Pezpallet};
|
|
||||||
|
|
||||||
mod inject_runtime_type;
|
|
||||||
mod runtime;
|
|
||||||
mod tasks;
|
|
||||||
|
|
||||||
#[import_section(tasks::tasks_example)]
|
|
||||||
#[pezpallet]
|
|
||||||
pub mod pezframe_system {
|
|
||||||
#[allow(unused)]
|
|
||||||
use super::{pezframe_system, pezframe_system::pezpallet_prelude::*};
|
|
||||||
pub use crate::dispatch::RawOrigin;
|
|
||||||
use crate::{pezpallet_prelude::*, traits::tasks::Task as TaskTrait};
|
|
||||||
|
|
||||||
pub mod config_preludes {
|
|
||||||
use super::{inject_runtime_type, DefaultConfig};
|
|
||||||
pub struct TestDefaultConfig;
|
|
||||||
|
|
||||||
#[crate::register_default_impl(TestDefaultConfig)]
|
|
||||||
impl DefaultConfig for TestDefaultConfig {
|
|
||||||
type AccountId = u64;
|
|
||||||
type BaseCallFilter = pezframe_support::traits::Everything;
|
|
||||||
#[inject_runtime_type]
|
|
||||||
type RuntimeOrigin = ();
|
|
||||||
#[inject_runtime_type]
|
|
||||||
type RuntimeCall = ();
|
|
||||||
#[inject_runtime_type]
|
|
||||||
type PalletInfo = ();
|
|
||||||
#[inject_runtime_type]
|
|
||||||
type RuntimeTask = ();
|
|
||||||
type DbWeight = ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[pezpallet::pezpallet]
|
|
||||||
pub struct Pezpallet<T>(_);
|
|
||||||
|
|
||||||
#[pezpallet::config(with_default, pezframe_system_config)]
|
|
||||||
#[pezpallet::disable_pezframe_system_supertrait_check]
|
|
||||||
pub trait Config: 'static {
|
|
||||||
#[pezpallet::no_default]
|
|
||||||
type Block: Parameter + pezsp_runtime::traits::Block;
|
|
||||||
type AccountId;
|
|
||||||
#[pezpallet::no_default_bounds]
|
|
||||||
type BaseCallFilter: crate::traits::Contains<Self::RuntimeCall>;
|
|
||||||
#[pezpallet::no_default_bounds]
|
|
||||||
type RuntimeOrigin;
|
|
||||||
#[pezpallet::no_default_bounds]
|
|
||||||
type RuntimeCall;
|
|
||||||
#[pezpallet::no_default_bounds]
|
|
||||||
type RuntimeTask: crate::traits::tasks::Task;
|
|
||||||
#[pezpallet::no_default_bounds]
|
|
||||||
type PalletInfo: crate::traits::PalletInfo;
|
|
||||||
type DbWeight: Get<crate::weights::RuntimeDbWeight>;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[pezpallet::error]
|
|
||||||
pub enum Error<T> {
|
|
||||||
/// Required by construct_runtime
|
|
||||||
CallFiltered,
|
|
||||||
/// Used in tasks example.
|
|
||||||
NotFound,
|
|
||||||
/// The specified [`Task`] is not valid.
|
|
||||||
InvalidTask,
|
|
||||||
/// The specified [`Task`] failed during execution.
|
|
||||||
FailedTask,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[pezpallet::origin]
|
|
||||||
pub type Origin<T> = RawOrigin<<T as Config>::AccountId>;
|
|
||||||
|
|
||||||
#[pezpallet::call]
|
|
||||||
impl<T: Config> Pezpallet<T> {
|
|
||||||
#[pezpallet::call_index(0)]
|
|
||||||
#[pezpallet::weight(task.weight())]
|
|
||||||
pub fn do_task(_origin: OriginFor<T>, task: T::RuntimeTask) -> DispatchResultWithPostInfo {
|
|
||||||
if !task.is_valid() {
|
|
||||||
return Err(Error::<T>::InvalidTask.into());
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Err(_err) = task.run() {
|
|
||||||
return Err(Error::<T>::FailedTask.into());
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(().into())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type Data<T> = StorageMap<_, Twox64Concat, u32, u64, ValueQuery>;
|
|
||||||
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type OptionLinkedMap<T> = StorageMap<_, Blake2_128Concat, u32, u32, OptionQuery>;
|
|
||||||
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type GenericData<T: Config> =
|
|
||||||
StorageMap<_, Identity, BlockNumberFor<T>, BlockNumberFor<T>, ValueQuery>;
|
|
||||||
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type GenericData2<T: Config> =
|
|
||||||
StorageMap<_, Blake2_128Concat, BlockNumberFor<T>, BlockNumberFor<T>, OptionQuery>;
|
|
||||||
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type DataDM<T> =
|
|
||||||
StorageDoubleMap<_, Twox64Concat, u32, Blake2_128Concat, u32, u64, ValueQuery>;
|
|
||||||
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type GenericDataDM<T: Config> = StorageDoubleMap<
|
|
||||||
_,
|
|
||||||
Blake2_128Concat,
|
|
||||||
BlockNumberFor<T>,
|
|
||||||
Identity,
|
|
||||||
BlockNumberFor<T>,
|
|
||||||
BlockNumberFor<T>,
|
|
||||||
ValueQuery,
|
|
||||||
>;
|
|
||||||
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type GenericData2DM<T: Config> = StorageDoubleMap<
|
|
||||||
_,
|
|
||||||
Blake2_128Concat,
|
|
||||||
BlockNumberFor<T>,
|
|
||||||
Twox64Concat,
|
|
||||||
BlockNumberFor<T>,
|
|
||||||
BlockNumberFor<T>,
|
|
||||||
OptionQuery,
|
|
||||||
>;
|
|
||||||
|
|
||||||
#[pezpallet::storage]
|
|
||||||
#[pezpallet::unbounded]
|
|
||||||
pub type AppendableDM<T: Config> = StorageDoubleMap<
|
|
||||||
_,
|
|
||||||
Blake2_128Concat,
|
|
||||||
u32,
|
|
||||||
Blake2_128Concat,
|
|
||||||
BlockNumberFor<T>,
|
|
||||||
Vec<u32>,
|
|
||||||
ValueQuery,
|
|
||||||
>;
|
|
||||||
|
|
||||||
#[pezpallet::genesis_config]
|
|
||||||
pub struct GenesisConfig<T: Config> {
|
|
||||||
pub data: Vec<(u32, u64)>,
|
|
||||||
pub test_config: Vec<(u32, u32, u64)>,
|
|
||||||
#[serde(skip)]
|
|
||||||
pub _config: core::marker::PhantomData<T>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<T: Config> Default for GenesisConfig<T> {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self {
|
|
||||||
_config: Default::default(),
|
|
||||||
data: vec![(15u32, 42u64)],
|
|
||||||
test_config: vec![(15u32, 16u32, 42u64)],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[pezpallet::genesis_build]
|
|
||||||
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
|
|
||||||
fn build(&self) {
|
|
||||||
for (k, v) in &self.data {
|
|
||||||
<Data<T>>::insert(k, v);
|
|
||||||
}
|
|
||||||
for (k1, k2, v) in &self.test_config {
|
|
||||||
<DataDM<T>>::insert(k1, k2, v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Some running total.
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type Total<T: Config> = StorageValue<_, (u32, u32), ValueQuery>;
|
|
||||||
|
|
||||||
/// Numbers to be added into the total.
|
|
||||||
#[pezpallet::storage]
|
|
||||||
pub type Numbers<T: Config> = StorageMap<_, Twox64Concat, u32, u32, OptionQuery>;
|
|
||||||
|
|
||||||
pub mod pezpallet_prelude {
|
|
||||||
pub type OriginFor<T> = <T as super::Config>::RuntimeOrigin;
|
|
||||||
|
|
||||||
pub type HeaderFor<T> =
|
|
||||||
<<T as super::Config>::Block as pezsp_runtime::traits::HeaderProvider>::HeaderT;
|
|
||||||
|
|
||||||
pub type BlockNumberFor<T> = <HeaderFor<T> as pezsp_runtime::traits::Header>::Number;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type BlockNumber = u32;
|
|
||||||
type AccountId = u32;
|
|
||||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
|
||||||
type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, RuntimeCall, (), ()>;
|
|
||||||
type Block = generic::Block<Header, UncheckedExtrinsic>;
|
|
||||||
|
|
||||||
#[crate::runtime]
|
|
||||||
mod runtime {
|
|
||||||
#[runtime::runtime]
|
|
||||||
#[runtime::derive(
|
|
||||||
RuntimeCall,
|
|
||||||
RuntimeEvent,
|
|
||||||
RuntimeError,
|
|
||||||
RuntimeOrigin,
|
|
||||||
RuntimeFreezeReason,
|
|
||||||
RuntimeHoldReason,
|
|
||||||
RuntimeSlashReason,
|
|
||||||
RuntimeLockId,
|
|
||||||
RuntimeTask,
|
|
||||||
RuntimeViewFunction
|
|
||||||
)]
|
|
||||||
pub struct Runtime;
|
|
||||||
|
|
||||||
#[runtime::pezpallet_index(0)]
|
|
||||||
pub type System = self::pezframe_system;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[crate::derive_impl(self::pezframe_system::config_preludes::TestDefaultConfig as self::pezframe_system::DefaultConfig)]
|
|
||||||
impl Config for Runtime {
|
|
||||||
type Block = Block;
|
|
||||||
type AccountId = AccountId;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
fn new_test_ext() -> TestExternalities {
|
|
||||||
RuntimeGenesisConfig::default().build_storage().unwrap().into()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
trait Sorted {
|
|
||||||
fn sorted(self) -> Self;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
impl<T: Ord> Sorted for Vec<T> {
|
|
||||||
fn sorted(mut self) -> Self {
|
|
||||||
self.sort();
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn map_issue_3318() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
type OptionLinkedMap = self::pezframe_system::OptionLinkedMap<Runtime>;
|
|
||||||
|
|
||||||
OptionLinkedMap::insert(1, 1);
|
|
||||||
assert_eq!(OptionLinkedMap::get(1), Some(1));
|
|
||||||
OptionLinkedMap::insert(1, 2);
|
|
||||||
assert_eq!(OptionLinkedMap::get(1), Some(2));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn map_swap_works() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
type OptionLinkedMap = self::pezframe_system::OptionLinkedMap<Runtime>;
|
|
||||||
|
|
||||||
OptionLinkedMap::insert(0, 0);
|
|
||||||
OptionLinkedMap::insert(1, 1);
|
|
||||||
OptionLinkedMap::insert(2, 2);
|
|
||||||
OptionLinkedMap::insert(3, 3);
|
|
||||||
|
|
||||||
let collect = || OptionLinkedMap::iter().collect::<Vec<_>>().sorted();
|
|
||||||
assert_eq!(collect(), vec![(0, 0), (1, 1), (2, 2), (3, 3)]);
|
|
||||||
|
|
||||||
// Two existing
|
|
||||||
OptionLinkedMap::swap(1, 2);
|
|
||||||
assert_eq!(collect(), vec![(0, 0), (1, 2), (2, 1), (3, 3)]);
|
|
||||||
|
|
||||||
// Back to normal
|
|
||||||
OptionLinkedMap::swap(2, 1);
|
|
||||||
assert_eq!(collect(), vec![(0, 0), (1, 1), (2, 2), (3, 3)]);
|
|
||||||
|
|
||||||
// Left existing
|
|
||||||
OptionLinkedMap::swap(2, 5);
|
|
||||||
assert_eq!(collect(), vec![(0, 0), (1, 1), (3, 3), (5, 2)]);
|
|
||||||
|
|
||||||
// Right existing
|
|
||||||
OptionLinkedMap::swap(5, 2);
|
|
||||||
assert_eq!(collect(), vec![(0, 0), (1, 1), (2, 2), (3, 3)]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn double_map_swap_works() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
type DataDM = self::pezframe_system::DataDM<Runtime>;
|
|
||||||
|
|
||||||
DataDM::insert(0, 1, 1);
|
|
||||||
DataDM::insert(1, 0, 2);
|
|
||||||
DataDM::insert(1, 1, 3);
|
|
||||||
|
|
||||||
let get_all = || {
|
|
||||||
vec![
|
|
||||||
DataDM::get(0, 1),
|
|
||||||
DataDM::get(1, 0),
|
|
||||||
DataDM::get(1, 1),
|
|
||||||
DataDM::get(2, 0),
|
|
||||||
DataDM::get(2, 1),
|
|
||||||
]
|
|
||||||
};
|
|
||||||
assert_eq!(get_all(), vec![1, 2, 3, 0, 0]);
|
|
||||||
|
|
||||||
// Two existing
|
|
||||||
DataDM::swap(0, 1, 1, 0);
|
|
||||||
assert_eq!(get_all(), vec![2, 1, 3, 0, 0]);
|
|
||||||
|
|
||||||
// Left existing
|
|
||||||
DataDM::swap(1, 0, 2, 0);
|
|
||||||
assert_eq!(get_all(), vec![2, 0, 3, 1, 0]);
|
|
||||||
|
|
||||||
// Right existing
|
|
||||||
DataDM::swap(2, 1, 1, 1);
|
|
||||||
assert_eq!(get_all(), vec![2, 0, 0, 1, 3]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn map_basic_insert_remove_should_work() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
type Map = self::pezframe_system::Data<Runtime>;
|
|
||||||
|
|
||||||
// initialized during genesis
|
|
||||||
assert_eq!(Map::get(&15u32), 42u64);
|
|
||||||
|
|
||||||
// get / insert / take
|
|
||||||
let key = 17u32;
|
|
||||||
assert_eq!(Map::get(&key), 0u64);
|
|
||||||
Map::insert(key, 4u64);
|
|
||||||
assert_eq!(Map::get(&key), 4u64);
|
|
||||||
assert_eq!(Map::take(&key), 4u64);
|
|
||||||
assert_eq!(Map::get(&key), 0u64);
|
|
||||||
|
|
||||||
// mutate
|
|
||||||
Map::mutate(&key, |val| {
|
|
||||||
*val = 15;
|
|
||||||
});
|
|
||||||
assert_eq!(Map::get(&key), 15u64);
|
|
||||||
|
|
||||||
// remove
|
|
||||||
Map::remove(&key);
|
|
||||||
assert_eq!(Map::get(&key), 0u64);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn map_iteration_should_work() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
type Map = self::pezframe_system::Data<Runtime>;
|
|
||||||
|
|
||||||
assert_eq!(Map::iter().collect::<Vec<_>>().sorted(), vec![(15, 42)]);
|
|
||||||
// insert / remove
|
|
||||||
let key = 17u32;
|
|
||||||
Map::insert(key, 4u64);
|
|
||||||
assert_eq!(Map::iter().collect::<Vec<_>>().sorted(), vec![(15, 42), (key, 4)]);
|
|
||||||
assert_eq!(Map::take(&15), 42u64);
|
|
||||||
assert_eq!(Map::take(&key), 4u64);
|
|
||||||
assert_eq!(Map::iter().collect::<Vec<_>>().sorted(), vec![]);
|
|
||||||
|
|
||||||
// Add couple of more elements
|
|
||||||
Map::insert(key, 42u64);
|
|
||||||
assert_eq!(Map::iter().collect::<Vec<_>>().sorted(), vec![(key, 42)]);
|
|
||||||
Map::insert(key + 1, 43u64);
|
|
||||||
assert_eq!(Map::iter().collect::<Vec<_>>().sorted(), vec![(key, 42), (key + 1, 43)]);
|
|
||||||
|
|
||||||
// mutate
|
|
||||||
let key = key + 2;
|
|
||||||
Map::mutate(&key, |val| {
|
|
||||||
*val = 15;
|
|
||||||
});
|
|
||||||
assert_eq!(
|
|
||||||
Map::iter().collect::<Vec<_>>().sorted(),
|
|
||||||
vec![(key - 2, 42), (key - 1, 43), (key, 15)]
|
|
||||||
);
|
|
||||||
Map::mutate(&key, |val| {
|
|
||||||
*val = 17;
|
|
||||||
});
|
|
||||||
assert_eq!(
|
|
||||||
Map::iter().collect::<Vec<_>>().sorted(),
|
|
||||||
vec![(key - 2, 42), (key - 1, 43), (key, 17)]
|
|
||||||
);
|
|
||||||
|
|
||||||
// remove first
|
|
||||||
Map::remove(&key);
|
|
||||||
assert_eq!(Map::iter().collect::<Vec<_>>().sorted(), vec![(key - 2, 42), (key - 1, 43)]);
|
|
||||||
|
|
||||||
// remove last from the list
|
|
||||||
Map::remove(&(key - 2));
|
|
||||||
assert_eq!(Map::iter().collect::<Vec<_>>().sorted(), vec![(key - 1, 43)]);
|
|
||||||
|
|
||||||
// remove the last element
|
|
||||||
Map::remove(&(key - 1));
|
|
||||||
assert_eq!(Map::iter().collect::<Vec<_>>().sorted(), vec![]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn double_map_basic_insert_remove_remove_prefix_with_commit_should_work() {
|
|
||||||
let key1 = 17u32;
|
|
||||||
let key2 = 18u32;
|
|
||||||
type DoubleMap = self::pezframe_system::DataDM<Runtime>;
|
|
||||||
let mut e = new_test_ext();
|
|
||||||
e.execute_with(|| {
|
|
||||||
// initialized during genesis
|
|
||||||
assert_eq!(DoubleMap::get(&15u32, &16u32), 42u64);
|
|
||||||
|
|
||||||
// get / insert / take
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 0u64);
|
|
||||||
DoubleMap::insert(&key1, &key2, &4u64);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 4u64);
|
|
||||||
assert_eq!(DoubleMap::take(&key1, &key2), 4u64);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 0u64);
|
|
||||||
|
|
||||||
// mutate
|
|
||||||
DoubleMap::mutate(&key1, &key2, |val| *val = 15);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 15u64);
|
|
||||||
|
|
||||||
// remove
|
|
||||||
DoubleMap::remove(&key1, &key2);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 0u64);
|
|
||||||
|
|
||||||
// remove prefix
|
|
||||||
DoubleMap::insert(&key1, &key2, &4u64);
|
|
||||||
DoubleMap::insert(&key1, &(key2 + 1), &4u64);
|
|
||||||
DoubleMap::insert(&(key1 + 1), &key2, &4u64);
|
|
||||||
DoubleMap::insert(&(key1 + 1), &(key2 + 1), &4u64);
|
|
||||||
});
|
|
||||||
e.commit_all().unwrap();
|
|
||||||
e.execute_with(|| {
|
|
||||||
assert!(matches!(
|
|
||||||
DoubleMap::clear_prefix(&key1, u32::max_value(), None),
|
|
||||||
MultiRemovalResults { maybe_cursor: None, backend: 2, unique: 2, loops: 2 }
|
|
||||||
));
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 0u64);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &(key2 + 1)), 0u64);
|
|
||||||
assert_eq!(DoubleMap::get(&(key1 + 1), &key2), 4u64);
|
|
||||||
assert_eq!(DoubleMap::get(&(key1 + 1), &(key2 + 1)), 4u64);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn double_map_basic_insert_remove_remove_prefix_should_work() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
let key1 = 17u32;
|
|
||||||
let key2 = 18u32;
|
|
||||||
type DoubleMap = self::pezframe_system::DataDM<Runtime>;
|
|
||||||
|
|
||||||
// initialized during genesis
|
|
||||||
assert_eq!(DoubleMap::get(&15u32, &16u32), 42u64);
|
|
||||||
|
|
||||||
// get / insert / take
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 0u64);
|
|
||||||
DoubleMap::insert(&key1, &key2, &4u64);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 4u64);
|
|
||||||
assert_eq!(DoubleMap::take(&key1, &key2), 4u64);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 0u64);
|
|
||||||
|
|
||||||
// mutate
|
|
||||||
DoubleMap::mutate(&key1, &key2, |val| *val = 15);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 15u64);
|
|
||||||
|
|
||||||
// remove
|
|
||||||
DoubleMap::remove(&key1, &key2);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 0u64);
|
|
||||||
|
|
||||||
// remove prefix
|
|
||||||
DoubleMap::insert(&key1, &key2, &4u64);
|
|
||||||
DoubleMap::insert(&key1, &(key2 + 1), &4u64);
|
|
||||||
DoubleMap::insert(&(key1 + 1), &key2, &4u64);
|
|
||||||
DoubleMap::insert(&(key1 + 1), &(key2 + 1), &4u64);
|
|
||||||
// all in overlay
|
|
||||||
assert!(matches!(
|
|
||||||
DoubleMap::clear_prefix(&key1, u32::max_value(), None),
|
|
||||||
MultiRemovalResults { maybe_cursor: None, backend: 0, unique: 0, loops: 0 }
|
|
||||||
));
|
|
||||||
// Note this is the incorrect answer (for now), since we are using v2 of
|
|
||||||
// `clear_prefix`.
|
|
||||||
// When we switch to v3, then this will become:
|
|
||||||
// MultiRemovalResults:: { maybe_cursor: None, backend: 0, unique: 2, loops: 2 },
|
|
||||||
assert!(matches!(
|
|
||||||
DoubleMap::clear_prefix(&key1, u32::max_value(), None),
|
|
||||||
MultiRemovalResults { maybe_cursor: None, backend: 0, unique: 0, loops: 0 }
|
|
||||||
));
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), 0u64);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &(key2 + 1)), 0u64);
|
|
||||||
assert_eq!(DoubleMap::get(&(key1 + 1), &key2), 4u64);
|
|
||||||
assert_eq!(DoubleMap::get(&(key1 + 1), &(key2 + 1)), 4u64);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn double_map_append_should_work() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
type DoubleMap = self::pezframe_system::AppendableDM<Runtime>;
|
|
||||||
|
|
||||||
let key1 = 17u32;
|
|
||||||
let key2 = 18u32;
|
|
||||||
|
|
||||||
DoubleMap::insert(&key1, &key2, &vec![1]);
|
|
||||||
DoubleMap::append(&key1, &key2, 2);
|
|
||||||
assert_eq!(DoubleMap::get(&key1, &key2), &[1, 2]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn double_map_mutate_exists_should_work() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
type DoubleMap = self::pezframe_system::DataDM<Runtime>;
|
|
||||||
|
|
||||||
let (key1, key2) = (11, 13);
|
|
||||||
|
|
||||||
// mutated
|
|
||||||
DoubleMap::mutate_exists(key1, key2, |v| *v = Some(1));
|
|
||||||
assert_eq!(DoubleMap::get(&key1, key2), 1);
|
|
||||||
|
|
||||||
// removed if mutated to `None`
|
|
||||||
DoubleMap::mutate_exists(key1, key2, |v| *v = None);
|
|
||||||
assert!(!DoubleMap::contains_key(&key1, key2));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn double_map_try_mutate_exists_should_work() {
|
|
||||||
new_test_ext().execute_with(|| {
|
|
||||||
type DoubleMap = self::pezframe_system::DataDM<Runtime>;
|
|
||||||
type TestResult = Result<(), &'static str>;
|
|
||||||
|
|
||||||
let (key1, key2) = (11, 13);
|
|
||||||
|
|
||||||
// mutated if `Ok`
|
|
||||||
assert_ok!(DoubleMap::try_mutate_exists(key1, key2, |v| -> TestResult {
|
|
||||||
*v = Some(1);
|
|
||||||
Ok(())
|
|
||||||
}));
|
|
||||||
assert_eq!(DoubleMap::get(&key1, key2), 1);
|
|
||||||
|
|
||||||
// no-op if `Err`
|
|
||||||
assert_noop!(
|
|
||||||
DoubleMap::try_mutate_exists(key1, key2, |v| -> TestResult {
|
|
||||||
*v = Some(2);
|
|
||||||
Err("nah")
|
|
||||||
}),
|
|
||||||
"nah"
|
|
||||||
);
|
|
||||||
|
|
||||||
// removed if mutated to`None`
|
|
||||||
assert_ok!(DoubleMap::try_mutate_exists(key1, key2, |v| -> TestResult {
|
|
||||||
*v = None;
|
|
||||||
Ok(())
|
|
||||||
}));
|
|
||||||
assert!(!DoubleMap::contains_key(&key1, key2));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
fn expected_metadata() -> PalletStorageMetadataIR {
|
|
||||||
PalletStorageMetadataIR {
|
|
||||||
prefix: "System",
|
|
||||||
entries: vec![
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "Data",
|
|
||||||
modifier: StorageEntryModifierIR::Default,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![StorageHasherIR::Twox64Concat],
|
|
||||||
key: scale_info::meta_type::<u32>(),
|
|
||||||
value: scale_info::meta_type::<u64>(),
|
|
||||||
},
|
|
||||||
default: vec![0, 0, 0, 0, 0, 0, 0, 0],
|
|
||||||
docs: vec![],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "OptionLinkedMap",
|
|
||||||
modifier: StorageEntryModifierIR::Optional,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![StorageHasherIR::Blake2_128Concat],
|
|
||||||
key: scale_info::meta_type::<u32>(),
|
|
||||||
value: scale_info::meta_type::<u32>(),
|
|
||||||
},
|
|
||||||
default: vec![0],
|
|
||||||
docs: vec![],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "GenericData",
|
|
||||||
modifier: StorageEntryModifierIR::Default,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![StorageHasherIR::Identity],
|
|
||||||
key: scale_info::meta_type::<u32>(),
|
|
||||||
value: scale_info::meta_type::<u32>(),
|
|
||||||
},
|
|
||||||
default: vec![0, 0, 0, 0],
|
|
||||||
docs: vec![],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "GenericData2",
|
|
||||||
modifier: StorageEntryModifierIR::Optional,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![StorageHasherIR::Blake2_128Concat],
|
|
||||||
key: scale_info::meta_type::<u32>(),
|
|
||||||
value: scale_info::meta_type::<u32>(),
|
|
||||||
},
|
|
||||||
default: vec![0],
|
|
||||||
docs: vec![],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "DataDM",
|
|
||||||
modifier: StorageEntryModifierIR::Default,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![StorageHasherIR::Twox64Concat, StorageHasherIR::Blake2_128Concat],
|
|
||||||
key: scale_info::meta_type::<(u32, u32)>(),
|
|
||||||
value: scale_info::meta_type::<u64>(),
|
|
||||||
},
|
|
||||||
default: vec![0, 0, 0, 0, 0, 0, 0, 0],
|
|
||||||
docs: vec![],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "GenericDataDM",
|
|
||||||
modifier: StorageEntryModifierIR::Default,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![StorageHasherIR::Blake2_128Concat, StorageHasherIR::Identity],
|
|
||||||
key: scale_info::meta_type::<(u32, u32)>(),
|
|
||||||
value: scale_info::meta_type::<u32>(),
|
|
||||||
},
|
|
||||||
default: vec![0, 0, 0, 0],
|
|
||||||
docs: vec![],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "GenericData2DM",
|
|
||||||
modifier: StorageEntryModifierIR::Optional,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![StorageHasherIR::Blake2_128Concat, StorageHasherIR::Twox64Concat],
|
|
||||||
key: scale_info::meta_type::<(u32, u32)>(),
|
|
||||||
value: scale_info::meta_type::<u32>(),
|
|
||||||
},
|
|
||||||
default: vec![0],
|
|
||||||
docs: vec![],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "AppendableDM",
|
|
||||||
modifier: StorageEntryModifierIR::Default,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![
|
|
||||||
StorageHasherIR::Blake2_128Concat,
|
|
||||||
StorageHasherIR::Blake2_128Concat,
|
|
||||||
],
|
|
||||||
key: scale_info::meta_type::<(u32, u32)>(),
|
|
||||||
value: scale_info::meta_type::<Vec<u32>>(),
|
|
||||||
},
|
|
||||||
default: vec![0],
|
|
||||||
docs: vec![],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "Total",
|
|
||||||
modifier: StorageEntryModifierIR::Default,
|
|
||||||
ty: StorageEntryTypeIR::Plain(scale_info::meta_type::<(u32, u32)>()),
|
|
||||||
default: vec![0, 0, 0, 0, 0, 0, 0, 0],
|
|
||||||
docs: vec![" Some running total."],
|
|
||||||
},
|
|
||||||
StorageEntryMetadataIR {
|
|
||||||
name: "Numbers",
|
|
||||||
modifier: StorageEntryModifierIR::Optional,
|
|
||||||
ty: StorageEntryTypeIR::Map {
|
|
||||||
hashers: vec![StorageHasherIR::Twox64Concat],
|
|
||||||
key: scale_info::meta_type::<u32>(),
|
|
||||||
value: scale_info::meta_type::<u32>(),
|
|
||||||
},
|
|
||||||
default: vec![0],
|
|
||||||
docs: vec![" Numbers to be added into the total."],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn store_metadata() {
|
|
||||||
let metadata = Pezpallet::<Runtime>::storage_metadata();
|
|
||||||
pretty_assertions::assert_eq!(expected_metadata(), metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
parameter_types! {
|
|
||||||
storage StorageParameter: u64 = 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn check_storage_parameter_type_works() {
|
|
||||||
TestExternalities::default().execute_with(|| {
|
|
||||||
assert_eq!(pezsp_io::hashing::twox_128(b":StorageParameter:"), StorageParameter::key());
|
|
||||||
|
|
||||||
assert_eq!(10, StorageParameter::get());
|
|
||||||
|
|
||||||
StorageParameter::set(&300);
|
|
||||||
assert_eq!(300, StorageParameter::get());
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn derive_partial_eq_no_bound_core_mod() {
|
|
||||||
mod core {}
|
|
||||||
|
|
||||||
#[derive(
|
|
||||||
crate::PartialEqNoBound,
|
|
||||||
crate::CloneNoBound,
|
|
||||||
crate::DebugNoBound,
|
|
||||||
crate::DefaultNoBound,
|
|
||||||
crate::EqNoBound,
|
|
||||||
)]
|
|
||||||
struct Test;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {}
|
|
||||||
@@ -1,133 +0,0 @@
|
|||||||
// This file is part of Bizinikiwi.
|
|
||||||
|
|
||||||
// Copyright (C) Parity Technologies (UK) Ltd. and Dijital Kurdistan Tech Institute
|
|
||||||
// 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.
|
|
||||||
#![allow(deprecated, clippy::deprecated_semver)]
|
|
||||||
|
|
||||||
use super::{pezframe_system, Block};
|
|
||||||
use crate::derive_impl;
|
|
||||||
|
|
||||||
#[crate::pezpallet(dev_mode)]
|
|
||||||
mod pezpallet_basic {
|
|
||||||
use super::pezframe_system;
|
|
||||||
|
|
||||||
#[pezpallet::pezpallet]
|
|
||||||
pub struct Pezpallet<T>(_);
|
|
||||||
|
|
||||||
#[pezpallet::config]
|
|
||||||
pub trait Config: pezframe_system::Config {}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl pezpallet_basic::Config for Runtime {}
|
|
||||||
|
|
||||||
#[crate::pezpallet(dev_mode)]
|
|
||||||
mod pezpallet_with_disabled_call {
|
|
||||||
use super::pezframe_system;
|
|
||||||
|
|
||||||
#[pezpallet::pezpallet]
|
|
||||||
pub struct Pezpallet<T>(_);
|
|
||||||
|
|
||||||
#[pezpallet::config]
|
|
||||||
pub trait Config: pezframe_system::Config {}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl pezpallet_with_disabled_call::Config for Runtime {}
|
|
||||||
|
|
||||||
#[crate::pezpallet(dev_mode)]
|
|
||||||
mod pezpallet_with_disabled_unsigned {
|
|
||||||
use super::pezframe_system;
|
|
||||||
|
|
||||||
#[pezpallet::pezpallet]
|
|
||||||
pub struct Pezpallet<T>(_);
|
|
||||||
|
|
||||||
#[pezpallet::config]
|
|
||||||
pub trait Config: pezframe_system::Config {}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl pezpallet_with_disabled_unsigned::Config for Runtime {}
|
|
||||||
|
|
||||||
#[crate::pezpallet]
|
|
||||||
mod pezpallet_with_instance {
|
|
||||||
use super::pezframe_system;
|
|
||||||
|
|
||||||
#[pezpallet::pezpallet]
|
|
||||||
pub struct Pezpallet<T, I = ()>(_);
|
|
||||||
|
|
||||||
#[pezpallet::config]
|
|
||||||
pub trait Config<I: 'static = ()>: pezframe_system::Config {}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
type Instance1 = pezpallet_with_instance::Pezpallet<pezpallet_with_instance::Instance1>;
|
|
||||||
|
|
||||||
impl pezpallet_with_instance::Config<pezpallet_with_instance::Instance1> for Runtime {}
|
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
type Instance2 = pezpallet_with_instance::Pezpallet<pezpallet_with_instance::Instance2>;
|
|
||||||
|
|
||||||
impl pezpallet_with_instance::Config<pezpallet_with_instance::Instance2> for Runtime {}
|
|
||||||
|
|
||||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
|
||||||
impl pezframe_system::Config for Runtime {
|
|
||||||
type Block = Block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[docify::export(runtime_macro)]
|
|
||||||
#[crate::runtime]
|
|
||||||
mod runtime {
|
|
||||||
// The main runtime
|
|
||||||
#[runtime::runtime]
|
|
||||||
// Runtime Types to be generated
|
|
||||||
#[runtime::derive(
|
|
||||||
RuntimeCall,
|
|
||||||
RuntimeEvent,
|
|
||||||
RuntimeError,
|
|
||||||
RuntimeOrigin,
|
|
||||||
RuntimeFreezeReason,
|
|
||||||
RuntimeHoldReason,
|
|
||||||
RuntimeSlashReason,
|
|
||||||
RuntimeLockId,
|
|
||||||
RuntimeTask,
|
|
||||||
RuntimeViewFunction
|
|
||||||
)]
|
|
||||||
pub struct Runtime;
|
|
||||||
|
|
||||||
// Use the concrete pezpallet type
|
|
||||||
#[runtime::pezpallet_index(0)]
|
|
||||||
pub type System = pezframe_system::Pezpallet<Runtime>;
|
|
||||||
|
|
||||||
// Use path to the pezpallet
|
|
||||||
#[runtime::pezpallet_index(1)]
|
|
||||||
pub type Basic = pezpallet_basic;
|
|
||||||
|
|
||||||
// Use the concrete pezpallet type with instance
|
|
||||||
#[runtime::pezpallet_index(2)]
|
|
||||||
pub type PalletWithInstance1 = pezpallet_with_instance::Pezpallet<Runtime, Instance1>;
|
|
||||||
|
|
||||||
// Use path to the pezpallet with instance
|
|
||||||
#[runtime::pezpallet_index(3)]
|
|
||||||
pub type PalletWithInstance2 = pezpallet_with_instance<Instance2>;
|
|
||||||
|
|
||||||
// Ensure that the runtime does not export the calls from the pezpallet
|
|
||||||
#[runtime::pezpallet_index(4)]
|
|
||||||
#[runtime::disable_call]
|
|
||||||
#[deprecated = "example"]
|
|
||||||
pub type PalletWithDisabledCall = pezpallet_with_disabled_call::Pezpallet<Runtime>;
|
|
||||||
|
|
||||||
// Ensure that the runtime does not export the unsigned calls from the pezpallet
|
|
||||||
#[runtime::pezpallet_index(5)]
|
|
||||||
#[runtime::disable_unsigned]
|
|
||||||
pub type PalletWithDisabledUnsigned = pezpallet_with_disabled_unsigned::Pezpallet<Runtime>;
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
// This file is part of Bizinikiwi.
|
|
||||||
|
|
||||||
// Copyright (C) Parity Technologies (UK) Ltd. and Dijital Kurdistan Tech Institute
|
|
||||||
// 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(test)]
|
|
||||||
use super::{
|
|
||||||
assert_ok,
|
|
||||||
pezframe_system::{Numbers, Total},
|
|
||||||
Runtime, RuntimeOrigin, RuntimeTask, System,
|
|
||||||
};
|
|
||||||
use pezframe_support_procedural::pezpallet_section;
|
|
||||||
|
|
||||||
#[pezpallet_section]
|
|
||||||
mod tasks_example {
|
|
||||||
#[docify::export(tasks_example)]
|
|
||||||
#[pezpallet::tasks_experimental]
|
|
||||||
impl<T: Config> Pezpallet<T> {
|
|
||||||
/// Add a pair of numbers into the totals and remove them.
|
|
||||||
#[pezpallet::task_list(Numbers::<T>::iter_keys())]
|
|
||||||
#[pezpallet::task_condition(|i| Numbers::<T>::contains_key(i))]
|
|
||||||
#[pezpallet::task_weight(0.into())]
|
|
||||||
#[pezpallet::task_index(0)]
|
|
||||||
pub fn add_number_into_total(i: u32) -> DispatchResult {
|
|
||||||
let v = Numbers::<T>::take(i).ok_or(Error::<T>::NotFound)?;
|
|
||||||
Total::<T>::mutate(|(total_keys, total_values)| {
|
|
||||||
*total_keys += i;
|
|
||||||
*total_values += v;
|
|
||||||
});
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[docify::export]
|
|
||||||
#[test]
|
|
||||||
fn tasks_work() {
|
|
||||||
super::new_test_ext().execute_with(|| {
|
|
||||||
Numbers::<Runtime>::insert(0, 1);
|
|
||||||
|
|
||||||
let task =
|
|
||||||
RuntimeTask::System(super::pezframe_system::Task::<Runtime>::AddNumberIntoTotal {
|
|
||||||
i: 0u32,
|
|
||||||
});
|
|
||||||
|
|
||||||
assert_ok!(System::do_task(RuntimeOrigin::signed(1), task.clone(),));
|
|
||||||
assert_eq!(Numbers::<Runtime>::get(0), None);
|
|
||||||
assert_eq!(Total::<Runtime>::get(), (0, 1));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -810,12 +810,10 @@ pub fn register_default_impl(attrs: TokenStream, tokens: TokenStream) -> TokenSt
|
|||||||
/// Attaching this attribute to such an item ensures that the combined impl generated via
|
/// Attaching this attribute to such an item ensures that the combined impl generated via
|
||||||
/// [`#[derive_impl(..)]`](macro@derive_impl) will use the correct type auto-generated by
|
/// [`#[derive_impl(..)]`](macro@derive_impl) will use the correct type auto-generated by
|
||||||
/// `construct_runtime!`.
|
/// `construct_runtime!`.
|
||||||
#[doc = docify::embed!("examples/proc_main/inject_runtime_type.rs", derive_impl_works_with_runtime_type_injection)]
|
|
||||||
///
|
///
|
||||||
/// However, if `no_aggregated_types` is specified while using
|
/// However, if `no_aggregated_types` is specified while using
|
||||||
/// [`#[derive_impl(..)]`](macro@derive_impl), then these items are attached verbatim to the
|
/// [`#[derive_impl(..)]`](macro@derive_impl), then these items are attached verbatim to the
|
||||||
/// combined impl.
|
/// combined impl.
|
||||||
#[doc = docify::embed!("examples/proc_main/inject_runtime_type.rs", derive_impl_works_with_no_aggregated_types)]
|
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn inject_runtime_type(_: TokenStream, tokens: TokenStream) -> TokenStream {
|
pub fn inject_runtime_type(_: TokenStream, tokens: TokenStream) -> TokenStream {
|
||||||
let item = tokens.clone();
|
let item = tokens.clone();
|
||||||
@@ -1162,9 +1160,8 @@ pub fn composite_enum(_: TokenStream, _: TokenStream) -> TokenStream {
|
|||||||
/// When submitted as unsigned transactions, note that the tasks will be executed in a random order.
|
/// When submitted as unsigned transactions, note that the tasks will be executed in a random order.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
#[doc = docify::embed!("examples/proc_main/tasks.rs", tasks_example)]
|
///
|
||||||
/// Now, this can be executed as follows:
|
/// See the `tasks` module in `pezframe-support` for usage examples.
|
||||||
#[doc = docify::embed!("examples/proc_main/tasks.rs", tasks_work)]
|
|
||||||
#[proc_macro_attribute]
|
#[proc_macro_attribute]
|
||||||
pub fn tasks_experimental(_: TokenStream, _: TokenStream) -> TokenStream {
|
pub fn tasks_experimental(_: TokenStream, _: TokenStream) -> TokenStream {
|
||||||
pezpallet_macro_stub()
|
pezpallet_macro_stub()
|
||||||
@@ -1292,7 +1289,8 @@ pub fn import_section(attr: TokenStream, tokens: TokenStream) -> TokenStream {
|
|||||||
/// Construct a runtime, with the given name and the given pallets.
|
/// Construct a runtime, with the given name and the given pallets.
|
||||||
///
|
///
|
||||||
/// # Example:
|
/// # Example:
|
||||||
#[doc = docify::embed!("examples/proc_main/runtime.rs", runtime_macro)]
|
///
|
||||||
|
/// See runtime construction examples in the `pezkuwi-sdk` documentation.
|
||||||
///
|
///
|
||||||
/// # Supported Attributes:
|
/// # Supported Attributes:
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ clap = { features = ["derive"], workspace = true }
|
|||||||
codec = { workspace = true, default-features = true }
|
codec = { workspace = true, default-features = true }
|
||||||
comfy-table = { workspace = true }
|
comfy-table = { workspace = true }
|
||||||
env_filter = { workspace = true }
|
env_filter = { workspace = true }
|
||||||
# frame-storage-access-test-runtime moved to integration tests to break circular dependency
|
|
||||||
gethostname = { workspace = true }
|
gethostname = { workspace = true }
|
||||||
|
pezframe-storage-access-test-runtime = { workspace = true, optional = true }
|
||||||
handlebars = { workspace = true }
|
handlebars = { workspace = true }
|
||||||
itertools = { workspace = true }
|
itertools = { workspace = true }
|
||||||
linked-hash-map = { workspace = true }
|
linked-hash-map = { workspace = true }
|
||||||
@@ -81,22 +81,21 @@ thiserror = { workspace = true }
|
|||||||
thousands = { workspace = true }
|
thousands = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
# bizinikiwi-test-runtime = { workspace = true, default-features = true }
|
bizinikiwi-test-runtime = { workspace = true, default-features = true }
|
||||||
# pezcumulus-test-runtime = { workspace = true, default-features = true }
|
pezcumulus-test-runtime = { workspace = true, default-features = true }
|
||||||
# zagros-runtime = { workspace = true, default-features = true }
|
zagros-runtime = { workspace = true, default-features = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
# Enable storage benchmark command (requires frame-storage-access-test-runtime)
|
# Enable storage benchmark command
|
||||||
storage-benchmark = []
|
storage-benchmark = ["pezframe-storage-access-test-runtime"]
|
||||||
# Enable teyrchain/parachain benchmark inherent data
|
# Enable teyrchain/parachain benchmark inherent data
|
||||||
# Note: requires pezcumulus-client-teyrchain-inherent with mock feature (needs pezcumulus-test-relay-sproof-builder)
|
teyrchain-benchmarks = ["pezcumulus-client-teyrchain-inherent/mock"]
|
||||||
teyrchain-benchmarks = []
|
|
||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
# "bizinikiwi-test-runtime/runtime-benchmarks",
|
"bizinikiwi-test-runtime/runtime-benchmarks",
|
||||||
"pezcumulus-client-teyrchain-inherent/runtime-benchmarks",
|
"pezcumulus-client-teyrchain-inherent/runtime-benchmarks",
|
||||||
"pezcumulus-primitives-proof-size-hostfunction/runtime-benchmarks",
|
"pezcumulus-primitives-proof-size-hostfunction/runtime-benchmarks",
|
||||||
# "pezcumulus-test-runtime/runtime-benchmarks",
|
"pezcumulus-test-runtime/runtime-benchmarks",
|
||||||
"pezframe-benchmarking/runtime-benchmarks",
|
"pezframe-benchmarking/runtime-benchmarks",
|
||||||
"pezframe-support/runtime-benchmarks",
|
"pezframe-support/runtime-benchmarks",
|
||||||
"pezframe-system/runtime-benchmarks",
|
"pezframe-system/runtime-benchmarks",
|
||||||
@@ -127,7 +126,7 @@ runtime-benchmarks = [
|
|||||||
"pezsp-transaction-pool/runtime-benchmarks",
|
"pezsp-transaction-pool/runtime-benchmarks",
|
||||||
"pezsp-trie/runtime-benchmarks",
|
"pezsp-trie/runtime-benchmarks",
|
||||||
"pezsp-version/runtime-benchmarks",
|
"pezsp-version/runtime-benchmarks",
|
||||||
# "zagros-runtime/runtime-benchmarks", # Not a dependency of this crate
|
"zagros-runtime/runtime-benchmarks",
|
||||||
]
|
]
|
||||||
rocksdb = ["pezsc-cli/rocksdb", "pezsc-client-db/rocksdb"]
|
rocksdb = ["pezsc-cli/rocksdb", "pezsc-client-db/rocksdb"]
|
||||||
std = [
|
std = [
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ pub(crate) const MAX_BATCH_SIZE_FOR_BLOCK_VALIDATION: usize = 10_000;
|
|||||||
|
|
||||||
pub(crate) fn get_wasm_module() -> Box<dyn pezsc_executor_common::wasm_runtime::WasmModule> {
|
pub(crate) fn get_wasm_module() -> Box<dyn pezsc_executor_common::wasm_runtime::WasmModule> {
|
||||||
let blob = pezsc_executor_common::runtime_blob::RuntimeBlob::uncompress_if_needed(
|
let blob = pezsc_executor_common::runtime_blob::RuntimeBlob::uncompress_if_needed(
|
||||||
frame_storage_access_test_runtime::WASM_BINARY
|
pezframe_storage_access_test_runtime::WASM_BINARY
|
||||||
.expect("You need to build the WASM binaries to run the benchmark!"),
|
.expect("You need to build the WASM binaries to run the benchmark!"),
|
||||||
)
|
)
|
||||||
.expect("Failed to create runtime blob");
|
.expect("Failed to create runtime blob");
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use codec::Encode;
|
use codec::Encode;
|
||||||
use frame_storage_access_test_runtime::StorageAccessParams;
|
|
||||||
use log::{debug, info};
|
use log::{debug, info};
|
||||||
|
use pezframe_storage_access_test_runtime::StorageAccessParams;
|
||||||
use pezsc_cli::{Error, Result};
|
use pezsc_cli::{Error, Result};
|
||||||
use pezsc_client_api::{Backend as ClientBackend, StorageProvider, UsageProvider};
|
use pezsc_client_api::{Backend as ClientBackend, StorageProvider, UsageProvider};
|
||||||
use pezsp_api::CallApiAt;
|
use pezsp_api::CallApiAt;
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use codec::Encode;
|
use codec::Encode;
|
||||||
use frame_storage_access_test_runtime::StorageAccessParams;
|
|
||||||
use log::{debug, info, trace, warn};
|
use log::{debug, info, trace, warn};
|
||||||
|
use pezframe_storage_access_test_runtime::StorageAccessParams;
|
||||||
use pezsc_cli::Result;
|
use pezsc_cli::Result;
|
||||||
use pezsc_client_api::{Backend as ClientBackend, StorageProvider, UsageProvider};
|
use pezsc_client_api::{Backend as ClientBackend, StorageProvider, UsageProvider};
|
||||||
use pezsc_client_db::{DbHash, DbState, DbStateBuilder};
|
use pezsc_client_db::{DbHash, DbState, DbStateBuilder};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "frame-storage-access-test-runtime"
|
name = "pezframe-storage-access-test-runtime"
|
||||||
description = "A runtime for testing storage access on block validation"
|
description = "A runtime for testing storage access on block validation"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ pezsp-runtime = { features = ["serde"], workspace = true }
|
|||||||
pezsp-std = { workspace = true }
|
pezsp-std = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
pezbp-test-utils = { workspace = true, default-features = true }
|
|
||||||
hex = { workspace = true, default-features = true }
|
hex = { workspace = true, default-features = true }
|
||||||
hex-literal = { workspace = true, default-features = true }
|
hex-literal = { workspace = true, default-features = true }
|
||||||
|
pezbp-test-utils = { workspace = true, default-features = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
@@ -48,8 +48,8 @@ std = [
|
|||||||
"serde/std",
|
"serde/std",
|
||||||
]
|
]
|
||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
"pezbp-test-utils/runtime-benchmarks",
|
|
||||||
"pezbp-runtime/runtime-benchmarks",
|
"pezbp-runtime/runtime-benchmarks",
|
||||||
|
"pezbp-test-utils/runtime-benchmarks",
|
||||||
"pezframe-support/runtime-benchmarks",
|
"pezframe-support/runtime-benchmarks",
|
||||||
"pezsp-consensus-grandpa/runtime-benchmarks",
|
"pezsp-consensus-grandpa/runtime-benchmarks",
|
||||||
"pezsp-runtime/runtime-benchmarks",
|
"pezsp-runtime/runtime-benchmarks",
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ pezkuwi-pez-node-primitives = { workspace = true, default-features = true }
|
|||||||
pezkuwi-primitives = { workspace = true, default-features = true }
|
pezkuwi-primitives = { workspace = true, default-features = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
# pezcumulus-test-client = { workspace = true }
|
pezcumulus-test-client = { workspace = true }
|
||||||
# pezcumulus-test-relay-sproof-builder = { workspace = true }
|
pezcumulus-test-relay-sproof-builder = { workspace = true }
|
||||||
pezsp-keyring = { workspace = true }
|
pezsp-keyring = { workspace = true }
|
||||||
pezsp-tracing = { workspace = true }
|
pezsp-tracing = { workspace = true }
|
||||||
pezsp-version = { workspace = true }
|
pezsp-version = { workspace = true }
|
||||||
@@ -78,8 +78,8 @@ runtime-benchmarks = [
|
|||||||
"pezcumulus-primitives-aura/runtime-benchmarks",
|
"pezcumulus-primitives-aura/runtime-benchmarks",
|
||||||
"pezcumulus-primitives-core/runtime-benchmarks",
|
"pezcumulus-primitives-core/runtime-benchmarks",
|
||||||
"pezcumulus-relay-chain-interface/runtime-benchmarks",
|
"pezcumulus-relay-chain-interface/runtime-benchmarks",
|
||||||
# "pezcumulus-test-client/runtime-benchmarks",
|
"pezcumulus-test-client/runtime-benchmarks",
|
||||||
# "pezcumulus-test-relay-sproof-builder/runtime-benchmarks",
|
"pezcumulus-test-relay-sproof-builder/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-overseer/runtime-benchmarks",
|
"pezkuwi-overseer/runtime-benchmarks",
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ pezsp-keyring = { workspace = true, default-features = true }
|
|||||||
|
|
||||||
# Pezkuwi
|
# Pezkuwi
|
||||||
metered = { features = ["futures_channel"], workspace = true }
|
metered = { features = ["futures_channel"], workspace = true }
|
||||||
# pezkuwi-test-client = { workspace = true }
|
pezkuwi-test-client = { workspace = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
@@ -57,7 +57,7 @@ runtime-benchmarks = [
|
|||||||
"pezkuwi-cli/runtime-benchmarks",
|
"pezkuwi-cli/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
"pezkuwi-service/runtime-benchmarks",
|
"pezkuwi-service/runtime-benchmarks",
|
||||||
# "pezkuwi-test-client/runtime-benchmarks",
|
"pezkuwi-test-client/runtime-benchmarks",
|
||||||
"pezsc-cli/runtime-benchmarks",
|
"pezsc-cli/runtime-benchmarks",
|
||||||
"pezsc-client-api/runtime-benchmarks",
|
"pezsc-client-api/runtime-benchmarks",
|
||||||
"pezsc-network/runtime-benchmarks",
|
"pezsc-network/runtime-benchmarks",
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ pezsp-core = { workspace = true, default-features = false, optional = true }
|
|||||||
pezsp-io = { workspace = true, default-features = false, optional = true }
|
pezsp-io = { workspace = true, default-features = false, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
pezpallet-sudo = { workspace = true, default-features = false }
|
pezpallet-sudo = { workspace = true, default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ pub use pezsp_runtime::BuildStorage;
|
|||||||
pub use pezsp_runtime::{Perbill, Permill};
|
pub use pezsp_runtime::{Perbill, Permill};
|
||||||
|
|
||||||
use pezcumulus_primitives_core::AggregateMessageOrigin; //, ClaimQueueOffset, CoreSelector};
|
use pezcumulus_primitives_core::AggregateMessageOrigin; //, ClaimQueueOffset, CoreSelector};
|
||||||
use teyrchains_common::{AccountId, Signature};
|
|
||||||
use pezstaging_xcm::latest::prelude::BodyId;
|
use pezstaging_xcm::latest::prelude::BodyId;
|
||||||
|
use teyrchains_common::{AccountId, Signature};
|
||||||
|
|
||||||
pub type SessionHandlers = ();
|
pub type SessionHandlers = ();
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,10 @@ use super::{
|
|||||||
RuntimeOrigin, TeyrchainInfo, TeyrchainSystem, WeightToFee, XcmpQueue,
|
RuntimeOrigin, TeyrchainInfo, TeyrchainSystem, WeightToFee, XcmpQueue,
|
||||||
};
|
};
|
||||||
|
|
||||||
use pezkuwi_sdk::{pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder, pezstaging_xcm_executor as xcm_executor, *};
|
use pezkuwi_sdk::{
|
||||||
|
pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder,
|
||||||
|
pezstaging_xcm_executor as xcm_executor, *,
|
||||||
|
};
|
||||||
|
|
||||||
use pezframe_support::{
|
use pezframe_support::{
|
||||||
parameter_types,
|
parameter_types,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ rand_core = { workspace = true }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
kvdb-memorydb = { workspace = true }
|
kvdb-memorydb = { workspace = true }
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true, default-features = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true, default-features = true }
|
||||||
pezsp-consensus-babe = { workspace = true, default-features = true }
|
pezsp-consensus-babe = { workspace = true, default-features = true }
|
||||||
pezsp-core = { workspace = true, default-features = true }
|
pezsp-core = { workspace = true, default-features = true }
|
||||||
pezsp-keyring = { workspace = true, default-features = true }
|
pezsp-keyring = { workspace = true, default-features = true }
|
||||||
@@ -51,7 +51,7 @@ runtime-benchmarks = [
|
|||||||
"pezkuwi-node-core-approval-voting/runtime-benchmarks",
|
"pezkuwi-node-core-approval-voting/runtime-benchmarks",
|
||||||
"pezkuwi-node-metrics/runtime-benchmarks",
|
"pezkuwi-node-metrics/runtime-benchmarks",
|
||||||
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-overseer/runtime-benchmarks",
|
"pezkuwi-overseer/runtime-benchmarks",
|
||||||
|
|||||||
@@ -52,29 +52,29 @@ rand_core = { workspace = true }
|
|||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
kvdb-memorydb = { workspace = true }
|
kvdb-memorydb = { workspace = true }
|
||||||
parking_lot = { workspace = true, default-features = true }
|
parking_lot = { workspace = true, default-features = true }
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||||
pezkuwi-primitives = { workspace = true, features = ["test"] }
|
pezkuwi-primitives = { workspace = true, features = ["test"] }
|
||||||
# pezkuwi-primitives-test-helpers = { workspace = true }
|
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||||
pezsp-consensus-babe = { workspace = true, default-features = true }
|
pezsp-consensus-babe = { workspace = true, default-features = true }
|
||||||
pezsp-core = { workspace = true, default-features = true }
|
pezsp-core = { workspace = true, default-features = true }
|
||||||
pezsp-keyring = { workspace = true, default-features = true }
|
pezsp-keyring = { workspace = true, default-features = true }
|
||||||
pezsp-keystore = { workspace = true, default-features = true }
|
pezsp-keystore = { workspace = true, default-features = true }
|
||||||
pezsp-tracing = { workspace = true }
|
pezsp-tracing = { workspace = true }
|
||||||
|
|
||||||
# pezkuwi-subsystem-bench = { workspace = true }
|
pezkuwi-subsystem-bench = { workspace = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
subsystem-benchmarks = []
|
subsystem-benchmarks = []
|
||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
"gum/runtime-benchmarks",
|
"gum/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-overseer/runtime-benchmarks",
|
"pezkuwi-overseer/runtime-benchmarks",
|
||||||
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-subsystem-bench/runtime-benchmarks",
|
"pezkuwi-subsystem-bench/runtime-benchmarks",
|
||||||
"pezsc-keystore/runtime-benchmarks",
|
"pezsc-keystore/runtime-benchmarks",
|
||||||
"pezsp-application-crypto/runtime-benchmarks",
|
"pezsp-application-crypto/runtime-benchmarks",
|
||||||
"pezsp-consensus-babe/runtime-benchmarks",
|
"pezsp-consensus-babe/runtime-benchmarks",
|
||||||
|
|||||||
@@ -37,16 +37,16 @@ pezsc-keystore = { workspace = true, default-features = true }
|
|||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
futures-timer = { workspace = true }
|
futures-timer = { workspace = true }
|
||||||
kvdb-memorydb = { workspace = true }
|
kvdb-memorydb = { workspace = true }
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||||
pezkuwi-primitives = { workspace = true, features = ["test"] }
|
pezkuwi-primitives = { workspace = true, features = ["test"] }
|
||||||
# pezkuwi-primitives-test-helpers = { workspace = true }
|
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||||
pezsp-application-crypto = { workspace = true, default-features = true }
|
pezsp-application-crypto = { workspace = true, default-features = true }
|
||||||
pezsp-core = { workspace = true, default-features = true }
|
pezsp-core = { workspace = true, default-features = true }
|
||||||
pezsp-keyring = { workspace = true, default-features = true }
|
pezsp-keyring = { workspace = true, default-features = true }
|
||||||
pezsp-keystore = { workspace = true, default-features = true }
|
pezsp-keystore = { workspace = true, default-features = true }
|
||||||
pezsp-tracing = { workspace = true, default-features = true }
|
pezsp-tracing = { workspace = true, default-features = true }
|
||||||
|
|
||||||
# pezkuwi-subsystem-bench = { workspace = true }
|
pezkuwi-subsystem-bench = { workspace = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# If not enabled, the dispute coordinator will do nothing.
|
# If not enabled, the dispute coordinator will do nothing.
|
||||||
@@ -54,13 +54,13 @@ disputes = []
|
|||||||
subsystem-benchmarks = []
|
subsystem-benchmarks = []
|
||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
"gum/runtime-benchmarks",
|
"gum/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-subsystem-bench/runtime-benchmarks",
|
"pezkuwi-subsystem-bench/runtime-benchmarks",
|
||||||
"pezsc-keystore/runtime-benchmarks",
|
"pezsc-keystore/runtime-benchmarks",
|
||||||
"pezsp-application-crypto/runtime-benchmarks",
|
"pezsp-application-crypto/runtime-benchmarks",
|
||||||
"pezsp-keyring/runtime-benchmarks",
|
"pezsp-keyring/runtime-benchmarks",
|
||||||
|
|||||||
@@ -59,15 +59,15 @@ criterion = { features = [
|
|||||||
pezkuwi-node-core-pvf-common = { features = [
|
pezkuwi-node-core-pvf-common = { features = [
|
||||||
"test-utils",
|
"test-utils",
|
||||||
], workspace = true, default-features = true }
|
], workspace = true, default-features = true }
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||||
# For benches and integration tests, depend on ourselves with the test-utils feature.
|
# For benches and integration tests, depend on ourselves with the test-utils feature.
|
||||||
# pezkuwi-node-core-pvf = { features = [
|
pezkuwi-node-core-pvf = { features = [
|
||||||
# "test-utils",
|
"test-utils",
|
||||||
# ], workspace = true, default-features = true }
|
], workspace = true, default-features = true }
|
||||||
# pezkuwichain-runtime = { workspace = true }
|
pezkuwichain-runtime = { workspace = true }
|
||||||
|
|
||||||
# test-teyrchain-adder = { workspace = true }
|
test-teyrchain-adder = { workspace = true }
|
||||||
# test-teyrchain-halt = { workspace = true }
|
test-teyrchain-halt = { workspace = true }
|
||||||
|
|
||||||
[target.'cfg(target_os = "linux")'.dev-dependencies]
|
[target.'cfg(target_os = "linux")'.dev-dependencies]
|
||||||
libc = { workspace = true }
|
libc = { workspace = true }
|
||||||
@@ -90,17 +90,17 @@ runtime-benchmarks = [
|
|||||||
"pezkuwi-node-core-pvf-common/runtime-benchmarks",
|
"pezkuwi-node-core-pvf-common/runtime-benchmarks",
|
||||||
"pezkuwi-node-core-pvf-execute-worker?/runtime-benchmarks",
|
"pezkuwi-node-core-pvf-execute-worker?/runtime-benchmarks",
|
||||||
"pezkuwi-node-core-pvf-prepare-worker?/runtime-benchmarks",
|
"pezkuwi-node-core-pvf-prepare-worker?/runtime-benchmarks",
|
||||||
# "pezkuwi-node-core-pvf/runtime-benchmarks",
|
"pezkuwi-node-core-pvf/runtime-benchmarks",
|
||||||
"pezkuwi-node-metrics/runtime-benchmarks",
|
"pezkuwi-node-metrics/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
|
"pezkuwi-teyrchain-primitives/runtime-benchmarks",
|
||||||
# "pezkuwichain-runtime/runtime-benchmarks",
|
"pezkuwichain-runtime/runtime-benchmarks",
|
||||||
"pezsc-sysinfo/runtime-benchmarks",
|
"pezsc-sysinfo/runtime-benchmarks",
|
||||||
"pezsc-tracing/runtime-benchmarks",
|
"pezsc-tracing/runtime-benchmarks",
|
||||||
# "test-teyrchain-adder/runtime-benchmarks",
|
"test-teyrchain-adder/runtime-benchmarks",
|
||||||
]
|
]
|
||||||
std = [
|
std = [
|
||||||
"codec/std",
|
"codec/std",
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ thiserror = { workspace = true }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
futures-timer = { workspace = true }
|
futures-timer = { workspace = true }
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||||
# pezkuwi-primitives-test-helpers = { workspace = true }
|
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||||
# pezkuwi-subsystem-bench = { workspace = true }
|
pezkuwi-subsystem-bench = { workspace = true }
|
||||||
pezsp-keyring = { workspace = true, default-features = true }
|
pezsp-keyring = { workspace = true, default-features = true }
|
||||||
pezsp-tracing = { workspace = true, default-features = true }
|
pezsp-tracing = { workspace = true, default-features = true }
|
||||||
rstest = { workspace = true }
|
rstest = { workspace = true }
|
||||||
@@ -52,13 +52,13 @@ runtime-benchmarks = [
|
|||||||
"gum/runtime-benchmarks",
|
"gum/runtime-benchmarks",
|
||||||
"pezkuwi-erasure-coding/runtime-benchmarks",
|
"pezkuwi-erasure-coding/runtime-benchmarks",
|
||||||
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-subsystem-bench/runtime-benchmarks",
|
"pezkuwi-subsystem-bench/runtime-benchmarks",
|
||||||
"pezsc-network/runtime-benchmarks",
|
"pezsc-network/runtime-benchmarks",
|
||||||
"pezsp-keyring/runtime-benchmarks",
|
"pezsp-keyring/runtime-benchmarks",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ pezsp-core = { workspace = true, default-features = true }
|
|||||||
pezsp-keyring = { workspace = true, default-features = true }
|
pezsp-keyring = { workspace = true, default-features = true }
|
||||||
pezsp-tracing = { workspace = true, default-features = true }
|
pezsp-tracing = { workspace = true, default-features = true }
|
||||||
|
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||||
# pezkuwi-primitives-test-helpers = { workspace = true }
|
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||||
# pezkuwi-subsystem-bench = { workspace = true }
|
pezkuwi-subsystem-bench = { workspace = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
subsystem-benchmarks = []
|
subsystem-benchmarks = []
|
||||||
@@ -56,13 +56,13 @@ runtime-benchmarks = [
|
|||||||
"gum/runtime-benchmarks",
|
"gum/runtime-benchmarks",
|
||||||
"pezkuwi-erasure-coding/runtime-benchmarks",
|
"pezkuwi-erasure-coding/runtime-benchmarks",
|
||||||
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-subsystem-bench/runtime-benchmarks",
|
"pezkuwi-subsystem-bench/runtime-benchmarks",
|
||||||
"pezsc-network/runtime-benchmarks",
|
"pezsc-network/runtime-benchmarks",
|
||||||
"pezsp-keyring/runtime-benchmarks",
|
"pezsp-keyring/runtime-benchmarks",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ rand = { workspace = true, default-features = true }
|
|||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
bitvec = { features = ["alloc"], workspace = true }
|
bitvec = { features = ["alloc"], workspace = true }
|
||||||
maplit = { workspace = true }
|
maplit = { workspace = true }
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||||
pezsp-application-crypto = { workspace = true, default-features = true }
|
pezsp-application-crypto = { workspace = true, default-features = true }
|
||||||
pezsp-authority-discovery = { workspace = true, default-features = true }
|
pezsp-authority-discovery = { workspace = true, default-features = true }
|
||||||
pezsp-core = { workspace = true, default-features = true }
|
pezsp-core = { workspace = true, default-features = true }
|
||||||
@@ -39,7 +39,7 @@ rand_chacha = { workspace = true, default-features = true }
|
|||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
"gum/runtime-benchmarks",
|
"gum/runtime-benchmarks",
|
||||||
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ thiserror = { workspace = true }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
async-channel = { workspace = true }
|
async-channel = { workspace = true }
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||||
pezkuwi-primitives = { workspace = true, features = ["test"] }
|
pezkuwi-primitives = { workspace = true, features = ["test"] }
|
||||||
# pezkuwi-primitives-test-helpers = { workspace = true }
|
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||||
# pezkuwi-subsystem-bench = { workspace = true }
|
pezkuwi-subsystem-bench = { workspace = true }
|
||||||
pezsc-keystore = { workspace = true, default-features = true }
|
pezsc-keystore = { workspace = true, default-features = true }
|
||||||
pezsc-network = { workspace = true, default-features = true }
|
pezsc-network = { workspace = true, default-features = true }
|
||||||
pezsp-application-crypto = { workspace = true, default-features = true }
|
pezsp-application-crypto = { workspace = true, default-features = true }
|
||||||
@@ -55,13 +55,13 @@ subsystem-benchmarks = []
|
|||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
"gum/runtime-benchmarks",
|
"gum/runtime-benchmarks",
|
||||||
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-subsystem-bench/runtime-benchmarks",
|
"pezkuwi-subsystem-bench/runtime-benchmarks",
|
||||||
"pezsc-keystore/runtime-benchmarks",
|
"pezsc-keystore/runtime-benchmarks",
|
||||||
"pezsc-network/runtime-benchmarks",
|
"pezsc-network/runtime-benchmarks",
|
||||||
"pezsp-application-crypto/runtime-benchmarks",
|
"pezsp-application-crypto/runtime-benchmarks",
|
||||||
|
|||||||
@@ -139,9 +139,9 @@ xcm-runtime-pezapis = { workspace = true, default-features = true }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
assert_matches = { workspace = true }
|
assert_matches = { workspace = true }
|
||||||
# pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
pezkuwi-node-subsystem-test-helpers = { workspace = true }
|
||||||
# pezkuwi-primitives-test-helpers = { workspace = true }
|
pezkuwi-primitives-test-helpers = { workspace = true }
|
||||||
# pezkuwi-test-client = { workspace = true }
|
pezkuwi-test-client = { workspace = true }
|
||||||
pezsp-tracing = { workspace = true }
|
pezsp-tracing = { workspace = true }
|
||||||
tempfile = { workspace = true }
|
tempfile = { workspace = true }
|
||||||
|
|
||||||
@@ -229,18 +229,18 @@ runtime-benchmarks = [
|
|||||||
"pezkuwi-node-core-runtime-api?/runtime-benchmarks",
|
"pezkuwi-node-core-runtime-api?/runtime-benchmarks",
|
||||||
"pezkuwi-node-core-teyrchains-inherent/runtime-benchmarks",
|
"pezkuwi-node-core-teyrchains-inherent/runtime-benchmarks",
|
||||||
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
"pezkuwi-node-network-protocol/runtime-benchmarks",
|
||||||
# "pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
"pezkuwi-node-subsystem-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-types/runtime-benchmarks",
|
"pezkuwi-node-subsystem-types/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
"pezkuwi-node-subsystem-util/runtime-benchmarks",
|
||||||
"pezkuwi-node-subsystem/runtime-benchmarks",
|
"pezkuwi-node-subsystem/runtime-benchmarks",
|
||||||
"pezkuwi-overseer/runtime-benchmarks",
|
"pezkuwi-overseer/runtime-benchmarks",
|
||||||
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
"pezkuwi-pez-node-primitives/runtime-benchmarks",
|
||||||
# "pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
"pezkuwi-primitives-test-helpers/runtime-benchmarks",
|
||||||
"pezkuwi-primitives/runtime-benchmarks",
|
"pezkuwi-primitives/runtime-benchmarks",
|
||||||
"pezkuwi-rpc/runtime-benchmarks",
|
"pezkuwi-rpc/runtime-benchmarks",
|
||||||
"pezkuwi-runtime-teyrchains/runtime-benchmarks",
|
"pezkuwi-runtime-teyrchains/runtime-benchmarks",
|
||||||
"pezkuwi-statement-distribution?/runtime-benchmarks",
|
"pezkuwi-statement-distribution?/runtime-benchmarks",
|
||||||
# "pezkuwi-test-client/runtime-benchmarks",
|
"pezkuwi-test-client/runtime-benchmarks",
|
||||||
"pezkuwichain-runtime-constants?/runtime-benchmarks",
|
"pezkuwichain-runtime-constants?/runtime-benchmarks",
|
||||||
"pezkuwichain-runtime?/runtime-benchmarks",
|
"pezkuwichain-runtime?/runtime-benchmarks",
|
||||||
"pezmmr-gadget/runtime-benchmarks",
|
"pezmmr-gadget/runtime-benchmarks",
|
||||||
|
|||||||
@@ -163,11 +163,8 @@ where
|
|||||||
.build(),
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let grandpa_hard_forks = if config.chain_spec.is_dicle() {
|
let grandpa_hard_forks =
|
||||||
grandpa_support::dicle_hard_forks()
|
if config.chain_spec.is_dicle() { grandpa_support::dicle_hard_forks() } else { Vec::new() };
|
||||||
} else {
|
|
||||||
Vec::new()
|
|
||||||
};
|
|
||||||
|
|
||||||
let (grandpa_block_import, grandpa_link) =
|
let (grandpa_block_import, grandpa_link) =
|
||||||
pezsc_consensus_grandpa::block_import_with_authority_set_hard_forks(
|
pezsc_consensus_grandpa::block_import_with_authority_set_hard_forks(
|
||||||
|
|||||||
@@ -17,8 +17,7 @@
|
|||||||
mod mock;
|
mod mock;
|
||||||
|
|
||||||
use mock::{
|
use mock::{
|
||||||
dicle_like_with_balances, AccountId, Balance, Balances, BaseXcmWeight, System, XcmConfig,
|
dicle_like_with_balances, AccountId, Balance, Balances, BaseXcmWeight, System, XcmConfig, CENTS,
|
||||||
CENTS,
|
|
||||||
};
|
};
|
||||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||||
use pezsp_runtime::traits::AccountIdConversion;
|
use pezsp_runtime::traits::AccountIdConversion;
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ use crate::{
|
|||||||
RuntimeOrigin, TeyrchainInfo, TeyrchainSystem, WeightToFee, XcmpQueue,
|
RuntimeOrigin, TeyrchainInfo, TeyrchainSystem, WeightToFee, XcmpQueue,
|
||||||
};
|
};
|
||||||
|
|
||||||
use pezkuwi_sdk::{pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder, pezstaging_xcm_executor as xcm_executor, *};
|
use pezkuwi_sdk::{
|
||||||
|
pezstaging_xcm as xcm, pezstaging_xcm_builder as xcm_builder,
|
||||||
|
pezstaging_xcm_executor as xcm_executor, *,
|
||||||
|
};
|
||||||
|
|
||||||
use pezframe_support::traits::Disabled;
|
use pezframe_support::traits::Disabled;
|
||||||
use pezframe_support::{
|
use pezframe_support::{
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ extern crate alloc;
|
|||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use smallvec::smallvec;
|
use smallvec::smallvec;
|
||||||
|
|
||||||
use pezkuwi_sdk::{pezstaging_teyrchain_info as teyrchain_info, *};
|
|
||||||
use pezframe_support::construct_runtime;
|
use pezframe_support::construct_runtime;
|
||||||
|
use pezkuwi_sdk::{pezstaging_teyrchain_info as teyrchain_info, *};
|
||||||
|
|
||||||
use pezsp_runtime::{
|
use pezsp_runtime::{
|
||||||
generic, impl_opaque_keys,
|
generic, impl_opaque_keys,
|
||||||
|
|||||||
+7
-1888
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user