neoneo-go/pkg/network/payload/payload.go
Roman Khimov d1a4e43c48 io: redo Serializable to return errors in BinReader/BinWriter
Further simplifies error handling.
2019-09-17 13:21:52 +03:00

23 lines
573 B
Go

package payload
import "github.com/CityOfZion/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) {}