Documentation ¶
Index ¶
- type BasicCheckError
- type Block
- func (b *Block) BasicCheck() error
- func (b *Block) Bytes() ([]byte, error)
- func (b *Block) Decode(r io.Reader) error
- func (b *Block) Encode(w io.Writer) error
- func (b *Block) Hash() hash.Hash
- func (b *Block) Header() *Header
- func (b *Block) MarshalCBOR() ([]byte, error)
- func (b *Block) PrevCertificate() *certificate.Certificate
- func (b *Block) SerializeSize() int
- func (b *Block) String() string
- func (b *Block) Transactions() Txs
- func (b *Block) UnmarshalCBOR(bs []byte) error
- type Header
- func (h *Header) BasicCheck() error
- func (h *Header) Decode(r io.Reader) error
- func (h *Header) Encode(w io.Writer) error
- func (h *Header) PrevBlockHash() hash.Hash
- func (h *Header) ProposerAddress() crypto.Address
- func (h *Header) SerializeSize() int
- func (h *Header) SortitionSeed() sortition.VerifiableSeed
- func (h *Header) StateRoot() hash.Hash
- func (h *Header) Time() time.Time
- func (h *Header) UnixTime() uint32
- func (h *Header) Version() uint8
- type Txs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicCheckError ¶ added in v0.15.0
type BasicCheckError struct {
Reason string
}
BasicCheckError is returned when the basic check on the certificate fails.
func (BasicCheckError) Error ¶ added in v0.15.0
func (e BasicCheckError) Error() string
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func MakeBlock ¶
func MakeBlock(version uint8, timestamp time.Time, txs Txs, prevBlockHash, stateRoot hash.Hash, prevCert *certificate.Certificate, sortitionSeed sortition.VerifiableSeed, proposer crypto.Address, ) *Block
func NewBlock ¶
func NewBlock(header *Header, prevCert *certificate.Certificate, txs Txs) *Block
func (*Block) BasicCheck ¶ added in v0.15.0
func (*Block) Bytes ¶
Bytes returns the serialized bytes for the Block. It caches the result so subsequent calls are more efficient.
func (*Block) MarshalCBOR ¶
func (*Block) PrevCertificate ¶
func (b *Block) PrevCertificate() *certificate.Certificate
func (*Block) SerializeSize ¶
SerializeSize returns the number of bytes it would take to serialize the block.
func (*Block) Transactions ¶
func (*Block) UnmarshalCBOR ¶
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
func (*Header) BasicCheck ¶ added in v0.15.0
func (*Header) PrevBlockHash ¶
PrevBlockHash returns the previous block hash.
func (*Header) ProposerAddress ¶
ProposerAddress returns the proposer address.
func (*Header) SerializeSize ¶
SerializeSize returns the number of bytes it would take to serialize the header.
func (*Header) SortitionSeed ¶
func (h *Header) SortitionSeed() sortition.VerifiableSeed
SortitionSeed returns the sortition seed.
Click to show internal directories.
Click to hide internal directories.