| 254 | const DUMMY_TXID: &str = "5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456"; |
| 255 | |
| 256 | fn get_test_nonces() -> ( |
| 257 | HashMap<usize, HashMap<PublicKey, PubNonce>>, |
| 258 | HashMap<usize, HashMap<PublicKey, Signature>>, |
| 259 | ) { |
| 260 | const SIGNERS: usize = 3; |
| 261 | const INPUTS: usize = 4; |
| 262 | |
| 263 | // Generate keys |
| 264 | let mut keypairs: Vec<Keypair> = Vec::new(); |
| 265 | let mut pubkeys: Vec<PublicKey> = Vec::new(); |
| 266 | for signer in 0..SIGNERS { |
| 267 | let (keypair, pubkey) = generate_keys_from_secret( |
| 268 | bitcoin::Network::Bitcoin, |
| 269 | &[(signer + 1) as u8; SECRET_KEY_SIZE].to_lower_hex_string(), |
| 270 | ); |
| 271 | keypairs.push(keypair); |
| 272 | pubkeys.push(pubkey); |
| 273 | } |
| 274 | |
| 275 | // Generate and sign nonces |
| 276 | let mut all_nonces: HashMap<usize, HashMap<PublicKey, PubNonce>> = HashMap::new(); |
| 277 | let mut all_sigs: HashMap<usize, HashMap<PublicKey, Signature>> = HashMap::new(); |
| 278 | for input in 0..INPUTS { |
| 279 | let mut nonces: HashMap<PublicKey, PubNonce> = HashMap::new(); |
| 280 | let mut sigs: HashMap<PublicKey, Signature> = HashMap::new(); |
| 281 | for signer in 0..SIGNERS { |
| 282 | let secret_nonce = generate_nonce(); |
| 283 | |
| 284 | nonces.insert(pubkeys[signer], secret_nonce.public_nonce()); |
| 285 | |
| 286 | let nonce_signature = |
| 287 | keypairs[signer].sign_schnorr(get_nonce_message(&secret_nonce.public_nonce())); |
| 288 | sigs.insert(pubkeys[signer], nonce_signature); |
| 289 | } |
| 290 | all_nonces.insert(input, nonces); |
| 291 | all_sigs.insert(input, sigs); |
| 292 | } |
| 293 | (all_nonces, all_sigs) |
| 294 | } |
| 295 | |
| 296 | fn get_test_tx() -> Transaction { |
| 297 | Transaction { |