MCPcopy Create free account
hub / github.com/BitVM/BitVM / flush

Method flush

bridge/src/client/cli/query_response.rs:25–58  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

23 }
24
25 pub fn flush(&self) {
26 println!(">>>> BitVM Query Response <<<<");
27
28 match &self.status {
29 ResponseStatus::OK => {
30 println!(
31 "{}",
32 json!({
33 "status": "OK",
34 "data": match &self.data {
35 Some(data) => data.clone(),
36 None => json!({}),
37 },
38 "error": "",
39 })
40 );
41 }
42 ResponseStatus::NOK(msg) => {
43 println!(
44 "{}",
45 json!({
46 "status": "NOK",
47 "data": "",
48 "error": msg
49 })
50 );
51 }
52 }
53
54 std::process::exit(match self.status {
55 ResponseStatus::OK => 0,
56 ResponseStatus::NOK(_) => 1,
57 });
58 }
59}

Calls

no outgoing calls

Tested by

no test coverage detected