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:
@@ -18,21 +18,21 @@
|
||||
|
||||
#![cfg(feature = "runtime-benchmarks")]
|
||||
use super::{Pallet as Auctions, *};
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
assert_ok,
|
||||
traits::{EnsureOrigin, OnInitialize},
|
||||
};
|
||||
use frame_system::RawOrigin;
|
||||
use pezframe_system::RawOrigin;
|
||||
use pezkuwi_runtime_teyrchains::paras;
|
||||
use sp_runtime::{traits::Bounded, SaturatedConversion};
|
||||
use pezsp_runtime::{traits::Bounded, SaturatedConversion};
|
||||
|
||||
use frame_benchmarking::v2::*;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
|
||||
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
|
||||
let events = frame_system::Pallet::<T>::events();
|
||||
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
|
||||
let events = pezframe_system::Pallet::<T>::events();
|
||||
let system_event: <T as pezframe_system::Config>::RuntimeEvent = generic_event.into();
|
||||
// compare to the last event record
|
||||
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
|
||||
let pezframe_system::EventRecord { event, .. } = &events[events.len() - 1];
|
||||
assert_eq!(event, &system_event);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ fn fill_winners<T: Config + paras::Config>(lease_period_index: LeasePeriodOf<T>)
|
||||
.is_ok());
|
||||
}
|
||||
assert_ok!(paras::Pallet::<T>::add_trusted_validation_code(
|
||||
frame_system::Origin::<T>::Root.into(),
|
||||
pezframe_system::Origin::<T>::Root.into(),
|
||||
T::Registrar::worst_validation_code(),
|
||||
));
|
||||
|
||||
@@ -81,7 +81,7 @@ fn fill_winners<T: Config + paras::Config>(lease_period_index: LeasePeriodOf<T>)
|
||||
}
|
||||
|
||||
#[benchmarks(
|
||||
where T: pallet_babe::Config + paras::Config,
|
||||
where T: pezpallet_babe::Config + paras::Config,
|
||||
)]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
@@ -113,7 +113,7 @@ mod benchmarks {
|
||||
fn bid() -> Result<(), BenchmarkError> {
|
||||
// If there is an offset, we need to be on that block to be able to do lease things.
|
||||
let (_, offset) = T::Leaser::lease_period_length();
|
||||
frame_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
pezframe_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
|
||||
// Create a new auction
|
||||
let duration = BlockNumberFor::<T>::max_value();
|
||||
@@ -138,7 +138,7 @@ mod benchmarks {
|
||||
)?;
|
||||
T::Registrar::register(owner, new_para, worst_head_data, worst_validation_code.clone())?;
|
||||
assert_ok!(paras::Pallet::<T>::add_trusted_validation_code(
|
||||
frame_system::Origin::<T>::Root.into(),
|
||||
pezframe_system::Origin::<T>::Root.into(),
|
||||
worst_validation_code,
|
||||
));
|
||||
|
||||
@@ -188,12 +188,12 @@ mod benchmarks {
|
||||
fn on_initialize() -> Result<(), BenchmarkError> {
|
||||
// If there is an offset, we need to be on that block to be able to do lease things.
|
||||
let (lease_length, offset) = T::Leaser::lease_period_length();
|
||||
frame_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
pezframe_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
|
||||
// Create a new auction
|
||||
let duration: BlockNumberFor<T> = lease_length / 2u32.into();
|
||||
let lease_period_index = LeasePeriodOf::<T>::zero();
|
||||
let now = frame_system::Pallet::<T>::block_number();
|
||||
let now = pezframe_system::Pallet::<T>::block_number();
|
||||
let origin = T::InitiateOrigin::try_successful_origin()
|
||||
.expect("InitiateOrigin has no successful origin required for the benchmark");
|
||||
Auctions::<T>::new_auction(origin, duration, lease_period_index)?;
|
||||
@@ -211,16 +211,16 @@ mod benchmarks {
|
||||
}
|
||||
|
||||
// Move ahead to the block we want to initialize
|
||||
frame_system::Pallet::<T>::set_block_number(duration + now + T::EndingPeriod::get());
|
||||
pezframe_system::Pallet::<T>::set_block_number(duration + now + T::EndingPeriod::get());
|
||||
|
||||
// Trigger epoch change for new random number value:
|
||||
{
|
||||
pallet_babe::EpochStart::<T>::set((Zero::zero(), u32::MAX.into()));
|
||||
pallet_babe::Pallet::<T>::on_initialize(duration + now + T::EndingPeriod::get());
|
||||
let authorities = pallet_babe::Pallet::<T>::authorities();
|
||||
pezpallet_babe::EpochStart::<T>::set((Zero::zero(), u32::MAX.into()));
|
||||
pezpallet_babe::Pallet::<T>::on_initialize(duration + now + T::EndingPeriod::get());
|
||||
let authorities = pezpallet_babe::Pallet::<T>::authorities();
|
||||
// Check for non empty authority set since it otherwise emits a No-OP warning.
|
||||
if !authorities.is_empty() {
|
||||
pallet_babe::Pallet::<T>::enact_epoch_change(
|
||||
pezpallet_babe::Pallet::<T>::enact_epoch_change(
|
||||
authorities.clone(),
|
||||
authorities,
|
||||
None,
|
||||
@@ -245,7 +245,7 @@ mod benchmarks {
|
||||
fn cancel_auction() -> Result<(), BenchmarkError> {
|
||||
// If there is an offset, we need to be on that block to be able to do lease things.
|
||||
let (lease_length, offset) = T::Leaser::lease_period_length();
|
||||
frame_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
pezframe_system::Pallet::<T>::set_block_number(offset + One::one());
|
||||
|
||||
// Create a new auction
|
||||
let duration: BlockNumberFor<T> = lease_length / 2u32.into();
|
||||
|
||||
@@ -19,34 +19,34 @@
|
||||
#[cfg(test)]
|
||||
use super::*;
|
||||
use crate::{auctions, mock::TestRegistrar};
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
assert_ok, derive_impl, ord_parameter_types, parameter_types, traits::EitherOfDiverse,
|
||||
};
|
||||
use frame_system::{EnsureRoot, EnsureSignedBy};
|
||||
use pallet_balances;
|
||||
use pezframe_system::{EnsureRoot, EnsureSignedBy};
|
||||
use pezpallet_balances;
|
||||
use pezkuwi_primitives::{BlockNumber, Id as ParaId};
|
||||
use pezkuwi_primitives_test_helpers::{dummy_head_data, dummy_validation_code};
|
||||
use sp_core::H256;
|
||||
use sp_runtime::{
|
||||
use pezsp_core::H256;
|
||||
use pezsp_runtime::{
|
||||
traits::{BlakeTwo256, IdentityLookup},
|
||||
BuildStorage,
|
||||
};
|
||||
use std::{cell::RefCell, collections::BTreeMap};
|
||||
|
||||
type Block = frame_system::mocking::MockBlockU32<Test>;
|
||||
type Block = pezframe_system::mocking::MockBlockU32<Test>;
|
||||
|
||||
frame_support::construct_runtime!(
|
||||
pezframe_support::construct_runtime!(
|
||||
pub enum Test
|
||||
{
|
||||
System: frame_system,
|
||||
Balances: pallet_balances,
|
||||
System: pezframe_system,
|
||||
Balances: pezpallet_balances,
|
||||
Auctions: auctions,
|
||||
}
|
||||
);
|
||||
|
||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||
impl frame_system::Config for Test {
|
||||
type BaseCallFilter = frame_support::traits::Everything;
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
impl pezframe_system::Config for Test {
|
||||
type BaseCallFilter = pezframe_support::traits::Everything;
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
type DbWeight = ();
|
||||
@@ -61,17 +61,17 @@ impl frame_system::Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Version = ();
|
||||
type PalletInfo = PalletInfo;
|
||||
type AccountData = pallet_balances::AccountData<u64>;
|
||||
type AccountData = pezpallet_balances::AccountData<u64>;
|
||||
type OnNewAccount = ();
|
||||
type OnKilledAccount = ();
|
||||
type SystemWeightInfo = ();
|
||||
type SS58Prefix = ();
|
||||
type OnSetCode = ();
|
||||
type MaxConsumers = frame_support::traits::ConstU32<16>;
|
||||
type MaxConsumers = pezframe_support::traits::ConstU32<16>;
|
||||
}
|
||||
|
||||
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pallet_balances::Config for Test {
|
||||
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
|
||||
impl pezpallet_balances::Config for Test {
|
||||
type AccountStore = System;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ impl Randomness<H256, BlockNumber> for TestPastRandomness {
|
||||
if let Some((output, known_since)) = &*p.borrow() {
|
||||
(*output, *known_since)
|
||||
} else {
|
||||
(H256::zero(), frame_system::Pallet::<Test>::block_number())
|
||||
(H256::zero(), pezframe_system::Pallet::<Test>::block_number())
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -206,15 +206,15 @@ impl Config for Test {
|
||||
|
||||
// This function basically just builds a genesis storage key/value store according to
|
||||
// our desired mock up.
|
||||
pub fn new_test_ext() -> sp_io::TestExternalities {
|
||||
let mut t = frame_system::GenesisConfig::<Test>::default().build_storage().unwrap();
|
||||
pallet_balances::GenesisConfig::<Test> {
|
||||
pub fn new_test_ext() -> pezsp_io::TestExternalities {
|
||||
let mut t = pezframe_system::GenesisConfig::<Test>::default().build_storage().unwrap();
|
||||
pezpallet_balances::GenesisConfig::<Test> {
|
||||
balances: vec![(1, 10), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)],
|
||||
..Default::default()
|
||||
}
|
||||
.assimilate_storage(&mut t)
|
||||
.unwrap();
|
||||
let mut ext: sp_io::TestExternalities = t.into();
|
||||
let mut ext: pezsp_io::TestExternalities = t.into();
|
||||
ext.execute_with(|| {
|
||||
// Register para 0, 1, 2, and 3 for tests
|
||||
assert_ok!(TestRegistrar::<Test>::register(
|
||||
|
||||
@@ -25,20 +25,20 @@ use crate::{
|
||||
use alloc::{vec, vec::Vec};
|
||||
use codec::Decode;
|
||||
use core::mem::swap;
|
||||
use frame_support::{
|
||||
use pezframe_support::{
|
||||
dispatch::DispatchResult,
|
||||
ensure,
|
||||
traits::{Currency, Get, Randomness, ReservableCurrency},
|
||||
weights::Weight,
|
||||
};
|
||||
use frame_system::pallet_prelude::BlockNumberFor;
|
||||
use pezframe_system::pezpallet_prelude::BlockNumberFor;
|
||||
pub use pallet::*;
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use sp_runtime::traits::{CheckedSub, One, Saturating, Zero};
|
||||
use pezsp_runtime::traits::{CheckedSub, One, Saturating, Zero};
|
||||
|
||||
type CurrencyOf<T> = <<T as Config>::Leaser as Leaser<BlockNumberFor<T>>>::Currency;
|
||||
type BalanceOf<T> = <<<T as Config>::Leaser as Leaser<BlockNumberFor<T>>>::Currency as Currency<
|
||||
<T as frame_system::Config>::AccountId,
|
||||
<T as pezframe_system::Config>::AccountId,
|
||||
>>::Balance;
|
||||
|
||||
pub trait WeightInfo {
|
||||
@@ -70,28 +70,28 @@ pub type AuctionIndex = u32;
|
||||
type LeasePeriodOf<T> = <<T as Config>::Leaser as Leaser<BlockNumberFor<T>>>::LeasePeriod;
|
||||
|
||||
// Winning data type. This encodes the top bidders of each range together with their bid.
|
||||
type WinningData<T> = [Option<(<T as frame_system::Config>::AccountId, ParaId, BalanceOf<T>)>;
|
||||
type WinningData<T> = [Option<(<T as pezframe_system::Config>::AccountId, ParaId, BalanceOf<T>)>;
|
||||
SlotRange::SLOT_RANGE_COUNT];
|
||||
// Winners data type. This encodes each of the final winners of a teyrchain auction, the teyrchain
|
||||
// index assigned to them, their winning bid and the range that they won.
|
||||
type WinnersData<T> =
|
||||
Vec<(<T as frame_system::Config>::AccountId, ParaId, BalanceOf<T>, SlotRange)>;
|
||||
Vec<(<T as pezframe_system::Config>::AccountId, ParaId, BalanceOf<T>, SlotRange)>;
|
||||
|
||||
#[frame_support::pallet]
|
||||
#[pezframe_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::{dispatch::DispatchClass, pallet_prelude::*, traits::EnsureOrigin};
|
||||
use frame_system::{ensure_root, ensure_signed, pallet_prelude::*};
|
||||
use pezframe_support::{dispatch::DispatchClass, pezpallet_prelude::*, traits::EnsureOrigin};
|
||||
use pezframe_system::{ensure_root, ensure_signed, pezpallet_prelude::*};
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
/// The module's configuration trait.
|
||||
#[pallet::config]
|
||||
pub trait Config: frame_system::Config {
|
||||
pub trait Config: pezframe_system::Config {
|
||||
/// The overarching event type.
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
|
||||
/// The type representing the leasing system.
|
||||
type Leaser: Leaser<
|
||||
@@ -373,7 +373,7 @@ impl<T: Config> Auctioneer<BlockNumberFor<T>> for Pallet<T> {
|
||||
|
||||
impl<T: Config> Pallet<T> {
|
||||
// A trick to allow me to initialize large arrays with nothing in them.
|
||||
const EMPTY: Option<(<T as frame_system::Config>::AccountId, ParaId, BalanceOf<T>)> = None;
|
||||
const EMPTY: Option<(<T as pezframe_system::Config>::AccountId, ParaId, BalanceOf<T>)> = None;
|
||||
|
||||
/// Create a new auction.
|
||||
///
|
||||
@@ -386,7 +386,7 @@ impl<T: Config> Pallet<T> {
|
||||
) -> DispatchResult {
|
||||
let maybe_auction = AuctionInfo::<T>::get();
|
||||
ensure!(maybe_auction.is_none(), Error::<T>::AuctionInProgress);
|
||||
let now = frame_system::Pallet::<T>::block_number();
|
||||
let now = pezframe_system::Pallet::<T>::block_number();
|
||||
if let Some((current_lease_period, _)) = T::Leaser::lease_period_index(now) {
|
||||
// If there is no active lease period, then we don't need to make this check.
|
||||
ensure!(lease_period_index >= current_lease_period, Error::<T>::LeasePeriodInPast);
|
||||
@@ -399,7 +399,7 @@ impl<T: Config> Pallet<T> {
|
||||
});
|
||||
|
||||
// Set the information.
|
||||
let ending = frame_system::Pallet::<T>::block_number().saturating_add(duration);
|
||||
let ending = pezframe_system::Pallet::<T>::block_number().saturating_add(duration);
|
||||
AuctionInfo::<T>::put((lease_period_index, ending));
|
||||
|
||||
Self::deposit_event(Event::<T>::AuctionStarted {
|
||||
@@ -435,7 +435,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
// Get the auction status and the current sample block. For the starting period, the sample
|
||||
// block is zero.
|
||||
let auction_status = Self::auction_status(frame_system::Pallet::<T>::block_number());
|
||||
let auction_status = Self::auction_status(pezframe_system::Pallet::<T>::block_number());
|
||||
// The offset into the ending samples of the auction.
|
||||
let offset = match auction_status {
|
||||
AuctionStatus::NotStarted => return Err(Error::<T>::AuctionEnded.into()),
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#[cfg(test)]
|
||||
use super::*;
|
||||
use crate::{auctions::mock::*, mock::TestRegistrar};
|
||||
use frame_support::{assert_noop, assert_ok, assert_storage_noop};
|
||||
use pallet_balances;
|
||||
use pezframe_support::{assert_noop, assert_ok, assert_storage_noop};
|
||||
use pezpallet_balances;
|
||||
use pezkuwi_primitives::Id as ParaId;
|
||||
use pezkuwi_primitives_test_helpers::{dummy_hash, dummy_head_data, dummy_validation_code};
|
||||
use sp_core::H256;
|
||||
use sp_runtime::DispatchError::BadOrigin;
|
||||
use pezsp_core::H256;
|
||||
use pezsp_runtime::DispatchError::BadOrigin;
|
||||
|
||||
#[test]
|
||||
fn basic_setup_works() {
|
||||
@@ -525,7 +525,7 @@ fn lower_bids_are_correctly_refunded() {
|
||||
#[test]
|
||||
fn initialize_winners_in_ending_period_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let ed: u64 = <Test as pallet_balances::Config>::ExistentialDeposit::get();
|
||||
let ed: u64 = <Test as pezpallet_balances::Config>::ExistentialDeposit::get();
|
||||
assert_eq!(ed, 1);
|
||||
System::run_to_block::<AllPalletsWithSystem>(1);
|
||||
assert_ok!(Auctions::new_auction(RuntimeOrigin::signed(6), 9, 1));
|
||||
@@ -639,7 +639,7 @@ fn handle_bid_checks_existing_lease_periods() {
|
||||
#[test]
|
||||
fn less_winning_samples_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let ed: u64 = <Test as pallet_balances::Config>::ExistentialDeposit::get();
|
||||
let ed: u64 = <Test as pezpallet_balances::Config>::ExistentialDeposit::get();
|
||||
assert_eq!(ed, 1);
|
||||
EndingPeriod::set(30);
|
||||
SampleLength::set(10);
|
||||
|
||||
Reference in New Issue
Block a user