From d561386d7f3374c75cab87b59eaed8816705854e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 28 Nov 2023 19:52:02 +0000 Subject: [PATCH] doc: more info about asset-instance to token id conv --- --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -278,6 +278,7 @@ /// `None` will be returned. /// /// Note: this function can return `Some` containing the token ID of a non-existing NFT. + /// It returns `None` when it failed to convert the `asset_instance` to a local ID. fn local_asset_instance_to_token_id(asset_instance: &AssetInstance) -> Option { match asset_instance { AssetInstance::Index(token_id) => Some(TokenId((*token_id).try_into().ok()?)), @@ -286,6 +287,9 @@ } /// Obtains the token ID of the `asset_instance` in the collection. + /// + /// Note: this function can return `Some` containing the token ID of a non-existing NFT. + /// It returns `None` when it failed to convert the `asset_instance` to a local ID. fn asset_instance_to_token_id( collection_locality: CollectionLocality, asset_instance: &AssetInstance, -- gitstuff