Skip to content

Commit 147ac9a

Browse files
committed
chore: re-use path length constant
1 parent 7d67300 commit 147ac9a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

cmd/crates/stellar-ledger/src/hd_path.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use crate::Error;
1+
use crate::{Error, HD_PATH_ELEMENTS_COUNT};
22

33
const HARDENED_OFFSET: u32 = 1 << 31;
4-
const STELLAR_PATH_DEPTH: u8 = 3;
54
const PURPOSE: u32 = 44;
65
const COIN_TYPE: u32 = 148;
76

@@ -11,7 +10,7 @@ pub struct HdPath(pub u32);
1110
impl HdPath {
1211
#[must_use]
1312
pub fn depth(&self) -> u8 {
14-
STELLAR_PATH_DEPTH
13+
HD_PATH_ELEMENTS_COUNT
1514
}
1615
}
1716

@@ -62,7 +61,7 @@ mod test {
6261

6362
#[test]
6463
fn test_depth() {
65-
assert_eq!(HdPath(7).depth(), STELLAR_PATH_DEPTH);
64+
assert_eq!(HdPath(7).depth(), HD_PATH_ELEMENTS_COUNT);
6665
}
6766

6867
#[test]

0 commit comments

Comments
 (0)