Allow arbitrary denominations in wallet minting (#684)

- Update `mint` method to use allowed amounts from the mint
- Add `get_allowed_amounts` method to fetch supported denominations
- Modify `test_mint_amounts_wrong_order` to expect new error message

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
Houdini
2025-03-06 20:15:14 +01:00
committed by GitHub
parent 72ac35405c
commit 7b3f5d01d0
3 changed files with 25 additions and 6 deletions

View File

@@ -221,9 +221,10 @@ async def test_mint_amounts_wrong_order(wallet1: Wallet):
"""Mint amount that is not part in 2^n"""
amts = [1, 2, 3]
mint_quote = await wallet1.request_mint(sum(amts))
allowed_amounts = wallet1.get_allowed_amounts()
await assert_err(
wallet1.mint(amount=sum(amts), split=[1, 2, 3], quote_id=mint_quote.quote),
f"Can only mint amounts with 2^n up to {2**settings.max_order}.",
f"Can only mint amounts supported by the mint: {allowed_amounts}",
)