_pkg.dev: drop mgetaddr "implementation"

It has no real payload, so all of this is just useless.
This commit is contained in:
Roman Khimov 2019-08-30 11:44:35 +03:00
parent 45d94ee8c6
commit db39149b3d
2 changed files with 0 additions and 54 deletions

View file

@ -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
}

View file

@ -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()))
}