Record the buy consumption fix

This commit is contained in:
ai-bot committed 2026-11-14 16:13:57 +00:00
1 parent 9d55ee40f9
commit 3304bad670
1 file changed
+1
+1
View File
@@ -33,6 +33,7 @@ finished step, with the commit message it used where the spec left a choice.
- 15 `tests/test_ledger.py` — the 8 cases of spec §5, plus `tests/__init__.py` so `unittest discover` finds the package.
- 16 `tests/test_tax.py` — the 8 cases of spec §6.
- decision: a leg carries one currency only (the CHECK of §4), so a buy keeps the NOK paid on `leg_out_ore`. §5.1 says `leg_in_ore`, which that CHECK forbids; `ledger.create_lots_for()` accepts either, and the form maps the given side to `leg_out_ore`.
- fix: `ledger._sats_to_consume()` returns 0 when `leg_out_sats` is NULL, so a buy with a sats fee consumes nothing — the fee lowers the sats that arrive instead (§3.2). Found by the fee case of `tests/test_tax.py`.
- next: run `python3 -m unittest discover -s tests -v`, then Phase B (`static/`).
## Not in this plan