()
| 186 | } |
| 187 | |
| 188 | pub async fn setup_test() -> SetupConfig { |
| 189 | let source_network = Network::Regtest; |
| 190 | let destination_network = DestinationNetwork::Local; |
| 191 | |
| 192 | let commitment_secrets = get_test_commitment_secrets(); |
| 193 | |
| 194 | let (_, verifier_0_public_key) = generate_keys_from_secret(source_network, VERIFIER_0_SECRET); |
| 195 | let (_, verifier_1_public_key) = generate_keys_from_secret(source_network, VERIFIER_1_SECRET); |
| 196 | let mut n_of_n_public_keys: Vec<PublicKey> = Vec::new(); |
| 197 | n_of_n_public_keys.push(verifier_0_public_key); |
| 198 | n_of_n_public_keys.push(verifier_1_public_key); |
| 199 | |
| 200 | let depositor_context = |
| 201 | DepositorContext::new(source_network, DEPOSITOR_SECRET, &n_of_n_public_keys); |
| 202 | let operator_context = |
| 203 | OperatorContext::new(source_network, OPERATOR_SECRET, &n_of_n_public_keys); |
| 204 | let verifier_0_context = |
| 205 | VerifierContext::new(source_network, VERIFIER_0_SECRET, &n_of_n_public_keys); |
| 206 | let verifier_1_context = |
| 207 | VerifierContext::new(source_network, VERIFIER_1_SECRET, &n_of_n_public_keys); |
| 208 | let withdrawer_context = |
| 209 | WithdrawerContext::new(source_network, WITHDRAWER_SECRET, &n_of_n_public_keys); |
| 210 | |
| 211 | let valid_proof = get_valid_proof(); |
| 212 | let invalid_proof = invalidate_proof(&valid_proof); |
| 213 | |
| 214 | let client_0 = BitVMClient::new( |
| 215 | Some(get_esplora_url(source_network)), |
| 216 | source_network, |
| 217 | destination_network, |
| 218 | Some(get_chain_adaptor(destination_network, None, None)), |
| 219 | &n_of_n_public_keys, |
| 220 | Some(DEPOSITOR_SECRET), |
| 221 | Some(OPERATOR_SECRET), |
| 222 | Some(VERIFIER_0_SECRET), |
| 223 | Some(WITHDRAWER_SECRET), |
| 224 | Some("test_client_0"), |
| 225 | Some(valid_proof.vk.clone()), |
| 226 | ) |
| 227 | .await; |
| 228 | |
| 229 | let client_1 = BitVMClient::new( |
| 230 | Some(get_esplora_url(source_network)), |
| 231 | source_network, |
| 232 | destination_network, |
| 233 | Some(get_chain_adaptor(destination_network, None, None)), |
| 234 | &n_of_n_public_keys, |
| 235 | Some(DEPOSITOR_SECRET), |
| 236 | Some(OPERATOR_SECRET), |
| 237 | Some(VERIFIER_1_SECRET), |
| 238 | Some(WITHDRAWER_SECRET), |
| 239 | Some("test_client_1"), |
| 240 | Some(valid_proof.vk.clone()), |
| 241 | ) |
| 242 | .await; |
| 243 | |
| 244 | let connector_a = ConnectorA::new( |
| 245 | source_network, |
no test coverage detected