Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidBodyType = errors.New("invalid body type")
ErrInvalidBodyType signals an invalid header pointer was provided
var ErrInvalidHeaderType = errors.New("invalid header type")
ErrInvalidHeaderType signals an invalid header pointer was provided
var ErrMiniBlockEmpty = errors.New("mini block is empty")
ErrMiniBlockEmpty signals that mini block is empty
var ErrNilBlockBody = errors.New("nil block body")
ErrNilBlockBody signals that block body is nil
var ErrNilCacher = errors.New("nil cacher")
ErrNilCacher signals that a nil cache has been provided
var ErrNilHeadersDataPool = errors.New("nil headers data pool")
ErrNilHeadersDataPool signals that a nil header pool has been provided
var ErrNilHeadersNoncesDataPool = errors.New("nil headers nonces cache")
ErrNilHeadersNoncesDataPool signals that a nil header - nonce cache
var ErrNilMetaBlockPool = errors.New("nil meta block data pool")
ErrNilMetaBlockPool signals that a nil meta block data pool was provided
var ErrNilMiniBlockHashesPool = errors.New("nil meta block mini block hashes data pool")
ErrNilMiniBlockHashesPool signals that a nil meta block data pool was provided
var ErrNilNonceConverter = errors.New("nil nonce converter")
ErrNilNonceConverter signals that a nil nonce-byte slice converter has been provided
var ErrNilPeerChangeBlockDataPool = errors.New("nil peer change block data pool")
ErrNilPeerChangeBlockDataPool signals that a nil peer change pool has been provided
var ErrNilShardHeaderPool = errors.New("nil meta block shard header data pool")
ErrNilShardHeaderPool signals that a nil meta block data pool was provided
var ErrNilTxBlockDataPool = errors.New("nil tx block data pool")
ErrNilTxBlockDataPool signals that a nil tx block body pool has been provided
var ErrNilTxDataPool = errors.New("nil transaction data pool")
ErrNilTxDataPool signals that a nil transaction pool has been provided
var ErrWrongTypeAssertion = errors.New("wrong type assertion")
ErrWrongTypeAssertion signals that wrong type was provided
Functions ¶
This section is empty.
Types ¶
type BodyHandler ¶
type BodyHandler interface { // IntegrityAndValidity checks the integrity and validity of the block IntegrityAndValidity() error }
BodyHandler interface for a block body
type CapnpHelper ¶
type CapnpHelper interface { // Save saves the serialized data of the implementer type into a stream through Capnp protocol Save(w io.Writer) error // Load loads the data from the stream into a go structure through Capnp protocol Load(r io.Reader) error }
CapnpHelper is an interface that defines methods needed for serializing and deserializing Capnp structures into Go structures and viceversa
type ChainHandler ¶
type ChainHandler interface { GetGenesisHeader() HeaderHandler SetGenesisHeader(gb HeaderHandler) error GetGenesisHeaderHash() []byte SetGenesisHeaderHash(hash []byte) GetCurrentBlockHeader() HeaderHandler SetCurrentBlockHeader(bh HeaderHandler) error GetCurrentBlockHeaderHash() []byte SetCurrentBlockHeaderHash(hash []byte) GetCurrentBlockBody() BodyHandler SetCurrentBlockBody(body BodyHandler) error GetLocalHeight() int64 SetLocalHeight(height int64) GetNetworkHeight() int64 SetNetworkHeight(height int64) HasBadBlock(blockHash []byte) bool PutBadBlock(blockHash []byte) }
ChainHandler is the interface defining the functionality a blockchain should implement
type HeaderHandler ¶
type HeaderHandler interface { GetNonce() uint64 GetEpoch() uint32 GetRound() uint32 GetRootHash() []byte GetPrevHash() []byte GetPrevRandSeed() []byte GetRandSeed() []byte GetPubKeysBitmap() []byte GetSignature() []byte GetTimeStamp() uint64 GetTxCount() uint32 SetNonce(n uint64) SetEpoch(e uint32) SetRound(r uint32) SetTimeStamp(ts uint64) SetRootHash(rHash []byte) SetPrevHash(pvHash []byte) SetPrevRandSeed(pvRandSeed []byte) SetRandSeed(randSeed []byte) SetPubKeysBitmap(pkbm []byte) SetSignature(sg []byte) SetTxCount(txCount uint32) GetMiniBlockHeadersWithDst(destId uint32) map[string]uint32 GetMiniBlockProcessed(hash []byte) bool SetMiniBlockProcessed(hash []byte, processed bool) }
HeaderHandler defines getters and setters for header data holder
Directories
¶
Path | Synopsis |
---|---|
TODO: remove this file once we completely migrate to Numbat Trie implementation crypto_test.go needs to be removed as well as the sha3 folder
|
TODO: remove this file once we completely migrate to Numbat Trie implementation crypto_test.go needs to be removed as well as the sha3 folder |
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202. |
rlp
Package rlp implements the RLP serialization format.
|
Package rlp implements the RLP serialization format. |