mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-24 09:25:21 +00:00
_pkg.dev: drop mgetaddr "implementation"
It has no real payload, so all of this is just useless.
This commit is contained in:
parent
45d94ee8c6
commit
db39149b3d
2 changed files with 0 additions and 54 deletions
|
@ -1,30 +0,0 @@
|
|||
package payload
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/CityOfZion/neo-go/pkg/wire/command"
|
||||
)
|
||||
|
||||
//GetAddrMessage represents a GetAddress message on the neo-network
|
||||
type GetAddrMessage struct{}
|
||||
|
||||
// NewGetAddrMessage returns a GetAddrMessage object
|
||||
func NewGetAddrMessage() (*GetAddrMessage, error) {
|
||||
return &GetAddrMessage{}, nil
|
||||
}
|
||||
|
||||
// DecodePayload Implements Messager interface
|
||||
func (v *GetAddrMessage) DecodePayload(r io.Reader) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// EncodePayload Implements messager interface
|
||||
func (v *GetAddrMessage) EncodePayload(w io.Writer) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Command Implements messager interface
|
||||
func (v *GetAddrMessage) Command() command.Type {
|
||||
return command.GetAddr
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package payload
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/CityOfZion/neo-go/pkg/wire/util/Checksum"
|
||||
|
||||
"github.com/CityOfZion/neo-go/pkg/wire/command"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNewGetAddr(t *testing.T) {
|
||||
|
||||
getAddrMessage, err := NewGetAddrMessage()
|
||||
assert.Equal(t, nil, err)
|
||||
|
||||
assert.Equal(t, command.GetAddr, getAddrMessage.Command())
|
||||
|
||||
buf := new(bytes.Buffer)
|
||||
|
||||
assert.Equal(t, int(3806393949), int(checksum.FromBuf(buf)))
|
||||
assert.Equal(t, int(0), len(buf.Bytes()))
|
||||
}
|
Loading…
Reference in a new issue