Skip to content

Commit

Permalink
fix: cantransfer attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mrshiposha committed Sep 6, 2024
1 parent 951285e commit 20cd25d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions substrate/frame/nfts/src/impl_asset_ops/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ impl<T: Config<I>, I: 'static> UpdateMetadata<Instance, CanTransfer> for Pallet<
_can_transfer: CanTransfer,
update: bool,
) -> DispatchResult {
if update {
let disable = !update;

if disable {
let transfer_disabled =
Self::has_system_attribute(collection, &item, PalletAttributes::TransferDisabled)?;

Expand All @@ -311,7 +313,7 @@ impl<T: Config<I>, I: 'static> UpdateMetadata<Instance, CanTransfer> for Pallet<
<Self as UpdateMetadata<Instance, _>>::update_metadata(
id,
Bytes(SystemAttribute(&PalletAttributes::<T::CollectionId>::TransferDisabled.encode())),
update.then_some(&[]),
disable.then_some(&[]),
)
}
}
Expand Down

0 comments on commit 20cd25d

Please sign in to comment.