mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 04:01:55 +00:00
tendermint/binary -> tendermint/wire
This commit is contained in:
17
wire/time.go
Normal file
17
wire/time.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package wire
|
||||
|
||||
import (
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Time
|
||||
|
||||
func WriteTime(t time.Time, w io.Writer, n *int64, err *error) {
|
||||
WriteInt64(t.UnixNano(), w, n, err)
|
||||
}
|
||||
|
||||
func ReadTime(r io.Reader, n *int64, err *error) time.Time {
|
||||
t := ReadInt64(r, n, err)
|
||||
return time.Unix(0, t)
|
||||
}
|
Reference in New Issue
Block a user