difftreelog
doc: more info about asset-instance to token id conv
in: master
1 file changed
pallets/foreign-assets/src/lib.rsdiffbeforeafterboth278 /// `None` will be returned.278 /// `None` will be returned.279 ///279 ///280 /// Note: this function can return `Some` containing the token ID of a non-existing NFT.280 /// Note: this function can return `Some` containing the token ID of a non-existing NFT.281 /// It returns `None` when it failed to convert the `asset_instance` to a local ID.281 fn local_asset_instance_to_token_id(asset_instance: &AssetInstance) -> Option<TokenId> {282 fn local_asset_instance_to_token_id(asset_instance: &AssetInstance) -> Option<TokenId> {282 match asset_instance {283 match asset_instance {283 AssetInstance::Index(token_id) => Some(TokenId((*token_id).try_into().ok()?)),284 AssetInstance::Index(token_id) => Some(TokenId((*token_id).try_into().ok()?)),286 }287 }287288288 /// Obtains the token ID of the `asset_instance` in the collection.289 /// Obtains the token ID of the `asset_instance` in the collection.290 ///291 /// Note: this function can return `Some` containing the token ID of a non-existing NFT.292 /// It returns `None` when it failed to convert the `asset_instance` to a local ID.289 fn asset_instance_to_token_id(293 fn asset_instance_to_token_id(290 collection_locality: CollectionLocality,294 collection_locality: CollectionLocality,291 asset_instance: &AssetInstance,295 asset_instance: &AssetInstance,