MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / invoke

Function invoke

libatomic/tests/local_service_test.rs:133–143  ·  view source on GitHub ↗

Exercise the same protobuf bytes the Node addon passes to LocalService.

(
    service: &LocalService,
    method: &str,
    request: &Req,
)

Source from the content-addressed store, hash-verified

131
132// Exercise the same protobuf bytes the Node addon passes to LocalService.
133async fn invoke<Req: Message, Res: Message + Default>(
134 service: &LocalService,
135 method: &str,
136 request: &Req,
137) -> Res {
138 let bytes = service
139 .call(method, &request.encode_to_vec())
140 .await
141 .unwrap();
142 Res::decode(bytes.as_slice()).unwrap()
143}
144
145#[tokio::test]
146async fn local_add_record_log_and_change_use_existing_handlers() {

Calls 4

decodeFunction · 0.50
unwrapMethod · 0.45
callMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected