MCPcopy Create free account
hub / github.com/base/base / new

Method new

crates/execution/flashblocks-node/src/test_harness.rs:113–122  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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> {

Callers

nothing calls this directly

Calls 4

flashblocks_stateMethod · 0.80
blockchain_providerMethod · 0.45
blockMethod · 0.45

Tested by

no test coverage detected