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

test(#176): reveal that last smith certification does not postpone expiry

parent a4693f4b
No related branches found
No related tags found
1 merge request!232Resolve "PromotedToSmith is issued even for Smith"
......@@ -580,21 +580,24 @@ fn certifying_an_online_smith() {
RuntimeOrigin::signed(1),
5
));
Pallet::<Runtime>::on_new_session(3);
assert_ok!(Pallet::<Runtime>::certify_smith(
RuntimeOrigin::signed(2),
5
));
// Smith can expire
// TODO: test failing because expires_on is not postponed to session 8
assert_eq!(
Smiths::<Runtime>::get(5),
Some(SmithMeta {
status: Smith,
expires_on: Some(7),
expires_on: Some(8),
issued_certs: vec![],
received_certs: vec![1, 2]
})
);
assert_eq!(ExpiresOn::<Runtime>::get(7), Some(vec![5]));
assert_eq!(ExpiresOn::<Runtime>::get(8), Some(vec![5]));
Pallet::<Runtime>::on_smith_goes_online(5);
// After going online, the expiration disappears
......@@ -609,6 +612,7 @@ fn certifying_an_online_smith() {
);
// 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]));
assert_eq!(ExpiresOn::<Runtime>::get(8), 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.
Finish editing this message first!
Please register or to comment