pub trait Ledger: Copy + Debug + Send + Sync {
type Validator: Validator;
// Required methods
fn name() -> String;
fn record_root_history() -> usize;
fn merkle_height() -> u8;
fn srs() -> &'static UniversalParam;
}Expand description
A CAP ledger.
This trait aggregates various other traits that constitute a ledger and network. It also provides whole-ledger information.
Required Associated Types§
sourcetype Validator: Validator
type Validator: Validator
The state of a validator for this ledger.
Note that this determines all of the other types, such as Block and Transaction, used by this ledger.
Required Methods§
sourcefn record_root_history() -> usize
fn record_root_history() -> usize
The number of past MerkleTree roots maintained by validators.
This determines how out of data a CAP transaction can be and still be accepted by a validator. If a transaction was constructed against a ledger state which is less than record_root_history transactions old, the transaction can be accepted.
sourcefn merkle_height() -> u8
fn merkle_height() -> u8
The height of the ledger’s records MerkleTree.