test(v2): rewrite cassette tests for v1.1 position-keyed wire shape (#29 v1.1)
The wire-shape pivot (m007 denomination-keyed → m008 position-keyed)
needs the unit test surface re-written to match:
test_cassette_configs.py
- PublishCassettesPayload tests pivot to positions-keyed input.
Validators reject non-int / non-positive position keys, negative
denom, negative count. Zero count allowed (empty cassette).
- NEW: test_accepts_multiple_same_denomination_cassettes — pins the
v1.1 operational requirement (real machines load 4×$20 for cash-out
throughput) per coord-log 18:45Z. No denom-unique validator.
- CassettePayloadRow tests pivot to the new field shape
(denomination + count, no position).
- UpsertCassetteConfigData tests cover edit-denomination (the v1.1
"operator swaps a cartridge during refill" scenario) and edit-count.
Position no longer in the model.
test_cassette_state_consumer.py
- _make_state_event helper builds {"positions": {...}} ciphertext.
- Happy-path assertion checks p.positions keys + denomination/count
per row.
- NEW: test_round_trips_multiple_same_denomination — covers the v1.1
four-of-the-same case through encrypt → decrypt → parse.
- All negative paths (tamper, wrong privkey, malformed pubkey,
missing fields, garbage JSON, wrong shape) carry over with the new
payload shape.
- d-tag tests unchanged (position vs denomination isn't on the d-tag).
test_nip44_v2.py
- TestBitspireCrossTest temporarily re-skipped at the class level: the
13:15Z fixture is encoded with the v1 denomination-keyed shape;
bitspire's posting a v1.1 fixture and commit g will swap +
unskip.
Total: 148 passed, 3 skipped (bitspire cross-test pending the v1.1
fixture from bitspire), 1 pre-existing async-plugin failure unchanged.
Branch tip is now functionally green (the pre-existing async failure
predates this PR + can't be addressed without a pytest plugin install).
Pending commit g for the cross-test fixture re-wire when bitspire posts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3014962563
commit
1cebefcde5
3 changed files with 132 additions and 80 deletions
|
|
@ -308,6 +308,16 @@ _BITSPIRE_FIXTURE = {
|
|||
}
|
||||
|
||||
|
||||
@pytest.mark.skip(
|
||||
reason=(
|
||||
"v1.1 wire-shape pivot (coord-log 2026-05-30T18:30Z + 18:45Z): the "
|
||||
"13:15Z fixture above is encoded with the old `{denominations: ...}` "
|
||||
"wire shape; the v1.1 wire shape is `{positions: {<pos>: "
|
||||
"{denomination, count}}}`. Bitspire will post a fresh fixture against "
|
||||
"the v1.1 shape; once posted, swap `_BITSPIRE_FIXTURE` for the new "
|
||||
"JSON and drop this skip (v1.1 commit g on the PR)."
|
||||
)
|
||||
)
|
||||
class TestBitspireCrossTest:
|
||||
"""Byte-compat cross-test between our hand-rolled NIP-44 v2 (`nip44.py`)
|
||||
and the nostr-tools NIP-44 v2 impl that bitspire uses on the ATM side
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue