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

Method validate_data

bridge/src/client/client.rs:541–572  ·  view source on GitHub ↗
(client: &AsyncClient, data: &BitVMClientPublicData)

Source from the content-addressed store, hash-verified

539 }
540
541 pub async fn validate_data(client: &AsyncClient, data: &BitVMClientPublicData) -> bool {
542 println!(
543 "Validating {} PEG-IN graphs and {} PEG-OUT graphs...",
544 data.peg_in_graphs.len(),
545 data.peg_out_graphs.len()
546 );
547 for peg_in_graph in data.peg_in_graphs.iter() {
548 if let Err(err) = peg_in_graph.validate() {
549 eprintln!(
550 "Encountered invalid peg-in graph (graph ID: {}), with error: {}",
551 peg_in_graph.id(),
552 err,
553 );
554
555 return false;
556 }
557 }
558 for peg_out_graph in data.peg_out_graphs.iter() {
559 if let Err(err) = peg_out_graph.validate(client).await {
560 eprintln!(
561 "Encountered invalid peg-out graph (graph ID: {}), with error: {}",
562 peg_out_graph.id(),
563 err,
564 );
565
566 return false;
567 }
568 }
569
570 // println!("All graph data is valid");
571 true
572 }
573
574 /// Merges `data` into `self.data`.
575 ///

Callers

nothing calls this directly

Calls 1

validateMethod · 0.45

Tested by

no test coverage detected