protocol: move magic exchange to version payload

closes #889
This commit is contained in:
Anna Shaleva 2020-05-21 13:35:44 +03:00
parent 23b814ad4d
commit 64a2fb63e1
5 changed files with 46 additions and 43 deletions

View file

@ -3,18 +3,20 @@ package payload
import (
"testing"
"github.com/nspcc-dev/neo-go/pkg/config"
"github.com/nspcc-dev/neo-go/pkg/internal/testserdes"
"github.com/stretchr/testify/assert"
)
func TestVersionEncodeDecode(t *testing.T) {
var magic config.NetMode = 56753
var port uint16 = 3000
var id uint32 = 13337
useragent := "/NEO:0.0.1/"
var height uint32 = 100500
var relay = true
version := NewVersion(id, port, useragent, height, relay)
version := NewVersion(magic, id, port, useragent, height, relay)
versionDecoded := &Version{}
testserdes.EncodeDecodeBinary(t, version, versionDecoded)