MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / send_ok

Function send_ok

nodedb/tests/cross_engine_bitmap_currency.rs:78–98  ·  view source on GitHub ↗

Push a plan, tick, pop response, assert `Ok`.

(
    core: &mut CoreLoop,
    tx: &mut Producer<BridgeRequest>,
    rx: &mut Consumer<BridgeResponse>,
    plan: PhysicalPlan,
)

Source from the content-addressed store, hash-verified

76
77/// Push a plan, tick, pop response, assert `Ok`.
78fn send_ok(
79 core: &mut CoreLoop,
80 tx: &mut Producer<BridgeRequest>,
81 rx: &mut Consumer<BridgeResponse>,
82 plan: PhysicalPlan,
83) -> Vec<u8> {
84 tx.try_push(BridgeRequest {
85 inner: make_req(plan),
86 })
87 .unwrap();
88 core.tick();
89 let resp = rx.try_pop().unwrap();
90 assert_eq!(
91 resp.inner.status,
92 Status::Ok,
93 "expected Ok status, got {:?}: {:?}",
94 resp.inner.status,
95 resp.inner.error_code
96 );
97 resp.inner.payload.to_vec()
98}
99
100/// Parse a JSON response payload into a `serde_json::Value`.
101fn parse_json(payload: &[u8]) -> serde_json::Value {

Calls 5

try_pushMethod · 0.80
try_popMethod · 0.80
make_reqFunction · 0.70
tickMethod · 0.45
to_vecMethod · 0.45

Tested by

no test coverage detected