Add beacon chain event for finalization

This commit is contained in:
Paul Hauner
2019-09-14 22:26:09 -04:00
parent 879f5bfdd0
commit da26341011
2 changed files with 37 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
use serde_derive::{Deserialize, Serialize};
use std::marker::PhantomData;
use types::{Attestation, BeaconBlock, EthSpec, Hash256};
use types::{Attestation, BeaconBlock, Epoch, EthSpec, Hash256};
pub trait EventHandler<T: EthSpec>: Sized + Send + Sync {
fn register(&self, kind: EventKind<T>) -> Result<(), String>;
@@ -33,6 +33,10 @@ pub enum EventKind<T: EthSpec> {
current_head_beacon_block_root: Hash256,
previous_head_beacon_block_root: Hash256,
},
BeaconFinalization {
epoch: Epoch,
root: Hash256,
},
BeaconBlockImported {
block_root: Hash256,
block: Box<BeaconBlock<T>>,