Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add event to asset claim #6029

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ pub mod pallet {
///
/// \[ location, query ID \]
NotifyTargetMigrationFail(VersionedMultiLocation, QueryId),
/// Some assets have been claimed from an asset trap
///
/// \[ hash, origin, assets \]
AssetsClaimed(H256, MultiLocation, VersionedMultiAssets),
}

#[pallet::origin]
Expand Down Expand Up @@ -1303,12 +1307,13 @@ pub mod pallet {
(0, Here) => (),
_ => return false,
};
let hash = BlakeTwo256::hash_of(&(origin, versioned));
let hash = BlakeTwo256::hash_of(&(origin, versioned.clone()));
match AssetTraps::<T>::get(hash) {
0 => return false,
1 => AssetTraps::<T>::remove(hash),
n => AssetTraps::<T>::insert(hash, n - 1),
}
Self::deposit_event(Event::AssetsClaimed(hash, origin.clone(), versioned));
return true
}
}
Expand Down