mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-01-10 20:24:19 +01:00
Balance Views Grouped By Keyset (#652)
* balance view per keyset + relative changes.
Still lacking: settings changes
* import unit
* fix 0 balance
* settings
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@ from typing import List
|
||||
|
||||
import pytest
|
||||
|
||||
from cashu.core.base import BlindedMessage, Proof
|
||||
from cashu.core.base import BlindedMessage, MintKeyset, Proof, Unit
|
||||
from cashu.core.crypto.b_dhke import step1_alice
|
||||
from cashu.core.helpers import calculate_number_of_blank_outputs
|
||||
from cashu.core.models import PostMintQuoteRequest
|
||||
@@ -218,7 +218,11 @@ async def test_generate_change_promises_returns_empty_if_no_outputs(ledger: Ledg
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_balance(ledger: Ledger):
|
||||
balance = await ledger.get_balance()
|
||||
unit = Unit["sat"]
|
||||
active_keyset: MintKeyset = next(
|
||||
filter(lambda k: k.active and k.unit == unit, ledger.keysets.values())
|
||||
)
|
||||
balance = await ledger.get_balance(active_keyset)
|
||||
assert balance == 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user