neo-go/pkg/network/payload/payload.go

27 lines
665 B
Go
Raw Normal View History

2018-01-28 15:06:41 +00:00
package payload
import "github.com/nspcc-dev/neo-go/pkg/io"
2018-01-28 15:06:41 +00:00
// MaxSize is the maximum payload size in decompressed form.
const MaxSize = 0x02000000
2018-01-28 15:06:41 +00:00
// Payload is anything that can be binary encoded/decoded.
type Payload interface {
io.Serializable
2018-01-28 15:06:41 +00:00
}
// NullPayload is a dummy payload with no fields.
type NullPayload struct {
}
// NewNullPayload returns zero-sized stub payload.
func NewNullPayload() NullPayload {
return NullPayload{}
}
// DecodeBinary implements the Serializable interface.
func (p NullPayload) DecodeBinary(r *io.BinReader) {}
// EncodeBinary implements the Serializable interface.
func (p NullPayload) EncodeBinary(w *io.BinWriter) {}