[][src]Module blockchain::traits

Common trait definitions related to block context.

The consensus layer for this crate works on different levels.

On execute level, one uses ExecuteContext, and the type parameters defined allows it to be used by an executor -- given a block, and an externalities, it executes the state. This is suitable for plain state transition.

On importer level, one uses ImportContext. This allows the block to be written into a backend together with auxiliaries. This is suitable for implementing common consensus algorithms.

On builder level, one uses BuildContext. This allows to be used with BuilderExecutor which is able to create new blocks. Used together with ImportContext, one can build a proposer.

Structs

ImportOperation

Import operation.

Operation

Operation for a backend.

Traits

AsExternalities

Trait that allows conversion into externalities.

Auxiliary

A value where the key is contained in.

Backend

Commit-able backend for a block context.

Block

A block contains a hash, and reference a parent block via parent hash.

BlockExecutor

Block executor

BuilderExecutor

Builder executor

ChainQuery

Chain query interface for a backend.

ImportBlock

Trait used for committing block, usually built on top of a backend.

NullExternalities

Null externalities.

StorageExternalities

Externalities for reading a key value based storage.