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

test(#108): reveal certification expiry issue

parent 22345178
No related branches found
No related tags found
No related merge requests found
...@@ -175,3 +175,43 @@ fn test_cert_period() { ...@@ -175,3 +175,43 @@ fn test_cert_period() {
)); ));
}); });
} }
#[test]
fn test_cert_expiry() {
new_test_ext(DefaultCertificationConfig {
apply_cert_period_at_genesis: true,
certs_by_receiver: btreemap![
0 => btreemap![
1 => Some(5),
2 => Some(5),
],
1 => btreemap![
0 => Some(6),
2 => Some(6),
],
2 => btreemap![
0 => Some(7),
1 => Some(7),
],
],
})
.execute_with(|| {
run_to_block(5);
// Expiry of cert by issuer 1
System::assert_has_event(RuntimeEvent::DefaultCertification(Event::RemovedCert {
issuer: 1,
issuer_issued_count: 1,
receiver: 0,
receiver_received_count: 1,
expiration: true,
}));
// Expiry of cert by issuer 2
System::assert_has_event(RuntimeEvent::DefaultCertification(Event::RemovedCert {
receiver: 0,
issuer: 2,
issuer_issued_count: 1,
receiver_received_count: 0, // <-- No more cert received
expiration: true,
}));
});
}
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