pub fn rand() -> Self {
        let rng = &mut thread_rng();

        let pk = priv_key_from_fs(rng.gen());
        let (eth_pk, eth_address) = {
            let eth_pk = rng.gen::<[u8; 32]>().into();
            let eth_address;
            loop {
                if let Ok(address) = PackedEthSignature::address_from_private_key(&eth_pk) {
                    eth_address = address;
                    break;
                }
            }
            (eth_pk, eth_address)
        };
        Self::new(pk, 0, eth_address, eth_pk)
    }
/// Note: probably not secure, use for testing.
probably not secure, use for testing.
probably not secure use for testing .
pub fn rand() -> Self {
        let rng = &mut thread_rng();
        let pk = priv_key_from_fs(rng.gen());
        let (eth_pk, eth_address) = {
            let eth_pk = rng.gen::<[u8; 32]>().into();
            let eth_address;
            loop {
                if let Ok(address) = PackedEthSignature::address_from_private_key(&eth_pk) {
                    eth_address = address;
                    break;
                }
            }
            (eth_pk, eth_address)
        };
        Self::new(pk, 0, eth_address, eth_pk)
    }
pub fn rand ( ) -> Self { let rng = & mut thread_rng ( ) ; let pk = priv_key_from_fs ( rng . gen ( ) ) ; let ( eth_pk , eth_address ) = { let eth_pk = rng . gen :: < [ u8 ; 32 ] > ( ) . into ( ) ; let eth_address ; loop { if let Ok ( address ) = PackedEthSignature :: address_from_private_key ( & eth_pk ) { eth_address = address ; break ; } } ( eth_pk , eth_address ) } ; Self :: new ( pk , 0 , eth_address , eth_pk ) }
Note: probably not secure, use for testing.
Note : probably not secure use for testing .