Reject a currency code that isn't one #49
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#45 Give the config module a home to load from
rosa/casino
Reference
rosa/casino#49
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
The currency is stored as a bare string and validated nowhere. Reading it back
converts the code and unwraps the result, so a config naming
USDDparsescleanly, the casino opens, and the game panics at whatever point first asks what
the tables deal in — some arbitrary distance into a hand, with nothing pointing
at the config file as the cause.
Settle it where the file is read. A code that is not a currency fails the load,
naming the file and the code it could not make sense of, and the player is told
what to fix before anything else happens.
An empty value keeps meaning the house default. That is not the same defect: an
empty key reads as "I have not decided", the existing test says as much, and the
distinction survives the change intact. What is wrong is a code that looks
plausible, passes, and detonates later.
Acceptance criteria
names both the file and the code
mid-game
Blocked by