2

I want to pass the collection id in the from of MultiAssets to transfer it to the another chain. But i'm facing this issue

error[E0614]: type `<T as pallet_nfts::Config>::CollectionId` cannot be dereferenced
   --> xnft/src/lib.rs:201:30
    |
201 |             let assets: MultiAssets = (*collection_id).try_into().map_err(|()| Error::<T>::BadVersion)?;
    |                     

              ^^^^^^^^^^^^^^^^

1 Answer 1

1

The error message indicates that you're trying to dereference a type <T as pallet_nfts::Config>::CollectionId, but it is not a type that can be dereferenced.

To resolve this issue, you should avoid dereferencing the collection_id directly. Instead, you can use the Into trait to convert it into the desired type. Here's an example of how you can modify your code to fix the issue:

let assets: MultiAssets = collection_id.into();

By using the Into trait, the collection_id will be automatically converted into the appropriate type, as long as there is an implementation of Into<MultiAssets> for CollectionId.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.