mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-31 12:34:38 -04:00
Make it possible to create random public keys
This is useful for tests.
This commit is contained in:
parent
3f56fe93e0
commit
c539465925
1 changed files with 7 additions and 0 deletions
|
@ -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<PublicKey> for Point {
|
||||
fn from(from: PublicKey) -> Self {
|
||||
from.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue