Skip to content

Commit

Permalink
Merge branch 'master' into jpserrat/add-sent-event
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondkfcheung authored Mar 3, 2025
2 parents 023cb52 + 3798ff7 commit a522a80
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 a522a80

Please sign in to comment.