(&self)
| 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) { |
no test coverage detected