379cb741ed
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.
42 lines
1.4 KiB
Rust
42 lines
1.4 KiB
Rust
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
|
// SPDX-FileCopyrightText: 2021-2022 Parity Technologies (UK) Ltd.
|
|
#![cfg_attr(not(feature = "std"), no_std)]
|
|
pub mod v1;
|
|
pub mod v2;
|
|
use codec::Encode;
|
|
use pezsp_core::blake2_256;
|
|
use pezsp_std::marker::PhantomData;
|
|
use xcm::prelude::{AccountKey20, Ethereum, GlobalConsensus, Location};
|
|
use xcm_executor::traits::ConvertLocation;
|
|
|
|
pub use snowbridge_verification_primitives::*;
|
|
|
|
/// DEPRECATED in favor of [xcm_builder::ExternalConsensusLocationsConverterFor]
|
|
pub struct EthereumLocationsConverterFor<AccountId>(PhantomData<AccountId>);
|
|
impl<AccountId> ConvertLocation<AccountId> for EthereumLocationsConverterFor<AccountId>
|
|
where
|
|
AccountId: From<[u8; 32]> + Clone,
|
|
{
|
|
fn convert_location(location: &Location) -> Option<AccountId> {
|
|
match location.unpack() {
|
|
(2, [GlobalConsensus(Ethereum { chain_id })]) =>
|
|
Some(Self::from_chain_id(chain_id).into()),
|
|
(2, [GlobalConsensus(Ethereum { chain_id }), AccountKey20 { network: _, key }]) =>
|
|
Some(Self::from_chain_id_with_key(chain_id, *key).into()),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl<AccountId> EthereumLocationsConverterFor<AccountId> {
|
|
pub fn from_chain_id(chain_id: &u64) -> [u8; 32] {
|
|
(b"ethereum-chain", chain_id).using_encoded(blake2_256)
|
|
}
|
|
pub fn from_chain_id_with_key(chain_id: &u64, key: [u8; 20]) -> [u8; 32] {
|
|
(b"ethereum-chain", chain_id, key).using_encoded(blake2_256)
|
|
}
|
|
}
|
|
|
|
pub type CallIndex = [u8; 2];
|