forked from TrueCloudLab/neoneo-go
payload: improve address test
Check that the structure has proper values stored.
This commit is contained in:
parent
26eee620ec
commit
01c96fbc50
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue