mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-22 03:17:56 +00:00
Complete terminology rebrand to Pezkuwi ecosystem
Applied global changes: Polkadot->Pezkuwi, Parachain->TeyrChain, pallet->pezpallet, frame->pezframe. Updated authors in Cargo.toml to include Kurdistan Tech Institute and pezkuwichain team. Used Cargo aliases to maintain SDK compatibility while using rebranded names in source code.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use frame_support::{dispatch::GetDispatchInfo, weights::Weight};
|
||||
use pezframe_support::{dispatch::GetDispatchInfo, weights::Weight};
|
||||
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_core::{H160, H256};
|
||||
@@ -17,9 +17,9 @@ use crate::{
|
||||
};
|
||||
|
||||
// Required for runtime benchmarks
|
||||
pallet_assets::runtime_benchmarks_enabled! {
|
||||
pezpallet_assets::runtime_benchmarks_enabled! {
|
||||
pub struct BenchmarkHelper;
|
||||
impl<AssetIdParameter> pallet_assets::BenchmarkHelper<AssetIdParameter> for BenchmarkHelper
|
||||
impl<AssetIdParameter> pezpallet_assets::BenchmarkHelper<AssetIdParameter> for BenchmarkHelper
|
||||
where
|
||||
AssetIdParameter: From<u128>,
|
||||
{
|
||||
@@ -86,7 +86,7 @@ impl From<AssetType> for AssetId {
|
||||
match asset {
|
||||
AssetType::Xcm(id) => {
|
||||
let mut result: [u8; 16] = [0u8; 16];
|
||||
let hash: H256 = id.using_encoded(<Runtime as frame_system::Config>::Hashing::hash);
|
||||
let hash: H256 = id.using_encoded(<Runtime as pezframe_system::Config>::Hashing::hash);
|
||||
result.copy_from_slice(&hash.as_fixed_bytes()[0..16]);
|
||||
u128::from_le_bytes(result)
|
||||
}
|
||||
@@ -115,11 +115,11 @@ pub struct AssetRegistrarMetadata {
|
||||
}
|
||||
|
||||
// We instruct how to register the Assets
|
||||
// In this case, we tell it to Create an Asset in pallet-assets
|
||||
// In this case, we tell it to Create an Asset in pezpallet-assets
|
||||
pub struct AssetRegistrar;
|
||||
use frame_support::{pallet_prelude::DispatchResult, transactional};
|
||||
use pezframe_support::{pezpallet_prelude::DispatchResult, transactional};
|
||||
|
||||
impl pallet_asset_manager::AssetRegistrar<Runtime> for AssetRegistrar {
|
||||
impl pezpallet_asset_manager::AssetRegistrar<Runtime> for AssetRegistrar {
|
||||
#[transactional]
|
||||
fn create_foreign_asset(
|
||||
asset: AssetId,
|
||||
@@ -156,10 +156,10 @@ impl pallet_asset_manager::AssetRegistrar<Runtime> for AssetRegistrar {
|
||||
// For us both of them (Foreign and Local) have the same annotated weight for a given
|
||||
// witness
|
||||
// We need to take the dispatch info from the destroy call, which is already annotated in
|
||||
// the assets pallet
|
||||
// the assets pezpallet
|
||||
|
||||
// This is the dispatch info of destroy
|
||||
RuntimeCall::Assets(pallet_assets::Call::<Runtime>::start_destroy { id: asset.into() })
|
||||
RuntimeCall::Assets(pezpallet_assets::Call::<Runtime>::start_destroy { id: asset.into() })
|
||||
.get_dispatch_info()
|
||||
.call_weight
|
||||
}
|
||||
@@ -206,7 +206,7 @@ impl AccountIdAssetIdConversion<AccountId, AssetId> for Runtime {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
mod asset_registrar {
|
||||
use pallet_asset_manager::AssetRegistrar;
|
||||
use pezpallet_asset_manager::AssetRegistrar;
|
||||
use sp_io::TestExternalities;
|
||||
|
||||
use crate::{
|
||||
@@ -375,13 +375,13 @@ mod tests {
|
||||
// Test with X1 junction
|
||||
let v3_location = MultiLocation {
|
||||
parents: 0,
|
||||
interior: JunctionsV3::X1(JunctionV3::Parachain(1000)),
|
||||
interior: JunctionsV3::X1(JunctionV3::TeyrChain(1000)),
|
||||
};
|
||||
let v4_location = convert_v3_to_v4(v3_location).unwrap();
|
||||
assert_eq!(v4_location.parents, 0);
|
||||
|
||||
// Create X1 junction with Arc
|
||||
let junction_array = Arc::new([xcm::v4::Junction::Parachain(1000)]);
|
||||
let junction_array = Arc::new([xcm::v4::Junction::TeyrChain(1000)]);
|
||||
let expected_interior = xcm::v4::Junctions::X1(junction_array);
|
||||
assert_eq!(v4_location.interior, expected_interior);
|
||||
}
|
||||
@@ -401,7 +401,7 @@ mod tests {
|
||||
// Test with more complex location
|
||||
let v3_location = MultiLocation {
|
||||
parents: 0,
|
||||
interior: JunctionsV3::X1(JunctionV3::Parachain(1000)),
|
||||
interior: JunctionsV3::X1(JunctionV3::TeyrChain(1000)),
|
||||
};
|
||||
let asset_type = AssetType::from(v3_location);
|
||||
match asset_type {
|
||||
@@ -409,7 +409,7 @@ mod tests {
|
||||
assert_eq!(location.parents, 0);
|
||||
|
||||
// Create X1 junction with Arc
|
||||
let junction_array = Arc::new([xcm::v4::Junction::Parachain(1000)]);
|
||||
let junction_array = Arc::new([xcm::v4::Junction::TeyrChain(1000)]);
|
||||
let expected_interior = xcm::v4::Junctions::X1(junction_array);
|
||||
assert_eq!(location.interior, expected_interior);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user