Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidOptional = errors.New("decoding failed, invalid optional")
ErrInvalidOptional is returned when decoding an optional fails
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
Body represents an optional types.Body.
type Boolean ¶ added in v0.3.0
type Boolean struct {
// contains filtered or unexported fields
}
Boolean represents an optional bool type.
func NewBoolean ¶ added in v0.3.0
NewBoolean returns a new optional.Boolean
func (*Boolean) Exists ¶ added in v0.3.0
Exists returns true if the value is Some, false if it is None.
type Bytes ¶
type Bytes struct {
// contains filtered or unexported fields
}
Bytes represents an optional Bytes type.
type CoreHeader ¶
type CoreHeader struct { ParentHash common.Hash `json:"parentHash"` Number *big.Int `json:"number"` StateRoot common.Hash `json:"stateRoot"` ExtrinsicsRoot common.Hash `json:"extrinsicsRoot"` Digest Digest `json:"digest"` }
CoreHeader is a state block header This is copied from core/types since core/types imports this package, we cannot import core/types.
func (*CoreHeader) String ¶ added in v0.3.0
func (h *CoreHeader) String() string
type Digest ¶ added in v0.3.0
type Digest interface { Encode() ([]byte, error) Decode(io.Reader) error // Decode assumes the type byte (first byte) has been removed from the encoding. }
Digest is the interface implemented by the block digest
type FixedSizeBytes ¶ added in v0.3.2
type FixedSizeBytes struct {
// contains filtered or unexported fields
}
FixedSizeBytes represents an optional FixedSizeBytes type. It does not length-encode the value when encoding.
func NewFixedSizeBytes ¶ added in v0.3.2
func NewFixedSizeBytes(exists bool, value []byte) *FixedSizeBytes
NewFixedSizeBytes returns a new optional.FixedSizeBytes
func (*FixedSizeBytes) Decode ¶ added in v0.3.2
func (x *FixedSizeBytes) Decode(r io.Reader) (*FixedSizeBytes, error)
Decode return an optional FixedSizeBytes from scale encoded data
func (*FixedSizeBytes) Encode ¶ added in v0.3.2
func (x *FixedSizeBytes) Encode() ([]byte, error)
Encode returns the SCALE encoded optional
func (*FixedSizeBytes) Exists ¶ added in v0.3.2
func (x *FixedSizeBytes) Exists() bool
Exists returns true if the value is Some, false if it is None.
func (*FixedSizeBytes) Set ¶ added in v0.3.2
func (x *FixedSizeBytes) Set(exists bool, value []byte)
Set sets the exists and value fields.
func (*FixedSizeBytes) String ¶ added in v0.3.2
func (x *FixedSizeBytes) String() string
String returns the value as a string.
func (*FixedSizeBytes) Value ¶ added in v0.3.2
func (x *FixedSizeBytes) Value() []byte
Value returns the []byte value. It returns nil if it is None.
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
Hash represents an optional Hash type.
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header represents an optional header type
func NewHeader ¶
func NewHeader(exists bool, value *CoreHeader) *Header
NewHeader returns a new optional.Header
func (*Header) Set ¶
func (x *Header) Set(exists bool, value *CoreHeader)
Set sets the exists and value fields.
func (*Header) Value ¶
func (x *Header) Value() *CoreHeader
Value returns the value of the header. It returns nil if the header is None.
type Uint32 ¶
type Uint32 struct {
// contains filtered or unexported fields
}
Uint32 represents an optional uint32 type.