An exchange entry accepts a pair it then overrules #54

Closed
opened 2026-08-19 14:50:38 +00:00 by rosa · 0 comments
Owner

What to build

A document whose exchange entry names a pair inside the value is refused, rather
than read and then overruled by the entry's key.

An exchange writes the pair as the key and leaves it out of the value, so an
entry states prices alone. The reader that fills those prices is shared with the
one that reads a standalone quotation, which does take a base and a quote, so an
entry accepts both fields and discards them. This reads back as a USD/EUR
quotation with no complaint:

{ "USD/EUR": { "base": "GBP", "quote": "JPY", "rate": "0.9" } }

The entry already declares only the price fields to the deserializer, so refusing
a base or a quote agrees with what the format says it is.

Acceptance criteria

  • An exchange entry that names a base or a quote is refused, and the error names the field that does not belong there.
  • A standalone quotation still reads its base and quote as before.
  • An entry carrying a field no price uses, such as the time of the quote, is still skipped.
  • A test covers an entry whose named pair disagrees with its key.

Blocked by

None — can start immediately.

## What to build A document whose exchange entry names a pair inside the value is refused, rather than read and then overruled by the entry's key. An exchange writes the pair as the key and leaves it out of the value, so an entry states prices alone. The reader that fills those prices is shared with the one that reads a standalone quotation, which does take a base and a quote, so an entry accepts both fields and discards them. This reads back as a USD/EUR quotation with no complaint: ```json { "USD/EUR": { "base": "GBP", "quote": "JPY", "rate": "0.9" } } ``` The entry already declares only the price fields to the deserializer, so refusing a base or a quote agrees with what the format says it is. ## Acceptance criteria - [ ] An exchange entry that names a base or a quote is refused, and the error names the field that does not belong there. - [ ] A standalone quotation still reads its base and quote as before. - [ ] An entry carrying a field no price uses, such as the time of the quote, is still skipped. - [ ] A test covers an entry whose named pair disagrees with its key. ## Blocked by None — can start immediately.
rosa closed this issue 2026-08-20 17:41:12 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rosa/lucre#54
No description provided.