MCPcopy Create free account
hub / github.com/SeismicSystems/summit / test_get_minimum_stake

Function test_get_minimum_stake

rpc/tests/integration_test.rs:231–260  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229 let key_store_path = temp_dir.path().to_str().unwrap().to_string();
230
231 let server = SummitRpcServer::new(
232 key_store_path,
233 mailbox,
234 TEST_GENESIS_HASH,
235 b"_SUMMIT",
236 None,
237 #[cfg(feature = "permissioned")]
238 Arc::new(AtomicBool::new(false)),
239 );
240
241 let cap = MAX_CONCURRENT_STATE_PROOFS;
242
243 // Keep cap - 1 proof requests in flight, held open by the gated mock.
244 let mut held = Vec::new();
245 for _ in 0..(cap - 1) {
246 let server = server.clone();
247 held.push(tokio::spawn(async move {
248 let _ = server.get_state_proof(vec!["epoch".to_string()]).await;
249 }));
250 }
251
252 // Start the cap-th request; it acquires the last slot and hands its permit
253 // to the (gated) proof task.
254 let cancel = {
255 let server = server.clone();
256 tokio::spawn(async move {
257 let _ = server.get_state_proof(vec!["epoch".to_string()]).await;
258 })
259 };
260
261 // Wait until every request has reached the mock, so all cap slots are
262 // acquired and all permits are now owned by the mock's detached tasks.
263 let deadline = tokio::time::Instant::now() + Duration::from_secs(5);

Callers

nothing calls this directly

Calls 6

create_test_keystoreFunction · 0.85
pathMethod · 0.80
buildMethod · 0.45
get_minimum_stakeMethod · 0.45

Tested by

no test coverage detected