git.delta.rocks / unique-network / refs/commits / b76251dab35f

difftreelog

refactor local_asset_id_to_collection

Daniel Shiposha2023-11-16parent: #05c886f.patch.diff
in: master

1 file changed

modifiedpallets/foreign-assets/src/lib.rsdiffbeforeafterboth
262 return Some(CollectionLocality::Local(NATIVE_FUNGIBLE_COLLECTION_ID));262 return Some(CollectionLocality::Local(NATIVE_FUNGIBLE_COLLECTION_ID));
263 }263 }
264264
265 let collection_junction = if asset_location.parents == 0 {265 let prefix = if asset_location.parents == 0 {
266 match &asset_location.interior {266 &Here
267 X1(junction) => junction,
268 _ => return None,
269 }
270 } else if asset_location.parents == self_location.parents {267 } else if asset_location.parents == self_location.parents {
271 asset_location
272 .interior
273 .match_and_split(&self_location.interior)?268 &self_location.interior
274 } else {269 } else {
275 return None;270 return None;
276 };271 };
277272
278 let GeneralIndex(collection_id) = collection_junction else {273 let GeneralIndex(collection_id) = asset_location.interior.match_and_split(prefix)? else {
279 return None;274 return None;
280 };275 };
281276