Documentation
¶
Index ¶
- type Bytes32ValueCodec
- func (Bytes32ValueCodec) Decode(b []byte) ([32]byte, error)
- func (Bytes32ValueCodec) DecodeJSON(_ []byte) ([32]byte, error)
- func (Bytes32ValueCodec) Encode(value [32]byte) ([]byte, error)
- func (Bytes32ValueCodec) EncodeJSON(_ [32]byte) ([]byte, error)
- func (Bytes32ValueCodec) Stringify(value [32]byte) string
- func (Bytes32ValueCodec) ValueType() string
- type SSZMarshallable
- type SSZValueCodec
- func (SSZValueCodec[T]) Decode(b []byte) (T, error)
- func (SSZValueCodec[T]) DecodeJSON(_ []byte) (T, error)
- func (SSZValueCodec[T]) Encode(value T) ([]byte, error)
- func (SSZValueCodec[T]) EncodeJSON(_ T) ([]byte, error)
- func (SSZValueCodec[T]) Stringify(value T) string
- func (SSZValueCodec[T]) ValueType() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes32ValueCodec ¶
type Bytes32ValueCodec struct{}
Bytes32ValueCodec provides methods to encode and decode [32]byte values.
func (Bytes32ValueCodec) Decode ¶
func (Bytes32ValueCodec) Decode(b []byte) ([32]byte, error)
Decode unmarshals the provided bytes into a value of type [32]byte.
func (Bytes32ValueCodec) DecodeJSON ¶
func (Bytes32ValueCodec) DecodeJSON(_ []byte) ([32]byte, error)
DecodeJSON is not implemented and will panic if called.
func (Bytes32ValueCodec) Encode ¶
func (Bytes32ValueCodec) Encode(value [32]byte) ([]byte, error)
Encode marshals the provided value into its [32]byte encoding.
func (Bytes32ValueCodec) EncodeJSON ¶
func (Bytes32ValueCodec) EncodeJSON(_ [32]byte) ([]byte, error)
EncodeJSON is not implemented and will panic if called.
func (Bytes32ValueCodec) Stringify ¶
func (Bytes32ValueCodec) Stringify(value [32]byte) string
Stringify returns the string representation of the provided value.
func (Bytes32ValueCodec) ValueType ¶
func (Bytes32ValueCodec) ValueType() string
ValueType returns the name of the interface that this codec is intended for.
type SSZMarshallable ¶
type SSZMarshallable interface { fssz.Marshaler fssz.Unmarshaler String() string }
SSZMarshallable defines an interface for types that can be marshaled and unmarshaled using SSZ encoding, and also provides a string representation of the type.
type SSZValueCodec ¶
type SSZValueCodec[T SSZMarshallable] struct{}
SSZValueCodec provides methods to encode and decode SSZ values.
func (SSZValueCodec[T]) Decode ¶
func (SSZValueCodec[T]) Decode(b []byte) (T, error)
Decode unmarshals the provided bytes into a value of type T.
func (SSZValueCodec[T]) DecodeJSON ¶
func (SSZValueCodec[T]) DecodeJSON(_ []byte) (T, error)
DecodeJSON is not implemented and will panic if called.
func (SSZValueCodec[T]) Encode ¶
func (SSZValueCodec[T]) Encode(value T) ([]byte, error)
Encode marshals the provided value into its SSZ encoding.
func (SSZValueCodec[T]) EncodeJSON ¶
func (SSZValueCodec[T]) EncodeJSON(_ T) ([]byte, error)
EncodeJSON is not implemented and will panic if called.
func (SSZValueCodec[T]) Stringify ¶
func (SSZValueCodec[T]) Stringify(value T) string
Stringify returns the string representation of the provided value.
func (SSZValueCodec[T]) ValueType ¶
func (SSZValueCodec[T]) ValueType() string
ValueType returns the name of the interface that this codec is intended for.