pub struct CosmosState {
pub chain_id: Option<String>,
pub highest_height: i64,
/* private fields */
}Expand description
Cosmos/CometBFT-specific validator state
Tracks signed votes to prevent double-signing at the same (height, round, type).
Fields§
§chain_id: Option<String>Chain ID this validator is bound to
highest_height: i64Highest height we’ve signed at
Implementations§
Source§impl CosmosState
impl CosmosState
Sourcepub fn get_signed_vote(
&self,
height: i64,
round: i32,
msg_type: CosmosSignedMsgType,
) -> Option<&CosmosSignedVote>
pub fn get_signed_vote( &self, height: i64, round: i32, msg_type: CosmosSignedMsgType, ) -> Option<&CosmosSignedVote>
Get the signed vote at a specific (height, round, type), if any
Sourcepub fn record_vote(
&mut self,
height: i64,
round: i32,
msg_type: CosmosSignedMsgType,
block_hash: Option<[u8; 32]>,
)
pub fn record_vote( &mut self, height: i64, round: i32, msg_type: CosmosSignedMsgType, block_hash: Option<[u8; 32]>, )
Record a new signed vote
Trait Implementations§
Source§impl Clone for CosmosState
impl Clone for CosmosState
Source§fn clone(&self) -> CosmosState
fn clone(&self) -> CosmosState
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 CosmosState
impl Debug for CosmosState
Source§impl Default for CosmosState
impl Default for CosmosState
Source§fn default() -> CosmosState
fn default() -> CosmosState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CosmosState
impl<'de> Deserialize<'de> for CosmosState
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
Auto Trait Implementations§
impl Freeze for CosmosState
impl RefUnwindSafe for CosmosState
impl Send for CosmosState
impl Sync for CosmosState
impl Unpin for CosmosState
impl UnwindSafe for CosmosState
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