Skip to content
Snippets Groups Projects
Commit 8242c0af authored by Cédric Moreau's avatar Cédric Moreau
Browse files

test(#176): show that ExpiresOn is not correctly updated for Pending smiths

parent 7ed8892a
No related branches found
No related tags found
1 merge request!232Resolve "PromotedToSmith is issued even for Smith"
......@@ -575,6 +575,7 @@ fn certifying_an_online_smith() {
assert_ok!(Pallet::<Runtime>::accept_invitation(RuntimeOrigin::signed(
5
)));
Pallet::<Runtime>::on_new_session(2);
assert_ok!(Pallet::<Runtime>::certify_smith(
RuntimeOrigin::signed(1),
5
......@@ -588,11 +589,14 @@ fn certifying_an_online_smith() {
Smiths::<Runtime>::get(5),
Some(SmithMeta {
status: Smith,
expires_on: Some(5),
expires_on: Some(7),
issued_certs: vec![],
received_certs: vec![1, 2]
})
);
// TODO: test is failing here because ExpiresOn is not correctly updated
assert_eq!(ExpiresOn::<Runtime>::get(7), Some(vec![5]));
Pallet::<Runtime>::on_smith_goes_online(5);
// After going online, the expiration disappears
assert_eq!(
......@@ -604,6 +608,8 @@ fn certifying_an_online_smith() {
received_certs: vec![1, 2]
})
);
// ExpiresOn is not unscheduled, but as expires_on has switched to None it's not a problem
assert_eq!(ExpiresOn::<Runtime>::get(7), Some(vec![5]));
// We can receive certification without postponing the expiration (because we are online)
assert_ok!(Pallet::<Runtime>::certify_smith(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment