pub fn keypair_from_seed(seed: &[u8]) -> Result<Keypair, Box<dyn error::Error>> {
    if seed.len() < ed25519_dalek::SECRET_KEY_LENGTH {
        return Err("Seed is too short".into());
    }
    let secret = ed25519_dalek::SecretKey::from_bytes(&seed[..ed25519_dalek::SECRET_KEY_LENGTH])
        .map_err(|e| e.to_string())?;
    let public = ed25519_dalek::PublicKey::from(&secret);
    let dalek_keypair = ed25519_dalek::Keypair { secret, public };
    Ok(Keypair(dalek_keypair))
}
/// Constructs a `Keypair` from caller-provided seed entropy
Constructs a `Keypair` from caller-provided seed entropy
Constructs a ` Keypair ` from caller - provided seed entropy
pub fn keypair_from_seed(seed: &[u8]) -> Result<Keypair, Box<dyn error::Error>> {
    if seed.len() < ed25519_dalek::SECRET_KEY_LENGTH {
        return Err("Seed is too short".into());
    }
    let secret = ed25519_dalek::SecretKey::from_bytes(&seed[..ed25519_dalek::SECRET_KEY_LENGTH])
        .map_err(|e| e.to_string())?;
    let public = ed25519_dalek::PublicKey::from(&secret);
    let dalek_keypair = ed25519_dalek::Keypair { secret, public };
    Ok(Keypair(dalek_keypair))
}
pub fn keypair_from_seed ( seed : & [ u8 ] ) -> Result < Keypair , Box < dyn error :: Error > > { if seed . len ( ) < ed25519_dalek :: SECRET_KEY_LENGTH { return Err ( " " . into ( ) ) ; } let secret = ed25519_dalek :: SecretKey :: from_bytes ( & seed [ .. ed25519_dalek :: SECRET_KEY_LENGTH ] ) . map_err ( | e | e . to_string ( ) ) ? ; let public = ed25519_dalek :: PublicKey :: from ( & secret ) ; let dalek_keypair = ed25519_dalek :: Keypair { secret , public } ; Ok ( Keypair ( dalek_keypair ) ) }
Constructs a `Keypair` from caller-provided seed entropy
Constructs a ` Keypair ` from caller - provided seed entropy
seed
&[u8]