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

Method read_from_l2

bridge/src/client/client.rs:317–340  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

315 }
316
317 async fn read_from_l2(&mut self) {
318 let peg_out_result = self.chain_service.get_peg_out_init().await;
319 if peg_out_result.is_ok() {
320 let mut events = peg_out_result.unwrap();
321 for peg_out_graph in self.data.peg_out_graphs.iter_mut() {
322 if !peg_out_graph.is_peg_out_initiated() {
323 match peg_out_graph.match_and_set_peg_out_event(&mut events).await {
324 Ok(_) => {
325 if peg_out_graph.peg_out_chain_event.is_some() {
326 println!(
327 "Peg-out graph ID: {} Event Matched, Event: {:?}",
328 peg_out_graph.id(),
329 peg_out_graph.peg_out_chain_event
330 )
331 }
332 }
333 Err(err) => println!("Error: {}", err),
334 }
335 }
336 }
337 } else {
338 panic!("Get event failed from L2 chain: {:?}", peg_out_result.err());
339 }
340 }
341
342 async fn get_latest_file_names(
343 data_store: &DataStore,

Callers 1

sync_l2Method · 0.80

Calls 3

get_peg_out_initMethod · 0.80
is_peg_out_initiatedMethod · 0.80

Tested by

no test coverage detected