mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 15:41:02 +00:00
Add finality verifier test with different validator set id. (#698)
* Add test for invalid set id. * cargo fmt --all * Update modules/finality-verifier/src/lib.rs Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
277167face
commit
4719cb2292
@@ -203,6 +203,27 @@ mod tests {
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rejects_justification_that_skips_authority_set_transition() {
|
||||
run_test(|| {
|
||||
initialize_substrate_bridge();
|
||||
|
||||
let child = test_header(1);
|
||||
let header = test_header(2);
|
||||
|
||||
let set_id = 2;
|
||||
let grandpa_round = 1;
|
||||
let justification =
|
||||
make_justification_for_header(&header, grandpa_round, set_id, &authority_list()).encode();
|
||||
let ancestry_proof = vec![child, header.clone()];
|
||||
|
||||
assert_err!(
|
||||
Module::<TestRuntime>::submit_finality_proof(Origin::signed(1), header, justification, ancestry_proof,),
|
||||
<Error<TestRuntime>>::InvalidJustification
|
||||
);
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn does_not_import_header_with_invalid_finality_proof() {
|
||||
run_test(|| {
|
||||
|
||||
Reference in New Issue
Block a user