|
1 | 1 | // Copyright (c) 2021 MASSA LABS <[email protected]>
|
2 | 2 |
|
| 3 | +use std::fmt::Display; |
| 4 | + |
3 | 5 | use crate::Amount;
|
4 | 6 | use massa_hash::HASH_SIZE_BYTES;
|
5 | 7 | use massa_time::MassaTime;
|
@@ -41,3 +43,38 @@ pub struct CompactConfig {
|
41 | 43 | pub block_reward: Amount,
|
42 | 44 | pub roll_price: Amount,
|
43 | 45 | }
|
| 46 | + |
| 47 | +impl Display for CompactConfig { |
| 48 | + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
| 49 | + writeln!( |
| 50 | + f, |
| 51 | + " Genesis timestamp: {}", |
| 52 | + self.genesis_timestamp.to_utc_string() |
| 53 | + )?; |
| 54 | + if let Some(end) = self.end_timestamp { |
| 55 | + writeln!(f, " End timestamp: {}", end.to_utc_string())?; |
| 56 | + } |
| 57 | + writeln!(f, " Thread count: {}", self.thread_count)?; |
| 58 | + writeln!(f, " t0: {}", self.t0)?; |
| 59 | + writeln!(f, " delta_f0: {}", self.delta_f0)?; |
| 60 | + writeln!( |
| 61 | + f, |
| 62 | + " Operation validity periods: {}", |
| 63 | + self.operation_validity_periods |
| 64 | + )?; |
| 65 | + writeln!(f, " Periods per cycle: {}", self.periods_per_cycle)?; |
| 66 | + writeln!( |
| 67 | + f, |
| 68 | + " Proof of stake lookback cycles: {}", |
| 69 | + self.pos_lookback_cycles |
| 70 | + )?; |
| 71 | + writeln!( |
| 72 | + f, |
| 73 | + " Proof of stake lock cycles: {}", |
| 74 | + self.pos_lock_cycles |
| 75 | + )?; |
| 76 | + writeln!(f, " Block reward: {}", self.block_reward)?; |
| 77 | + writeln!(f, " Periods per cycle: {}", self.periods_per_cycle)?; |
| 78 | + Ok(()) |
| 79 | + } |
| 80 | +} |
0 commit comments