MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / uplink_meta_log

Function uplink_meta_log

chirpstack/src/test/assert.rs:404–438  ·  view source on GitHub ↗
(um: stream::UplinkMeta)

Source from the content-addressed store, hash-verified

402}
403
404pub fn uplink_meta_log(um: stream::UplinkMeta) -> Validator {
405 Box::new(move || {
406 let um = um.clone();
407 Box::pin(async move {
408 let key = redis_key("stream:meta".to_string());
409 let srr: StreamReadReply = redis::cmd("XREAD")
410 .arg("COUNT")
411 .arg(1_usize)
412 .arg("STREAMS")
413 .arg(&key)
414 .arg("0")
415 .query_async(&mut get_async_redis_conn().await.unwrap())
416 .await
417 .unwrap();
418
419 for stream_key in &srr.keys {
420 for stream_id in &stream_key.ids {
421 for (k, v) in &stream_id.map {
422 assert_eq!("up", k);
423 if let redis::Value::BulkString(b) = v {
424 let pl = stream::UplinkMeta::decode(&mut Cursor::new(b)).unwrap();
425 assert_eq!(um, pl);
426 } else {
427 panic!("Invalid payload");
428 }
429
430 return;
431 }
432 }
433 }
434
435 panic!("No UplinkMeta");
436 })
437 })
438}
439
440pub fn device_uplink_frame_log(uf: stream::UplinkFrameLog) -> Validator {
441 Box::new(move || {

Callers

nothing calls this directly

Calls 5

redis_keyFunction · 0.85
get_async_redis_connFunction · 0.85
to_stringMethod · 0.80
unwrapMethod · 0.80
decodeFunction · 0.50

Tested by

no test coverage detected