From 995389f40d7e8926da799c80493b0efac690e35c Mon Sep 17 00:00:00 2001 From: Maksym Arutyunyan Date: Wed, 11 Dec 2024 13:08:04 +0000 Subject: [PATCH] . --- test-utils/src/simple_rng.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test-utils/src/simple_rng.rs b/test-utils/src/simple_rng.rs index 0f4bcb6d..b3c72320 100644 --- a/test-utils/src/simple_rng.rs +++ b/test-utils/src/simple_rng.rs @@ -1,7 +1,4 @@ -use bitcoin::{ - secp256k1, - secp256k1::{constants::SECRET_KEY_SIZE, Secp256k1, Signing}, -}; +use bitcoin::secp256k1::{constants::SECRET_KEY_SIZE, PublicKey, Secp256k1, SecretKey, Signing}; use std::cell::RefCell; thread_local! { @@ -18,14 +15,12 @@ where }) } -pub fn generate_keypair( - secp: &Secp256k1, -) -> (secp256k1::SecretKey, secp256k1::PublicKey) { +pub fn generate_keypair(secp: &Secp256k1) -> (SecretKey, PublicKey) { with_rng(|rng| { let mut data = [0u8; SECRET_KEY_SIZE]; rng.fill_bytes(&mut data); - let sk = secp256k1::SecretKey::from_slice(&data).unwrap(); - let pk = secp256k1::PublicKey::from_secret_key(secp, &sk); + let sk = SecretKey::from_slice(&data).unwrap(); + let pk = PublicKey::from_secret_key(secp, &sk); (sk, pk) }) }