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:
2025-12-14 00:04:10 +03:00
parent e4778b4576
commit 379cb741ed
9082 changed files with 997824 additions and 997542 deletions
+6 -6
View File
@@ -31,11 +31,11 @@ use bp_messages::{
};
use bp_runtime::{AccountIdOf, HashOf, UnverifiedStorageProofParams};
use codec::Decode;
use frame_benchmarking::{account, v2::*};
use frame_support::weights::Weight;
use frame_system::RawOrigin;
use sp_runtime::{traits::TrailingZeroInput, BoundedVec};
use sp_std::{ops::RangeInclusive, prelude::*};
use pezframe_benchmarking::{account, v2::*};
use pezframe_support::weights::Weight;
use pezframe_system::RawOrigin;
use pezsp_runtime::{traits::TrailingZeroInput, BoundedVec};
use pezsp_std::{ops::RangeInclusive, prelude::*};
const SEED: u32 = 0;
@@ -143,7 +143,7 @@ struct ReceiveMessagesProofSetup<T: Config<I>, I: 'static> {
relayer_id_on_src: AccountIdOf<BridgedChainOf<T, I>>,
relayer_id_on_tgt: T::AccountId,
msgs_count: u32,
_phantom_data: sp_std::marker::PhantomData<I>,
_phantom_data: pezsp_std::marker::PhantomData<I>,
}
impl<T: Config<I>, I: 'static> ReceiveMessagesProofSetup<T, I> {
+12 -12
View File
@@ -24,12 +24,12 @@ use bp_messages::{
UnrewardedRelayerOccupation,
};
use bp_runtime::{AccountIdOf, OwnedBridgeModule};
use frame_support::{dispatch::CallableCallFor, traits::IsSubType};
use sp_runtime::transaction_validity::TransactionValidity;
use pezframe_support::{dispatch::CallableCallFor, traits::IsSubType};
use pezsp_runtime::transaction_validity::TransactionValidity;
/// Helper struct that provides methods for working with a call supported by `MessagesCallInfo`.
pub struct CallHelper<T: Config<I>, I: 'static> {
_phantom_data: sp_std::marker::PhantomData<(T, I)>,
_phantom_data: pezsp_std::marker::PhantomData<(T, I)>,
}
impl<T: Config<I>, I: 'static> CallHelper<T, I> {
@@ -70,7 +70,7 @@ impl<T: Config<I>, I: 'static> CallHelper<T, I> {
}
}
/// Trait representing a call that is a sub type of `pallet_bridge_messages::Call`.
/// Trait representing a call that is a sub type of `pezpallet_bridge_messages::Call`.
pub trait CallSubType<T: Config<I, RuntimeCall = Self>, I: 'static>:
IsSubType<CallableCallFor<Pallet<T, I>, T>>
{
@@ -112,7 +112,7 @@ pub trait CallSubType<T: Config<I, RuntimeCall = Self>, I: 'static>:
impl<
Call: IsSubType<CallableCallFor<Pallet<T, I>, T>>,
T: frame_system::Config<RuntimeCall = Call> + Config<I>,
T: pezframe_system::Config<RuntimeCall = Call> + Config<I>,
I: 'static,
> CallSubType<T, I> for T::RuntimeCall
{
@@ -195,7 +195,7 @@ impl<
"Rejecting messages transaction on halted pallet"
);
return sp_runtime::transaction_validity::InvalidTransaction::Call.into();
return pezsp_runtime::transaction_validity::InvalidTransaction::Call.into();
},
Some(MessagesCallInfo::ReceiveMessagesProof(proof_info))
if proof_info
@@ -207,7 +207,7 @@ impl<
"Rejecting obsolete messages delivery transaction"
);
return sp_runtime::transaction_validity::InvalidTransaction::Stale.into();
return pezsp_runtime::transaction_validity::InvalidTransaction::Stale.into();
},
Some(MessagesCallInfo::ReceiveMessagesDeliveryProof(proof_info))
if proof_info.is_obsolete() =>
@@ -218,12 +218,12 @@ impl<
"Rejecting obsolete messages confirmation transaction"
);
return sp_runtime::transaction_validity::InvalidTransaction::Stale.into();
return pezsp_runtime::transaction_validity::InvalidTransaction::Stale.into();
},
_ => {},
}
Ok(sp_runtime::transaction_validity::ValidTransaction::default())
Ok(pezsp_runtime::transaction_validity::ValidTransaction::default())
}
}
@@ -253,7 +253,7 @@ mod tests {
target_chain::FromBridgedChainMessagesProof, DeliveredMessages, InboundLaneData, LaneState,
OutboundLaneData, UnrewardedRelayer, UnrewardedRelayersState,
};
use sp_std::ops::RangeInclusive;
use pezsp_std::ops::RangeInclusive;
fn fill_unrewarded_relayers() {
let mut inbound_lane_state = InboundLanes::<TestRuntime>::get(test_lane_id()).unwrap();
@@ -296,7 +296,7 @@ mod tests {
RuntimeCall::Messages(crate::Call::<TestRuntime, ()>::receive_messages_proof {
relayer_id_at_bridged_chain: 42,
messages_count: nonces_end.checked_sub(nonces_start).map(|x| x + 1).unwrap_or(0) as u32,
dispatch_weight: frame_support::weights::Weight::zero(),
dispatch_weight: pezframe_support::weights::Weight::zero(),
proof: Box::new(FromBridgedChainMessagesProof {
bridged_header_hash: Default::default(),
storage_proof: Default::default(),
@@ -310,7 +310,7 @@ mod tests {
}
fn run_test<T>(test: impl Fn() -> T) -> T {
sp_io::TestExternalities::new(Default::default()).execute_with(|| {
pezsp_io::TestExternalities::new(Default::default()).execute_with(|| {
InboundLanes::<TestRuntime>::insert(test_lane_id(), InboundLaneData::opened());
OutboundLanes::<TestRuntime>::insert(test_lane_id(), OutboundLaneData::opened());
test()
+4 -4
View File
@@ -26,8 +26,8 @@ use bp_messages::{
use bp_runtime::AccountIdOf;
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
use scale_info::{Type, TypeInfo};
use sp_runtime::RuntimeDebug;
use sp_std::prelude::PartialEq;
use pezsp_runtime::RuntimeDebug;
use pezsp_std::prelude::PartialEq;
/// Inbound lane storage.
pub trait InboundLaneStorage {
@@ -63,7 +63,7 @@ pub struct StoredInboundLaneData<T: Config<I>, I: 'static>(
pub InboundLaneData<AccountIdOf<BridgedChainOf<T, I>>>,
);
impl<T: Config<I>, I: 'static> sp_std::ops::Deref for StoredInboundLaneData<T, I> {
impl<T: Config<I>, I: 'static> pezsp_std::ops::Deref for StoredInboundLaneData<T, I> {
type Target = InboundLaneData<AccountIdOf<BridgedChainOf<T, I>>>;
fn deref(&self) -> &Self::Target {
@@ -71,7 +71,7 @@ impl<T: Config<I>, I: 'static> sp_std::ops::Deref for StoredInboundLaneData<T, I
}
}
impl<T: Config<I>, I: 'static> sp_std::ops::DerefMut for StoredInboundLaneData<T, I> {
impl<T: Config<I>, I: 'static> pezsp_std::ops::DerefMut for StoredInboundLaneData<T, I> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
@@ -26,9 +26,9 @@ use bp_messages::{
};
use bp_runtime::AccountIdOf;
use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use frame_support::{ensure, sp_runtime::RuntimeDebug, PalletError};
use pezframe_support::{ensure, pezsp_runtime::RuntimeDebug, PalletError};
use scale_info::TypeInfo;
use sp_std::marker::PhantomData;
use pezsp_std::marker::PhantomData;
/// Lanes manager errors.
#[derive(
@@ -156,7 +156,7 @@ impl<T: Config<I>, I: 'static> RuntimeInboundLaneStorage<T, I> {
// apart from the explicit closure, the lane may be unable to receive any messages.
// Right now we do an additional check here, but it may be done later (e.g. by
// explicitly closing the lane and reopening it from
// `pallet-xcm-bridge-hub::on-initialize`)
// `pezpallet-xcm-bridge-hub::on-initialize`)
//
// The fact that we only check it here, means that the `MessageDispatch` may switch
// to inactive state during some message dispatch in the middle of message delivery
+16 -16
View File
@@ -69,8 +69,8 @@ use bp_runtime::{
Size,
};
use codec::{Decode, Encode};
use frame_support::{dispatch::PostDispatchInfo, ensure, fail, traits::Get, DefaultNoBound};
use sp_std::{marker::PhantomData, prelude::*};
use pezframe_support::{dispatch::PostDispatchInfo, ensure, fail, traits::Get, DefaultNoBound};
use pezsp_std::{marker::PhantomData, prelude::*};
mod call_ext;
mod inbound_lane;
@@ -94,22 +94,22 @@ pub use tests::*;
/// The target that will be used when publishing logs related to this pallet.
pub const LOG_TARGET: &str = "runtime::bridge-messages";
#[frame_support::pallet]
#[pezframe_support::pallet]
pub mod pallet {
use super::*;
use bp_messages::{LaneIdType, ReceivedMessages, ReceptionResult};
use bp_runtime::RangeInclusiveExt;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
#[pallet::config]
pub trait Config<I: 'static = ()>: frame_system::Config {
pub trait Config<I: 'static = ()>: pezframe_system::Config {
// General types
/// The overarching event type.
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self, I>>
+ IsType<<Self as frame_system::Config>::RuntimeEvent>;
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
/// Benchmarks results from runtime we're plugged into.
type WeightInfo: WeightInfoExt;
@@ -411,11 +411,11 @@ pub mod pallet {
);
// update relayers state with actual numbers to compute actual weight below
relayers_state.unrewarded_relayer_entries = sp_std::cmp::min(
relayers_state.unrewarded_relayer_entries = pezsp_std::cmp::min(
relayers_state.unrewarded_relayer_entries,
actually_rewarded_relayers,
);
relayers_state.total_messages = sp_std::cmp::min(
relayers_state.total_messages = pezsp_std::cmp::min(
relayers_state.total_messages,
received_range.checked_len().unwrap_or(MessageNonce::MAX),
);
@@ -516,7 +516,7 @@ pub mod pallet {
pub type PalletOperatingMode<T: Config<I>, I: 'static = ()> =
StorageValue<_, MessagesOperatingMode, ValueQuery>;
// TODO: https://github.com/paritytech/parity-bridges-common/pull/2213: let's limit number of
// TODO: https://github.com/pezkuwichain/kurdistan-sdk/issues/89: let's limit number of
// possible opened lanes && use it to constraint maps below
/// Map of lane id => inbound lane data.
@@ -549,7 +549,7 @@ pub mod pallet {
pub opened_lanes: Vec<T::LaneId>,
/// Dummy marker.
#[serde(skip)]
pub _phantom: sp_std::marker::PhantomData<I>,
pub _phantom: pezsp_std::marker::PhantomData<I>,
}
#[pallet::genesis_build]
@@ -570,7 +570,7 @@ pub mod pallet {
#[pallet::hooks]
impl<T: Config<I>, I: 'static> Hooks<BlockNumberFor<T>> for Pallet<T, I> {
#[cfg(feature = "try-runtime")]
fn try_state(_n: BlockNumberFor<T>) -> Result<(), sp_runtime::TryRuntimeError> {
fn try_state(_n: BlockNumberFor<T>) -> Result<(), pezsp_runtime::TryRuntimeError> {
Self::do_try_state()
}
}
@@ -615,14 +615,14 @@ pub mod pallet {
#[cfg(any(feature = "try-runtime", test))]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// Ensure the correctness of the state of this pallet.
pub fn do_try_state() -> Result<(), sp_runtime::TryRuntimeError> {
pub fn do_try_state() -> Result<(), pezsp_runtime::TryRuntimeError> {
Self::do_try_state_for_outbound_lanes()
}
/// Ensure the correctness of the state of outbound lanes.
pub fn do_try_state_for_outbound_lanes() -> Result<(), sp_runtime::TryRuntimeError> {
use sp_runtime::traits::One;
use sp_std::vec::Vec;
pub fn do_try_state_for_outbound_lanes() -> Result<(), pezsp_runtime::TryRuntimeError> {
use pezsp_runtime::traits::One;
use pezsp_std::vec::Vec;
// collect unpruned lanes
let mut unpruned_lanes = Vec::new();
+11 -11
View File
@@ -17,7 +17,7 @@
//! A module that is responsible for migration of storage.
use crate::{Config, Pallet};
use frame_support::{
use pezframe_support::{
traits::{Get, StorageVersion},
weights::Weight,
};
@@ -33,7 +33,7 @@ pub mod v0 {
use bp_messages::{MessageNonce, UnrewardedRelayer};
use bp_runtime::AccountIdOf;
use codec::{Decode, Encode};
use sp_std::collections::vec_deque::VecDeque;
use pezsp_std::collections::vec_deque::VecDeque;
#[derive(Encode, Decode, Clone, PartialEq, Eq)]
pub(crate) struct StoredInboundLaneData<T: Config<I>, I: 'static>(
@@ -60,8 +60,8 @@ pub mod v1 {
InboundLaneData, InboundLanes, OutboundLaneData, OutboundLanes, StoredInboundLaneData,
};
use bp_messages::LaneState;
use frame_support::traits::UncheckedOnRuntimeUpgrade;
use sp_std::marker::PhantomData;
use pezframe_support::traits::UncheckedOnRuntimeUpgrade;
use pezsp_std::marker::PhantomData;
/// Migrates the pallet storage to v1.
pub struct UncheckedMigrationV0ToV1<T, I>(PhantomData<(T, I)>);
@@ -98,7 +98,7 @@ pub mod v1 {
}
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<sp_std::vec::Vec<u8>, sp_runtime::DispatchError> {
fn pre_upgrade() -> Result<pezsp_std::vec::Vec<u8>, pezsp_runtime::DispatchError> {
use codec::Encode;
let number_of_inbound_to_migrate = InboundLanes::<T, I>::iter_keys().count();
@@ -107,7 +107,7 @@ pub mod v1 {
}
#[cfg(feature = "try-runtime")]
fn post_upgrade(state: sp_std::vec::Vec<u8>) -> Result<(), sp_runtime::DispatchError> {
fn post_upgrade(state: pezsp_std::vec::Vec<u8>) -> Result<(), pezsp_runtime::DispatchError> {
use codec::Decode;
const LOG_TARGET: &str = "runtime::bridge-messages-migration";
@@ -119,11 +119,11 @@ pub mod v1 {
tracing::info!(target: LOG_TARGET, %number_of_inbound_to_migrate, "post-upgrade expects inbound lanes to have been migrated.");
tracing::info!(target: LOG_TARGET, %number_of_outbound_to_migrate, "post-upgrade expects outbound lanes to have been migrated.");
frame_support::ensure!(
pezframe_support::ensure!(
number_of_inbound_to_migrate as usize == number_of_inbound,
"must migrate all `InboundLanes`."
);
frame_support::ensure!(
pezframe_support::ensure!(
number_of_outbound_to_migrate as usize == number_of_outbound,
"must migrate all `OutboundLanes`."
);
@@ -134,13 +134,13 @@ pub mod v1 {
}
/// [`UncheckedMigrationV0ToV1`] wrapped in a
/// [`VersionedMigration`](frame_support::migrations::VersionedMigration), ensuring the
/// [`VersionedMigration`](pezframe_support::migrations::VersionedMigration), ensuring the
/// migration is only performed when on-chain version is 0.
pub type MigrationToV1<T, I> = frame_support::migrations::VersionedMigration<
pub type MigrationToV1<T, I> = pezframe_support::migrations::VersionedMigration<
0,
1,
UncheckedMigrationV0ToV1<T, I>,
Pallet<T, I>,
<T as frame_system::Config>::DbWeight,
<T as pezframe_system::Config>::DbWeight,
>;
}
@@ -23,10 +23,10 @@ use bp_messages::{
UnrewardedRelayer,
};
use codec::{Decode, DecodeWithMemTracking, Encode};
use frame_support::{traits::Get, BoundedVec, PalletError};
use pezframe_support::{traits::Get, BoundedVec, PalletError};
use scale_info::TypeInfo;
use sp_runtime::RuntimeDebug;
use sp_std::{collections::vec_deque::VecDeque, marker::PhantomData, ops::RangeInclusive};
use pezsp_runtime::RuntimeDebug;
use pezsp_std::{collections::vec_deque::VecDeque, marker::PhantomData, ops::RangeInclusive};
/// Outbound lane storage.
pub trait OutboundLaneStorage {
@@ -233,7 +233,7 @@ mod tests {
TestRuntime, REGULAR_PAYLOAD,
},
};
use sp_std::ops::RangeInclusive;
use pezsp_std::ops::RangeInclusive;
fn unrewarded_relayers(
nonces: RangeInclusive<MessageNonce>,
+11 -11
View File
@@ -29,11 +29,11 @@ use bp_runtime::{
HashOf, HasherOf, RangeInclusiveExt, RawStorageProof, StorageProofChecker, StorageProofError,
};
use codec::Decode;
use sp_std::vec::Vec;
use pezsp_std::vec::Vec;
/// 'Parsed' message delivery proof - inbound lane id and its state.
pub(crate) type ParsedMessagesDeliveryProofFromBridgedChain<T, I> =
(<T as Config<I>>::LaneId, InboundLaneData<<T as frame_system::Config>::AccountId>);
(<T as Config<I>>::LaneId, InboundLaneData<<T as pezframe_system::Config>::AccountId>);
/// Verify proof of Bridged -> This chain messages.
///
@@ -171,7 +171,7 @@ type MessagesStorageProofAdapter<T, I> = StorageProofCheckerAdapter<T, I>;
/// A `StorageProofAdapter` implementation for raw storage proofs.
struct StorageProofCheckerAdapter<T: Config<I>, I: 'static> {
storage: StorageProofChecker<HasherOf<BridgedChainOf<T, I>>>,
_dummy: sp_std::marker::PhantomData<(T, I)>,
_dummy: pezsp_std::marker::PhantomData<(T, I)>,
}
impl<T: Config<I>, I: 'static> StorageProofCheckerAdapter<T, I> {
@@ -220,7 +220,7 @@ mod tests {
use bp_messages::LaneState;
use bp_runtime::{HeaderId, StorageProofError};
use codec::Encode;
use sp_runtime::traits::Header;
use pezsp_runtime::traits::Header;
fn using_messages_proof<R>(
nonces_end: MessageNonce,
@@ -244,7 +244,7 @@ mod tests {
add_unused_key,
);
sp_io::TestExternalities::new(Default::default()).execute_with(move || {
pezsp_io::TestExternalities::new(Default::default()).execute_with(move || {
let bridged_header = BridgedChainHeader::new(
0,
Default::default(),
@@ -254,11 +254,11 @@ mod tests {
);
let bridged_header_hash = bridged_header.hash();
pallet_bridge_grandpa::BestFinalized::<TestRuntime>::put(HeaderId(
pezpallet_bridge_grandpa::BestFinalized::<TestRuntime>::put(HeaderId(
0,
bridged_header_hash,
));
pallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
pezpallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
bridged_header_hash,
bridged_header.build(),
);
@@ -316,8 +316,8 @@ mod tests {
false,
|proof| {
let bridged_header_hash =
pallet_bridge_grandpa::BestFinalized::<TestRuntime>::get().unwrap().1;
pallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::remove(
pezpallet_bridge_grandpa::BestFinalized::<TestRuntime>::get().unwrap().1;
pezpallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::remove(
bridged_header_hash,
);
verify_messages_proof::<TestRuntime, ()>(proof, 10)
@@ -339,8 +339,8 @@ mod tests {
false,
|proof| {
let bridged_header_hash =
pallet_bridge_grandpa::BestFinalized::<TestRuntime>::get().unwrap().1;
pallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
pezpallet_bridge_grandpa::BestFinalized::<TestRuntime>::get().unwrap().1;
pezpallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
bridged_header_hash,
BridgedChainHeader::new(
0,
@@ -25,8 +25,8 @@ use bp_runtime::{
RawStorageProof, UnverifiedStorageProofParams,
};
use codec::Encode;
use sp_std::{ops::RangeInclusive, prelude::*};
use sp_trie::{trie_types::TrieDBMutBuilderV1, LayoutV1, MemoryDB, TrieMut};
use pezsp_std::{ops::RangeInclusive, prelude::*};
use pezsp_trie::{trie_types::TrieDBMutBuilderV1, LayoutV1, MemoryDB, TrieMut};
/// Dummy message generation function.
pub fn generate_dummy_message(_: MessageNonce) -> MessagePayload {
+37 -37
View File
@@ -43,14 +43,14 @@ use bp_runtime::{
messages::MessageDispatchResult, Chain, ChainId, Size, UnverifiedStorageProofParams,
};
use codec::{Decode, DecodeWithMemTracking, Encode};
use frame_support::{
use pezframe_support::{
derive_impl,
weights::{constants::RocksDbWeight, Weight},
};
use scale_info::TypeInfo;
use sp_core::H256;
use sp_runtime::{
testing::Header as SubstrateHeader,
use pezsp_core::H256;
use pezsp_runtime::{
testing::Header as BizinikiwiHeader,
traits::{BlakeTwo256, ConstU32},
BuildStorage, StateVersion,
};
@@ -84,11 +84,11 @@ impl Chain for ThisChain {
type BlockNumber = u64;
type Hash = H256;
type Hasher = BlakeTwo256;
type Header = SubstrateHeader;
type Header = BizinikiwiHeader;
type AccountId = AccountId;
type Balance = Balance;
type Nonce = u64;
type Signature = sp_runtime::MultiSignature;
type Signature = pezsp_runtime::MultiSignature;
const STATE_VERSION: StateVersion = StateVersion::V1;
fn max_extrinsic_size() -> u32 {
@@ -109,7 +109,7 @@ impl ChainWithMessages for ThisChain {
pub struct BridgedChain;
pub type BridgedHeaderHash = H256;
pub type BridgedChainHeader = SubstrateHeader;
pub type BridgedChainHeader = BizinikiwiHeader;
impl Chain for BridgedChain {
const ID: ChainId = *b"tbch";
@@ -121,7 +121,7 @@ impl Chain for BridgedChain {
type AccountId = TestRelayer;
type Balance = Balance;
type Nonce = u64;
type Signature = sp_runtime::MultiSignature;
type Signature = pezsp_runtime::MultiSignature;
const STATE_VERSION: StateVersion = StateVersion::V1;
fn max_extrinsic_size() -> u32 {
@@ -147,41 +147,41 @@ impl ChainWithMessages for BridgedChain {
const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce = 128;
}
type Block = frame_system::mocking::MockBlock<TestRuntime>;
type Block = pezframe_system::mocking::MockBlock<TestRuntime>;
use crate as pallet_bridge_messages;
use crate as pezpallet_bridge_messages;
frame_support::construct_runtime! {
pezframe_support::construct_runtime! {
pub enum TestRuntime
{
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Event<T>},
BridgedChainGrandpa: pallet_bridge_grandpa::{Pallet, Call, Event<T>},
Messages: pallet_bridge_messages::{Pallet, Call, Event<T>},
System: pezframe_system::{Pallet, Call, Config<T>, Storage, Event<T>},
Balances: pezpallet_balances::{Pallet, Call, Event<T>},
BridgedChainGrandpa: pezpallet_bridge_grandpa::{Pallet, Call, Event<T>},
Messages: pezpallet_bridge_messages::{Pallet, Call, Event<T>},
}
}
pub type DbWeight = RocksDbWeight;
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for TestRuntime {
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for TestRuntime {
type Block = Block;
type AccountData = pallet_balances::AccountData<Balance>;
type AccountData = pezpallet_balances::AccountData<Balance>;
type DbWeight = DbWeight;
}
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
impl pallet_balances::Config for TestRuntime {
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
impl pezpallet_balances::Config for TestRuntime {
type AccountStore = System;
}
impl pallet_bridge_grandpa::Config for TestRuntime {
impl pezpallet_bridge_grandpa::Config for TestRuntime {
type RuntimeEvent = RuntimeEvent;
type BridgedChain = BridgedChain;
type MaxFreeHeadersPerBlock = ConstU32<4>;
type FreeHeadersInterval = ConstU32<1_024>;
type HeadersToKeep = ConstU32<8>;
type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<TestRuntime>;
type WeightInfo = pezpallet_bridge_grandpa::weights::BridgeWeight<TestRuntime>;
}
/// weights of messages pallet calls we use in tests.
@@ -288,7 +288,7 @@ impl TestDeliveryPayments {
/// cleared after the call.
pub fn is_reward_paid(relayer: AccountId) -> bool {
let key = (b":delivery-relayer-reward:", relayer).encode();
frame_support::storage::unhashed::take::<bool>(&key).is_some()
pezframe_support::storage::unhashed::take::<bool>(&key).is_some()
}
}
@@ -302,7 +302,7 @@ impl DeliveryPayments<AccountId> for TestDeliveryPayments {
_actual_weight: Weight,
) {
let key = (b":delivery-relayer-reward:", relayer).encode();
frame_support::storage::unhashed::put(&key, &true);
pezframe_support::storage::unhashed::put(&key, &true);
}
}
@@ -315,7 +315,7 @@ impl TestDeliveryConfirmationPayments {
/// cleared after the call.
pub fn is_reward_paid(relayer: AccountId, fee: TestMessageFee) -> bool {
let key = (b":relayer-reward:", relayer, fee).encode();
frame_support::storage::unhashed::take::<bool>(&key).is_some()
pezframe_support::storage::unhashed::take::<bool>(&key).is_some()
}
}
@@ -332,7 +332,7 @@ impl DeliveryConfirmationPayments<AccountId, TestLaneIdType> for TestDeliveryCon
let rewarded_relayers = relayers_rewards.len();
for (relayer, reward) in &relayers_rewards {
let key = (b":relayer-reward:", relayer, reward).encode();
frame_support::storage::unhashed::put(&key, &true);
pezframe_support::storage::unhashed::put(&key, &true);
}
rewarded_relayers as _
@@ -354,8 +354,8 @@ impl TestMessageDispatch {
pub fn emulate_enqueued_message(lane: TestLaneIdType) {
let key = (b"dispatched", lane).encode();
let dispatched = frame_support::storage::unhashed::get_or_default::<MessageNonce>(&key[..]);
frame_support::storage::unhashed::put(&key[..], &(dispatched + 1));
let dispatched = pezframe_support::storage::unhashed::get_or_default::<MessageNonce>(&key[..]);
pezframe_support::storage::unhashed::put(&key[..], &(dispatched + 1));
}
}
@@ -365,7 +365,7 @@ impl MessageDispatch for TestMessageDispatch {
type LaneId = TestLaneIdType;
fn is_active(lane: Self::LaneId) -> bool {
frame_support::storage::unhashed::get_or_default::<MessageNonce>(
pezframe_support::storage::unhashed::get_or_default::<MessageNonce>(
&(b"dispatched", lane).encode()[..],
) <= BridgedChain::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX
}
@@ -395,13 +395,13 @@ pub struct TestOnMessagesDelivered;
impl TestOnMessagesDelivered {
pub fn call_arguments() -> Option<(TestLaneIdType, MessageNonce)> {
frame_support::storage::unhashed::get(b"TestOnMessagesDelivered.OnMessagesDelivered")
pezframe_support::storage::unhashed::get(b"TestOnMessagesDelivered.OnMessagesDelivered")
}
}
impl OnMessagesDelivered<TestLaneIdType> for TestOnMessagesDelivered {
fn on_messages_delivered(lane: TestLaneIdType, enqueued_messages: MessageNonce) {
frame_support::storage::unhashed::put(
pezframe_support::storage::unhashed::put(
b"TestOnMessagesDelivered.OnMessagesDelivered",
&(lane, enqueued_messages),
);
@@ -459,15 +459,15 @@ pub fn inbound_unrewarded_relayers_state(lane: TestLaneIdType) -> UnrewardedRela
}
/// Return test externalities to use in tests.
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
pallet_balances::GenesisConfig::<TestRuntime> {
pub fn new_test_ext() -> pezsp_io::TestExternalities {
let mut t = pezframe_system::GenesisConfig::<TestRuntime>::default().build_storage().unwrap();
pezpallet_balances::GenesisConfig::<TestRuntime> {
balances: vec![(ENDOWED_ACCOUNT, 1_000_000)],
..Default::default()
}
.assimilate_storage(&mut t)
.unwrap();
sp_io::TestExternalities::new(t)
pezsp_io::TestExternalities::new(t)
}
/// Run pallet test.
@@ -515,7 +515,7 @@ pub fn prepare_messages_proof(
// let's now insert bridged chain header into the storage
let bridged_header_hash = Default::default();
pallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
pezpallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
bridged_header_hash,
StoredHeaderData { number: 0, state_root: storage_root },
);
@@ -548,7 +548,7 @@ pub fn prepare_messages_delivery_proof(
// let's now insert bridged chain header into the storage
let bridged_header_hash = Default::default();
pallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
pezpallet_bridge_grandpa::ImportedHeaders::<TestRuntime>::insert(
bridged_header_hash,
StoredHeaderData { number: 0, state_root: storage_root },
);
+1 -1
View File
@@ -21,6 +21,6 @@
#[cfg(test)]
pub(crate) mod mock;
#[cfg(test)]
mod pallet_tests;
mod pezpallet_tests;
pub mod messages_generation;
@@ -37,14 +37,14 @@ use bp_messages::{
use bp_runtime::{BasicOperatingMode, PreComputedSize, RangeInclusiveExt, Size};
use bp_test_utils::generate_owned_bridge_module_tests;
use codec::Encode;
use frame_support::{
use pezframe_support::{
assert_err, assert_noop, assert_ok,
dispatch::Pays,
storage::generator::{StorageMap, StorageValue},
weights::Weight,
};
use frame_system::{EventRecord, Pallet as System, Phase};
use sp_runtime::{BoundedVec, DispatchError};
use pezframe_system::{EventRecord, Pallet as System, Phase};
use pezsp_runtime::{BoundedVec, DispatchError};
fn get_ready_for_events() {
System::<TestRuntime>::set_block_number(1);
@@ -117,7 +117,7 @@ fn receive_messages_delivery_proof() {
}
#[test]
fn pallet_rejects_transactions_if_halted() {
fn pezpallet_rejects_transactions_if_halted() {
run_test(|| {
// send message first to be able to check that delivery_proof fails later
send_regular_message(test_lane_id());
@@ -187,7 +187,7 @@ fn receive_messages_fails_if_dispatcher_is_inactive() {
}
#[test]
fn pallet_rejects_new_messages_in_rejecting_outbound_messages_operating_mode() {
fn pezpallet_rejects_new_messages_in_rejecting_outbound_messages_operating_mode() {
run_test(|| {
// send message first to be able to check that delivery_proof fails later
send_regular_message(test_lane_id());
@@ -1222,7 +1222,7 @@ fn do_try_state_for_outbound_lanes_works() {
);
assert_err!(
Pallet::<TestRuntime>::do_try_state(),
sp_runtime::TryRuntimeError::Other("Found unpruned lanes!")
pezsp_runtime::TryRuntimeError::Other("Found unpruned lanes!")
);
// remove message for nonce 1
+8 -8
View File
@@ -14,9 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for pallet_bridge_messages
//! Autogenerated weights for pezpallet_bridge_messages
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `serban-ROG-Zephyrus`, CPU: `12th Gen Intel(R) Core(TM) i7-12700H`
@@ -29,7 +29,7 @@
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_bridge_messages
// --pallet=pezpallet_bridge_messages
// --extrinsic=*
// --execution=wasm
// --wasm-execution=Compiled
@@ -42,13 +42,13 @@
#![allow(unused_imports)]
#![allow(missing_docs)]
use frame_support::{
use pezframe_support::{
traits::Get,
weights::{constants::RocksDbWeight, Weight},
};
use sp_std::marker::PhantomData;
use pezsp_std::marker::PhantomData;
/// Weight functions needed for pallet_bridge_messages.
/// Weight functions needed for pezpallet_bridge_messages.
pub trait WeightInfo {
fn receive_single_message_proof() -> Weight;
fn receive_n_messages_proof(n: u32) -> Weight;
@@ -60,11 +60,11 @@ pub trait WeightInfo {
fn receive_single_n_bytes_message_proof_with_dispatch(n: u32) -> Weight;
}
/// Weights for `pallet_bridge_messages` that are generated using one of the Bridge testnets.
/// Weights for `pezpallet_bridge_messages` that are generated using one of the Bridge testnets.
///
/// Those weights are test only and must never be used in production.
pub struct BridgeWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for BridgeWeight<T> {
impl<T: pezframe_system::Config> WeightInfo for BridgeWeight<T> {
/// Storage: BridgeUnknownMessages PalletOperatingMode (r:1 w:0)
///
/// Proof: BridgeUnknownMessages PalletOperatingMode (max_values: Some(1), max_size: Some(2),
+3 -3
View File
@@ -20,7 +20,7 @@ use crate::weights::WeightInfo;
use bp_messages::{MessageNonce, UnrewardedRelayersState};
use bp_runtime::{PreComputedSize, Size};
use frame_support::weights::Weight;
use pezframe_support::weights::Weight;
/// Size of the message being delivered in benchmarks.
pub const EXPECTED_DEFAULT_MESSAGE_LENGTH: u32 = 128;
@@ -284,7 +284,7 @@ pub trait WeightInfoExt: WeightInfo {
// storage values that are read during the call. So we may ignore the weight of this check.
//
// However, during (2) we read and update storage values of other pallets
// (`pallet-bridge-relayers` and balances/assets pallet). So we need to add this weight to the
// (`pezpallet-bridge-relayers` and balances/assets pallet). So we need to add this weight to the
// weight of our call. Hence two following methods.
/// Extra weight that is added to the `receive_messages_proof` call weight by signed extensions
@@ -444,7 +444,7 @@ impl WeightInfoExt for () {
}
}
impl<T: frame_system::Config> WeightInfoExt for crate::weights::BridgeWeight<T> {
impl<T: pezframe_system::Config> WeightInfoExt for crate::weights::BridgeWeight<T> {
fn expected_extra_storage_proof_size() -> u32 {
EXTRA_STORAGE_PROOF_SIZE
}