diff options
| author | historia <[not public]> | 2026-09-18 21:50:17 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 21:50:17 -0400 |
| commit | 2c38386484cdb507c4687caceb37e0b963e33594 (patch) | |
| tree | b25ecf9f509a48d8126f5a4b3a0482de42676239 /internal/casino/manager_test.go | |
| parent | e7848ea79a9a57fdf391d30c48ce649f3d2f6180 (diff) | |
| download | thehouseoficarus-2c38386484cdb507c4687caceb37e0b963e33594.tar.gz | |
fix: make slot payout and stake resolution one durable save
Diffstat (limited to 'internal/casino/manager_test.go')
| -rw-r--r-- | internal/casino/manager_test.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/internal/casino/manager_test.go b/internal/casino/manager_test.go index 6601b52..9b5d35a 100644 --- a/internal/casino/manager_test.go +++ b/internal/casino/manager_test.go @@ -23,17 +23,16 @@ func (w *testWallet) Wager(amount int) (Wager, error) { return wager, nil } -func (w *testWallet) PayCredits(amount int) error { +// PayCredits mirrors the production wallet: it banks the payout and, in the +// same step, consumes the stakes the settlement resolves. +func (w *testWallet) PayCredits(amount int, stakeIDs ...string) error { w.paid += amount + for _, id := range stakeIDs { + w.ResolveStake(id) + } return nil } -// PayStakeCover routes through PayCredits so a wallet rejecting payouts -// (failingPayoutWallet) rejects stake-covering settlements identically. -func (w *testWallet) PayStakeCover(amount int, _ []string) error { - return w.PayCredits(amount) -} - // ResolveStake settles one outstanding stake by handle, mirroring the // production wallet. func (w *testWallet) ResolveStake(stakeID string) { |
