Skip to content

Commit

Permalink
fixup! WIP: needs refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
steveej committed Nov 7, 2024
1 parent 6adf5e3 commit a9cba70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct Settings {
}

/// Returns the default derivation path per config version.
pub const fn default_derivation_path(config: ConfigDiscriminants) -> usize {
pub const fn default_derivation_path(config: ConfigDiscriminants) -> u32 {
match config {
// TODO: what should these be?
ConfigDiscriminants::V1 => 3,
Expand Down
6 changes: 4 additions & 2 deletions core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use failure::{bail, ResultExt};
use log::debug;

use crate::{
config::Seed,
config::{self, ConfigDiscriminants, Seed},
types::{SeedExplorerError, SeedExplorerResult},
};
use hc_seed_bundle::{LockedSeedCipher, UnlockedSeedBundle};
Expand Down Expand Up @@ -47,7 +47,9 @@ pub async fn generate_device_bundle(
.await
.unwrap();

let derivation_path = maybe_derivation_path.unwrap_or(DEFAULT_DERIVATION_PATH_V3);
let derivation_path = maybe_derivation_path.unwrap_or(config::default_derivation_path(
ConfigDiscriminants::default(),
));

let device_bundle = master.derive(derivation_path).await.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion gen-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async fn main() -> Result<(), Error> {
let derivation_path = if let Some(derivation_path) = args.derivation_path {
derivation_path
} else {
hpos_config_core::utils::DEFAULT_DERIVATION_PATH_V2
hpos_config_core::config::default_derivation_path(ConfigDiscriminants::default())
};

// TODO: don't hardcode this
Expand Down

0 comments on commit a9cba70

Please sign in to comment.