feat(chainsync): add cursor to observer args
This commit is contained in:
parent
61b37cce41
commit
b55ee1799f
1 changed files with 3 additions and 3 deletions
|
|
@ -10,8 +10,8 @@ use crate::{BlockBody, Message, State, Tip, WrappedHeader};
|
|||
|
||||
/// An observer of chain-sync events sent by the state-machine
|
||||
pub trait Observer<C> where C: Debug {
|
||||
fn on_block(&self, content: &C) -> Result<(), Box<dyn std::error::Error>> {
|
||||
log::debug!("asked to save block {:?}", content);
|
||||
fn on_block(&self, cursor: &Option<Point>, content: &C) -> Result<(), Box<dyn std::error::Error>> {
|
||||
log::debug!("asked to save block content {:?} at cursor {:?}", content, cursor);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ where
|
|||
}
|
||||
|
||||
debug!("reporint block to observer");
|
||||
self.observer.on_block(&content)?;
|
||||
self.observer.on_block(&self.cursor, &content)?;
|
||||
|
||||
Ok(Self {
|
||||
tip: Some(tip),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue