aboutsummaryrefslogtreecommitdiff
path: root/peer/messages_test.go
blob: 113c0904592e5ba45dbc49579afa4ab2e3281b8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package peer

import (
	"bytes"
	"testing"
)

func TestHandshake(t *testing.T) {
	h := Handshake{
		Proto:  Proto,
		PeerID: NewIDFixed(),
	}
	b := &bytes.Buffer{}
	h.Encode(b)
	t.Log(b.Bytes())
	if len(b.Bytes()) != len(Proto)+49 {
		t.Error("expexted X+49 len")
	}
}