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 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 ¶ added in v1.0.3
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 DBWriteCacher ¶
DBWriteCacher is used to cache changes made to the trie, and only write to the database when it's needed
type HeaderHandler ¶
type HeaderHandler interface { GetShardID() uint32 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) IsInterfaceNil() bool }
HeaderHandler defines getters and setters for header data holder
type TransactionHandler ¶
type TransactionHandler interface { IsInterfaceNil() bool GetValue() *big.Int GetData() string GetRecvAddress() []byte GetSndAddress() []byte SetValue(*big.Int) SetData(string) SetRecvAddress([]byte) SetSndAddress([]byte) }
TransactionHandler defines the type of executable transaction
type Trie ¶
type Trie interface { Get(key []byte) ([]byte, error) Update(key, value []byte) error Delete(key []byte) error Root() ([]byte, error) Prove(key []byte) ([][]byte, error) VerifyProof(proofs [][]byte, key []byte) (bool, error) Commit() error Recreate(root []byte) (Trie, error) String() string }
Trie is an interface for Merkle Trees implementations
Directories ¶
Path | Synopsis |
---|---|
TODO: remove this file once we completely migrate to Elrond Trie implementation crypto_test.go needs to be removed as well as the sha3 folder
|
TODO: remove this file once we completely migrate to Elrond 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. |