feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
[package]
|
||||
name = "pezpallet-example-tasks"
|
||||
version = "1.0.0"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
repository.workspace = true
|
||||
description = "Pallet to demonstrate the usage of Tasks to recognize and execute service work"
|
||||
publish = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { workspace = true }
|
||||
log = { workspace = true }
|
||||
scale-info = { features = ["derive"], workspace = true }
|
||||
|
||||
pezframe-support = { workspace = true }
|
||||
pezframe-system = { workspace = true }
|
||||
|
||||
pezsp-core = { workspace = true }
|
||||
pezsp-io = { workspace = true }
|
||||
pezsp-runtime = { workspace = true }
|
||||
|
||||
pezframe-benchmarking = { optional = true, workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"codec/std",
|
||||
"pezframe-benchmarking?/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
"log/std",
|
||||
"scale-info/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-io/std",
|
||||
"pezsp-runtime/std",
|
||||
]
|
||||
runtime-benchmarks = [
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezsp-io/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
]
|
||||
try-runtime = [
|
||||
"pezframe-support/try-runtime",
|
||||
"pezframe-system/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
experimental = ["pezframe-support/experimental", "pezframe-system/experimental"]
|
||||
@@ -0,0 +1,42 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// 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.
|
||||
|
||||
//! Benchmarking for `pezpallet-example-tasks`.
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
|
||||
use crate::*;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
|
||||
#[benchmarks]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
|
||||
#[benchmark]
|
||||
fn add_number_into_total() {
|
||||
Numbers::<T>::insert(0, 1);
|
||||
|
||||
#[block]
|
||||
{
|
||||
Task::<T>::add_number_into_total(0).unwrap();
|
||||
}
|
||||
|
||||
assert_eq!(Numbers::<T>::get(0), None);
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::mock::Runtime);
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// 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.
|
||||
|
||||
//! This pallet demonstrates the use of the `pallet::task` api for service work.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use pezframe_support::dispatch::DispatchResult;
|
||||
use pezframe_system::offchain::CreateBare;
|
||||
#[cfg(feature = "experimental")]
|
||||
use pezframe_system::offchain::SubmitTransaction;
|
||||
// Re-export pallet items so that they can be accessed from the crate namespace.
|
||||
pub use pallet::*;
|
||||
|
||||
pub mod mock;
|
||||
pub mod tests;
|
||||
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
mod benchmarking;
|
||||
|
||||
pub mod weights;
|
||||
pub use weights::*;
|
||||
|
||||
#[cfg(feature = "experimental")]
|
||||
const LOG_TARGET: &str = "pezpallet-example-tasks";
|
||||
|
||||
#[pezframe_support::pallet(dev_mode)]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
#[pallet::error]
|
||||
pub enum Error<T> {
|
||||
/// The referenced task was not found.
|
||||
NotFound,
|
||||
}
|
||||
|
||||
#[pallet::tasks_experimental]
|
||||
impl<T: Config> Pallet<T> {
|
||||
/// Add a pair of numbers into the totals and remove them.
|
||||
#[pallet::task_list(Numbers::<T>::iter_keys())]
|
||||
#[pallet::task_condition(|i| Numbers::<T>::contains_key(i))]
|
||||
#[pallet::task_weight(T::WeightInfo::add_number_into_total())]
|
||||
#[pallet::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(())
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
|
||||
#[cfg(feature = "experimental")]
|
||||
fn offchain_worker(_block_number: BlockNumberFor<T>) {
|
||||
if let Some(key) = Numbers::<T>::iter_keys().next() {
|
||||
// Create a valid task
|
||||
let task = Task::<T>::AddNumberIntoTotal { i: key };
|
||||
let runtime_task = <T as Config>::RuntimeTask::from(task);
|
||||
let call = pezframe_system::Call::<T>::do_task { task: runtime_task.into() };
|
||||
|
||||
// Submit the task as an unsigned transaction
|
||||
let xt = <T as CreateBare<pezframe_system::Call<T>>>::create_bare(call.into());
|
||||
let res = SubmitTransaction::<T, pezframe_system::Call<T>>::submit_transaction(xt);
|
||||
match res {
|
||||
Ok(_) => log::info!(target: LOG_TARGET, "Submitted the task."),
|
||||
Err(e) => log::error!(target: LOG_TARGET, "Error submitting task: {:?}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "experimental"))]
|
||||
fn offchain_worker(_block_number: BlockNumberFor<T>) {}
|
||||
}
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: CreateBare<pezframe_system::Call<Self>> + pezframe_system::Config {
|
||||
type RuntimeTask: pezframe_support::traits::Task
|
||||
+ IsType<<Self as pezframe_system::Config>::RuntimeTask>
|
||||
+ From<Task<Self>>;
|
||||
type WeightInfo: WeightInfo;
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
/// Some running total.
|
||||
#[pallet::storage]
|
||||
pub type Total<T: Config> = StorageValue<_, (u32, u32), ValueQuery>;
|
||||
|
||||
/// Numbers to be added into the total.
|
||||
#[pallet::storage]
|
||||
pub type Numbers<T: Config> = StorageMap<_, Twox64Concat, u32, u32, OptionQuery>;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// 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.
|
||||
|
||||
//! Mock runtime for `tasks-example` tests.
|
||||
#![cfg(test)]
|
||||
|
||||
use crate::{self as pezpallet_example_tasks};
|
||||
use pezframe_support::derive_impl;
|
||||
use pezsp_runtime::testing::TestXt;
|
||||
|
||||
pub type AccountId = u32;
|
||||
pub type Balance = u32;
|
||||
|
||||
type Block = pezframe_system::mocking::MockBlock<Runtime>;
|
||||
pezframe_support::construct_runtime!(
|
||||
pub enum Runtime {
|
||||
System: pezframe_system,
|
||||
TasksExample: pezpallet_example_tasks,
|
||||
}
|
||||
);
|
||||
|
||||
pub type Extrinsic = TestXt<RuntimeCall, ()>;
|
||||
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
impl pezframe_system::Config for Runtime {
|
||||
type Block = Block;
|
||||
}
|
||||
|
||||
impl<LocalCall> pezframe_system::offchain::CreateTransactionBase<LocalCall> for Runtime
|
||||
where
|
||||
RuntimeCall: From<LocalCall>,
|
||||
{
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type Extrinsic = Extrinsic;
|
||||
}
|
||||
|
||||
impl<LocalCall> pezframe_system::offchain::CreateBare<LocalCall> for Runtime
|
||||
where
|
||||
RuntimeCall: From<LocalCall>,
|
||||
{
|
||||
fn create_bare(call: Self::RuntimeCall) -> Self::Extrinsic {
|
||||
Extrinsic::new_bare(call)
|
||||
}
|
||||
}
|
||||
|
||||
impl pezpallet_example_tasks::Config for Runtime {
|
||||
type RuntimeTask = RuntimeTask;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
pub fn advance_to(b: u64) {
|
||||
#[cfg(feature = "experimental")]
|
||||
use pezframe_support::traits::Hooks;
|
||||
while System::block_number() < b {
|
||||
System::set_block_number(System::block_number() + 1);
|
||||
#[cfg(feature = "experimental")]
|
||||
TasksExample::offchain_worker(System::block_number());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// 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.
|
||||
|
||||
//! Tests for `pezpallet-example-tasks`.
|
||||
#![cfg(test)]
|
||||
|
||||
use crate::{mock::*, Numbers};
|
||||
#[cfg(feature = "experimental")]
|
||||
use codec::Decode;
|
||||
use pezframe_support::traits::Task;
|
||||
#[cfg(feature = "experimental")]
|
||||
use pezsp_core::offchain::{testing, OffchainWorkerExt, TransactionPoolExt};
|
||||
use pezsp_runtime::BuildStorage;
|
||||
|
||||
#[cfg(feature = "experimental")]
|
||||
use pezframe_support::{assert_noop, assert_ok};
|
||||
|
||||
// This function basically just builds a genesis storage key/value store according to
|
||||
// our desired mockup.
|
||||
pub fn new_test_ext() -> pezsp_io::TestExternalities {
|
||||
let t = RuntimeGenesisConfig {
|
||||
// We use default for brevity, but you can configure as desired if needed.
|
||||
system: Default::default(),
|
||||
}
|
||||
.build_storage()
|
||||
.unwrap();
|
||||
t.into()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn task_enumerate_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
Numbers::<Runtime>::insert(0, 1);
|
||||
assert_eq!(crate::pallet::Task::<Runtime>::iter().collect::<Vec<_>>().len(), 1);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn runtime_task_enumerate_works_via_pezframe_system_config() {
|
||||
new_test_ext().execute_with(|| {
|
||||
Numbers::<Runtime>::insert(0, 1);
|
||||
Numbers::<Runtime>::insert(1, 4);
|
||||
assert_eq!(
|
||||
<Runtime as pezframe_system::Config>::RuntimeTask::iter().collect::<Vec<_>>().len(),
|
||||
2
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn runtime_task_enumerate_works_via_pallet_config() {
|
||||
new_test_ext().execute_with(|| {
|
||||
Numbers::<Runtime>::insert(1, 4);
|
||||
assert_eq!(
|
||||
<Runtime as crate::pallet::Config>::RuntimeTask::iter()
|
||||
.collect::<Vec<_>>()
|
||||
.len(),
|
||||
1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn task_index_works_at_pallet_level() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(crate::pallet::Task::<Runtime>::AddNumberIntoTotal { i: 2u32 }.task_index(), 0);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn task_index_works_at_runtime_level() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_eq!(
|
||||
<Runtime as pezframe_system::Config>::RuntimeTask::TasksExample(crate::pallet::Task::<
|
||||
Runtime,
|
||||
>::AddNumberIntoTotal {
|
||||
i: 1u32
|
||||
})
|
||||
.task_index(),
|
||||
0
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "experimental")]
|
||||
#[test]
|
||||
fn task_execution_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
System::set_block_number(1);
|
||||
Numbers::<Runtime>::insert(0, 1);
|
||||
Numbers::<Runtime>::insert(1, 4);
|
||||
|
||||
let task =
|
||||
<Runtime as pezframe_system::Config>::RuntimeTask::TasksExample(crate::pallet::Task::<
|
||||
Runtime,
|
||||
>::AddNumberIntoTotal {
|
||||
i: 1u32,
|
||||
});
|
||||
assert_ok!(System::do_task(RuntimeOrigin::signed(1), task.clone(),));
|
||||
assert_eq!(Numbers::<Runtime>::get(0), Some(1));
|
||||
assert_eq!(Numbers::<Runtime>::get(1), None);
|
||||
assert_eq!(crate::Total::<Runtime>::get(), (1, 4));
|
||||
System::assert_last_event(pezframe_system::Event::<Runtime>::TaskCompleted { task }.into());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "experimental")]
|
||||
#[test]
|
||||
fn task_execution_fails_for_invalid_task() {
|
||||
new_test_ext().execute_with(|| {
|
||||
Numbers::<Runtime>::insert(1, 4);
|
||||
assert_noop!(
|
||||
System::do_task(
|
||||
RuntimeOrigin::signed(1),
|
||||
<Runtime as pezframe_system::Config>::RuntimeTask::TasksExample(
|
||||
crate::pallet::Task::<Runtime>::AddNumberIntoTotal { i: 0u32 }
|
||||
),
|
||||
),
|
||||
pezframe_system::Error::<Runtime>::InvalidTask
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "experimental")]
|
||||
#[test]
|
||||
fn task_with_offchain_worker() {
|
||||
let (offchain, _offchain_state) = testing::TestOffchainExt::new();
|
||||
let (pool, pool_state) = testing::TestTransactionPoolExt::new();
|
||||
|
||||
let mut t = pezsp_io::TestExternalities::default();
|
||||
t.register_extension(OffchainWorkerExt::new(offchain));
|
||||
t.register_extension(TransactionPoolExt::new(pool));
|
||||
|
||||
t.execute_with(|| {
|
||||
advance_to(1);
|
||||
assert!(pool_state.read().transactions.is_empty());
|
||||
|
||||
Numbers::<Runtime>::insert(0, 10);
|
||||
assert_eq!(crate::Total::<Runtime>::get(), (0, 0));
|
||||
|
||||
advance_to(2);
|
||||
|
||||
let tx = pool_state.write().transactions.pop().unwrap();
|
||||
assert!(pool_state.read().transactions.is_empty());
|
||||
let tx = Extrinsic::decode(&mut &*tx).unwrap();
|
||||
use pezsp_runtime::traits::ExtrinsicLike;
|
||||
assert!(tx.is_bare());
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// 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.
|
||||
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// 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.
|
||||
|
||||
//! Autogenerated weights for `pezpallet_example_tasks`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0
|
||||
//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! WORST CASE MAP SIZE: `1000000`
|
||||
//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
|
||||
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
|
||||
|
||||
// Executed Command:
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_example_tasks
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/examples/tasks/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --heap-pages=4096
|
||||
// --template=bizinikiwi/.maintain/frame-weight-template.hbs
|
||||
// --no-storage-info
|
||||
// --no-min-squares
|
||||
// --no-median-slopes
|
||||
// --genesis-builder-policy=none
|
||||
// --exclude-pallets=pezpallet_xcm,pezpallet_xcm_benchmarks::fungible,pezpallet_xcm_benchmarks::generic,pezpallet_nomination_pools,pezpallet_remark,pezpallet_transaction_storage,pezpallet_election_provider_multi_block,pezpallet_election_provider_multi_block::signed,pezpallet_election_provider_multi_block::unsigned,pezpallet_election_provider_multi_block::verifier
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
#![allow(missing_docs)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
use pezframe_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for `pezpallet_example_tasks`.
|
||||
pub trait WeightInfo {
|
||||
fn add_number_into_total() -> Weight;
|
||||
}
|
||||
|
||||
/// Weights for `pezpallet_example_tasks` using the Bizinikiwi node and recommended hardware.
|
||||
pub struct BizinikiwiWeight<T>(PhantomData<T>);
|
||||
impl<T: pezframe_system::Config> WeightInfo for BizinikiwiWeight<T> {
|
||||
/// Storage: `TasksExample::Numbers` (r:1 w:1)
|
||||
/// Proof: `TasksExample::Numbers` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `TasksExample::Total` (r:1 w:1)
|
||||
/// Proof: `TasksExample::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
fn add_number_into_total() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3465`
|
||||
// Minimum execution time: 2_861_000 picoseconds.
|
||||
Weight::from_parts(2_984_000, 3465)
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
}
|
||||
}
|
||||
|
||||
// For backwards compatibility and tests.
|
||||
impl WeightInfo for () {
|
||||
/// Storage: `TasksExample::Numbers` (r:1 w:1)
|
||||
/// Proof: `TasksExample::Numbers` (`max_values`: None, `max_size`: None, mode: `Measured`)
|
||||
/// Storage: `TasksExample::Total` (r:1 w:1)
|
||||
/// Proof: `TasksExample::Total` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
|
||||
fn add_number_into_total() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3465`
|
||||
// Minimum execution time: 2_861_000 picoseconds.
|
||||
Weight::from_parts(2_984_000, 3465)
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(2_u64))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user