rebrand: kusama → dicle
- Replace all kusama/Kusama references with dicle/Dicle - Rename weight files from ksm_size to dcl_size - Update papi-tests files from ksm to dcl - Remove chain-specs/kusama.json files - cargo check --workspace successful (Finished output) - Update MAINNET_ROADMAP.md: FAZ 8 completed
This commit is contained in:
@@ -124,9 +124,9 @@
|
||||
//!
|
||||
//! Asset Hub also has another type of assets called `ForeignAssets`.
|
||||
//! These assets are identified by the XCM Location to their origin.
|
||||
//! Two such assets are a Teyrchain asset, like Moonbeam's GLMR, and KSM, from the cousin Kusama
|
||||
//! Two such assets are a Teyrchain asset, like Moonbeam's GLMR, and DCL, from the cousin Dicle
|
||||
//! network. These are represented as `../Teyrchain(2004)/PalletInstance(10)` and
|
||||
//! `../../GlobalConsensus(Kusama)` respectively.
|
||||
//! `../../GlobalConsensus(Dicle)` respectively.
|
||||
//!
|
||||
//! The whole type can be seen in the [format](https://github.com/polkadot-fellows/xcm-format#6-universal-asset-identifiers)
|
||||
//! and [rust docs](xcm::v4::prelude::Asset).
|
||||
|
||||
@@ -106,7 +106,7 @@ impl<T: Config> Pezpallet<T> {
|
||||
/// Check if the given asset ID represents a network native asset based on our
|
||||
/// UniversalLocation.
|
||||
///
|
||||
/// Returns true if the asset is a native network asset (HEZ, KSM, ZGR, PAS) that should be
|
||||
/// Returns true if the asset is a native network asset (HEZ, DCL, ZGR, PAS) that should be
|
||||
/// blocked during Asset Hub Migration.
|
||||
fn is_network_native_asset(asset_id: &AssetId) -> bool {
|
||||
let universal_location = T::UniversalLocation::get();
|
||||
@@ -119,7 +119,7 @@ impl<T: Config> Pezpallet<T> {
|
||||
1 => {
|
||||
if let Some(Junction::GlobalConsensus(network)) = universal_location.first() {
|
||||
let is_target_network = match network {
|
||||
NetworkId::Pezkuwi | NetworkId::Kusama => true,
|
||||
NetworkId::Pezkuwi | NetworkId::Dicle => true,
|
||||
NetworkId::ByGenesis(genesis_hash) => {
|
||||
// Check if this is Zagros by genesis hash
|
||||
*genesis_hash == xcm::v5::ZAGROS_GENESIS_HASH
|
||||
@@ -141,7 +141,7 @@ impl<T: Config> Pezpallet<T> {
|
||||
(universal_location.first(), universal_location.last())
|
||||
{
|
||||
let is_target_network = match network {
|
||||
NetworkId::Pezkuwi | NetworkId::Kusama => true,
|
||||
NetworkId::Pezkuwi | NetworkId::Dicle => true,
|
||||
NetworkId::ByGenesis(genesis_hash) => {
|
||||
// Check if this is Zagros by genesis hash
|
||||
*genesis_hash == xcm::v5::ZAGROS_GENESIS_HASH
|
||||
|
||||
@@ -55,8 +55,8 @@ pub enum NetworkId {
|
||||
ByFork { block_number: u64, block_hash: [u8; 32] },
|
||||
/// The Pezkuwi mainnet Relay-chain.
|
||||
Pezkuwi,
|
||||
/// The Kusama canary-net Relay-chain.
|
||||
Kusama,
|
||||
/// The Dicle canary-net Relay-chain.
|
||||
Dicle,
|
||||
/// The Zagros testnet Relay-chain.
|
||||
Zagros,
|
||||
/// The Pezkuwichain testnet Relay-chain.
|
||||
@@ -90,7 +90,7 @@ impl From<NewNetworkId> for NetworkId {
|
||||
ByGenesis(hash) => Self::ByGenesis(hash),
|
||||
ByFork { block_number, block_hash } => Self::ByFork { block_number, block_hash },
|
||||
Pezkuwi => Self::Pezkuwi,
|
||||
Kusama => Self::Kusama,
|
||||
Dicle => Self::Dicle,
|
||||
Zagros => Self::Zagros,
|
||||
Pezkuwichain => Self::Pezkuwichain,
|
||||
Wococo => Self::Wococo,
|
||||
|
||||
@@ -667,30 +667,30 @@ mod tests {
|
||||
fn relative_to_works() {
|
||||
use Junctions::*;
|
||||
use NetworkId::*;
|
||||
assert_eq!(X1(Pezkuwi.into()).relative_to(&X1(Kusama.into())), (Parent, Pezkuwi).into());
|
||||
let base = X3(Kusama.into(), Teyrchain(1), PalletInstance(1));
|
||||
assert_eq!(X1(Pezkuwi.into()).relative_to(&X1(Dicle.into())), (Parent, Pezkuwi).into());
|
||||
let base = X3(Dicle.into(), Teyrchain(1), PalletInstance(1));
|
||||
|
||||
// Ancestors.
|
||||
assert_eq!(Here.relative_to(&base), (Parent, Parent, Parent).into());
|
||||
assert_eq!(X1(Kusama.into()).relative_to(&base), (Parent, Parent).into());
|
||||
assert_eq!(X2(Kusama.into(), Teyrchain(1)).relative_to(&base), (Parent,).into());
|
||||
assert_eq!(X1(Dicle.into()).relative_to(&base), (Parent, Parent).into());
|
||||
assert_eq!(X2(Dicle.into(), Teyrchain(1)).relative_to(&base), (Parent,).into());
|
||||
assert_eq!(
|
||||
X3(Kusama.into(), Teyrchain(1), PalletInstance(1)).relative_to(&base),
|
||||
X3(Dicle.into(), Teyrchain(1), PalletInstance(1)).relative_to(&base),
|
||||
Here.into()
|
||||
);
|
||||
|
||||
// Ancestors with one child.
|
||||
assert_eq!(X1(Pezkuwi.into()).relative_to(&base), (Parent, Parent, Parent, Pezkuwi).into());
|
||||
assert_eq!(
|
||||
X2(Kusama.into(), Teyrchain(2)).relative_to(&base),
|
||||
X2(Dicle.into(), Teyrchain(2)).relative_to(&base),
|
||||
(Parent, Parent, Teyrchain(2)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
X3(Kusama.into(), Teyrchain(1), PalletInstance(2)).relative_to(&base),
|
||||
X3(Dicle.into(), Teyrchain(1), PalletInstance(2)).relative_to(&base),
|
||||
(Parent, PalletInstance(2)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
X4(Kusama.into(), Teyrchain(1), PalletInstance(1), [1u8; 32].into()).relative_to(&base),
|
||||
X4(Dicle.into(), Teyrchain(1), PalletInstance(1), [1u8; 32].into()).relative_to(&base),
|
||||
([1u8; 32],).into()
|
||||
);
|
||||
|
||||
@@ -700,15 +700,15 @@ mod tests {
|
||||
(Parent, Parent, Parent, Pezkuwi, Teyrchain(1)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
X3(Kusama.into(), Teyrchain(2), PalletInstance(1)).relative_to(&base),
|
||||
X3(Dicle.into(), Teyrchain(2), PalletInstance(1)).relative_to(&base),
|
||||
(Parent, Parent, Teyrchain(2), PalletInstance(1)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
X4(Kusama.into(), Teyrchain(1), PalletInstance(2), [1u8; 32].into()).relative_to(&base),
|
||||
X4(Dicle.into(), Teyrchain(1), PalletInstance(2), [1u8; 32].into()).relative_to(&base),
|
||||
(Parent, PalletInstance(2), [1u8; 32]).into()
|
||||
);
|
||||
assert_eq!(
|
||||
X5(Kusama.into(), Teyrchain(1), PalletInstance(1), [1u8; 32].into(), 1u128.into())
|
||||
X5(Dicle.into(), Teyrchain(1), PalletInstance(1), [1u8; 32].into(), 1u128.into())
|
||||
.relative_to(&base),
|
||||
([1u8; 32], 1u128).into()
|
||||
);
|
||||
@@ -719,10 +719,10 @@ mod tests {
|
||||
use Junctions::*;
|
||||
use NetworkId::*;
|
||||
assert_eq!(X1(Pezkuwi.into()).global_consensus(), Ok(Pezkuwi));
|
||||
assert_eq!(X2(Kusama.into(), 1u64.into()).global_consensus(), Ok(Kusama));
|
||||
assert_eq!(X2(Dicle.into(), 1u64.into()).global_consensus(), Ok(Dicle));
|
||||
assert_eq!(Here.global_consensus(), Err(()));
|
||||
assert_eq!(X1(1u64.into()).global_consensus(), Err(()));
|
||||
assert_eq!(X2(1u64.into(), Kusama.into()).global_consensus(), Err(()));
|
||||
assert_eq!(X2(1u64.into(), Dicle.into()).global_consensus(), Err(()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -732,7 +732,7 @@ mod tests {
|
||||
assert_eq!(x, X1(GlobalConsensus(Pezkuwi)));
|
||||
let x: Junctions = Pezkuwi.into();
|
||||
assert_eq!(x, X1(GlobalConsensus(Pezkuwi)));
|
||||
let x: Junctions = (Pezkuwi, Kusama).into();
|
||||
assert_eq!(x, X2(GlobalConsensus(Pezkuwi), GlobalConsensus(Kusama)));
|
||||
let x: Junctions = (Pezkuwi, Dicle).into();
|
||||
assert_eq!(x, X2(GlobalConsensus(Pezkuwi), GlobalConsensus(Dicle)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ pub enum Instruction<Call> {
|
||||
/// - `xcm`: The message to be exported.
|
||||
///
|
||||
/// As an example, to export a message for execution on Asset Hub (teyrchain #1000 in the
|
||||
/// Kusama network), you would call with `network: NetworkId::Kusama` and
|
||||
/// Dicle network), you would call with `network: NetworkId::Dicle` and
|
||||
/// `destination: X1(Teyrchain(1000))`. Alternatively, to export a message for execution on
|
||||
/// Pezkuwi, you would call with `network: NetworkId:: Pezkuwi` and `destination: Here`.
|
||||
///
|
||||
|
||||
@@ -715,16 +715,16 @@ mod tests {
|
||||
|
||||
// Relay-chain context pointing to different consensus relay,
|
||||
let relay_to_remote_relay =
|
||||
MultiLocation::new(1, (GlobalConsensus(Kusama), PalletInstance(42), GeneralIndex(42)));
|
||||
let expected = MultiLocation::new(1, GlobalConsensus(Kusama));
|
||||
MultiLocation::new(1, (GlobalConsensus(Dicle), PalletInstance(42), GeneralIndex(42)));
|
||||
let expected = MultiLocation::new(1, GlobalConsensus(Dicle));
|
||||
assert_eq!(relay_to_remote_relay.chain_location(), expected);
|
||||
|
||||
// Relay-chain context pointing to different consensus teyrchain,
|
||||
let relay_to_remote_para = MultiLocation::new(
|
||||
1,
|
||||
(GlobalConsensus(Kusama), Teyrchain(42), PalletInstance(42), GeneralIndex(42)),
|
||||
(GlobalConsensus(Dicle), Teyrchain(42), PalletInstance(42), GeneralIndex(42)),
|
||||
);
|
||||
let expected = MultiLocation::new(1, (GlobalConsensus(Kusama), Teyrchain(42)));
|
||||
let expected = MultiLocation::new(1, (GlobalConsensus(Dicle), Teyrchain(42)));
|
||||
assert_eq!(relay_to_remote_para.chain_location(), expected);
|
||||
|
||||
// Teyrchain context pointing to relay chain,
|
||||
@@ -739,16 +739,16 @@ mod tests {
|
||||
|
||||
// Teyrchain context pointing to different consensus relay,
|
||||
let para_to_remote_relay =
|
||||
MultiLocation::new(2, (GlobalConsensus(Kusama), PalletInstance(42), GeneralIndex(42)));
|
||||
let expected = MultiLocation::new(2, GlobalConsensus(Kusama));
|
||||
MultiLocation::new(2, (GlobalConsensus(Dicle), PalletInstance(42), GeneralIndex(42)));
|
||||
let expected = MultiLocation::new(2, GlobalConsensus(Dicle));
|
||||
assert_eq!(para_to_remote_relay.chain_location(), expected);
|
||||
|
||||
// Teyrchain context pointing to different consensus teyrchain,
|
||||
let para_to_remote_para = MultiLocation::new(
|
||||
2,
|
||||
(GlobalConsensus(Kusama), Teyrchain(42), PalletInstance(42), GeneralIndex(42)),
|
||||
(GlobalConsensus(Dicle), Teyrchain(42), PalletInstance(42), GeneralIndex(42)),
|
||||
);
|
||||
let expected = MultiLocation::new(2, (GlobalConsensus(Kusama), Teyrchain(42)));
|
||||
let expected = MultiLocation::new(2, (GlobalConsensus(Dicle), Teyrchain(42)));
|
||||
assert_eq!(para_to_remote_para.chain_location(), expected);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ impl From<NewNetworkId> for NetworkId {
|
||||
ByGenesis(hash) => Self::ByGenesis(hash),
|
||||
ByFork { block_number, block_hash } => Self::ByFork { block_number, block_hash },
|
||||
Pezkuwi => Self::Pezkuwi,
|
||||
Kusama => Self::Kusama,
|
||||
Dicle => Self::Dicle,
|
||||
Ethereum { chain_id } => Self::Ethereum { chain_id },
|
||||
BitcoinCore => Self::BitcoinCore,
|
||||
BitcoinCash => Self::BitcoinCash,
|
||||
@@ -153,8 +153,8 @@ pub enum NetworkId {
|
||||
ByFork { block_number: u64, block_hash: [u8; 32] },
|
||||
/// The Pezkuwi mainnet Relay-chain.
|
||||
Pezkuwi,
|
||||
/// The Kusama canary-net Relay-chain.
|
||||
Kusama,
|
||||
/// The Dicle canary-net Relay-chain.
|
||||
Dicle,
|
||||
/// The Zagros testnet Relay-chain.
|
||||
Zagros,
|
||||
/// The Pezkuwichain testnet Relay-chain.
|
||||
@@ -188,7 +188,7 @@ impl From<OldNetworkId> for NetworkId {
|
||||
ByGenesis(hash) => Self::ByGenesis(hash),
|
||||
ByFork { block_number, block_hash } => Self::ByFork { block_number, block_hash },
|
||||
Pezkuwi => Self::Pezkuwi,
|
||||
Kusama => Self::Kusama,
|
||||
Dicle => Self::Dicle,
|
||||
Zagros => Self::Zagros,
|
||||
Pezkuwichain => Self::Pezkuwichain,
|
||||
Wococo => Self::Wococo,
|
||||
|
||||
@@ -622,20 +622,20 @@ mod tests {
|
||||
fn relative_to_works() {
|
||||
use NetworkId::*;
|
||||
assert_eq!(
|
||||
Junctions::from([Pezkuwi.into()]).relative_to(&Junctions::from([Kusama.into()])),
|
||||
Junctions::from([Pezkuwi.into()]).relative_to(&Junctions::from([Dicle.into()])),
|
||||
(Parent, Pezkuwi).into()
|
||||
);
|
||||
let base = Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(1)]);
|
||||
let base = Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(1)]);
|
||||
|
||||
// Ancestors.
|
||||
assert_eq!(Here.relative_to(&base), (Parent, Parent, Parent).into());
|
||||
assert_eq!(Junctions::from([Kusama.into()]).relative_to(&base), (Parent, Parent).into());
|
||||
assert_eq!(Junctions::from([Dicle.into()]).relative_to(&base), (Parent, Parent).into());
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(1)]).relative_to(&base),
|
||||
(Parent,).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(1)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(1)]).relative_to(&base),
|
||||
Here.into()
|
||||
);
|
||||
|
||||
@@ -645,15 +645,15 @@ mod tests {
|
||||
(Parent, Parent, Parent, Pezkuwi).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(2)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(2)]).relative_to(&base),
|
||||
(Parent, Parent, Teyrchain(2)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(2)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(2)]).relative_to(&base),
|
||||
(Parent, PalletInstance(2)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(1), [1u8; 32].into()])
|
||||
Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(1), [1u8; 32].into()])
|
||||
.relative_to(&base),
|
||||
([1u8; 32],).into()
|
||||
);
|
||||
@@ -664,17 +664,17 @@ mod tests {
|
||||
(Parent, Parent, Parent, Pezkuwi, Teyrchain(1)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(2), PalletInstance(1)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(2), PalletInstance(1)]).relative_to(&base),
|
||||
(Parent, Parent, Teyrchain(2), PalletInstance(1)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(2), [1u8; 32].into()])
|
||||
Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(2), [1u8; 32].into()])
|
||||
.relative_to(&base),
|
||||
(Parent, PalletInstance(2), [1u8; 32]).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([
|
||||
Kusama.into(),
|
||||
Dicle.into(),
|
||||
Teyrchain(1),
|
||||
PalletInstance(1),
|
||||
[1u8; 32].into(),
|
||||
@@ -689,10 +689,10 @@ mod tests {
|
||||
fn global_consensus_works() {
|
||||
use NetworkId::*;
|
||||
assert_eq!(Junctions::from([Pezkuwi.into()]).global_consensus(), Ok(Pezkuwi));
|
||||
assert_eq!(Junctions::from([Kusama.into(), 1u64.into()]).global_consensus(), Ok(Kusama));
|
||||
assert_eq!(Junctions::from([Dicle.into(), 1u64.into()]).global_consensus(), Ok(Dicle));
|
||||
assert_eq!(Here.global_consensus(), Err(()));
|
||||
assert_eq!(Junctions::from([1u64.into()]).global_consensus(), Err(()));
|
||||
assert_eq!(Junctions::from([1u64.into(), Kusama.into()]).global_consensus(), Err(()));
|
||||
assert_eq!(Junctions::from([1u64.into(), Dicle.into()]).global_consensus(), Err(()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -702,15 +702,15 @@ mod tests {
|
||||
assert_eq!(x, Junctions::from([GlobalConsensus(Pezkuwi)]));
|
||||
let x: Junctions = Pezkuwi.into();
|
||||
assert_eq!(x, Junctions::from([GlobalConsensus(Pezkuwi)]));
|
||||
let x: Junctions = (Pezkuwi, Kusama).into();
|
||||
assert_eq!(x, Junctions::from([GlobalConsensus(Pezkuwi), GlobalConsensus(Kusama)]));
|
||||
let x: Junctions = (Pezkuwi, Dicle).into();
|
||||
assert_eq!(x, Junctions::from([GlobalConsensus(Pezkuwi), GlobalConsensus(Dicle)]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn encode_decode_junctions_works() {
|
||||
let original = Junctions::from([
|
||||
Pezkuwi.into(),
|
||||
Kusama.into(),
|
||||
Dicle.into(),
|
||||
1u64.into(),
|
||||
GlobalConsensus(Pezkuwi),
|
||||
Teyrchain(123),
|
||||
|
||||
@@ -977,7 +977,7 @@ pub enum Instruction<Call> {
|
||||
/// - `xcm`: The message to be exported.
|
||||
///
|
||||
/// As an example, to export a message for execution on Statemine (teyrchain #1000 in the
|
||||
/// Kusama network), you would call with `network: NetworkId::Kusama` and
|
||||
/// Dicle network), you would call with `network: NetworkId::Dicle` and
|
||||
/// `destination: [Teyrchain(1000)].into()`. Alternatively, to export a message for execution
|
||||
/// on Pezkuwi, you would call with `network: NetworkId:: Pezkuwi` and `destination: Here`.
|
||||
///
|
||||
|
||||
@@ -142,8 +142,8 @@ pub enum NetworkId {
|
||||
ByFork { block_number: u64, block_hash: [u8; 32] },
|
||||
/// The Pezkuwi mainnet Relay-chain.
|
||||
Pezkuwi,
|
||||
/// The Kusama canary-net Relay-chain.
|
||||
Kusama,
|
||||
/// The Dicle canary-net Relay-chain.
|
||||
Dicle,
|
||||
/// An Ethereum network specified by its chain ID.
|
||||
#[codec(index = 7)]
|
||||
Ethereum {
|
||||
@@ -175,7 +175,7 @@ impl From<OldNetworkId> for NetworkId {
|
||||
ByGenesis(hash) => Self::ByGenesis(hash),
|
||||
ByFork { block_number, block_hash } => Self::ByFork { block_number, block_hash },
|
||||
Pezkuwi => Self::Pezkuwi,
|
||||
Kusama => Self::Kusama,
|
||||
Dicle => Self::Dicle,
|
||||
Zagros => Self::ByGenesis(ZAGROS_GENESIS_HASH),
|
||||
Pezkuwichain => Self::ByGenesis(PEZKUWICHAIN_GENESIS_HASH),
|
||||
Wococo => Self::ByGenesis(DUMMY_GENESIS_HASH),
|
||||
|
||||
@@ -622,20 +622,20 @@ mod tests {
|
||||
fn relative_to_works() {
|
||||
use NetworkId::*;
|
||||
assert_eq!(
|
||||
Junctions::from([Pezkuwi.into()]).relative_to(&Junctions::from([Kusama.into()])),
|
||||
Junctions::from([Pezkuwi.into()]).relative_to(&Junctions::from([Dicle.into()])),
|
||||
(Parent, Pezkuwi).into()
|
||||
);
|
||||
let base = Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(1)]);
|
||||
let base = Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(1)]);
|
||||
|
||||
// Ancestors.
|
||||
assert_eq!(Here.relative_to(&base), (Parent, Parent, Parent).into());
|
||||
assert_eq!(Junctions::from([Kusama.into()]).relative_to(&base), (Parent, Parent).into());
|
||||
assert_eq!(Junctions::from([Dicle.into()]).relative_to(&base), (Parent, Parent).into());
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(1)]).relative_to(&base),
|
||||
(Parent,).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(1)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(1)]).relative_to(&base),
|
||||
Here.into()
|
||||
);
|
||||
|
||||
@@ -645,15 +645,15 @@ mod tests {
|
||||
(Parent, Parent, Parent, Pezkuwi).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(2)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(2)]).relative_to(&base),
|
||||
(Parent, Parent, Teyrchain(2)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(2)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(2)]).relative_to(&base),
|
||||
(Parent, PalletInstance(2)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(1), [1u8; 32].into()])
|
||||
Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(1), [1u8; 32].into()])
|
||||
.relative_to(&base),
|
||||
([1u8; 32],).into()
|
||||
);
|
||||
@@ -664,17 +664,17 @@ mod tests {
|
||||
(Parent, Parent, Parent, Pezkuwi, Teyrchain(1)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(2), PalletInstance(1)]).relative_to(&base),
|
||||
Junctions::from([Dicle.into(), Teyrchain(2), PalletInstance(1)]).relative_to(&base),
|
||||
(Parent, Parent, Teyrchain(2), PalletInstance(1)).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([Kusama.into(), Teyrchain(1), PalletInstance(2), [1u8; 32].into()])
|
||||
Junctions::from([Dicle.into(), Teyrchain(1), PalletInstance(2), [1u8; 32].into()])
|
||||
.relative_to(&base),
|
||||
(Parent, PalletInstance(2), [1u8; 32]).into()
|
||||
);
|
||||
assert_eq!(
|
||||
Junctions::from([
|
||||
Kusama.into(),
|
||||
Dicle.into(),
|
||||
Teyrchain(1),
|
||||
PalletInstance(1),
|
||||
[1u8; 32].into(),
|
||||
@@ -689,10 +689,10 @@ mod tests {
|
||||
fn global_consensus_works() {
|
||||
use NetworkId::*;
|
||||
assert_eq!(Junctions::from([Pezkuwi.into()]).global_consensus(), Ok(Pezkuwi));
|
||||
assert_eq!(Junctions::from([Kusama.into(), 1u64.into()]).global_consensus(), Ok(Kusama));
|
||||
assert_eq!(Junctions::from([Dicle.into(), 1u64.into()]).global_consensus(), Ok(Dicle));
|
||||
assert_eq!(Here.global_consensus(), Err(()));
|
||||
assert_eq!(Junctions::from([1u64.into()]).global_consensus(), Err(()));
|
||||
assert_eq!(Junctions::from([1u64.into(), Kusama.into()]).global_consensus(), Err(()));
|
||||
assert_eq!(Junctions::from([1u64.into(), Dicle.into()]).global_consensus(), Err(()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -702,15 +702,15 @@ mod tests {
|
||||
assert_eq!(x, Junctions::from([GlobalConsensus(Pezkuwi)]));
|
||||
let x: Junctions = Pezkuwi.into();
|
||||
assert_eq!(x, Junctions::from([GlobalConsensus(Pezkuwi)]));
|
||||
let x: Junctions = (Pezkuwi, Kusama).into();
|
||||
assert_eq!(x, Junctions::from([GlobalConsensus(Pezkuwi), GlobalConsensus(Kusama)]));
|
||||
let x: Junctions = (Pezkuwi, Dicle).into();
|
||||
assert_eq!(x, Junctions::from([GlobalConsensus(Pezkuwi), GlobalConsensus(Dicle)]));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn encode_decode_junctions_works() {
|
||||
let original = Junctions::from([
|
||||
Pezkuwi.into(),
|
||||
Kusama.into(),
|
||||
Dicle.into(),
|
||||
1u64.into(),
|
||||
GlobalConsensus(Pezkuwi),
|
||||
Teyrchain(123),
|
||||
|
||||
@@ -933,7 +933,7 @@ pub enum Instruction<Call> {
|
||||
/// - `xcm`: The message to be exported.
|
||||
///
|
||||
/// As an example, to export a message for execution on Statemine (teyrchain #1000 in the
|
||||
/// Kusama network), you would call with `network: NetworkId::Kusama` and
|
||||
/// Dicle network), you would call with `network: NetworkId::Dicle` and
|
||||
/// `destination: [Teyrchain(1000)].into()`. Alternatively, to export a message for execution
|
||||
/// on Pezkuwi, you would call with `network: NetworkId:: Pezkuwi` and `destination: Here`.
|
||||
///
|
||||
|
||||
@@ -146,8 +146,8 @@ fn alias_child_location() {
|
||||
&Location::new(0, PalletInstance(42)),
|
||||
));
|
||||
assert!(AliasChildLocation::contains(
|
||||
&Location::new(2, GlobalConsensus(Kusama)),
|
||||
&Location::new(2, [GlobalConsensus(Kusama), Teyrchain(42), GeneralIndex(12)]),
|
||||
&Location::new(2, GlobalConsensus(Dicle)),
|
||||
&Location::new(2, [GlobalConsensus(Dicle), Teyrchain(42), GeneralIndex(12)]),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ fn take_weight_credit_barrier_should_work() {
|
||||
#[test]
|
||||
fn computed_origin_should_work() {
|
||||
let mut message = Xcm::<()>(vec![
|
||||
UniversalOrigin(GlobalConsensus(Kusama)),
|
||||
UniversalOrigin(GlobalConsensus(Dicle)),
|
||||
DescendOrigin(Teyrchain(100).into()),
|
||||
DescendOrigin(PalletInstance(69).into()),
|
||||
WithdrawAsset((Parent, 100).into()),
|
||||
@@ -64,7 +64,7 @@ fn computed_origin_should_work() {
|
||||
AllowPaidFrom::set(vec![(
|
||||
Parent,
|
||||
Parent,
|
||||
GlobalConsensus(Kusama),
|
||||
GlobalConsensus(Dicle),
|
||||
Teyrchain(100),
|
||||
PalletInstance(69),
|
||||
)
|
||||
|
||||
@@ -302,7 +302,7 @@ pub fn to_account(l: impl Into<Location>) -> Result<u64, Location> {
|
||||
return Err(l);
|
||||
}
|
||||
match l.first_interior() {
|
||||
Some(GlobalConsensus(Kusama)) => 4000,
|
||||
Some(GlobalConsensus(Dicle)) => 4000,
|
||||
Some(GlobalConsensus(Pezkuwi)) => 4001,
|
||||
_ => return Err(l),
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@ use super::*;
|
||||
fn universal_origin_should_work() {
|
||||
AllowUnpaidFrom::set(vec![[Teyrchain(1)].into(), [Teyrchain(2)].into()]);
|
||||
clear_universal_aliases();
|
||||
// Teyrchain 1 may represent Kusama to us
|
||||
add_universal_alias(Teyrchain(1), Kusama);
|
||||
// Teyrchain 1 may represent Dicle to us
|
||||
add_universal_alias(Teyrchain(1), Dicle);
|
||||
// Teyrchain 2 may represent Pezkuwi to us
|
||||
add_universal_alias(Teyrchain(2), Pezkuwi);
|
||||
|
||||
let message = Xcm(vec![
|
||||
UniversalOrigin(GlobalConsensus(Kusama)),
|
||||
UniversalOrigin(GlobalConsensus(Dicle)),
|
||||
TransferAsset { assets: (Parent, 100u128).into(), beneficiary: Here.into() },
|
||||
]);
|
||||
let mut hash = fake_message_hash(&message);
|
||||
@@ -46,7 +46,7 @@ fn universal_origin_should_work() {
|
||||
);
|
||||
|
||||
let message = Xcm(vec![
|
||||
UniversalOrigin(GlobalConsensus(Kusama)),
|
||||
UniversalOrigin(GlobalConsensus(Dicle)),
|
||||
TransferAsset { assets: (Parent, 100u128).into(), beneficiary: Here.into() },
|
||||
]);
|
||||
let mut hash = fake_message_hash(&message);
|
||||
@@ -65,9 +65,9 @@ fn universal_origin_should_work() {
|
||||
}
|
||||
);
|
||||
|
||||
add_asset((Ancestor(2), GlobalConsensus(Kusama)), (Parent, 100));
|
||||
add_asset((Ancestor(2), GlobalConsensus(Dicle)), (Parent, 100));
|
||||
let message = Xcm(vec![
|
||||
UniversalOrigin(GlobalConsensus(Kusama)),
|
||||
UniversalOrigin(GlobalConsensus(Dicle)),
|
||||
TransferAsset { assets: (Parent, 100u128).into(), beneficiary: Here.into() },
|
||||
]);
|
||||
let mut hash = fake_message_hash(&message);
|
||||
@@ -79,7 +79,7 @@ fn universal_origin_should_work() {
|
||||
Weight::zero(),
|
||||
);
|
||||
assert_eq!(r, Outcome::Complete { used: Weight::from_parts(20, 20) });
|
||||
assert_eq!(asset_list((Ancestor(2), GlobalConsensus(Kusama))), vec![]);
|
||||
assert_eq!(asset_list((Ancestor(2), GlobalConsensus(Dicle))), vec![]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -684,12 +684,12 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn ensure_is_remote_works() {
|
||||
// A Kusama teyrchain is remote from the Pezkuwi Relay.
|
||||
let x = ensure_is_remote(Pezkuwi, (Parent, Kusama, Teyrchain(1000)));
|
||||
assert_eq!(x, Ok((Kusama, Teyrchain(1000).into())));
|
||||
// A Dicle teyrchain is remote from the Pezkuwi Relay.
|
||||
let x = ensure_is_remote(Pezkuwi, (Parent, Dicle, Teyrchain(1000)));
|
||||
assert_eq!(x, Ok((Dicle, Teyrchain(1000).into())));
|
||||
|
||||
// Pezkuwi Relay is remote from a Kusama teyrchain.
|
||||
let x = ensure_is_remote((Kusama, Teyrchain(1000)), (Parent, Parent, Pezkuwi));
|
||||
// Pezkuwi Relay is remote from a Dicle teyrchain.
|
||||
let x = ensure_is_remote((Dicle, Teyrchain(1000)), (Parent, Parent, Pezkuwi));
|
||||
assert_eq!(x, Ok((Pezkuwi, Here)));
|
||||
|
||||
// Our own teyrchain is local.
|
||||
|
||||
@@ -70,7 +70,7 @@ impl SendXcm for TestSendXcm {
|
||||
|
||||
pub type TestXcmRouter = EnsureDecodableXcm<TestSendXcm>;
|
||||
|
||||
// copied from kusama constants
|
||||
// copied from dicle constants
|
||||
pub const UNITS: Balance = 1_000_000_000_000;
|
||||
pub const CENTS: Balance = UNITS / 30_000;
|
||||
|
||||
@@ -120,16 +120,16 @@ impl configuration::Config for Runtime {
|
||||
type WeightInfo = configuration::TestWeightInfo;
|
||||
}
|
||||
|
||||
// aims to closely emulate the Kusama XcmConfig
|
||||
// aims to closely emulate the Dicle XcmConfig
|
||||
parameter_types! {
|
||||
pub const KsmLocation: Location = Location::here();
|
||||
pub const KusamaNetwork: NetworkId = NetworkId::Kusama;
|
||||
pub UniversalLocation: InteriorLocation = KusamaNetwork::get().into();
|
||||
pub const DicleNetwork: NetworkId = NetworkId::Dicle;
|
||||
pub UniversalLocation: InteriorLocation = DicleNetwork::get().into();
|
||||
pub CheckAccount: (AccountId, MintLocation) = (XcmPallet::check_account(), MintLocation::Local);
|
||||
}
|
||||
|
||||
pub type SovereignAccountOf =
|
||||
(ChildTeyrchainConvertsVia<ParaId, AccountId>, AccountId32Aliases<KusamaNetwork, AccountId>);
|
||||
(ChildTeyrchainConvertsVia<ParaId, AccountId>, AccountId32Aliases<DicleNetwork, AccountId>);
|
||||
|
||||
pub type LocalCurrencyAdapter =
|
||||
FungibleAdapter<Balances, IsConcrete<KsmLocation>, SovereignAccountOf, AccountId, CheckAccount>;
|
||||
@@ -139,7 +139,7 @@ pub type LocalAssetTransactor = (LocalCurrencyAdapter,);
|
||||
type LocalOriginConverter = (
|
||||
SovereignSignedViaLocation<SovereignAccountOf, RuntimeOrigin>,
|
||||
ChildTeyrchainAsNative<origin::Origin, RuntimeOrigin>,
|
||||
SignedAccountId32AsNative<KusamaNetwork, RuntimeOrigin>,
|
||||
SignedAccountId32AsNative<DicleNetwork, RuntimeOrigin>,
|
||||
ChildSystemTeyrchainAsSuperuser<ParaId, RuntimeOrigin>,
|
||||
);
|
||||
|
||||
@@ -156,13 +156,13 @@ pub type Barrier = (
|
||||
);
|
||||
|
||||
parameter_types! {
|
||||
pub KusamaForAssetHub: (AssetFilter, Location) =
|
||||
pub DicleForAssetHub: (AssetFilter, Location) =
|
||||
(Wild(AllOf { id: AssetId(Here.into()), fun: WildFungible }), Teyrchain(1000).into());
|
||||
pub const MaxInstructions: u32 = 100;
|
||||
pub const MaxAssetsIntoHolding: u32 = 4;
|
||||
}
|
||||
|
||||
pub type TrustedTeleporters = (xcm_builder::Case<KusamaForAssetHub>,);
|
||||
pub type TrustedTeleporters = (xcm_builder::Case<DicleForAssetHub>,);
|
||||
|
||||
pub struct XcmConfig;
|
||||
impl xcm_executor::Config for XcmConfig {
|
||||
@@ -200,7 +200,7 @@ impl xcm_executor::Config for XcmConfig {
|
||||
|
||||
/// Converts a local signed origin into an XCM location. Forms the basis for local origins
|
||||
/// sending/executing XCMs.
|
||||
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, KusamaNetwork>;
|
||||
pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, DicleNetwork>;
|
||||
|
||||
impl pezpallet_xcm::Config for Runtime {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
@@ -245,7 +245,7 @@ construct_runtime!(
|
||||
}
|
||||
);
|
||||
|
||||
pub fn kusama_like_with_balances(
|
||||
pub fn dicle_like_with_balances(
|
||||
balances: Vec<(AccountId, Balance)>,
|
||||
) -> pezsp_io::TestExternalities {
|
||||
let mut t = pezframe_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
mod mock;
|
||||
|
||||
use mock::{
|
||||
kusama_like_with_balances, AccountId, Balance, Balances, BaseXcmWeight, System, XcmConfig,
|
||||
dicle_like_with_balances, AccountId, Balance, Balances, BaseXcmWeight, System, XcmConfig,
|
||||
CENTS,
|
||||
};
|
||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||
@@ -44,7 +44,7 @@ fn buy_execution<C>() -> Instruction<C> {
|
||||
fn withdraw_and_deposit_works() {
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating();
|
||||
let balances = vec![(ALICE, INITIAL_BALANCE), (para_acc.clone(), INITIAL_BALANCE)];
|
||||
kusama_like_with_balances(balances).execute_with(|| {
|
||||
dicle_like_with_balances(balances).execute_with(|| {
|
||||
let other_para_id = 3000;
|
||||
let amount = REGISTER_AMOUNT;
|
||||
let weight = BaseXcmWeight::get() * 3;
|
||||
@@ -79,7 +79,7 @@ fn withdraw_and_deposit_works() {
|
||||
fn transfer_asset_works() {
|
||||
let bob = AccountId::new([1u8; 32]);
|
||||
let balances = vec![(ALICE, INITIAL_BALANCE), (bob.clone(), INITIAL_BALANCE)];
|
||||
kusama_like_with_balances(balances).execute_with(|| {
|
||||
dicle_like_with_balances(balances).execute_with(|| {
|
||||
let amount = REGISTER_AMOUNT;
|
||||
let weight = BaseXcmWeight::get();
|
||||
let message = Xcm(vec![TransferAsset {
|
||||
@@ -117,7 +117,7 @@ fn report_holding_works() {
|
||||
use xcm::opaque::latest::prelude::*;
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating();
|
||||
let balances = vec![(ALICE, INITIAL_BALANCE), (para_acc.clone(), INITIAL_BALANCE)];
|
||||
kusama_like_with_balances(balances).execute_with(|| {
|
||||
dicle_like_with_balances(balances).execute_with(|| {
|
||||
let other_para_id = 3000;
|
||||
let amount = REGISTER_AMOUNT;
|
||||
let weight = BaseXcmWeight::get() * 4;
|
||||
@@ -195,11 +195,11 @@ fn report_holding_works() {
|
||||
}
|
||||
|
||||
/// Scenario:
|
||||
/// A teyrchain wants to move KSM from Kusama to Asset Hub.
|
||||
/// A teyrchain wants to move DCL from Dicle to Asset Hub.
|
||||
/// The teyrchain sends an XCM to withdraw funds combined with a teleport to the destination.
|
||||
///
|
||||
/// This way of moving funds from a relay to a teyrchain will only work for trusted chains.
|
||||
/// Reserve based transfer should be used to move KSM to a community teyrchain.
|
||||
/// Reserve based transfer should be used to move DCL to a community teyrchain.
|
||||
///
|
||||
/// Asserts that the balances are updated accordingly and the correct XCM is sent.
|
||||
#[test]
|
||||
@@ -207,7 +207,7 @@ fn teleport_to_asset_hub_works() {
|
||||
use xcm::opaque::latest::prelude::*;
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating();
|
||||
let balances = vec![(ALICE, INITIAL_BALANCE), (para_acc.clone(), INITIAL_BALANCE)];
|
||||
kusama_like_with_balances(balances).execute_with(|| {
|
||||
dicle_like_with_balances(balances).execute_with(|| {
|
||||
let asset_hub_id = 1000;
|
||||
let other_para_id = 3000;
|
||||
let amount = REGISTER_AMOUNT;
|
||||
@@ -246,7 +246,7 @@ fn teleport_to_asset_hub_works() {
|
||||
}
|
||||
);
|
||||
|
||||
// teleports are allowed from asset hub to kusama.
|
||||
// teleports are allowed from asset hub to dicle.
|
||||
let message = Xcm(vec![
|
||||
WithdrawAsset((Here, amount).into()),
|
||||
buy_execution(),
|
||||
@@ -277,7 +277,7 @@ fn teleport_to_asset_hub_works() {
|
||||
}
|
||||
|
||||
/// Scenario:
|
||||
/// A teyrchain wants to move KSM from Kusama to the teyrchain.
|
||||
/// A teyrchain wants to move DCL from Dicle to the teyrchain.
|
||||
/// It withdraws funds and then deposits them into the reserve account of the destination chain.
|
||||
/// to the destination.
|
||||
///
|
||||
@@ -287,7 +287,7 @@ fn reserve_based_transfer_works() {
|
||||
use xcm::opaque::latest::prelude::*;
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating();
|
||||
let balances = vec![(ALICE, INITIAL_BALANCE), (para_acc.clone(), INITIAL_BALANCE)];
|
||||
kusama_like_with_balances(balances).execute_with(|| {
|
||||
dicle_like_with_balances(balances).execute_with(|| {
|
||||
let other_para_id = 3000;
|
||||
let amount = REGISTER_AMOUNT;
|
||||
let transfer_effects = vec![
|
||||
@@ -412,7 +412,7 @@ fn recursive_xcm_execution_fail() {
|
||||
let mut hash = fake_message_hash(&message);
|
||||
let weight = BaseXcmWeight::get() * 3;
|
||||
|
||||
kusama_like_with_balances(balances).execute_with(|| {
|
||||
dicle_like_with_balances(balances).execute_with(|| {
|
||||
let outcome = XcmExecutor::<XcmTestConfig>::prepare_and_execute(
|
||||
origin,
|
||||
message,
|
||||
|
||||
@@ -26,6 +26,6 @@ parameter_types! {
|
||||
|
||||
parameter_types! {
|
||||
pub const KsmLocation: Location = Location::parent();
|
||||
pub const RelayNetwork: NetworkId = NetworkId::Kusama;
|
||||
pub const RelayNetwork: NetworkId = NetworkId::Dicle;
|
||||
pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get()), Teyrchain(TeyrchainId::<Runtime>::get().into())].into();
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ parameter_types! {
|
||||
|
||||
parameter_types! {
|
||||
pub const KsmLocation: Location = Location::parent();
|
||||
pub const RelayNetwork: NetworkId = NetworkId::Kusama;
|
||||
pub const RelayNetwork: NetworkId = NetworkId::Dicle;
|
||||
pub UniversalLocation: InteriorLocation = [GlobalConsensus(RelayNetwork::get()), Teyrchain(MsgQueue::teyrchain_id().into())].into();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user