Skip to content
Snippets Groups Projects
Commit c553c09f authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

use mint instead of deposit

parent 582a46c2
No related branches found
No related tags found
1 merge request!307mint UD instead of deposit + disable burn
Pipeline #39530 failed
...@@ -331,10 +331,11 @@ pub mod pallet { ...@@ -331,10 +331,11 @@ pub mod pallet {
core::num::NonZeroU16::new(current_ud_index) core::num::NonZeroU16::new(current_ud_index)
.expect("unreachable because current_ud_index is never zero."), .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 { Self::deposit_event(Event::UdsClaimed {
count: uds_count, count: uds_count,
total: uds_total, total: actual_total,
who: who.clone(), who: who.clone(),
}); });
Ok(().into()) Ok(().into())
......
...@@ -62,6 +62,11 @@ fn test_claim_uds() { ...@@ -62,6 +62,11 @@ fn test_claim_uds() {
total: 1_000, total: 1_000,
who: 1, 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); assert_eq!(Balances::free_balance(1), 1_000);
// Others members should not receive any UDs with Alice claim // Others members should not receive any UDs with Alice claim
assert_eq!(Balances::free_balance(2), 0); assert_eq!(Balances::free_balance(2), 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment