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

Commit

Permalink
Add event to asset claim (#6029)
Browse files Browse the repository at this point in the history
  • Loading branch information
girazoki authored Oct 10, 2022
1 parent fb0dd8e commit f85f96c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,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 @@ -1312,12 +1316,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

0 comments on commit f85f96c

Please sign in to comment.