Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ngutech21 committed Dec 4, 2023
1 parent 7b1e924 commit 4cff653
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions moksha-core/src/keyset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,37 +229,37 @@ mod tests {
#[test]
fn test_derive_keys_master() -> anyhow::Result<()> {
let keys = super::derive_keys("master", "0/0/0/0");
assert!(keys.len() == 64);
assert_eq!(keys.len(), 64);

let pub_keys = super::derive_pubkeys(&keys);
let id = super::legacy_derive_keyset_id(&pub_keys);
assert_eq!("JHV8eUnoAln/", id);
assert!(id.len() == 12);
assert_eq!(id.len(), 12);
Ok(())
}

#[test]
fn test_derive_keys_master_v1() -> anyhow::Result<()> {
let keys = super::derive_keys("supersecretprivatekey", "");
assert!(keys.len() == 64);
assert_eq!(keys.len(), 64);

let pub_keys = super::derive_pubkeys(&keys);
let id = super::derive_keyset_id(&pub_keys);
//assert_eq!("00d31cecf59d18c0", id); // FIXME
assert!(id.len() == 16);
assert_eq!(id.len(), 16);
Ok(())
}

// uses values from cashu test_mint.py
#[test]
fn test_derive_keys_cashu_py() -> anyhow::Result<()> {
let keys = super::derive_keys("TEST_PRIVATE_KEY", "0/0/0/0");
assert!(keys.len() == 64);
assert_eq!(keys.len(), 64);

let pub_keys = super::derive_pubkeys(&keys);
let id = super::legacy_derive_keyset_id(&pub_keys);
assert_eq!("1cCNIAZ2X/w1", id);
assert!(id.len() == 12);
assert_eq!(id.len(), 12);
Ok(())
}

Expand All @@ -282,7 +282,7 @@ mod tests {

let keyset_id = super::legacy_derive_keyset_id(&pubs);

assert!(keyset_id.len() == 12);
assert_eq!(keyset_id.len(), 12);
assert_eq!(keyset_id, "cNbjM0O6V/Kl");
Ok(())
}
Expand Down

0 comments on commit 4cff653

Please sign in to comment.