mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-07 08:37:01 +00:00
.
This commit is contained in:
@@ -18,6 +18,8 @@ const (
|
||||
|
||||
TYPE_STRING = Byte(0x10)
|
||||
TYPE_BYTESLICE = Byte(0x11)
|
||||
|
||||
TYPE_TIME = Byte(0x20)
|
||||
)
|
||||
|
||||
func GetBinaryType(o Binary) Byte {
|
||||
@@ -38,6 +40,8 @@ func GetBinaryType(o Binary) Byte {
|
||||
case String: return TYPE_STRING
|
||||
case ByteSlice: return TYPE_BYTESLICE
|
||||
|
||||
case Time: return TYPE_TIME
|
||||
|
||||
default: panic("Unsupported type")
|
||||
}
|
||||
}
|
||||
@@ -59,6 +63,8 @@ func ReadBinary(r io.Reader) Binary {
|
||||
case TYPE_STRING: return ReadString(r)
|
||||
case TYPE_BYTESLICE:return ReadByteSlice(r)
|
||||
|
||||
case TYPE_TIME: return ReadTime(r)
|
||||
|
||||
default: panic("Unsupported type")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user