From fbe2ae8df99551397cabc7319728ad30be5ad23e Mon Sep 17 00:00:00 2001 From: clostao <49268919+clostao@users.noreply.github.com> Date: Thu, 16 Nov 2023 09:07:09 +0100 Subject: [PATCH] Panicking error to unimplemented (SlowMist N8) (#142) Co-authored-by: DxFFFFFF --- pallets/custom-balances/src/lib.rs | 4 ++-- pallets/custom-balances/src/tests.rs | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pallets/custom-balances/src/lib.rs b/pallets/custom-balances/src/lib.rs index dc29c6e2..899b89a9 100644 --- a/pallets/custom-balances/src/lib.rs +++ b/pallets/custom-balances/src/lib.rs @@ -240,9 +240,9 @@ pub mod pallet { fn make_free_balance_be( _who: &T::AccountId, - _balance: Self::Balance, + balance: Self::Balance, ) -> SignedImbalance { - panic!("make_free_balance_be is not allowed in this pallet") + SignedImbalance::Positive(NeutralImbalance::new(balance)) } } diff --git a/pallets/custom-balances/src/tests.rs b/pallets/custom-balances/src/tests.rs index a88ca5c1..de740340 100644 --- a/pallets/custom-balances/src/tests.rs +++ b/pallets/custom-balances/src/tests.rs @@ -322,17 +322,6 @@ fn settle_returns_error() { }); } -#[test] -#[should_panic] -fn make_free_balance_be_panics() { - new_test_ext().execute_with(|| { - >::make_free_balance_be( - &ZeroAddress::get().into(), - 0u128, - ); - }); -} - // Inspect functions #[test]