(um: stream::UplinkMeta)
| 402 | } |
| 403 | |
| 404 | pub 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 | |
| 440 | pub fn device_uplink_frame_log(uf: stream::UplinkFrameLog) -> Validator { |
| 441 | Box::new(move || { |
nothing calls this directly
no test coverage detected