feat(chainsync): add cursor to observer args
This commit is contained in:
parent
e8ea99db6e
commit
1b6cbbc095
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
|
/// An observer of chain-sync events sent by the state-machine
|
||||||
pub trait Observer<C> where C: Debug {
|
pub trait Observer<C> where C: Debug {
|
||||||
fn on_block(&self, content: &C) -> Result<(), Box<dyn std::error::Error>> {
|
fn on_block(&self, cursor: &Option<Point>, content: &C) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
log::debug!("asked to save block {:?}", content);
|
log::debug!("asked to save block content {:?} at cursor {:?}", content, cursor);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,7 +127,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("reporint block to observer");
|
debug!("reporint block to observer");
|
||||||
self.observer.on_block(&content)?;
|
self.observer.on_block(&self.cursor, &content)?;
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
tip: Some(tip),
|
tip: Some(tip),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue