diff --git a/swap/src/bitcoin.rs b/swap/src/bitcoin.rs index 7577633d..fef2e252 100644 --- a/swap/src/bitcoin.rs +++ b/swap/src/bitcoin.rs @@ -105,6 +105,13 @@ impl SecretKey { #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] pub struct PublicKey(Point); +impl PublicKey { + #[cfg(test)] + pub fn random() -> Self { + Self(Point::random(&mut rand::thread_rng())) + } +} + impl From for Point { fn from(from: PublicKey) -> Self { from.0