From 01c96fbc50e767e0ca75d949c3a3aa902a7e9281 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 29 Aug 2019 18:39:46 +0300 Subject: [PATCH] payload: improve address test Check that the structure has proper values stored. --- pkg/network/payload/address_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/network/payload/address_test.go b/pkg/network/payload/address_test.go index 2d5f2f255..d8593dbba 100644 --- a/pkg/network/payload/address_test.go +++ b/pkg/network/payload/address_test.go @@ -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)