lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README | LICENSE

fixtures.rs (1189B)


      1 use alloc::vec::Vec;
      2 use radroots_simplex_chat_proto::prelude::{RadrootsSimplexChatMessage, decode_messages};
      3 use radroots_simplex_smp_proto::prelude::RadrootsSimplexSmpQueueUri;
      4 
      5 pub const fn synthetic_fixture_id() -> &'static str {
      6     "rr-synth/stack/duplex-v1"
      7 }
      8 
      9 pub const fn synthetic_connection_id() -> &'static str {
     10     "rr-synth-conn-001"
     11 }
     12 
     13 pub fn synthetic_invitation_queue() -> RadrootsSimplexSmpQueueUri {
     14     RadrootsSimplexSmpQueueUri::parse(
     15         "smp://cnItc3ludGgtc2VydmVyLWtleS1oYXNoLTAwMDAwMDE@relay.synthetic.invalid/aW52aXRl#/?v=4&dh=cnItc3ludGgtZGg&q=m",
     16     )
     17     .unwrap()
     18 }
     19 
     20 pub fn synthetic_reply_queue() -> RadrootsSimplexSmpQueueUri {
     21     RadrootsSimplexSmpQueueUri::parse(
     22         "smp://cnItc3ludGgtcmVwbHkta2V5LWhhc2gtMDAwMDAwMDE@reply.synthetic.invalid/cmVwbHk#/?v=4&dh=cnItc3ludGgtcmVwbHk&q=m",
     23     )
     24     .unwrap()
     25 }
     26 
     27 pub fn synthetic_chat_messages() -> Vec<RadrootsSimplexChatMessage> {
     28     decode_messages(
     29         br#"[{
     30             "v":"1-16",
     31             "msgId":"AQ",
     32             "event":"x.msg.new",
     33             "params":{
     34                 "content":{"type":"text","text":"hello from rr-synth"}
     35             }
     36         }]"#,
     37     )
     38     .unwrap()
     39 }