Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pallets/asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3740,8 +3740,15 @@ impl<T: AssetConfig> Pallet<T> {
}
}

if let Err(e) = Self::ensure_holder_is_not_frozen(sender, asset_id) {
asset_transfer_errors.push(e);
}
Comment on lines +3743 to +3745

if skip_locked_check {
if Self::get_holders_balance(sender, asset_id) < transfer_value {
let frozen_balance = Self::get_holders_frozen_balance(sender, asset_id);
let current_balance = Self::get_holders_balance(sender, asset_id);

if current_balance.saturating_sub(frozen_balance) < transfer_value {
Comment on lines +3748 to +3751
Comment thread
Neopallium marked this conversation as resolved.
asset_transfer_errors.push(Error::<T>::InsufficientBalance.into());
Comment on lines 3747 to 3752
}
} else {
Expand Down
7 changes: 7 additions & 0 deletions pallets/nft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,12 @@ impl<T: Config> Pallet<T> {
nft_transfer_errors.push(e);
}

if let Err(e) =
pallet_asset::Pallet::<T>::ensure_holder_is_not_frozen(sender, nfts.asset_id())
{
nft_transfer_errors.push(e);
}
Comment on lines +1232 to +1236

if skip_locked_check {
for nft_id in nfts.ids() {
if !Self::is_holder_of_nft(nfts.asset_id(), nft_id, sender) {
Expand Down Expand Up @@ -1471,6 +1477,7 @@ impl<T: Config> Pallet<T> {
!Self::is_nft_locked(&asset_id, &nft_id, &asset_holder),
Error::<T>::NFTIsLocked
);
pallet_asset::Pallet::<T>::ensure_holder_is_not_frozen(&asset_holder, &asset_id)?;

match asset_holder {
AssetHolder::Account(acc_id) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ fn cross_identity_nft_transfer_when_portfolio_is_frozen() {
AssetHolder::Account(bob.acc()),
non_fungible_fund(asset_id, NFTId(1)),
),
SettlementError::FailedAssetTransferringConditions
AssetError::InvalidTransferSenderIsFrozen
);
});
}
Expand Down