Extend nostr entry test

This commit is contained in:
thePR0M3TH3AN
2025-07-04 22:16:02 -04:00
parent 3d4e31acb2
commit 45315e3b55

View File

@@ -4,6 +4,8 @@ from tempfile import TemporaryDirectory
from helpers import create_vault, TEST_SEED, TEST_PASSWORD
from nostr.coincurve_keys import Keys
sys.path.append(str(Path(__file__).resolve().parents[1]))
from password_manager.entry_management import EntryManager
@@ -36,3 +38,11 @@ def test_nostr_key_determinism():
assert nsec1 == nsec2
assert npub1.startswith("npub")
assert nsec1.startswith("nsec")
priv_hex = Keys.bech32_to_hex(nsec1)
derived = Keys(priv_k=priv_hex)
encoded_npub = Keys.hex_to_bech32(derived.public_key_hex(), "npub")
assert encoded_npub == npub1
data = enc_mgr.load_json_data(entry_mgr.index_file)
assert data["entries"][str(idx)]["label"] == "main"