mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-26 03:01:42 +00:00
pretty print ConsensusState
This commit is contained in:
@ -144,6 +144,13 @@ func (ps *PartSet) RootHash() []byte {
|
||||
return ps.rootHash
|
||||
}
|
||||
|
||||
func (ps *PartSet) Count() uint16 {
|
||||
if ps == nil {
|
||||
return 0
|
||||
}
|
||||
return ps.count
|
||||
}
|
||||
|
||||
func (ps *PartSet) Total() uint16 {
|
||||
if ps == nil {
|
||||
return 0
|
||||
@ -197,3 +204,11 @@ func (ps *PartSet) GetReader() io.Reader {
|
||||
}
|
||||
return bytes.NewReader(buf)
|
||||
}
|
||||
|
||||
func (ps *PartSet) Description() string {
|
||||
if ps == nil {
|
||||
return "nil-PartSet"
|
||||
} else {
|
||||
return fmt.Sprintf("(%v of %v)", ps.Count(), ps.Total())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user