pub struct StaticValidatorSetProvider<A> { /* private fields */ }Expand description
A validator set provider that always returns the same validator set.
This is a simple implementation of ValidatorSetProvider that returns
the same validator set for all heights. This is useful for testing or
for applications where the validator set doesn’t change.
Implementations§
Source§impl<A> StaticValidatorSetProvider<A>
impl<A> StaticValidatorSetProvider<A>
Sourcepub fn new(validator_set: ValidatorSet<A>) -> Self
pub fn new(validator_set: ValidatorSet<A>) -> Self
Create a new static validator set provider.
§Arguments
validator_set: The validator set to return for all heights
Trait Implementations§
Source§impl<A: Clone + Send + Sync> ValidatorSetProvider<A> for StaticValidatorSetProvider<A>
impl<A: Clone + Send + Sync> ValidatorSetProvider<A> for StaticValidatorSetProvider<A>
fn get_validator_set(&self, _height: u64) -> Result<ValidatorSet<A>, Error>
Auto Trait Implementations§
impl<A> Freeze for StaticValidatorSetProvider<A>
impl<A> RefUnwindSafe for StaticValidatorSetProvider<A>where
A: RefUnwindSafe,
impl<A> Send for StaticValidatorSetProvider<A>where
A: Send,
impl<A> Sync for StaticValidatorSetProvider<A>where
A: Sync,
impl<A> Unpin for StaticValidatorSetProvider<A>where
A: Unpin,
impl<A> UnwindSafe for StaticValidatorSetProvider<A>where
A: UnwindSafe,
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