MCPcopy Index your code
hub / github.com/BitVM/BitVM / operator_status

Method operator_status

bridge/src/client/client.rs:681–709  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

679 }
680
681 async fn operator_status(&self) {
682 if self.operator_context.is_none() {
683 panic!("Operator context must be initialized");
684 }
685
686 let mut peg_out_graphs_by_id: HashMap<&String, &PegOutGraph> = HashMap::new();
687 for peg_out_graph in self.data.peg_out_graphs.iter() {
688 peg_out_graphs_by_id.insert(peg_out_graph.id(), peg_out_graph);
689 }
690
691 let operator_public_key = &self.operator_context.as_ref().unwrap().operator_public_key;
692 for peg_in_graph in self.data.peg_in_graphs.iter() {
693 let peg_out_graph_id = peg_out_generate_id(peg_in_graph, operator_public_key);
694 if !peg_out_graphs_by_id.contains_key(&peg_out_graph_id) {
695 println!(
696 "[OPERATOR]: Peg-in graph ID: {} status: Missing peg out graph.\n",
697 peg_in_graph.id() // TODO update this to ask the operator to create a new peg out graph
698 );
699 } else {
700 let peg_out_graph = peg_out_graphs_by_id.get(&peg_out_graph_id).unwrap();
701 let status = peg_out_graph.operator_status(&self.esplora).await;
702 println!(
703 "[OPERATOR]: Peg-out graph ID: {} status: {}\n",
704 peg_out_graph.id(),
705 status
706 );
707 }
708 }
709 }
710
711 // TODO: refactor, see note on self.process_peg_in_as_verifier
712 pub async fn process_peg_in_as_depositor(&mut self, peg_in_graph_id: &GraphId) {

Callers 3

statusMethod · 0.45
process_peg_outsMethod · 0.45

Calls 3

as_refMethod · 0.80
idMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected