Skip to content

Commit

Permalink
Cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Dec 2, 2024
1 parent 0f3106b commit e120595
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cmd/soroban-cli/src/config/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ mod tests {
}

#[test]
fn test_from_str_for_seed_phrase() {
fn test_secret_from_seed_phrase() {
let secret = Secret::from_str(TEST_SEED_PHRASE).unwrap();
let public_key = secret.public_key(None).unwrap();
let private_key = secret.private_key(None).unwrap();
Expand All @@ -216,18 +216,17 @@ mod tests {
}

#[test]
fn test_from_str_for_secure_store_secret() {
fn test_secret_from_secure_store() {
//todo: add assertion for getting public key - will need to mock the keychain and add the keypair to the keychain
let secret = Secret::from_str("secure_store:org.stellar.cli-alice").unwrap();

assert!(matches!(secret, Secret::SecureStore { .. }));
}

#[test]
#[should_panic]
fn test_secure_store_will_not_reveal_private_key() {
let secret = Secret::from_str("secure_store").unwrap();
secret.private_key(None).unwrap();
let private_key_result = secret.private_key(None);
assert!(private_key_result.is_err());
assert!(matches!(
private_key_result.unwrap_err(),
Error::SecureStoreDoesNotRevealSecretKey
));
}

#[test]
Expand Down

0 comments on commit e120595

Please sign in to comment.