|
@@ -1,4 +1,4 @@
|
|
|
-use std::io;
|
|
|
|
|
|
|
+use std::{fmt, io};
|
|
|
|
|
|
|
|
use incrementalmerkletree::{bridgetree::BridgeTree, Tree};
|
|
use incrementalmerkletree::{bridgetree::BridgeTree, Tree};
|
|
|
use log::debug;
|
|
use log::debug;
|
|
@@ -196,6 +196,19 @@ impl PartialEq for BlockProposal {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+impl fmt::Display for BlockProposal {
|
|
|
|
|
+ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
|
|
|
|
+ formatter.write_fmt(format_args!(
|
|
|
|
|
+ "BlockProposal {{ leader: {}, hash: {}, epoch: {}, slot: {}, txs: {} }}",
|
|
|
|
|
+ self.address.to_string(),
|
|
|
|
|
+ self.block.header.headerhash(),
|
|
|
|
|
+ self.block.header.epoch,
|
|
|
|
|
+ self.block.header.slot,
|
|
|
|
|
+ self.block.txs.len()
|
|
|
|
|
+ ))
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
impl net::Message for BlockProposal {
|
|
impl net::Message for BlockProposal {
|
|
|
fn name() -> &'static str {
|
|
fn name() -> &'static str {
|
|
|
"proposal"
|
|
"proposal"
|