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,104 @@
|
||||
// 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.
|
||||
|
||||
use crate::{
|
||||
unsigned::{miner::OffchainWorkerMiner, Call, Config, Pallet},
|
||||
verifier::Verifier,
|
||||
CurrentPhase, Phase,
|
||||
};
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_election_provider_support::ElectionProvider;
|
||||
use pezframe_support::{assert_ok, pezpallet_prelude::*};
|
||||
use pezframe_system::RawOrigin;
|
||||
use pezsp_std::boxed::Box;
|
||||
|
||||
#[benchmarks(where T: crate::Config + crate::signed::Config + crate::verifier::Config)]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
|
||||
#[benchmark(pov_mode = Measured)]
|
||||
fn validate_unsigned() -> Result<(), BenchmarkError> {
|
||||
#[cfg(test)]
|
||||
crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value());
|
||||
crate::Pallet::<T>::start().unwrap();
|
||||
|
||||
crate::Pallet::<T>::roll_until_matches(|| {
|
||||
matches!(CurrentPhase::<T>::get(), Phase::Unsigned(_))
|
||||
});
|
||||
let call: Call<T> = OffchainWorkerMiner::<T>::mine_solution(T::MinerPages::get(), false)
|
||||
.map(|solution| Call::submit_unsigned { paged_solution: Box::new(solution) })
|
||||
.unwrap();
|
||||
|
||||
#[block]
|
||||
{
|
||||
assert_ok!(Pallet::<T>::validate_unsigned(TransactionSource::Local, &call));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark(pov_mode = Measured)]
|
||||
fn submit_unsigned() -> Result<(), BenchmarkError> {
|
||||
#[cfg(test)]
|
||||
crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value());
|
||||
crate::Pallet::<T>::start().unwrap();
|
||||
|
||||
// roll to unsigned phase open
|
||||
crate::Pallet::<T>::roll_until_matches(|| {
|
||||
matches!(CurrentPhase::<T>::get(), Phase::Unsigned(_))
|
||||
});
|
||||
// TODO: we need to better ensure that this is actually worst case
|
||||
let solution =
|
||||
OffchainWorkerMiner::<T>::mine_solution(T::MinerPages::get(), false).unwrap();
|
||||
|
||||
// nothing is queued
|
||||
assert!(T::Verifier::queued_score().is_none());
|
||||
#[block]
|
||||
{
|
||||
assert_ok!(Pallet::<T>::submit_unsigned(RawOrigin::None.into(), Box::new(solution)));
|
||||
}
|
||||
|
||||
// something is queued
|
||||
assert!(T::Verifier::queued_score().is_some());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark(extra, pov_mode = Measured)]
|
||||
fn mine_solution(p: Linear<1, { T::Pages::get() }>) -> Result<(), BenchmarkError> {
|
||||
#[cfg(test)]
|
||||
crate::mock::ElectionStart::set(pezsp_runtime::traits::Bounded::max_value());
|
||||
crate::Pallet::<T>::start().unwrap();
|
||||
|
||||
// roll to unsigned phase open
|
||||
crate::Pallet::<T>::roll_until_matches(|| {
|
||||
matches!(CurrentPhase::<T>::get(), Phase::Unsigned(_))
|
||||
});
|
||||
|
||||
#[block]
|
||||
{
|
||||
OffchainWorkerMiner::<T>::mine_solution(p, true).unwrap();
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite!(
|
||||
Pallet,
|
||||
crate::mock::ExtBuilder::full().build_unchecked(),
|
||||
crate::mock::Runtime
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user