mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-06 08:07:11 +00:00
HexBytes formatting; Make computeHashFromAunts more defensive
This commit is contained in:
@@ -51,3 +51,12 @@ func (bz HexBytes) Bytes() []byte {
|
||||
func (bz HexBytes) String() string {
|
||||
return strings.ToUpper(hex.EncodeToString(bz))
|
||||
}
|
||||
|
||||
func (bz HexBytes) Format(s fmt.State, verb rune) {
|
||||
switch verb {
|
||||
case 'p':
|
||||
s.Write([]byte(fmt.Sprintf("%p", bz)))
|
||||
default:
|
||||
s.Write([]byte(fmt.Sprintf("%X", []byte(bz))))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user