Module chain_core::property
source · Expand description
chain core properties
define the different properties a supported chain needs to implement to work in our models.
Block
The Block is the atomic element that compose a chain. Or in other
words the chain is composed of a succession of Block
.
the Block
trait implements the necessary feature we expect of
a Block
in the chain. Having a function that requires the object
to implement the Block traits means that we are expecting to have
only access to:
- the block and its parent’s identifier (the block hash);
- the block number, its position in the blockchain relative to the beginning of the chain. We often call this number the block Date.
Ledger
this trait is to make sure we are following the Transactions of the chain appropriately.
LeaderSelection
This trait is following the protocol of the blockchain is followed properly and determined a given instance of the LeaderSelection object is selected to write a block in the chain.
Enums
Traits
- Block property
- A trait representing block dates.
- Trait identifying the block identifier type. TODO: add a Readable trait bound
- Define that an object that can be read from an
std::io::Read
object. - Define that an object can be read from a byte slice. This trait is implemented for all
Deserialize
implementors by default. The default implementation can be overridden if the user is sure they can benefit from slice-specific functions ofCodec
. - A fragment is some item contained in a block, such as a transaction, a delegation-related certificate, an update proposal, and so on. Fragments can be serialized (so that they can be concatenated to form a binary block( and have a unique ID (typically the hash of their serialization). TODO: add a Readable trait bound
- Trait identifying the fragment identifier type. TODO: add a Readable trait bound
- Defines the way to parse the object from a UTF-8 string.
- Accessor to fragments within a block.
- Access to the block header.
- Trait identifying the block header type.
- Define that an object can be written to an
std::io::Write
object. - define a transaction within the blockchain. This transaction can be used for the UTxO model. However it can also be used for any other elements that the blockchain has (a transaction type to add Stacking Pools and so on…).
- Trait identifying the transaction identifier type.