mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-01-08 03:14:18 +01:00
mint: add seed decrypt (#403)
* mint: add seed decrypt * add mint seed decryoption and migration tool
This commit is contained in:
@@ -2,9 +2,7 @@ import pytest
|
||||
|
||||
from cashu.core.base import MintKeyset
|
||||
from cashu.core.settings import settings
|
||||
|
||||
SEED = "TEST_PRIVATE_KEY"
|
||||
DERIVATION_PATH = "m/0'/0'/0'"
|
||||
from tests.test_mint_init import DECRYPTON_KEY, DERIVATION_PATH, ENCRYPTED_SEED, SEED
|
||||
|
||||
|
||||
async def assert_err(f, msg):
|
||||
@@ -55,3 +53,21 @@ async def test_keyset_0_11_0():
|
||||
== "026b714529f157d4c3de5a93e3a67618475711889b6434a497ae6ad8ace6682120"
|
||||
)
|
||||
assert keyset.id == "Zkdws9zWxNc4"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_keyset_0_15_0_encrypted():
|
||||
settings.mint_seed_decryption_key = DECRYPTON_KEY
|
||||
keyset = MintKeyset(
|
||||
encrypted_seed=ENCRYPTED_SEED,
|
||||
derivation_path=DERIVATION_PATH,
|
||||
version="0.15.0",
|
||||
)
|
||||
assert len(keyset.public_keys_hex) == settings.max_order
|
||||
assert keyset.seed == "TEST_PRIVATE_KEY"
|
||||
assert keyset.derivation_path == "m/0'/0'/0'"
|
||||
assert (
|
||||
keyset.public_keys_hex[1]
|
||||
== "02194603ffa36356f4a56b7df9371fc3192472351453ec7398b8da8117e7c3e104"
|
||||
)
|
||||
assert keyset.id == "009a1f293253e41e"
|
||||
|
||||
Reference in New Issue
Block a user