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

detail integration test

parent 829652c2
No related branches found
No related tags found
1 merge request!219automatically claim membership
Pipeline #35384 passed
......@@ -484,8 +484,7 @@ fn test_identity_creation_workflow() {
// block time is 6_000 ms
// ud creation period is 60_000 ms ~ 10 blocks
// first ud is at 24_000 ms ~ 4 blocks
// at block 75 this should be the UD number 7, so next is 8 not 9
// FIXME wrong UD count
// at block 75 this is UD number 8, so next is 9
first_eligible_ud: pallet_universal_dividend::FirstEligibleUd(Some(
sp_std::num::NonZeroU16::new(9).unwrap()
))
......@@ -497,6 +496,26 @@ fn test_identity_creation_workflow() {
status: pallet_identity::IdtyStatus::Member,
})
);
run_to_block(84);
System::assert_has_event(RuntimeEvent::UniversalDividend(
pallet_universal_dividend::Event::NewUdCreated {
amount: 1000,
index: 9,
monetary_mass: 50_000, // 13_000 (initial) + 4 * 1000 * 8 (produced) + 5000
members_count: 5,
},
));
assert_ok!(UniversalDividend::claim_uds(
frame_system::RawOrigin::Signed(AccountKeyring::Eve.to_account_id()).into(),
));
System::assert_has_event(RuntimeEvent::UniversalDividend(
pallet_universal_dividend::Event::UdsClaimed {
count: 1,
total: 1000,
who: AccountKeyring::Eve.to_account_id(),
},
));
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment