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

Method new

bridge/src/contexts/withdrawer.rs:33–53  ·  view source on GitHub ↗
(
        network: Network,
        withdrawer_secret: &str,
        n_of_n_public_keys: &[PublicKey],
    )

Source from the content-addressed store, hash-verified

31
32impl WithdrawerContext {
33 pub fn new(
34 network: Network,
35 withdrawer_secret: &str,
36 n_of_n_public_keys: &[PublicKey],
37 ) -> Self {
38 let (keypair, public_key) = generate_keys_from_secret(network, withdrawer_secret);
39 let (n_of_n_public_key, n_of_n_taproot_public_key) =
40 generate_n_of_n_public_key(n_of_n_public_keys);
41
42 WithdrawerContext {
43 network,
44
45 withdrawer_keypair: keypair,
46 withdrawer_public_key: public_key,
47 withdrawer_taproot_public_key: XOnlyPublicKey::from(public_key),
48
49 n_of_n_public_keys: n_of_n_public_keys.to_owned(),
50 n_of_n_public_key,
51 n_of_n_taproot_public_key,
52 }
53 }
54}

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected