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

Function multiple_flashblocks_same_block

crates/execution/flashblocks/src/cache.rs:194–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192
193 #[test]
194 fn multiple_flashblocks_same_block() {
195 let mut cache = FlashblockCache::new(10);
196
197 assert!(cache.insert(make_flashblock(11, 0)));
198 assert!(cache.insert(make_flashblock(11, 1)));
199 assert!(cache.insert(make_flashblock(11, 2)));
200 assert_eq!(cache.total_flashblocks(), 3);
201 assert_eq!(cache.len(), 1);
202
203 let drained = cache.drain(11);
204 assert_eq!(drained.len(), 3);
205 assert_eq!(drained[0].index, 0);
206 assert_eq!(drained[1].index, 1);
207 assert_eq!(drained[2].index, 2);
208 }
209}

Callers

nothing calls this directly

Calls 1

drainMethod · 0.45

Tested by

no test coverage detected