From da1b8d68b3d98775648da818ce40dd361ef12f66 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 12 Jul 2023 15:41:46 +0200 Subject: [PATCH] Fix refund benchmark for pallet_assets (#14561) * Fix refund benchmark for pallet_assets * Update frame/assets/src/benchmarking.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Re-added docs * Another "fix" --------- Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: parity-processbot <> --- frame/assets/src/benchmarking.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frame/assets/src/benchmarking.rs b/frame/assets/src/benchmarking.rs index 982edf33514cf..376f19139ab9b 100644 --- a/frame/assets/src/benchmarking.rs +++ b/frame/assets/src/benchmarking.rs @@ -514,8 +514,8 @@ 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()); + // `touch` should reserve balance of the caller according to the `AssetAccountDeposit` amount... + assert_eq!(T::Currency::reserved_balance(&new_account), T::AssetAccountDeposit::get()); // ...and also create an `Account` entry. assert!(Account::::contains_key(asset_id.into(), &new_account)); }: _(SystemOrigin::Signed(new_account.clone()), asset_id, true) @@ -535,8 +535,8 @@ benchmarks_instance_pallet! { asset_id, new_account_lookup.clone() ).is_ok()); - // `touch_other` should reserve balance of the freezer - assert!(!T::Currency::reserved_balance(&asset_owner).is_zero()); + // `touch` should reserve balance of the caller according to the `AssetAccountDeposit` amount... + assert_eq!(T::Currency::reserved_balance(&asset_owner), T::AssetAccountDeposit::get()); assert!(Account::::contains_key(asset_id.into(), &new_account)); }: _(SystemOrigin::Signed(asset_owner.clone()), asset_id, new_account_lookup.clone()) verify {