mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 12:07:57 +00:00
Use No-Op Ancestry Checker (#755)
* Use no-op ancestry checker * Check that current header height is greater than last finalized * Ensure that incoming headers are strictly greater than last finalized * Ensure that header numbers always increase in tests
This commit is contained in:
committed by
Bastian Köcher
parent
c00a47d5ca
commit
658e4e9b5c
@@ -78,7 +78,7 @@ pub trait HeaderChain<H, E> {
|
||||
fn authority_set() -> AuthoritySet;
|
||||
|
||||
/// Write a header finalized by GRANDPA to the underlying pallet storage.
|
||||
fn append_header(header: H);
|
||||
fn append_header(header: H) -> Result<(), E>;
|
||||
}
|
||||
|
||||
impl<H: Default, E> HeaderChain<H, E> for () {
|
||||
@@ -90,7 +90,9 @@ impl<H: Default, E> HeaderChain<H, E> for () {
|
||||
AuthoritySet::default()
|
||||
}
|
||||
|
||||
fn append_header(_header: H) {}
|
||||
fn append_header(_header: H) -> Result<(), E> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait for checking if a given child header is a direct descendant of an ancestor.
|
||||
|
||||
Reference in New Issue
Block a user