From 7a427f109ed907d6931c3c95eec5a9cc019387ac Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 26 Nov 2023 16:09:43 -0300 Subject: [PATCH] mint run with env vars --- .github/workflows/tests.yml | 2 +- tests/test_mint.py | 23 +++++++++++++++++++++++ tests/test_wallet_restore.py | 5 +++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c6017725..6659b06a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: MINT_PORT: 3337 MINT_DATABASE: ${{ inputs.db-url }} MINT_CACHE_SECRETS: ${{ inputs.mint-cache-secrets }} - MINT_ONLY_DEPRECATED: ${{ inputs.mint-only-deprecated }} + DEBUG_MINT_ONLY_DEPRECATED: ${{ inputs.mint-only-deprecated }} TOR: false run: | make test diff --git a/tests/test_mint.py b/tests/test_mint.py index de422e94..be935f98 100644 --- a/tests/test_mint.py +++ b/tests/test_mint.py @@ -133,6 +133,29 @@ async def test_generate_promises(ledger: Ledger): assert promises[0].dleq.e +@pytest.mark.asyncio +async def test_generate_promises_deprecated_keyset_id(ledger: Ledger): + blinded_messages_mock = [ + BlindedMessage( + amount=8, + B_="02634a2c2b34bec9e8a4aba4361f6bf202d7fa2365379b0840afe249a7a9d71239", + id="eGnEWtdJ0PIM", + ) + ] + promises = await ledger._generate_promises(blinded_messages_mock) + assert ( + promises[0].C_ + == "031422eeffb25319e519c68de000effb294cb362ef713a7cf4832cea7b0452ba6e" + ) + assert promises[0].amount == 8 + assert promises[0].id == "eGnEWtdJ0PIM" + + # DLEQ proof present + assert promises[0].dleq + assert promises[0].dleq.s + assert promises[0].dleq.e + + @pytest.mark.asyncio async def test_generate_promises_keyset_backwards_compatibility_pre_v0_15( ledger: Ledger, diff --git a/tests/test_wallet_restore.py b/tests/test_wallet_restore.py index e7e5d0d9..c9dddb54 100644 --- a/tests/test_wallet_restore.py +++ b/tests/test_wallet_restore.py @@ -8,6 +8,7 @@ from cashu.core.base import Proof from cashu.core.crypto.secp import PrivateKey from cashu.core.errors import CashuError +from cashu.core.settings import settings from cashu.wallet.wallet import Wallet from cashu.wallet.wallet import Wallet as Wallet1 from cashu.wallet.wallet import Wallet as Wallet2 @@ -85,6 +86,10 @@ async def wallet3(mint): @pytest.mark.asyncio +@pytest.mark.skipif( + settings.debug_mint_only_deprecated, + reason="settings.debug_mint_only_deprecated is set", +) async def test_bump_secret_derivation(wallet3: Wallet): await wallet3._init_private_key( "half depart obvious quality work element tank gorilla view sugar picture"