use super::Scheme; use commonware_consensus::{simplex::types::Activity, Viewable}; use commonware_cryptography::Digest; use std::marker::PhantomData; use tracing::info; /// Implementation of `commonware-consensus::Reporter`. #[derive(Clone)] pub struct Reporter { _phantom: PhantomData, } impl Reporter { pub fn new() -> Self { Self { _phantom: PhantomData, } } } impl commonware_consensus::Reporter for Reporter { type Activity = Activity; async fn report(&mut self, activity: Self::Activity) { let view = activity.view(); match activity { Activity::Notarization(notarization) => { info!(view, payload = ?notarization.proposal.payload, "notarized"); } Activity::Finalization(finalization) => { info!(view, payload = ?finalization.proposal.payload, "finalized"); } Activity::Nullification(_) => { info!(view, "nullified"); } _ => {} } } }