Skip to content

Commit

Permalink
Remove pallet::getter usage from pallet-nft-fractionalization (#7124
Browse files Browse the repository at this point in the history
)

Description
Part of #3326
As per title, `pallet::getter` usage has been removed from
`pallet-nft-fractionalization`.

---------

Co-authored-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
muraca and ggwpez authored Mar 3, 2025
1 parent 1bc6ca6 commit 3798ff7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions prdoc/pr_7124.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: Remove pallet::getter from pallet-nft-fractionalization
doc:
- audience: Runtime Dev
description: |
This PR removes all pallet::getter occurrences from pallet-nft-fractionalization and replaces them with explicit implementations.

crates:
- name: pallet-nft-fractionalization
bump: major
8 changes: 7 additions & 1 deletion substrate/frame/nft-fractionalization/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ pub mod pallet {

/// Keeps track of the corresponding NFT ID, asset ID and amount minted.
#[pallet::storage]
#[pallet::getter(fn nft_to_asset)]
pub type NftToAsset<T: Config> = StorageMap<
_,
Blake2_128Concat,
Expand Down Expand Up @@ -338,6 +337,13 @@ pub mod pallet {
T::PalletId::get().into_account_truncating()
}

/// Keeps track of the corresponding NFT ID, asset ID and amount minted.
pub fn nft_to_asset(
key: (T::NftCollectionId, T::NftId),
) -> Option<Details<AssetIdOf<T>, AssetBalanceOf<T>, DepositOf<T>, T::AccountId>> {
NftToAsset::<T>::get(key)
}

/// Prevent further transferring of NFT.
fn do_lock_nft(nft_collection_id: T::NftCollectionId, nft_id: T::NftId) -> DispatchResult {
T::Nfts::disable_transfer(&nft_collection_id, &nft_id)
Expand Down

0 comments on commit 3798ff7

Please sign in to comment.