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

Method create_peg_in_graph

bridge/src/client/client.rs:917–939  ·  view source on GitHub ↗
(&mut self, input: Input, evm_address: &str)

Source from the content-addressed store, hash-verified

915 }
916
917 pub async fn create_peg_in_graph(&mut self, input: Input, evm_address: &str) -> String {
918 if self.depositor_context.is_none() {
919 panic!("Depositor context must be initialized");
920 }
921
922 let peg_in_graph =
923 PegInGraph::new(self.depositor_context.as_ref().unwrap(), input, evm_address);
924
925 let peg_in_graph_id = peg_in_generate_id(&peg_in_graph.peg_in_deposit_transaction);
926
927 let graph = self
928 .data
929 .peg_in_graphs
930 .iter()
931 .find(|&peg_out_graph| peg_out_graph.id().eq(&peg_in_graph_id));
932 if graph.is_some() {
933 panic!("Peg in graph already exists");
934 }
935
936 self.data.peg_in_graphs.push(peg_in_graph);
937
938 peg_in_graph_id
939 }
940
941 pub async fn broadcast_peg_in_deposit(
942 &mut self,

Callers 10

test_peg_in_feesFunction · 0.80
test_peg_out_feesFunction · 0.80
test_musig2_peg_inFunction · 0.80
create_peg_in_graphFunction · 0.80
test_syncFunction · 0.80
setup_and_create_graphsFunction · 0.80
create_peg_in_graphFunction · 0.80
create_peg_in_graphFunction · 0.80

Calls 3

as_refMethod · 0.80
idMethod · 0.45
pushMethod · 0.45

Tested by 9

test_peg_in_feesFunction · 0.64
test_peg_out_feesFunction · 0.64
test_musig2_peg_inFunction · 0.64
create_peg_in_graphFunction · 0.64
test_syncFunction · 0.64
setup_and_create_graphsFunction · 0.64
create_peg_in_graphFunction · 0.64
create_peg_in_graphFunction · 0.64