[−][src]Trait tendermint_light_client::store::LightStore
Store for light blocks.
The light store records light blocks received from peers, and their verification status. Additionally, the light store will contain one or more trusted light blocks specified at initialization time.
Implements
- [LCV-DIST-STORE.1]
Required methods
pub fn get(&self, height: Height, status: Status) -> Option<LightBlock>
[src]
Get the light block at the given height with the given status, or return None
otherwise.
pub fn update(&mut self, light_block: &LightBlock, status: Status)
[src]
Update the status
of the given light_block
.
pub fn insert(&mut self, light_block: LightBlock, status: Status)
[src]
Insert a new light block in the store with the given status. Overrides any other block with the same height and status.
pub fn remove(&mut self, height: Height, status: Status)
[src]
Remove the light block with the given height and status, if any.
pub fn latest(&self, status: Status) -> Option<LightBlock>
[src]
Get the light block of greatest height with the given status.
pub fn all(&self, status: Status) -> Box<dyn Iterator<Item = LightBlock>>
[src]
Get an iterator of all light blocks with the given status.
Provided methods
pub fn get_non_failed(&self, height: Height) -> Option<(LightBlock, Status)>
[src]
Get a block at a given height whatever its verification status as long as it hasn't failed
verification (ie. its status is not Status::Failed
).
pub fn latest_trusted_or_verified(&self) -> Option<LightBlock>
[src]
Get the light block of greatest height with the trusted or verified status.
pub fn get_trusted_or_verified(&self, height: Height) -> Option<LightBlock>
[src]
Get the light block of the given height with the trusted or verified status.