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

Function test_sync

bridge/tests/bridge/client/sync.rs:15–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14#[tokio::test]
15async fn test_sync() {
16 let mut config = setup_test().await;
17
18 println!("Read from remote");
19 config.client_0.sync().await;
20
21 println!("Modify data and save");
22 let amount = Amount::from_sat(INITIAL_AMOUNT + PEG_OUT_FEE + 1);
23 let faucet = Faucet::new(FaucetType::EsploraRegtest);
24 let address = generate_pay_to_pubkey_script_address(
25 config.depositor_context.network,
26 &config.depositor_context.depositor_public_key,
27 );
28 faucet.fund_input(&address, amount).await.wait().await;
29
30 let outpoint = generate_stub_outpoint(&config.client_0, &address, amount).await;
31
32 println!("Creating peg in graph ...");
33 let peg_in_graph_id = config
34 .client_0
35 .create_peg_in_graph(Input { outpoint, amount }, &config.depositor_evm_address)
36 .await;
37
38 println!("Creating peg out graph ...");
39 config.client_0.create_peg_out_graph(
40 &peg_in_graph_id,
41 Input {
42 outpoint: generate_stub_outpoint(
43 &config.client_0,
44 &generate_pay_to_pubkey_script_address(
45 config.depositor_context.network,
46 &config.depositor_context.depositor_public_key,
47 ),
48 amount,
49 )
50 .await,
51 amount,
52 },
53 config.commitment_secrets,
54 );
55
56 println!("Save to remote");
57 config.client_0.flush().await;
58}

Callers

nothing calls this directly

Calls 9

setup_testFunction · 0.85
generate_stub_outpointFunction · 0.85
waitMethod · 0.80
fund_inputMethod · 0.80
create_peg_in_graphMethod · 0.80
create_peg_out_graphMethod · 0.80
syncMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected