mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
Add unit tests for the equivocation detection loop (#2571)
* Add unit tests for the equivocation detection loop * clippy * use std::future::pending()
This commit is contained in:
committed by
Bastian Köcher
parent
655a5055cc
commit
4cd9e2fe79
@@ -32,6 +32,10 @@ impl<P: FinalityPipeline, SC: SourceClientBase<P>> FinalityProofsStream<P, SC> {
|
||||
Self { stream: None }
|
||||
}
|
||||
|
||||
pub fn from_stream(stream: SC::FinalityProofsStream) -> Self {
|
||||
Self { stream: Some(Box::pin(stream)) }
|
||||
}
|
||||
|
||||
fn next(&mut self) -> Option<<SC::FinalityProofsStream as Stream>::Item> {
|
||||
let stream = match &mut self.stream {
|
||||
Some(stream) => stream,
|
||||
@@ -131,12 +135,6 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::mock::*;
|
||||
|
||||
impl<P: FinalityPipeline, SC: SourceClientBase<P>> FinalityProofsStream<P, SC> {
|
||||
fn from_stream(stream: SC::FinalityProofsStream) -> Self {
|
||||
Self { stream: Some(Box::pin(stream)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn finality_proofs_buf_fill_works() {
|
||||
// when stream is currently empty, nothing is changed
|
||||
|
||||
Reference in New Issue
Block a user