You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A second tautological assert! was introduced during the recent test work — this time inside crates/tools/src/secure_vault.rs::tests::test_vault_from_env (line 227). The assertion vault.admin_secret_key.is_none() || vault.admin_secret_key.is_some() is logically equivalent to true (it's just A || !A on the same boolean variable), so the test passes regardless of what the environment looks like. Same family of issue as #32: the test hides a bug instead of catching it, and silently green CI is worse than a noisy red CI.
Evidence
// crates/tools/src/secure_vault.rs (mod tests)#[test]fntest_vault_from_env(){let vault = SecureVault::from_env();assert!(vault.admin_secret_key.is_none() || vault.admin_secret_key.is_some());}#[test]fntest_validate_for_testnet(){let vault = SecureVault::from_env();assert!(vault.validate_for_testnet().is_ok());// also asserts a tautology: this only// catches "validator panics" but not "validator// returned Ok for malformed input"}
test_vault_from_env's predicate A || !A is literally true for any A: bool. test_validate_for_testnet only asserts that the validator returns Ok, but SecureVault::validate_for_testnet is so permissive (line 67 — only rejects "non-empty keys that don't start with S/G") that passing the test says very little about correctness.
Impact
A broken environment in which SOROBAN_ADMIN_SECRET_KEY is unset, malformed, or accidentally starts with a non-S character returns Ok from the testnet validator and None from the loader — the test calls both paths "good". A regression here would not be caught.
Costs 0 lines of code coverage for any actual property.
Overview
A second tautological
assert!was introduced during the recent test work — this time insidecrates/tools/src/secure_vault.rs::tests::test_vault_from_env(line 227). The assertionvault.admin_secret_key.is_none() || vault.admin_secret_key.is_some()is logically equivalent totrue(it's justA || !Aon the same boolean variable), so the test passes regardless of what the environment looks like. Same family of issue as #32: the test hides a bug instead of catching it, and silently green CI is worse than a noisy red CI.Evidence
test_vault_from_env's predicateA || !Ais literally true for anyA: bool.test_validate_for_testnetonly asserts that the validator returnsOk, butSecureVault::validate_for_testnetis so permissive (line 67 — only rejects "non-empty keys that don't start with S/G") that passing the test says very little about correctness.Impact
SOROBAN_ADMIN_SECRET_KEYis unset, malformed, or accidentally starts with a non-Scharacter returnsOkfrom the testnet validator andNonefrom the loader — the test calls both paths "good". A regression here would not be caught.Recommended Approach
Replace the two asserts with shape checks that mirror the production
validate_for_mainnetlogic:Acceptance Criteria
validate_for_mainnetandvalidate_for_testneteach have at least one positive AND one negative test.envwith valid keys AND a.envwith malformed keysAffected Files
crates/tools/src/secure_vault.rs