Skip to content

Commit

Permalink
mint run with env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 26, 2023
1 parent 905ad7b commit 7a427f1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions tests/test_mint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions tests/test_wallet_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 7a427f1

Please sign in to comment.