Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix refund benchmark for pallet_assets #14561

Merged
merged 5 commits into from
Jul 12, 2023
Merged
Changes from 3 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
3 changes: 1 addition & 2 deletions frame/assets/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,7 @@ benchmarks_instance_pallet! {
SystemOrigin::Signed(new_account.clone()).into(),
asset_id
).is_ok());
// `touch` should reserve some balance of the caller...
assert!(!T::Currency::reserved_balance(&new_account).is_zero());
assert_eq!(T::Currency::reserved_balance(&new_account), T::AssetAccountDeposit::get());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can re-add the comment? Basically this pr doesn't "fix" anything, it just ensures that the right amount is reserved or?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment re-added,
yeah, PR fixes just benchmark and right amount comparison, which didnt work for AssetAccountDeposit = 0

// ...and also create an `Account` entry.
assert!(Account::<T, I>::contains_key(asset_id.into(), &new_account));
}: _(SystemOrigin::Signed(new_account.clone()), asset_id, true)
Expand Down
Loading