pub struct ReservedState {
pub genesis_info: GenesisInfo,
pub members: Vec<Member>,
pub consensus_leader_order: Vec<MemberName>,
pub version: String,
}
Expand description
The partial set of the blockchain state which is reserved and protected.
It is stored in the reserved directory of the repository. Any transaction which modifies this state MUST produce a valid next one.
Fields§
§genesis_info: GenesisInfo
The genesis info. This must never be changed.
members: Vec<Member>
The members.
consensus_leader_order: Vec<MemberName>
The leader order of the consensus rounds.
It MUST be sorted by the name of the members.
version: String
The semantic version of Simperby protocol for this network.
Implementations§
Source§impl ReservedState
impl ReservedState
pub fn get_validator_set(&self) -> Result<Vec<(PublicKey, VotingPower)>, String>
pub fn get_governance_set( &self, ) -> Result<Vec<(PublicKey, VotingPower)>, String>
pub fn apply_delegate(&mut self, tx: &TxDelegate) -> Result<Self, String>
pub fn apply_undelegate(&mut self, tx: &TxUndelegate) -> Result<Self, String>
pub fn query_name(&self, public_key: &PublicKey) -> Option<MemberName>
pub fn query_public_key(&self, name: &MemberName) -> Option<PublicKey>
pub fn is_expelled(&self, name: &MemberName) -> Option<bool>
Trait Implementations§
Source§impl Clone for ReservedState
impl Clone for ReservedState
Source§fn clone(&self) -> ReservedState
fn clone(&self) -> ReservedState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ReservedState
impl Debug for ReservedState
Source§impl<'de> Deserialize<'de> for ReservedState
impl<'de> Deserialize<'de> for ReservedState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ReservedState
impl PartialEq for ReservedState
Source§impl Serialize for ReservedState
impl Serialize for ReservedState
impl Eq for ReservedState
impl StructuralPartialEq for ReservedState
Auto Trait Implementations§
impl Freeze for ReservedState
impl RefUnwindSafe for ReservedState
impl Send for ReservedState
impl Sync for ReservedState
impl Unpin for ReservedState
impl UnwindSafe for ReservedState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.