diff --git a/pallets/universal-dividend/src/lib.rs b/pallets/universal-dividend/src/lib.rs index 70518f7fd0f83752431c2e5f5c69a5385401cde9..6fda9a68c9621cb34358ede9a3cc138b7eb58905 100644 --- a/pallets/universal-dividend/src/lib.rs +++ b/pallets/universal-dividend/src/lib.rs @@ -331,10 +331,11 @@ pub mod pallet { core::num::NonZeroU16::new(current_ud_index) .expect("unreachable because current_ud_index is never zero."), ); - let _ = T::Currency::deposit(who, uds_total, Precision::Exact); + // Currency is issued here + let actual_total = T::Currency::mint_into(who, uds_total)?; Self::deposit_event(Event::UdsClaimed { count: uds_count, - total: uds_total, + total: actual_total, who: who.clone(), }); Ok(().into()) diff --git a/pallets/universal-dividend/src/tests.rs b/pallets/universal-dividend/src/tests.rs index 3240e9b5fdc713dedd381870e57e6ad22c2e0e39..56c683de11deedc42c9b65f1f694d9f17efef35c 100644 --- a/pallets/universal-dividend/src/tests.rs +++ b/pallets/universal-dividend/src/tests.rs @@ -62,6 +62,11 @@ fn test_claim_uds() { total: 1_000, who: 1, })); + // the expected event form pallet balances is "minted" + System::assert_has_event(RuntimeEvent::Balances(pallet_balances::Event::Minted { + who: 1, + amount: 1000, + })); assert_eq!(Balances::free_balance(1), 1_000); // Others members should not receive any UDs with Alice claim assert_eq!(Balances::free_balance(2), 0);