mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
wip refact 2
This commit is contained in:
parent
ccaaf07dad
commit
754a473488
9 changed files with 362 additions and 177 deletions
21
pkg/network/payload/version_test.go
Normal file
21
pkg/network/payload/version_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package payload
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVersionEncodeDecode(t *testing.T) {
|
||||
p := NewVersion(3000, "/NEO/", 0, true)
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
p.Encode(buf)
|
||||
|
||||
pd := &Version{}
|
||||
pd.Decode(buf)
|
||||
|
||||
if !reflect.DeepEqual(p, pd) {
|
||||
t.Fatalf("expect %v to be equal to %v", p, pd)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue