neoneo-go/pkg/network/payload/payload.go
Evgenii Stratonikov 505029152f payload: always dereference NullPayload
There is no need in extra indirection level.
2020-06-19 15:02:21 +03:00

23 lines
568 B
Go

package payload
import "github.com/nspcc-dev/neo-go/pkg/io"
// Payload is anything that can be binary encoded/decoded.
type Payload interface {
io.Serializable
}
// NullPayload is a dummy payload with no fields.
type NullPayload struct {
}
// NewNullPayload returns zero-sized stub payload.
func NewNullPayload() NullPayload {
return NullPayload{}
}
// DecodeBinary implements Serializable interface.
func (p NullPayload) DecodeBinary(r *io.BinReader) {}
// EncodeBinary implements Serializable interface.
func (p NullPayload) EncodeBinary(w *io.BinWriter) {}