Merge branch 'master' into gav-xcm-v3

This commit is contained in:
Keith Yeung
2022-09-22 21:36:30 +08:00
203 changed files with 5861 additions and 3564 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ version = "0.1.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.2.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.144", optional = true, features = ["derive"] }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
+8 -8
View File
@@ -47,13 +47,13 @@ pub mod pallet {
#[pallet::config]
pub trait Config: frame_system::Config {
/// The overarching event type.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
type Origin: From<<Self as SystemConfig>::Origin>
+ Into<Result<CumulusOrigin, <Self as Config>::Origin>>;
type RuntimeOrigin: From<<Self as SystemConfig>::RuntimeOrigin>
+ Into<Result<CumulusOrigin, <Self as Config>::RuntimeOrigin>>;
/// The overarching call type; we assume sibling chains use the same type.
type Call: From<Call<Self>> + Encode;
type RuntimeCall: From<Call<Self>> + Encode;
type XcmSender: SendXcm;
}
@@ -108,7 +108,7 @@ pub mod pallet {
Xcm(vec![Transact {
origin_kind: OriginKind::Native,
require_weight_at_most: 1_000,
call: <T as Config>::Call::from(Call::<T>::ping {
call: <T as Config>::RuntimeCall::from(Call::<T>::ping {
seq,
payload: payload.clone().to_vec(),
})
@@ -196,7 +196,7 @@ pub mod pallet {
#[pallet::weight(0)]
pub fn ping(origin: OriginFor<T>, seq: u32, payload: Vec<u8>) -> DispatchResult {
// Only accept pings from other chains.
let para = ensure_sibling_para(<T as Config>::Origin::from(origin))?;
let para = ensure_sibling_para(<T as Config>::RuntimeOrigin::from(origin))?;
Self::deposit_event(Event::Pinged(para, seq, payload.clone()));
match send_xcm::<T::XcmSender>(
@@ -204,7 +204,7 @@ pub mod pallet {
Xcm(vec![Transact {
origin_kind: OriginKind::Native,
require_weight_at_most: 1_000,
call: <T as Config>::Call::from(Call::<T>::pong {
call: <T as Config>::RuntimeCall::from(Call::<T>::pong {
seq,
payload: payload.clone(),
})
@@ -222,7 +222,7 @@ pub mod pallet {
#[pallet::weight(0)]
pub fn pong(origin: OriginFor<T>, seq: u32, payload: Vec<u8>) -> DispatchResult {
// Only accept pings from other chains.
let para = ensure_sibling_para(<T as Config>::Origin::from(origin))?;
let para = ensure_sibling_para(<T as Config>::RuntimeOrigin::from(origin))?;
if let Some(sent_at) = Pings::<T>::take(seq) {
Self::deposit_event(Event::Ponged(