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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user