mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-24 09:25:21 +00:00
7d91a3a89e
This way we can use it in scripts and cli.
19 lines
445 B
Go
19 lines
445 B
Go
package payload
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/internal/testserdes"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestEncodeDecodeBinary(t *testing.T) {
|
|
payload := NewPing(uint32(1), uint32(2))
|
|
assert.NotEqual(t, 0, payload.Timestamp)
|
|
|
|
decodedPing := &Ping{}
|
|
testserdes.EncodeDecodeBinary(t, payload, decodedPing)
|
|
|
|
assert.Equal(t, uint32(1), decodedPing.LastBlockIndex)
|
|
assert.Equal(t, uint32(2), decodedPing.Nonce)
|
|
}
|