Struct exonum_configuration::ConfigurationSchema [] [src]

pub struct ConfigurationSchema<T> { /* fields omitted */ }

ConfigurationService database schema: tables and logically atomic mutation methods.

Methods

impl<T> ConfigurationSchema<T> where
    T: AsRef<Snapshot>, 
[src]

Returns a ProofMapIndex table of all config proposes TxConfigPropose, which are stored within StorageValueConfigProposeData along with votes' data.

  • Table key is hash of a configuration. This hash is normalized when a new propose is put via put_propose:
    1. bytes of a String, containing configuration json ->
    2. String ->
    3. StoredConfiguration ->
    4. unique normalized String for a unique configuration ->
    5. bytes ->
    6. hash(bytes)
  • Table value is StorageValueConfigProposeData, containing TxConfigPropose, which contains bytes, corresponding to key.

Returns a ProofListIndex table of hashes of proposed configurations in propose commit order.

Returns a ProofListIndex table of votes of validators for config, referenced by the queried config_hash - hash of a configuration.

  1. The list of validators, who can vote for a config, is determined by validators of previous StoredConfiguration.
  2. Config, previous to a StoredConfiguration is referenced by previous_cfg_hash in StoredConfiguration.

  • Table index is validator_id - position of a validator's PublicKey in validator list of config, previous to config, referenced by the queried config_hash.
  • Table value is TxConfigVote, cast by validator with PublicKey, corresponding to index.

impl<'a> ConfigurationSchema<&'a mut Fork>
[src]

Mutable version of propose_data_by_config_hash index.

Mutable version of config_hash_by_ordinal index.

Mutable version of votes_by_config_hash index.

Put a new StorageValueConfigProposeData into propose_data_by_config_hash table with following fields:

  • tx_propose - tx_propose argument
  • num_votes - validators.len() of StoredConfiguration, referenced by previous_cfg_hash of config, stored in tx_propose.
  • votes_history_hash - root_hash of corresponding votes_by_config_hash table in a state right after initialization (all indices contain empty vote).

If an entry with the same hash of a configuration is present in propose_data_by_config_hash, as in config inside of tx_propose, nothing is done.

impl<T> ConfigurationSchema<T>
[src]