Add Bridges to xcm-emulator (#2812)

* rename bridge hub + BridgeMessages type

* bridge base

* bridge string approach

* add decl_test_bridges macro

* outbound lanes on the way

* get & dispatch mock bridge done

* fix bridge errors + log::debug for messages

* clean up

* update source OutboundLaneData

* rococo & wococo added

* sender_receiver_accounts_parameter_types macro

* sender_receiver_accounts_parameter_types macro 2

* fixed multi parachain + example on the way

* working but router error

* bridge working

* refactor NetworkComponent

* make it generic

* working as generic

* clean up

* last bit

* ".git/.scripts/commands/fmt/fmt.sh"

* fix bridge hub handler name

* ".git/.scripts/commands/fmt/fmt.sh"

* add AssetConversion back for AssetHubWestend

* Update xcm/xcm-emulator/src/lib.rs

Co-authored-by: Squirrel <gilescope@gmail.com>

* add LaneId wrapper

* update substrate

* fix wrapper conversion

* remove duplicate in workspace

* Revert "update substrate"

This reverts commit 92e8f201ae433aed3f70b998ebd4c23d9168d0ee.

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
Co-authored-by: Squirrel <gilescope@gmail.com>
This commit is contained in:
Ignacio Palacios
2023-07-05 11:39:08 +02:00
committed by GitHub
parent fdd2e5221e
commit f6b33fe927
15 changed files with 1121 additions and 283 deletions
@@ -1,41 +1,25 @@
pub mod constants;
pub mod impls;
pub use constants::{
accounts::{ALICE, BOB},
asset_hub_kusama, asset_hub_polkadot, asset_hub_westend, bridge_hub_kusama,
bridge_hub_polkadot, collectives, kusama, penpal, polkadot, westend,
bridge_hub_polkadot, bridge_hub_rococo, collectives, kusama, penpal, polkadot, rococo, westend,
};
pub use impls::{RococoWococoMessageHandler, WococoRococoMessageHandler};
use frame_support::{parameter_types, sp_io, sp_tracing};
pub use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber};
pub use sp_core::{sr25519, storage::Storage, Get};
use xcm::prelude::*;
use xcm_emulator::{
decl_test_networks, decl_test_parachains, decl_test_relay_chains, Parachain, RelayChain,
TestExt,
decl_test_bridges, decl_test_networks, decl_test_parachains, decl_test_relay_chains,
decl_test_sender_receiver_accounts_parameter_types, BridgeMessageHandler, Parachain,
RelayChain, TestExt,
};
use xcm_executor::traits::ConvertLocation;
decl_test_relay_chains! {
#[api_version(5)]
pub struct Westend {
genesis = westend::genesis(),
on_init = (),
runtime = {
Runtime: westend_runtime::Runtime,
RuntimeOrigin: westend_runtime::RuntimeOrigin,
RuntimeCall: westend_runtime::RuntimeCall,
RuntimeEvent: westend_runtime::RuntimeEvent,
MessageQueue: westend_runtime::MessageQueue,
XcmConfig: westend_runtime::xcm_config::XcmConfig,
SovereignAccountOf: westend_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf,
System: westend_runtime::System,
Balances: westend_runtime::Balances,
},
pallets_extra = {
XcmPallet: westend_runtime::XcmPallet,
Sudo: westend_runtime::Sudo,
}
},
#[api_version(5)]
pub struct Polkadot {
genesis = polkadot::genesis(),
@@ -73,35 +57,71 @@ decl_test_relay_chains! {
pallets_extra = {
XcmPallet: kusama_runtime::XcmPallet,
}
},
#[api_version(5)]
pub struct Westend {
genesis = westend::genesis(),
on_init = (),
runtime = {
Runtime: westend_runtime::Runtime,
RuntimeOrigin: westend_runtime::RuntimeOrigin,
RuntimeCall: westend_runtime::RuntimeCall,
RuntimeEvent: westend_runtime::RuntimeEvent,
MessageQueue: westend_runtime::MessageQueue,
XcmConfig: westend_runtime::xcm_config::XcmConfig,
SovereignAccountOf: westend_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf,
System: westend_runtime::System,
Balances: westend_runtime::Balances,
},
pallets_extra = {
XcmPallet: westend_runtime::XcmPallet,
Sudo: westend_runtime::Sudo,
}
},
#[api_version(5)]
pub struct Rococo {
genesis = rococo::genesis(),
on_init = (),
runtime = {
Runtime: rococo_runtime::Runtime,
RuntimeOrigin: rococo_runtime::RuntimeOrigin,
RuntimeCall: rococo_runtime::RuntimeCall,
RuntimeEvent: rococo_runtime::RuntimeEvent,
MessageQueue: rococo_runtime::MessageQueue,
XcmConfig: rococo_runtime::xcm_config::XcmConfig,
SovereignAccountOf: rococo_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf,
System: rococo_runtime::System,
Balances: rococo_runtime::Balances,
},
pallets_extra = {
XcmPallet: rococo_runtime::XcmPallet,
Sudo: rococo_runtime::Sudo,
}
},
#[api_version(5)]
pub struct Wococo {
genesis = rococo::genesis(),
on_init = (),
runtime = {
Runtime: rococo_runtime::Runtime,
RuntimeOrigin: rococo_runtime::RuntimeOrigin,
RuntimeCall: rococo_runtime::RuntimeCall,
RuntimeEvent: rococo_runtime::RuntimeEvent,
MessageQueue: rococo_runtime::MessageQueue,
XcmConfig: rococo_runtime::xcm_config::XcmConfig,
SovereignAccountOf: rococo_runtime::xcm_config::LocationConverter, //TODO: rename to SovereignAccountOf,
System: rococo_runtime::System,
Balances: rococo_runtime::Balances,
},
pallets_extra = {
XcmPallet: rococo_runtime::XcmPallet,
Sudo: rococo_runtime::Sudo,
}
}
}
decl_test_parachains! {
// Westend
pub struct AssetHubWestend {
genesis = asset_hub_westend::genesis(),
on_init = (),
runtime = {
Runtime: asset_hub_westend_runtime::Runtime,
RuntimeOrigin: asset_hub_westend_runtime::RuntimeOrigin,
RuntimeCall: asset_hub_westend_runtime::RuntimeCall,
RuntimeEvent: asset_hub_westend_runtime::RuntimeEvent,
XcmpMessageHandler: asset_hub_westend_runtime::XcmpQueue,
DmpMessageHandler: asset_hub_westend_runtime::DmpQueue,
LocationToAccountId: asset_hub_westend_runtime::xcm_config::LocationToAccountId,
System: asset_hub_westend_runtime::System,
Balances: asset_hub_westend_runtime::Balances,
ParachainSystem: asset_hub_westend_runtime::ParachainSystem,
ParachainInfo: asset_hub_westend_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: asset_hub_westend_runtime::PolkadotXcm,
Assets: asset_hub_westend_runtime::Assets,
ForeignAssets: asset_hub_westend_runtime::ForeignAssets,
AssetConversion: asset_hub_westend_runtime::AssetConversion,
}
},
// Polkadot
// Polkadot Parachains
pub struct AssetHubPolkadot {
genesis = asset_hub_polkadot::genesis(),
on_init = (),
@@ -123,6 +143,46 @@ decl_test_parachains! {
Assets: asset_hub_polkadot_runtime::Assets,
}
},
pub struct Collectives {
genesis = collectives::genesis(),
on_init = (),
runtime = {
Runtime: collectives_polkadot_runtime::Runtime,
RuntimeOrigin: collectives_polkadot_runtime::RuntimeOrigin,
RuntimeCall: collectives_polkadot_runtime::RuntimeCall,
RuntimeEvent: collectives_polkadot_runtime::RuntimeEvent,
XcmpMessageHandler: collectives_polkadot_runtime::XcmpQueue,
DmpMessageHandler: collectives_polkadot_runtime::DmpQueue,
LocationToAccountId: collectives_polkadot_runtime::xcm_config::LocationToAccountId,
System: collectives_polkadot_runtime::System,
Balances: collectives_polkadot_runtime::Balances,
ParachainSystem: collectives_polkadot_runtime::ParachainSystem,
ParachainInfo: collectives_polkadot_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: collectives_polkadot_runtime::PolkadotXcm,
}
},
pub struct BridgeHubPolkadot {
genesis = bridge_hub_polkadot::genesis(),
on_init = (),
runtime = {
Runtime: bridge_hub_polkadot_runtime::Runtime,
RuntimeOrigin: bridge_hub_polkadot_runtime::RuntimeOrigin,
RuntimeCall: bridge_hub_polkadot_runtime::RuntimeCall,
RuntimeEvent: bridge_hub_polkadot_runtime::RuntimeEvent,
XcmpMessageHandler: bridge_hub_polkadot_runtime::XcmpQueue,
DmpMessageHandler: bridge_hub_polkadot_runtime::DmpQueue,
LocationToAccountId: bridge_hub_polkadot_runtime::xcm_config::LocationToAccountId,
System: bridge_hub_polkadot_runtime::System,
Balances: bridge_hub_polkadot_runtime::Balances,
ParachainSystem: bridge_hub_polkadot_runtime::ParachainSystem,
ParachainInfo: bridge_hub_polkadot_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: bridge_hub_polkadot_runtime::PolkadotXcm,
}
},
pub struct PenpalPolkadot {
genesis = penpal::genesis(penpal::PARA_ID),
on_init = (),
@@ -144,29 +204,7 @@ decl_test_parachains! {
Assets: penpal_runtime::Assets,
}
},
pub struct PenpalWestend {
genesis = penpal::genesis(penpal::PARA_ID),
on_init = (),
runtime = {
Runtime: penpal_runtime::Runtime,
RuntimeOrigin: penpal_runtime::RuntimeOrigin,
RuntimeCall: penpal_runtime::RuntimeCall,
RuntimeEvent: penpal_runtime::RuntimeEvent,
XcmpMessageHandler: penpal_runtime::XcmpQueue,
DmpMessageHandler: penpal_runtime::DmpQueue,
LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId,
System: penpal_runtime::System,
Balances: penpal_runtime::Balances,
ParachainSystem: penpal_runtime::ParachainSystem,
ParachainInfo: penpal_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: penpal_runtime::PolkadotXcm,
Assets: penpal_runtime::Assets,
}
},
// Kusama
// Kusama Parachains
pub struct AssetHubKusama {
genesis = asset_hub_kusama::genesis(),
on_init = (),
@@ -189,6 +227,26 @@ decl_test_parachains! {
ForeignAssets: asset_hub_kusama_runtime::Assets,
}
},
pub struct BridgeHubKusama {
genesis = bridge_hub_kusama::genesis(),
on_init = (),
runtime = {
Runtime: bridge_hub_kusama_runtime::Runtime,
RuntimeOrigin: bridge_hub_kusama_runtime::RuntimeOrigin,
RuntimeCall: bridge_hub_kusama_runtime::RuntimeCall,
RuntimeEvent: bridge_hub_kusama_runtime::RuntimeEvent,
XcmpMessageHandler: bridge_hub_kusama_runtime::XcmpQueue,
DmpMessageHandler: bridge_hub_kusama_runtime::DmpQueue,
LocationToAccountId: bridge_hub_kusama_runtime::xcm_config::LocationToAccountId,
System: bridge_hub_kusama_runtime::System,
Balances: bridge_hub_kusama_runtime::Balances,
ParachainSystem: bridge_hub_kusama_runtime::ParachainSystem,
ParachainInfo: bridge_hub_kusama_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: bridge_hub_kusama_runtime::PolkadotXcm,
}
},
pub struct PenpalKusama {
genesis = penpal::genesis(penpal::PARA_ID),
on_init = (),
@@ -210,64 +268,133 @@ decl_test_parachains! {
Assets: penpal_runtime::Assets,
}
},
pub struct Collectives {
genesis = collectives::genesis(),
// Westend Parachains
pub struct AssetHubWestend {
genesis = asset_hub_westend::genesis(),
on_init = (),
runtime = {
Runtime: collectives_polkadot_runtime::Runtime,
RuntimeOrigin: collectives_polkadot_runtime::RuntimeOrigin,
RuntimeCall: collectives_polkadot_runtime::RuntimeCall,
RuntimeEvent: collectives_polkadot_runtime::RuntimeEvent,
XcmpMessageHandler: collectives_polkadot_runtime::XcmpQueue,
DmpMessageHandler: collectives_polkadot_runtime::DmpQueue,
LocationToAccountId: collectives_polkadot_runtime::xcm_config::LocationToAccountId,
System: collectives_polkadot_runtime::System,
Balances: collectives_polkadot_runtime::Balances,
ParachainSystem: collectives_polkadot_runtime::ParachainSystem,
ParachainInfo: collectives_polkadot_runtime::ParachainInfo,
Runtime: asset_hub_westend_runtime::Runtime,
RuntimeOrigin: asset_hub_westend_runtime::RuntimeOrigin,
RuntimeCall: asset_hub_westend_runtime::RuntimeCall,
RuntimeEvent: asset_hub_westend_runtime::RuntimeEvent,
XcmpMessageHandler: asset_hub_westend_runtime::XcmpQueue,
DmpMessageHandler: asset_hub_westend_runtime::DmpQueue,
LocationToAccountId: asset_hub_westend_runtime::xcm_config::LocationToAccountId,
System: asset_hub_westend_runtime::System,
Balances: asset_hub_westend_runtime::Balances,
ParachainSystem: asset_hub_westend_runtime::ParachainSystem,
ParachainInfo: asset_hub_westend_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: collectives_polkadot_runtime::PolkadotXcm,
PolkadotXcm: asset_hub_westend_runtime::PolkadotXcm,
Assets: asset_hub_westend_runtime::Assets,
ForeignAssets: asset_hub_westend_runtime::ForeignAssets,
AssetConversion: asset_hub_westend_runtime::AssetConversion,
}
},
pub struct BHKusama {
genesis = bridge_hub_kusama::genesis(),
pub struct PenpalWestend {
genesis = penpal::genesis(penpal::PARA_ID),
on_init = (),
runtime = {
Runtime: bridge_hub_kusama_runtime::Runtime,
RuntimeOrigin: bridge_hub_kusama_runtime::RuntimeOrigin,
RuntimeCall: bridge_hub_kusama_runtime::RuntimeCall,
RuntimeEvent: bridge_hub_kusama_runtime::RuntimeEvent,
XcmpMessageHandler: bridge_hub_kusama_runtime::XcmpQueue,
DmpMessageHandler: bridge_hub_kusama_runtime::DmpQueue,
LocationToAccountId: bridge_hub_kusama_runtime::xcm_config::LocationToAccountId,
System: bridge_hub_kusama_runtime::System,
Balances: bridge_hub_kusama_runtime::Balances,
ParachainSystem: bridge_hub_kusama_runtime::ParachainSystem,
ParachainInfo:bridge_hub_kusama_runtime::ParachainInfo,
Runtime: penpal_runtime::Runtime,
RuntimeOrigin: penpal_runtime::RuntimeOrigin,
RuntimeCall: penpal_runtime::RuntimeCall,
RuntimeEvent: penpal_runtime::RuntimeEvent,
XcmpMessageHandler: penpal_runtime::XcmpQueue,
DmpMessageHandler: penpal_runtime::DmpQueue,
LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId,
System: penpal_runtime::System,
Balances: penpal_runtime::Balances,
ParachainSystem: penpal_runtime::ParachainSystem,
ParachainInfo: penpal_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: bridge_hub_kusama_runtime::PolkadotXcm,
PolkadotXcm: penpal_runtime::PolkadotXcm,
Assets: penpal_runtime::Assets,
}
},
pub struct BHPolkadot {
genesis = bridge_hub_polkadot::genesis(),
// Rococo Parachains
pub struct BridgeHubRococo {
genesis = bridge_hub_rococo::genesis(),
on_init = (),
runtime = {
Runtime: bridge_hub_polkadot_runtime::Runtime,
RuntimeOrigin: bridge_hub_polkadot_runtime::RuntimeOrigin,
RuntimeCall: bridge_hub_polkadot_runtime::RuntimeCall,
RuntimeEvent: bridge_hub_polkadot_runtime::RuntimeEvent,
XcmpMessageHandler: bridge_hub_polkadot_runtime::XcmpQueue,
DmpMessageHandler: bridge_hub_polkadot_runtime::DmpQueue,
LocationToAccountId: bridge_hub_polkadot_runtime::xcm_config::LocationToAccountId,
System: bridge_hub_polkadot_runtime::System,
Balances: bridge_hub_polkadot_runtime::Balances,
ParachainSystem: bridge_hub_polkadot_runtime::ParachainSystem,
ParachainInfo:bridge_hub_polkadot_runtime::ParachainInfo,
Runtime: bridge_hub_rococo_runtime::Runtime,
RuntimeOrigin: bridge_hub_rococo_runtime::RuntimeOrigin,
RuntimeCall: bridge_hub_rococo_runtime::RuntimeCall,
RuntimeEvent: bridge_hub_rococo_runtime::RuntimeEvent,
XcmpMessageHandler: bridge_hub_rococo_runtime::XcmpQueue,
DmpMessageHandler: bridge_hub_rococo_runtime::DmpQueue,
LocationToAccountId: bridge_hub_rococo_runtime::xcm_config::LocationToAccountId,
System: bridge_hub_rococo_runtime::System,
Balances: bridge_hub_rococo_runtime::Balances,
ParachainSystem: bridge_hub_rococo_runtime::ParachainSystem,
ParachainInfo: bridge_hub_rococo_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: bridge_hub_polkadot_runtime::PolkadotXcm,
PolkadotXcm: bridge_hub_rococo_runtime::PolkadotXcm,
}
},
pub struct AssetHubRococo {
genesis = asset_hub_polkadot::genesis(),
on_init = (),
runtime = {
Runtime: asset_hub_polkadot_runtime::Runtime,
RuntimeOrigin: asset_hub_polkadot_runtime::RuntimeOrigin,
RuntimeCall: asset_hub_polkadot_runtime::RuntimeCall,
RuntimeEvent: asset_hub_polkadot_runtime::RuntimeEvent,
XcmpMessageHandler: asset_hub_polkadot_runtime::XcmpQueue,
DmpMessageHandler: asset_hub_polkadot_runtime::DmpQueue,
LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId,
System: asset_hub_polkadot_runtime::System,
Balances: asset_hub_polkadot_runtime::Balances,
ParachainSystem: asset_hub_polkadot_runtime::ParachainSystem,
ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm,
Assets: asset_hub_polkadot_runtime::Assets,
}
},
// Wococo Parachains
pub struct BridgeHubWococo {
genesis = bridge_hub_rococo::genesis(),
on_init = (),
runtime = {
Runtime: bridge_hub_rococo_runtime::Runtime,
RuntimeOrigin: bridge_hub_rococo_runtime::RuntimeOrigin,
RuntimeCall: bridge_hub_rococo_runtime::RuntimeCall,
RuntimeEvent: bridge_hub_rococo_runtime::RuntimeEvent,
XcmpMessageHandler: bridge_hub_rococo_runtime::XcmpQueue,
DmpMessageHandler: bridge_hub_rococo_runtime::DmpQueue,
LocationToAccountId: bridge_hub_rococo_runtime::xcm_config::LocationToAccountId,
System: bridge_hub_rococo_runtime::System,
Balances: bridge_hub_rococo_runtime::Balances,
ParachainSystem: bridge_hub_rococo_runtime::ParachainSystem,
ParachainInfo: bridge_hub_rococo_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: bridge_hub_rococo_runtime::PolkadotXcm,
}
},
pub struct AssetHubWococo {
genesis = asset_hub_polkadot::genesis(),
on_init = (),
runtime = {
Runtime: asset_hub_polkadot_runtime::Runtime,
RuntimeOrigin: asset_hub_polkadot_runtime::RuntimeOrigin,
RuntimeCall: asset_hub_polkadot_runtime::RuntimeCall,
RuntimeEvent: asset_hub_polkadot_runtime::RuntimeEvent,
XcmpMessageHandler: asset_hub_polkadot_runtime::XcmpQueue,
DmpMessageHandler: asset_hub_polkadot_runtime::DmpQueue,
LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId,
System: asset_hub_polkadot_runtime::System,
Balances: asset_hub_polkadot_runtime::Balances,
ParachainSystem: asset_hub_polkadot_runtime::ParachainSystem,
ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo,
},
pallets_extra = {
PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm,
Assets: asset_hub_polkadot_runtime::Assets,
}
}
}
@@ -279,16 +406,22 @@ decl_test_networks! {
AssetHubPolkadot,
PenpalPolkadot,
Collectives,
BHPolkadot,
BridgeHubPolkadot,
],
// TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged
// bridge = PolkadotKusamaMockBridge
bridge = ()
},
pub struct KusamaMockNet {
relay_chain = Kusama,
parachains = vec![
AssetHubKusama,
PenpalKusama,
BHKusama,
BridgeHubKusama,
],
// TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged
// bridge = KusamaPolkadotMockBridge
bridge = ()
},
pub struct WestendMockNet {
relay_chain = Westend,
@@ -296,44 +429,72 @@ decl_test_networks! {
AssetHubWestend,
PenpalWestend,
],
bridge = ()
},
pub struct RococoMockNet {
relay_chain = Rococo,
parachains = vec![
AssetHubRococo,
BridgeHubRococo,
],
bridge = RococoWococoMockBridge
},
pub struct WococoMockNet {
relay_chain = Wococo,
parachains = vec![
AssetHubWococo,
BridgeHubWococo,
],
bridge = WococoRococoMockBridge
}
}
parameter_types! {
// Polkadot
pub PolkadotSender: AccountId = Polkadot::account_id_of(ALICE);
pub PolkadotReceiver: AccountId = Polkadot::account_id_of(BOB);
// Kusama
pub KusamaSender: AccountId = Kusama::account_id_of(ALICE);
pub KusamaReceiver: AccountId = Kusama::account_id_of(BOB);
// Westend
pub WestendSender: AccountId = Westend::account_id_of(ALICE);
pub WestendReceiver: AccountId = Westend::account_id_of(BOB);
// Asset Hub Westend
pub AssetHubWestendSender: AccountId = AssetHubWestend::account_id_of(ALICE);
pub AssetHubWestendReceiver: AccountId = AssetHubWestend::account_id_of(BOB);
// Asset Hub Polkadot
pub AssetHubPolkadotSender: AccountId = AssetHubPolkadot::account_id_of(ALICE);
pub AssetHubPolkadotReceiver: AccountId = AssetHubPolkadot::account_id_of(BOB);
// Asset Hub Kusama
pub AssetHubKusamaSender: AccountId = AssetHubKusama::account_id_of(ALICE);
pub AssetHubKusamaReceiver: AccountId = AssetHubKusama::account_id_of(BOB);
// Penpal Polkadot
pub PenpalPolkadotSender: AccountId = PenpalPolkadot::account_id_of(ALICE);
pub PenpalPolkadotReceiver: AccountId = PenpalPolkadot::account_id_of(BOB);
// Penpal Kusama
pub PenpalKusamaSender: AccountId = PenpalKusama::account_id_of(ALICE);
pub PenpalKusamaReceiver: AccountId = PenpalKusama::account_id_of(BOB);
// Penpal Westend
pub PenpalWestendSender: AccountId = PenpalWestend::account_id_of(ALICE);
pub PenpalWestendReceiver: AccountId = PenpalWestend::account_id_of(BOB);
// Collectives
pub CollectivesSender: AccountId = Collectives::account_id_of(ALICE);
pub CollectivesReceiver: AccountId = Collectives::account_id_of(BOB);
// Bridge Hub Polkadot
pub BHPolkadotSender: AccountId = BHPolkadot::account_id_of(ALICE);
pub BHPolkadotReceiver: AccountId = BHPolkadot::account_id_of(BOB);
// Bridge Hub Kusama
pub BHKusamaSender: AccountId = BHKusama::account_id_of(ALICE);
pub BHKusamaReceiver: AccountId = BHKusama::account_id_of(BOB);
decl_test_bridges! {
pub struct RococoWococoMockBridge {
source = BridgeHubRococo,
target = BridgeHubWococo,
handler = RococoWococoMessageHandler
},
pub struct WococoRococoMockBridge {
source = BridgeHubWococo,
target = BridgeHubRococo,
handler = WococoRococoMessageHandler
}
// TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged
// pub struct PolkadotKusamaMockBridge {
// source = BridgeHubPolkadot,
// target = BridgeHubKusama,
// handler = PolkadotKusamaMessageHandler
// },
// pub struct KusamaPolkadotMockBridge {
// source = BridgeHubKusama,
// target = BridgeHubPolkadot,
// handler = KusamaPolkadotMessageHandler
// }
}
decl_test_sender_receiver_accounts_parameter_types! {
// Relays
Polkadot { sender: ALICE, receiver: BOB },
Kusama { sender: ALICE, receiver: BOB },
Westend { sender: ALICE, receiver: BOB },
Rococo { sender: ALICE, receiver: BOB },
Wococo { sender: ALICE, receiver: BOB },
// Asset Hubs
AssetHubPolkadot { sender: ALICE, receiver: BOB },
AssetHubKusama { sender: ALICE, receiver: BOB },
AssetHubWestend { sender: ALICE, receiver: BOB },
AssetHubRococo { sender: ALICE, receiver: BOB },
AssetHubWococo { sender: ALICE, receiver: BOB },
// Collectives
Collectives { sender: ALICE, receiver: BOB },
// Bridged Hubs
BridgeHubPolkadot { sender: ALICE, receiver: BOB },
BridgeHubKusama { sender: ALICE, receiver: BOB },
BridgeHubRococo { sender: ALICE, receiver: BOB },
BridgeHubWococo { sender: ALICE, receiver: BOB },
// Penpals
PenpalPolkadot { sender: ALICE, receiver: BOB },
PenpalKusama { sender: ALICE, receiver: BOB },
PenpalWestend { sender: ALICE, receiver: BOB }
}