From b55ee1799fafa249b7dec53c419c30d267dbd68e Mon Sep 17 00:00:00 2001 From: Santiago Carmuega Date: Thu, 9 Dec 2021 06:49:48 -0300 Subject: [PATCH] feat(chainsync): add cursor to observer args --- pallas-chainsync/src/clients.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pallas-chainsync/src/clients.rs b/pallas-chainsync/src/clients.rs index e439e8b..a02669c 100644 --- a/pallas-chainsync/src/clients.rs +++ b/pallas-chainsync/src/clients.rs @@ -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 where C: Debug { - fn on_block(&self, content: &C) -> Result<(), Box> { - log::debug!("asked to save block {:?}", content); + fn on_block(&self, cursor: &Option, content: &C) -> Result<(), Box> { + 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),