Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Rename `RAD_SEED` to `RAD_KEYGEN_SEED`
cloudhead committed 2 years ago
commit a3ffe51ddf28e564dccf1558e2c3fdf4c62278f7
parent fe5757d12267e717dc7c6db65c51acfab70aa6e1
2 files changed +5 -5
modified radicle-cli/tests/commands.rs
@@ -110,7 +110,7 @@ fn formula(root: &Path, test: impl AsRef<Path>) -> Result<TestFormula, Box<dyn s
        .env("LANG", "C")
        .env("USER", "alice")
        .env(env::RAD_PASSPHRASE, "radicle")
-
        .env(env::RAD_SEED, RAD_SEED)
+
        .env(env::RAD_KEYGEN_SEED, RAD_SEED)
        .env(env::RAD_RNG_SEED, "0")
        .env(env::RAD_LOCAL_TIME, "1671125284")
        .envs(git::env::GIT_DEFAULT_CONFIG)
modified radicle/src/profile.rs
@@ -43,7 +43,7 @@ pub mod env {
    /// RNG seed. Must be convertible to a `u64`.
    pub const RAD_RNG_SEED: &str = "RAD_RNG_SEED";
    /// Private key seed. Used for generating deterministic keypairs.
-
    pub const RAD_SEED: &str = "RAD_SEED";
+
    pub const RAD_KEYGEN_SEED: &str = "RAD_KEYGEN_SEED";
    /// Show radicle hints.
    pub const RAD_HINT: &str = "RAD_HINT";
    /// Environment variable to set to overwrite the commit date for both
@@ -115,16 +115,16 @@ pub mod env {

    /// Return the seed stored in the [`RAD_SEED`] environment variable, or generate a random one.
    pub fn seed() -> crypto::Seed {
-
        if let Ok(seed) = var(RAD_SEED) {
+
        if let Ok(seed) = var(RAD_KEYGEN_SEED) {
            let Ok(seed) = (0..seed.len())
                .step_by(2)
                .map(|i| u8::from_str_radix(&seed[i..i + 2], 16))
                .collect::<Result<Vec<u8>, _>>()
            else {
-
                panic!("env::seed: invalid hexadecimal value set in `{RAD_SEED}`");
+
                panic!("env::seed: invalid hexadecimal value set in `{RAD_KEYGEN_SEED}`");
            };
            let Ok(seed): Result<[u8; 32], _> = seed.try_into() else {
-
                panic!("env::seed: invalid seed length set in `{RAD_SEED}`");
+
                panic!("env::seed: invalid seed length set in `{RAD_KEYGEN_SEED}`");
            };
            crypto::Seed::new(seed)
        } else {