-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Metadata to Base #270
Comments
@ilionic I would like to get your confirmation before I start working on this to make sure that this is indeed something that should be added to the RMRK pallets. |
@Szegoo yes that's correct - Base ( to be renamed to Catalog ) should have metadata ( as well as parts ) |
Ok, since we are going to store metadata for multiple entities(Nfts, Collections, Bases, Parts) we might want to do something like the following so that we avoid code duplication. // define an enum that will have all of the mentioned entities that will store metadata
enum Entity<T: Config> {
/// The entity is a collection
Collection(T::CollectionId),
/// The entity is a collection nft
Nft(T::CollectionId, T::ItemId),
/// The entity is a base
Base(BaseId),
/// The entity is a Part
Part(PartId),
}
// --snip--
#[pallet::call_index(9)]
#[pallet::weight(<T as pallet::Config>::WeightInfo::set_property())]
#[transactional]
pub fn set_property(
origin: OriginFor<T>,
entity: Entity<T>,
key: KeyLimitOf<T>,
value: ValueLimitOf<T>,
) -> DispatchResult {
let sender = ensure_signed(origin)?;
Self::property_set(sender, collection_id, maybe_nft_id, key.clone(), value.clone())?;
Self::deposit_event(Event::PropertySet { collection_id, maybe_nft_id, key, value });
Ok(())
}
// --snip-- And then inside @ilionic @HashWarlock Do you think this makes sense? |
Which parts would create duplicated code? I would think that we can still keep the parameters, and have an internal function that sets the metadata based on the |
If I understand you correctly you are suggesting that we have separate extrinsics for setting the metadata for each of these Entities but have each of them call the same function inside But I do think that we need to introduce an PropertySet {
entity: Entity<T>,
key: KeyLimitOf<T>,
value: ValueLimitOf<T>,
}, |
Inside the RMRK specifications, it is defined that the base should also have the ability to store metadata. This is specified inside here.
The text was updated successfully, but these errors were encountered: