mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 10:41:19 +00:00
c0627e29a8
* Add varint prefixing to ssz network encoder * fix spacing * fix comments * fix comments * Update varint.go
18 lines
520 B
Go
18 lines
520 B
Go
package encoder
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/gogo/protobuf/proto"
|
|
)
|
|
|
|
// NetworkEncoding represents an encoder compatible with Ethereum 2.0 p2p.
|
|
type NetworkEncoding interface {
|
|
// Decode reads bytes from the reader and decodes it to the provided message.
|
|
Decode(io.Reader, proto.Message) error
|
|
// Encode an arbitrary message to the provided writer.
|
|
Encode(io.Writer, proto.Message) (int, error)
|
|
// ProtocolSuffix returns the last part of the protocol ID to indicate the encoding scheme.
|
|
ProtocolSuffix() string
|
|
}
|