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
20 changes: 20 additions & 0 deletions pallets/runtime/tests/src/settlement_pallet/transfer_funds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,3 +492,23 @@ fn nft_spender_rejected() {
);
});
}

#[test]
fn nft_reject_frozen_asset() {
ExtBuilder::default().build().execute_with(|| {
let alice = User::new(Sr25519Keyring::Alice);
let asset_id = create_and_issue_nft_to_account(&alice);

assert_ok!(Asset::freeze(alice.origin(), asset_id));

assert_noop!(
Settlement::transfer_funds(
alice.origin(),
Some(AssetHolder::Account(alice.acc())),
AssetHolder::Portfolio(PortfolioId::default_portfolio(alice.did)),
nft_fund(asset_id, NFTId(1)),
),
AssetError::InvalidTransferFrozenAsset
);
});
}
1 change: 1 addition & 0 deletions pallets/settlement/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1630,6 +1630,7 @@ impl<T: Config> Pallet<T> {
}
FundDescription::NonFungible(ref nfts) => {
ensure!(nfts.len() > 0, Error::<T>::ZeroAmount);
Asset::<T>::ensure_asset_is_not_frozen(nfts.asset_id())?;
Nft::<T>::ensure_nft_ownership(&resolved_from, nfts)?;
Nft::<T>::transfer_holders_nfts(&resolved_from, to.clone(), nfts)?;
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/utility/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ pub mod pallet {
} else {
Self::deposit_event(Event::<T>::BatchCompleted);
}
let base_weight = <T as Config>::WeightInfo::batch(calls_len as u32);
let base_weight = <T as Config>::WeightInfo::force_batch(calls_len as u32);
Ok(Some(base_weight.saturating_add(weight)).into())
}

Expand Down