mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
Extend nostr entry test
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user