Skip to content
Snippets Groups Projects

Resolve "Change keypairs file to encrypted format (DEWIF)"

Open dvermd requested to merge dvermd/200-keypairs-dewif into dev
Files
47
@@ -213,10 +213,11 @@ pub fn key_wizard(mut key_pairs: DuniterKeyPairs) -> Result<DuniterKeyPairs, Cli
@@ -213,10 +213,11 @@ pub fn key_wizard(mut key_pairs: DuniterKeyPairs) -> Result<DuniterKeyPairs, Cli
mod tests {
mod tests {
use super::*;
use super::*;
 
use dup_crypto::keys::ed25519::KeyPairFromSeed32Generator;
use unwrap::unwrap;
use unwrap::unwrap;
static BASE58_SEED_INIT: &str = "4iXXx5GgRkZ85BVPwn8vFXvztdXAAa5yB573ErcAnngA";
static BASE58_SEED_INIT: &str = "4iXXx5GgRkZ85BVPwn8vFXvztdXAAa5yB573ErcAnngA";
static BASE58_PUB_INIT: &str = "otDgSpKvKAPPmE1MUYxc3UQ3RtEnKYz4iGD3BmwKPzM";
static BASE58_PUB_INIT: &str = "J2rQNuhMGwXKDJ4v9WJDczMSH7oVE4yyg5hDcroFmwCi";
static BASE58_SEED_TEST: &str = "ELjDWGPyCGMuhr7R7H2aip6UJA9qLRepmK77pcD41UqQ";
static BASE58_SEED_TEST: &str = "ELjDWGPyCGMuhr7R7H2aip6UJA9qLRepmK77pcD41UqQ";
static BASE58_PUB_TEST: &str = "6sewkaNWyEMqkEa2PVRWrDb3hxWtjPdUSB1zXVCqhdWV";
static BASE58_PUB_TEST: &str = "6sewkaNWyEMqkEa2PVRWrDb3hxWtjPdUSB1zXVCqhdWV";
@@ -245,22 +246,18 @@ mod tests {
@@ -245,22 +246,18 @@ mod tests {
fn setup_keys(both_keys: bool) -> DuniterKeyPairs {
fn setup_keys(both_keys: bool) -> DuniterKeyPairs {
let member_keypair = if both_keys {
let member_keypair = if both_keys {
Some(KeyPairEnum::Ed25519(ed25519::Ed25519KeyPair {
Some(KeyPairEnum::Ed25519(KeyPairFromSeed32Generator::generate(
seed: Seed32::from_base58(BASE58_SEED_INIT)
Seed32::from_base58(BASE58_SEED_INIT)
.expect("conf : keypairs file : fail to parse network_seed !"),
.expect("conf : keypairs file : fail to parse member_seed !"),
pubkey: ed25519::PublicKey::from_base58(BASE58_PUB_INIT)
)))
.expect("conf : keypairs file : fail to parse network_pub !"),
}))
} else {
} else {
None
None
};
};
DuniterKeyPairs {
DuniterKeyPairs {
network_keypair: KeyPairEnum::Ed25519(ed25519::Ed25519KeyPair {
network_keypair: KeyPairEnum::Ed25519(KeyPairFromSeed32Generator::generate(
seed: Seed32::from_base58(BASE58_SEED_INIT)
Seed32::from_base58(BASE58_SEED_INIT)
.expect("conf : keypairs file : fail to parse network_seed !"),
.expect("conf : keypairs file : fail to parse network_seed !"),
pubkey: ed25519::PublicKey::from_base58(BASE58_PUB_INIT)
)),
.expect("conf : keypairs file : fail to parse network_pub !"),
}),
member_keypair,
member_keypair,
}
}
}
}
Loading