rmrk-team/rmrk-substrate

ComposableResources and SlotResources are unused storages, should be deleted

bmacer opened this issue · 1 comments

Quite sure all of the storages go directly to Resources, regardless of type, so it should be safe to delete these two storages

#[pallet::storage]
#[pallet::getter(fn composable_resources)]
/// Stores resource info
pub type ComposableResources<T: Config> = StorageNMap<
_,
(
NMapKey<Blake2_128Concat, CollectionId>,
NMapKey<Blake2_128Concat, NftId>,
NMapKey<Blake2_128Concat, BaseId>,
),
(),
>;
#[pallet::storage]
#[pallet::getter(fn slot_resources)]
/// Stores resource info
pub type SlotResources<T: Config> = StorageNMap<
_,
(
NMapKey<Blake2_128Concat, CollectionId>,
NMapKey<Blake2_128Concat, NftId>,
NMapKey<Blake2_128Concat, ResourceId>,
NMapKey<Blake2_128Concat, BaseId>,
NMapKey<Blake2_128Concat, SlotId>,
),
(),
>;

Indeed we do use these storages. ComposableResource is populated during add_composable_resource and is used to check for the existence of a base on an NFT during equip in the equip pallet. Similarly, SlotResource is used for ensuring the existence of a slot on a particular NFT's particular resource when doing an equip in the rmrk-equip pallet.

Proposing changing these names to be more clear
ComposableResources -> EquippableBases
SlotResources -> EquippableSlots