XCM: Allow reclaim of assets dropped from holding (#3727)

* XCM: Introduce AssetTrap

* Revert reversions

* Remove attempts at weighing and add test

* Less storage use for asset trapping

* Add missing file

* Fixes

* Fixes

* Formatting

* Fixes

* Docs

* Filter types to allow runtimes to dictate which assets/origins should be trapped

* Formatting

* Tests

* Formatting

* Fixes

* Docs
This commit is contained in:
Gavin Wood
2021-08-28 02:09:36 +02:00
committed by GitHub
parent e56efb82d9
commit 636d0b030f
24 changed files with 519 additions and 49 deletions
+1 -1
View File
@@ -1044,7 +1044,7 @@ mod tests {
}
#[test]
fn invalid_attest_transactions_are_recognised() {
fn invalid_attest_transactions_are_recognized() {
new_test_ext().execute_with(|| {
let p = PrevalidateAttests::<Test>::new();
let c = Call::Claims(ClaimsCall::attest(StatementKind::Regular.to_text().to_vec()));
+3 -1
View File
@@ -1296,7 +1296,9 @@ impl xcm_executor::Config for XcmConfig {
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
// The weight trader piggybacks on the existing transaction-fee conversion logic.
type Trader = UsingComponents<WeightToFee, KsmLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = ();
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
}
parameter_types! {
+3 -1
View File
@@ -669,7 +669,9 @@ impl xcm_executor::Config for XcmConfig {
type Barrier = Barrier;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Trader = UsingComponents<WeightToFee, RocLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = ();
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
}
parameter_types! {
@@ -86,4 +86,6 @@ impl xcm_executor::Config for XcmConfig {
type Weigher = FixedWeightBounds<super::BaseXcmWeight, super::Call, MaxInstructions>;
type Trader = DummyWeightTrader;
type ResponseHandler = super::Xcm;
type AssetTrap = super::Xcm;
type AssetClaims = super::Xcm;
}
+3 -1
View File
@@ -938,7 +938,9 @@ impl xcm_executor::Config for XcmConfig {
type Barrier = Barrier;
type Weigher = FixedWeightBounds<BaseXcmWeight, Call, MaxInstructions>;
type Trader = UsingComponents<WeightToFee, WndLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = ();
type ResponseHandler = XcmPallet;
type AssetTrap = XcmPallet;
type AssetClaims = XcmPallet;
}
/// Type to convert an `Origin` type value into a `MultiLocation` value which represents an interior location