mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Initial Tributary handling
This commit is contained in:
@@ -132,6 +132,10 @@ impl<T: Transaction> Block<T> {
|
||||
res
|
||||
}
|
||||
|
||||
pub fn parent(&self) -> [u8; 32] {
|
||||
self.header.parent
|
||||
}
|
||||
|
||||
pub fn hash(&self) -> [u8; 32] {
|
||||
self.header.hash()
|
||||
}
|
||||
|
||||
@@ -84,6 +84,10 @@ impl<D: Db, T: Transaction> Blockchain<D, T> {
|
||||
res
|
||||
}
|
||||
|
||||
pub(crate) fn genesis(&self) -> [u8; 32] {
|
||||
self.genesis
|
||||
}
|
||||
|
||||
pub(crate) fn tip(&self) -> [u8; 32] {
|
||||
self.tip
|
||||
}
|
||||
|
||||
@@ -126,6 +126,9 @@ impl<D: Db, T: Transaction, P: P2p> Tributary<D, T, P> {
|
||||
Some(Self { network, synced_block, messages })
|
||||
}
|
||||
|
||||
pub fn genesis(&self) -> [u8; 32] {
|
||||
self.network.blockchain.read().unwrap().genesis()
|
||||
}
|
||||
pub fn tip(&self) -> [u8; 32] {
|
||||
self.network.blockchain.read().unwrap().tip()
|
||||
}
|
||||
|
||||
@@ -259,6 +259,7 @@ impl<D: Db, T: Transaction, P: P2p> Network for TendermintNetwork<D, T, P> {
|
||||
self.p2p.broadcast(to_broadcast).await
|
||||
}
|
||||
async fn slash(&mut self, validator: Self::ValidatorId) {
|
||||
// TODO: Handle this slash
|
||||
log::error!(
|
||||
"validator {} triggered a slash event on tributary {}",
|
||||
hex::encode(validator),
|
||||
|
||||
Reference in New Issue
Block a user