INNER CODE UNIT · Rust

agent_request_round_trips

Augani/dory · dory-core/pb/src/lib.rs:19

    fn agent_request_round_trips() {
        use agent::agent_request::Method;
        let req = agent::AgentRequest {
            method: Some(Method::ClockSync(agent::ClockSyncRequest {
                host_epoch_ns: 1_700_000_000_000_000_000,
            })),
        };
        let bytes = req.encode_to_vec();
        let back = agent::AgentRequest::decode(bytes.as_slice()).unwrap();
        assert_eq!(req, back);
        match back.method {
            Some(Method::ClockSync(r)) => assert_eq!(r.host_epoch_ns, 1_700_000_000_000_000_000),
            other => panic!("wrong method: {other:?}"),
        }
    }

    #[test]
    fn agent_response_error_round_trips() {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…