diff --git a/frame/assets/src/functions.rs b/frame/assets/src/functions.rs index 1515dac8c6d0b..2cdf2d7c4c8f6 100644 --- a/frame/assets/src/functions.rs +++ b/frame/assets/src/functions.rs @@ -750,12 +750,12 @@ impl, I: 'static> Pallet { break } } - T::CallbackHandle::destroyed(&id); Self::deposit_event(Event::ApprovalsDestroyed { asset_id: id, approvals_destroyed: removed_approvals as u32, approvals_remaining: details.approvals as u32, }); + T::CallbackHandle::destroyed(&id); Ok(()) })?; Ok(removed_approvals) diff --git a/frame/assets/src/mock.rs b/frame/assets/src/mock.rs index 11efbd6d2c4a8..93a87ee6714c6 100644 --- a/frame/assets/src/mock.rs +++ b/frame/assets/src/mock.rs @@ -92,11 +92,11 @@ impl pallet_balances::Config for Test { pub struct AssetsCallbackHandle; impl AssetsCallback for AssetsCallbackHandle { fn created(_id: &AssetId, _owner: &AccountId) { - storage::set(b"asset_created", &true.encode()); + storage::set(b"asset_created", &().encode()); } fn destroyed(_id: &AssetId) { - storage::set(b"asset_destroyed", &true.encode()); + storage::set(b"asset_destroyed", &().encode()); } } diff --git a/frame/assets/src/tests.rs b/frame/assets/src/tests.rs index 9601d0a280de0..8269e03bcc90e 100644 --- a/frame/assets/src/tests.rs +++ b/frame/assets/src/tests.rs @@ -1203,12 +1203,12 @@ fn normal_asset_create_and_destroy_callbacks_should_work() { assert!(storage::get(b"asset_destroyed").is_none()); Balances::make_free_balance_be(&1, 100); - assert_ok!(Assets::create(Origin::signed(1), 0, 1, 1)); + assert_ok!(Assets::create(RuntimeOrigin::signed(1), 0, 1, 1)); assert!(storage::get(b"asset_created").is_some()); assert!(storage::get(b"asset_destroyed").is_none()); let w = Asset::::get(0).unwrap().destroy_witness(); - assert_ok!(Assets::destroy(Origin::signed(1), 0, w)); + assert_ok!(Assets::destroy(RuntimeOrigin::signed(1), 0, w)); assert!(storage::get(b"asset_destroyed").is_some()); }); } @@ -1217,7 +1217,7 @@ fn normal_asset_create_and_destroy_callbacks_should_work() { fn root_asset_create_should_work() { new_test_ext().execute_with(|| { assert!(storage::get(b"asset_created").is_none()); - assert_ok!(Assets::force_create(Origin::root(), 0, 1, true, 1)); + assert_ok!(Assets::force_create(RuntimeOrigin::root(), 0, 1, true, 1)); assert!(storage::get(b"asset_created").is_some()); assert!(storage::get(b"asset_destroyed").is_none()); });