Create a new flashblocks test extension. If `process_canonical` is true, canonical blocks are automatically processed. Set to false for tests that need manual control over canonical block timing.
(process_canonical: bool)
| 111 | /// If `process_canonical` is true, canonical blocks are automatically processed. |
| 112 | /// Set to false for tests that need manual control over canonical block timing. |
| 113 | pub fn new(process_canonical: bool) -> Self { |
| 114 | let (sender, receiver) = mpsc::channel::<(Flashblock, oneshot::Sender<()>)>(100); |
| 115 | let inner = FlashblocksTestExtensionInner { |
| 116 | sender, |
| 117 | receiver: Arc::new(Mutex::new(Some(receiver))), |
| 118 | state: Arc::new(FlashblocksState::new(5)), |
| 119 | process_canonical, |
| 120 | }; |
| 121 | Self { inner: Arc::new(inner) } |
| 122 | } |
| 123 | |
| 124 | /// Get the flashblocks parts after the node has been launched. |
| 125 | pub fn parts(&self) -> Result<FlashblocksParts> { |
nothing calls this directly
no test coverage detected