payload: improve address test

Check that the structure has proper values stored.
This commit is contained in:
Roman Khimov 2019-08-29 18:39:46 +03:00
parent 26eee620ec
commit 01c96fbc50

View file

@ -13,10 +13,13 @@ import (
func TestEncodeDecodeAddress(t *testing.T) {
var (
e = util.NewEndpoint("127.0.0.1:2000")
addr = NewAddressAndTime(e, time.Now())
ts = time.Now()
addr = NewAddressAndTime(e, ts)
buf = new(bytes.Buffer)
)
assert.Equal(t, ts.UTC().Unix(), int64(addr.Timestamp))
assert.Equal(t, e, addr.Endpoint)
err := addr.EncodeBinary(buf)
assert.Nil(t, err)