mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 06:21:02 +00:00
Add environmental variable to track decoded instructions (#1320)
* Add environmental variable to track decoded instructions * Fix doc tests * Fix manifest formatting * ".git/.scripts/commands/fmt/fmt.sh" * Add one more test * Add SetAppendix in test --------- Co-authored-by: command-bot <>
This commit is contained in:
committed by
GitHub
parent
aedd280874
commit
995d81fd84
Generated
+1
@@ -17910,6 +17910,7 @@ version = "1.0.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bounded-collections",
|
"bounded-collections",
|
||||||
"derivative",
|
"derivative",
|
||||||
|
"environmental",
|
||||||
"hex",
|
"hex",
|
||||||
"hex-literal 0.4.1",
|
"hex-literal 0.4.1",
|
||||||
"impl-trait-for-tuples",
|
"impl-trait-for-tuples",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ scale-info = { version = "2.5.0", default-features = false, features = ["derive"
|
|||||||
sp-weights = { path = "../../substrate/primitives/weights", default-features = false, features = ["serde"] }
|
sp-weights = { path = "../../substrate/primitives/weights", default-features = false, features = ["serde"] }
|
||||||
serde = { version = "1.0.188", default-features = false, features = ["alloc", "derive"] }
|
serde = { version = "1.0.188", default-features = false, features = ["alloc", "derive"] }
|
||||||
xcm-procedural = { path = "procedural" }
|
xcm-procedural = { path = "procedural" }
|
||||||
|
environmental = { version = "1.1.4", default-features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
sp-io = { path = "../../substrate/primitives/io" }
|
sp-io = { path = "../../substrate/primitives/io" }
|
||||||
@@ -27,6 +28,7 @@ default = [ "std" ]
|
|||||||
wasm-api = []
|
wasm-api = []
|
||||||
std = [
|
std = [
|
||||||
"bounded-collections/std",
|
"bounded-collections/std",
|
||||||
|
"environmental/std",
|
||||||
"parity-scale-codec/std",
|
"parity-scale-codec/std",
|
||||||
"scale-info/std",
|
"scale-info/std",
|
||||||
"serde/std",
|
"serde/std",
|
||||||
|
|||||||
@@ -20,7 +20,8 @@
|
|||||||
// necessarily related to FRAME or even Substrate.
|
// necessarily related to FRAME or even Substrate.
|
||||||
//
|
//
|
||||||
// Hence, `no_std` rather than sp-runtime.
|
// Hence, `no_std` rather than sp-runtime.
|
||||||
#![no_std]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
|
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
use derivative::Derivative;
|
use derivative::Derivative;
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v2::{Junctions::*, Junction::*, MultiLocation};
|
/// # use staging_xcm::v2::{Junctions::*, Junction::*, MultiLocation};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m = MultiLocation::new(1, X2(PalletInstance(3), OnlyChild));
|
/// let mut m = MultiLocation::new(1, X2(PalletInstance(3), OnlyChild));
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
@@ -260,7 +260,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v2::{Junctions::*, Junction::*, MultiLocation};
|
/// # use staging_xcm::v2::{Junctions::*, Junction::*, MultiLocation};
|
||||||
/// let m = MultiLocation::new(1, X3(PalletInstance(3), OnlyChild, OnlyChild));
|
/// let m = MultiLocation::new(1, X3(PalletInstance(3), OnlyChild, OnlyChild));
|
||||||
/// assert!(m.starts_with(&MultiLocation::new(1, X1(PalletInstance(3)))));
|
/// assert!(m.starts_with(&MultiLocation::new(1, X1(PalletInstance(3)))));
|
||||||
/// assert!(!m.starts_with(&MultiLocation::new(1, X1(GeneralIndex(99)))));
|
/// assert!(!m.starts_with(&MultiLocation::new(1, X1(GeneralIndex(99)))));
|
||||||
@@ -279,7 +279,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v2::{Junctions::*, Junction::*, MultiLocation};
|
/// # use staging_xcm::v2::{Junctions::*, Junction::*, MultiLocation};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m = MultiLocation::new(1, X1(Parachain(21)));
|
/// let mut m = MultiLocation::new(1, X1(Parachain(21)));
|
||||||
/// assert_eq!(m.append_with(X1(PalletInstance(3))), Ok(()));
|
/// assert_eq!(m.append_with(X1(PalletInstance(3))), Ok(()));
|
||||||
@@ -302,7 +302,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v2::{Junctions::*, Junction::*, MultiLocation};
|
/// # use staging_xcm::v2::{Junctions::*, Junction::*, MultiLocation};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m = MultiLocation::new(2, X1(PalletInstance(3)));
|
/// let mut m = MultiLocation::new(2, X1(PalletInstance(3)));
|
||||||
/// assert_eq!(m.prepend_with(MultiLocation::new(1, X2(Parachain(21), OnlyChild))), Ok(()));
|
/// assert_eq!(m.prepend_with(MultiLocation::new(1, X2(Parachain(21), OnlyChild))), Ok(()));
|
||||||
@@ -839,7 +839,7 @@ impl Junctions {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v2::{Junctions::*, Junction::*};
|
/// # use staging_xcm::v2::{Junctions::*, Junction::*};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m = X3(Parachain(2), PalletInstance(3), OnlyChild);
|
/// let mut m = X3(Parachain(2), PalletInstance(3), OnlyChild);
|
||||||
/// assert_eq!(m.match_and_split(&X2(Parachain(2), PalletInstance(3))), Some(&OnlyChild));
|
/// assert_eq!(m.match_and_split(&X2(Parachain(2), PalletInstance(3))), Some(&OnlyChild));
|
||||||
@@ -857,7 +857,7 @@ impl Junctions {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v2::{Junctions::*, Junction::*};
|
/// # use staging_xcm::v2::{Junctions::*, Junction::*};
|
||||||
/// let mut j = X3(Parachain(2), PalletInstance(3), OnlyChild);
|
/// let mut j = X3(Parachain(2), PalletInstance(3), OnlyChild);
|
||||||
/// assert!(j.starts_with(&X2(Parachain(2), PalletInstance(3))));
|
/// assert!(j.starts_with(&X2(Parachain(2), PalletInstance(3))));
|
||||||
/// assert!(j.starts_with(&j));
|
/// assert!(j.starts_with(&j));
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ pub type SendResult = result::Result<(), SendError>;
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v2::prelude::*;
|
/// # use staging_xcm::v2::prelude::*;
|
||||||
/// # use parity_scale_codec::Encode;
|
/// # use parity_scale_codec::Encode;
|
||||||
///
|
///
|
||||||
/// /// A sender that only passes the message through and does nothing.
|
/// /// A sender that only passes the message through and does nothing.
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ impl Junctions {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation};
|
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m = X1(Parachain(21));
|
/// let mut m = X1(Parachain(21));
|
||||||
/// assert_eq!(m.append_with(X1(PalletInstance(3))), Ok(()));
|
/// assert_eq!(m.append_with(X1(PalletInstance(3))), Ok(()));
|
||||||
@@ -568,7 +568,7 @@ impl Junctions {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v3::{Junctions::*, Junction::*};
|
/// # use staging_xcm::v3::{Junctions::*, Junction::*};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m = X3(Parachain(2), PalletInstance(3), OnlyChild);
|
/// let mut m = X3(Parachain(2), PalletInstance(3), OnlyChild);
|
||||||
/// assert_eq!(m.match_and_split(&X2(Parachain(2), PalletInstance(3))), Some(&OnlyChild));
|
/// assert_eq!(m.match_and_split(&X2(Parachain(2), PalletInstance(3))), Some(&OnlyChild));
|
||||||
|
|||||||
+44
-15
@@ -22,7 +22,7 @@ use super::v2::{
|
|||||||
};
|
};
|
||||||
use crate::DoubleEncoded;
|
use crate::DoubleEncoded;
|
||||||
use alloc::{vec, vec::Vec};
|
use alloc::{vec, vec::Vec};
|
||||||
use bounded_collections::{parameter_types, BoundedVec, ConstU32};
|
use bounded_collections::{parameter_types, BoundedVec};
|
||||||
use core::{
|
use core::{
|
||||||
convert::{TryFrom, TryInto},
|
convert::{TryFrom, TryInto},
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
@@ -30,7 +30,8 @@ use core::{
|
|||||||
};
|
};
|
||||||
use derivative::Derivative;
|
use derivative::Derivative;
|
||||||
use parity_scale_codec::{
|
use parity_scale_codec::{
|
||||||
self, Decode, Encode, Error as CodecError, Input as CodecInput, MaxEncodedLen,
|
self, decode_vec_with_len, Compact, Decode, Encode, Error as CodecError, Input as CodecInput,
|
||||||
|
MaxEncodedLen,
|
||||||
};
|
};
|
||||||
use scale_info::TypeInfo;
|
use scale_info::TypeInfo;
|
||||||
|
|
||||||
@@ -69,13 +70,25 @@ pub type QueryId = u64;
|
|||||||
#[scale_info(bounds(), skip_type_params(Call))]
|
#[scale_info(bounds(), skip_type_params(Call))]
|
||||||
pub struct Xcm<Call>(pub Vec<Instruction<Call>>);
|
pub struct Xcm<Call>(pub Vec<Instruction<Call>>);
|
||||||
|
|
||||||
const MAX_INSTRUCTIONS_TO_DECODE: u32 = 100;
|
const MAX_INSTRUCTIONS_TO_DECODE: u8 = 100;
|
||||||
|
|
||||||
|
environmental::environmental!(instructions_count: u8);
|
||||||
|
|
||||||
impl<Call> Decode for Xcm<Call> {
|
impl<Call> Decode for Xcm<Call> {
|
||||||
fn decode<I: CodecInput>(input: &mut I) -> core::result::Result<Self, CodecError> {
|
fn decode<I: CodecInput>(input: &mut I) -> core::result::Result<Self, CodecError> {
|
||||||
let bounded_instructions =
|
instructions_count::using_once(&mut 0, || {
|
||||||
BoundedVec::<Instruction<Call>, ConstU32<MAX_INSTRUCTIONS_TO_DECODE>>::decode(input)?;
|
let number_of_instructions: u32 = <Compact<u32>>::decode(input)?.into();
|
||||||
Ok(Self(bounded_instructions.into_inner()))
|
instructions_count::with(|count| {
|
||||||
|
*count = count.saturating_add(number_of_instructions as u8);
|
||||||
|
if *count > MAX_INSTRUCTIONS_TO_DECODE {
|
||||||
|
return Err(CodecError::from("Max instructions exceeded"))
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
.unwrap_or(Ok(()))?;
|
||||||
|
let decoded_instructions = decode_vec_with_len(input, number_of_instructions as usize)?;
|
||||||
|
Ok(Self(decoded_instructions))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1441,15 +1454,31 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn decoding_fails_when_too_many_instructions() {
|
fn decoding_respects_limit() {
|
||||||
let small_xcm = Xcm::<()>(vec![ClearOrigin; 20]);
|
let max_xcm = Xcm::<()>(vec![ClearOrigin; MAX_INSTRUCTIONS_TO_DECODE as usize]);
|
||||||
let bytes = small_xcm.encode();
|
let encoded = max_xcm.encode();
|
||||||
let decoded_xcm = Xcm::<()>::decode(&mut &bytes[..]);
|
assert!(Xcm::<()>::decode(&mut &encoded[..]).is_ok());
|
||||||
assert!(matches!(decoded_xcm, Ok(_)));
|
|
||||||
|
|
||||||
let big_xcm = Xcm::<()>(vec![ClearOrigin; 64_000]);
|
let big_xcm = Xcm::<()>(vec![ClearOrigin; MAX_INSTRUCTIONS_TO_DECODE as usize + 1]);
|
||||||
let bytes = big_xcm.encode();
|
let encoded = big_xcm.encode();
|
||||||
let decoded_xcm = Xcm::<()>::decode(&mut &bytes[..]);
|
assert!(Xcm::<()>::decode(&mut &encoded[..]).is_err());
|
||||||
assert!(matches!(decoded_xcm, Err(CodecError { .. })));
|
|
||||||
|
let nested_xcm = Xcm::<()>(vec![
|
||||||
|
DepositReserveAsset {
|
||||||
|
assets: All.into(),
|
||||||
|
dest: Here.into(),
|
||||||
|
xcm: max_xcm,
|
||||||
|
};
|
||||||
|
(MAX_INSTRUCTIONS_TO_DECODE / 2) as usize
|
||||||
|
]);
|
||||||
|
let encoded = nested_xcm.encode();
|
||||||
|
assert!(Xcm::<()>::decode(&mut &encoded[..]).is_err());
|
||||||
|
|
||||||
|
let even_more_nested_xcm = Xcm::<()>(vec![SetAppendix(nested_xcm); 64]);
|
||||||
|
let encoded = even_more_nested_xcm.encode();
|
||||||
|
assert_eq!(encoded.len(), 342530);
|
||||||
|
// This should not decode since the limit is 100
|
||||||
|
assert_eq!(MAX_INSTRUCTIONS_TO_DECODE, 100, "precondition");
|
||||||
|
assert!(Xcm::<()>::decode(&mut &encoded[..]).is_err());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation};
|
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m = MultiLocation::new(1, X2(PalletInstance(3), OnlyChild));
|
/// let mut m = MultiLocation::new(1, X2(PalletInstance(3), OnlyChild));
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
@@ -292,7 +292,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
|
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m: MultiLocation = (Parent, Parachain(21), 69u64).into();
|
/// let mut m: MultiLocation = (Parent, Parachain(21), 69u64).into();
|
||||||
/// assert_eq!(m.append_with((Parent, PalletInstance(3))), Ok(()));
|
/// assert_eq!(m.append_with((Parent, PalletInstance(3))), Ok(()));
|
||||||
@@ -313,7 +313,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
|
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m: MultiLocation = (Parent, Parachain(21), 69u64).into();
|
/// let mut m: MultiLocation = (Parent, Parachain(21), 69u64).into();
|
||||||
/// let r = m.appended_with((Parent, PalletInstance(3))).unwrap();
|
/// let r = m.appended_with((Parent, PalletInstance(3))).unwrap();
|
||||||
@@ -333,7 +333,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
|
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let mut m: MultiLocation = (Parent, Parent, PalletInstance(3)).into();
|
/// let mut m: MultiLocation = (Parent, Parent, PalletInstance(3)).into();
|
||||||
/// assert_eq!(m.prepend_with((Parent, Parachain(21), OnlyChild)), Ok(()));
|
/// assert_eq!(m.prepend_with((Parent, Parachain(21), OnlyChild)), Ok(()));
|
||||||
@@ -382,7 +382,7 @@ impl MultiLocation {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
|
/// # use staging_xcm::v3::{Junctions::*, Junction::*, MultiLocation, Parent};
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
/// let m: MultiLocation = (Parent, Parent, PalletInstance(3)).into();
|
/// let m: MultiLocation = (Parent, Parent, PalletInstance(3)).into();
|
||||||
/// let r = m.prepended_with((Parent, Parachain(21), OnlyChild)).unwrap();
|
/// let r = m.prepended_with((Parent, Parachain(21), OnlyChild)).unwrap();
|
||||||
|
|||||||
@@ -449,8 +449,8 @@ pub type SendResult<T> = result::Result<(T, MultiAssets), SendError>;
|
|||||||
/// # Example
|
/// # Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use parity_scale_codec::Encode;
|
/// # use parity_scale_codec::Encode;
|
||||||
/// # use xcm::v3::{prelude::*, Weight};
|
/// # use staging_xcm::v3::{prelude::*, Weight};
|
||||||
/// # use xcm::VersionedXcm;
|
/// # use staging_xcm::VersionedXcm;
|
||||||
/// # use std::convert::Infallible;
|
/// # use std::convert::Infallible;
|
||||||
///
|
///
|
||||||
/// /// A sender that only passes the message through and does nothing.
|
/// /// A sender that only passes the message through and does nothing.
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ impl From<Error> for XcmError {
|
|||||||
/// use frame_support::{parameter_types, PalletId};
|
/// use frame_support::{parameter_types, PalletId};
|
||||||
/// use sp_runtime::traits::{AccountIdConversion, TrailingZeroInput};
|
/// use sp_runtime::traits::{AccountIdConversion, TrailingZeroInput};
|
||||||
/// use xcm::latest::prelude::*;
|
/// use xcm::latest::prelude::*;
|
||||||
/// use xcm_builder::{ParentIsPreset, CurrencyAdapter, IsConcrete};
|
/// use staging_xcm_builder::{ParentIsPreset, CurrencyAdapter, IsConcrete};
|
||||||
///
|
///
|
||||||
/// /// Our chain's account id.
|
/// /// Our chain's account id.
|
||||||
/// type AccountId = sp_runtime::AccountId32;
|
/// type AccountId = sp_runtime::AccountId32;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ impl<'a, Call> CreateMatcher for &'a mut [Instruction<Call>] {
|
|||||||
/// ```rust
|
/// ```rust
|
||||||
/// use frame_support::traits::ProcessMessageError;
|
/// use frame_support::traits::ProcessMessageError;
|
||||||
/// use xcm::latest::Instruction;
|
/// use xcm::latest::Instruction;
|
||||||
/// use xcm_builder::{CreateMatcher, MatchXcm};
|
/// use staging_xcm_builder::{CreateMatcher, MatchXcm};
|
||||||
///
|
///
|
||||||
/// let mut msg = [Instruction::<()>::ClearOrigin];
|
/// let mut msg = [Instruction::<()>::ClearOrigin];
|
||||||
/// let res = msg
|
/// let res = msg
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ use xcm_executor::traits::{MatchesFungible, MatchesNonFungible};
|
|||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use xcm::latest::{MultiLocation, Parent};
|
/// use xcm::latest::{MultiLocation, Parent};
|
||||||
/// use xcm_builder::IsConcrete;
|
/// use staging_xcm_builder::IsConcrete;
|
||||||
/// use xcm_executor::traits::MatchesFungible;
|
/// use xcm_executor::traits::MatchesFungible;
|
||||||
///
|
///
|
||||||
/// frame_support::parameter_types! {
|
/// frame_support::parameter_types! {
|
||||||
@@ -71,7 +71,7 @@ impl<T: Get<MultiLocation>, I: TryFrom<AssetInstance>> MatchesNonFungible<I> for
|
|||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use xcm::latest::prelude::*;
|
/// use xcm::latest::prelude::*;
|
||||||
/// use xcm_builder::IsAbstract;
|
/// use staging_xcm_builder::IsAbstract;
|
||||||
/// use xcm_executor::traits::{MatchesFungible, MatchesNonFungible};
|
/// use xcm_executor::traits::{MatchesFungible, MatchesNonFungible};
|
||||||
///
|
///
|
||||||
/// frame_support::parameter_types! {
|
/// frame_support::parameter_types! {
|
||||||
|
|||||||
@@ -446,7 +446,7 @@ impl Assets {
|
|||||||
/// Example:
|
/// Example:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use xcm_executor::Assets;
|
/// use staging_xcm_executor::Assets;
|
||||||
/// use xcm::latest::prelude::*;
|
/// use xcm::latest::prelude::*;
|
||||||
/// let assets_i_have: Assets = vec![ (Here, 100).into(), ([0; 32], 100).into() ].into();
|
/// let assets_i_have: Assets = vec![ (Here, 100).into(), ([0; 32], 100).into() ].into();
|
||||||
/// let assets_they_want: MultiAssetFilter = vec![ (Here, 200).into(), ([0; 32], 50).into() ].into();
|
/// let assets_they_want: MultiAssetFilter = vec![ (Here, 200).into(), ([0; 32], 50).into() ].into();
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ impl<AccountId> ConvertLocation<AccountId> for Tuple {
|
|||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use xcm::latest::{MultiLocation, Junctions, Junction, OriginKind};
|
/// # use xcm::latest::{MultiLocation, Junctions, Junction, OriginKind};
|
||||||
/// # use xcm_executor::traits::ConvertOrigin;
|
/// # use staging_xcm_executor::traits::ConvertOrigin;
|
||||||
/// // A convertor that will bump the para id and pass it to the next one.
|
/// // A convertor that will bump the para id and pass it to the next one.
|
||||||
/// struct BumpParaId;
|
/// struct BumpParaId;
|
||||||
/// impl ConvertOrigin<u32> for BumpParaId {
|
/// impl ConvertOrigin<u32> for BumpParaId {
|
||||||
|
|||||||
Reference in New Issue
Block a user