mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 16:41:10 +00:00
Backport of 1318 (#1348)
* recognise no reserves * adjust should_execute * docs and pass should_execute * typo
This commit is contained in:
@@ -137,13 +137,14 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
|
|||||||
return Err(()) // Deny
|
return Err(()) // Deny
|
||||||
}
|
}
|
||||||
|
|
||||||
// allow reserve transfers to arrive from relay chain
|
// An unexpected reserve transfer has arrived from the Relay Chain. Generally, `IsReserve`
|
||||||
|
// should not allow this, but we just log it here.
|
||||||
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
|
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
|
||||||
message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
|
message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
|
||||||
{
|
{
|
||||||
log::warn!(
|
log::warn!(
|
||||||
target: "xcm::barriers",
|
target: "xcm::barriers",
|
||||||
"Unexpected ReserveAssetDeposited from the relay chain",
|
"Unexpected ReserveAssetDeposited from the Relay Chain",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Permit everything else
|
// Permit everything else
|
||||||
|
|||||||
@@ -52,13 +52,14 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
|
|||||||
return Err(()) // Deny
|
return Err(()) // Deny
|
||||||
}
|
}
|
||||||
|
|
||||||
// allow reserve transfers to arrive from relay chain
|
// An unexpected reserve transfer has arrived from the Relay Chain. Generally, `IsReserve`
|
||||||
|
// should not allow this, but we just log it here.
|
||||||
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
|
if matches!(origin, MultiLocation { parents: 1, interior: Here }) &&
|
||||||
message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
|
message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. }))
|
||||||
{
|
{
|
||||||
log::warn!(
|
log::warn!(
|
||||||
target: "xcm::barrier",
|
target: "xcm::barrier",
|
||||||
"Unexpected ReserveAssetDeposited from the relay chain",
|
"Unexpected ReserveAssetDeposited from the Relay Chain",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Permit everything else
|
// Permit everything else
|
||||||
|
|||||||
@@ -162,7 +162,10 @@ impl xcm_executor::Config for XcmConfig {
|
|||||||
type XcmSender = XcmRouter;
|
type XcmSender = XcmRouter;
|
||||||
type AssetTransactor = AssetTransactors;
|
type AssetTransactor = AssetTransactors;
|
||||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||||
type IsReserve = NativeAsset;
|
// Statemine does not recognize a reserve location for any asset. This does not prevent
|
||||||
|
// Statemine acting _as_ a reserve location for KSM and assets created under `pallet-assets`.
|
||||||
|
// For KSM, users must use teleport where allowed (e.g. with the Relay Chain).
|
||||||
|
type IsReserve = ();
|
||||||
type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of KSM
|
type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of KSM
|
||||||
type LocationInverter = LocationInverter<Ancestry>;
|
type LocationInverter = LocationInverter<Ancestry>;
|
||||||
type Barrier = Barrier;
|
type Barrier = Barrier;
|
||||||
|
|||||||
@@ -162,7 +162,10 @@ impl xcm_executor::Config for XcmConfig {
|
|||||||
type XcmSender = XcmRouter;
|
type XcmSender = XcmRouter;
|
||||||
type AssetTransactor = AssetTransactors;
|
type AssetTransactor = AssetTransactors;
|
||||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||||
type IsReserve = NativeAsset;
|
// Statemint does not recognize a reserve location for any asset. This does not prevent
|
||||||
|
// Statemint acting _as_ a reserve location for DOT and assets created under `pallet-assets`.
|
||||||
|
// For DOT, users must use teleport where allowed (e.g. with the Relay Chain).
|
||||||
|
type IsReserve = ();
|
||||||
type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of DOT
|
type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of DOT
|
||||||
type LocationInverter = LocationInverter<Ancestry>;
|
type LocationInverter = LocationInverter<Ancestry>;
|
||||||
type Barrier = Barrier;
|
type Barrier = Barrier;
|
||||||
|
|||||||
@@ -158,7 +158,10 @@ impl xcm_executor::Config for XcmConfig {
|
|||||||
type XcmSender = XcmRouter;
|
type XcmSender = XcmRouter;
|
||||||
type AssetTransactor = AssetTransactors;
|
type AssetTransactor = AssetTransactors;
|
||||||
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
type OriginConverter = XcmOriginToTransactDispatchOrigin;
|
||||||
type IsReserve = NativeAsset;
|
// Westmint does not recognize a reserve location for any asset. This does not prevent
|
||||||
|
// Westmint acting _as_ a reserve location for WND and assets created under `pallet-assets`.
|
||||||
|
// For WND, users must use teleport where allowed (e.g. with the Relay Chain).
|
||||||
|
type IsReserve = ();
|
||||||
type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of WND
|
type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of WND
|
||||||
type LocationInverter = LocationInverter<Ancestry>;
|
type LocationInverter = LocationInverter<Ancestry>;
|
||||||
type Barrier = Barrier;
|
type Barrier = Barrier;
|
||||||
|
|||||||
Reference in New Issue
Block a user