From 9666676766bf21364f4fc4d0d1d336e72f2a91b4 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 6 Oct 2026 12:57:23 -0400 Subject: refactor: split casino.go, dedup helpers, remove audit docs --- internal/cryptomarket/client_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'internal/cryptomarket/client_test.go') diff --git a/internal/cryptomarket/client_test.go b/internal/cryptomarket/client_test.go index 39367fc..ab77b24 100644 --- a/internal/cryptomarket/client_test.go +++ b/internal/cryptomarket/client_test.go @@ -214,3 +214,24 @@ func TestClientCancellationDoesNotPoisonSharedBackoff(t *testing.T) { t.Fatalf("cancelled fetch poisoned the shared client: %v", e) } } + +func TestHaltedSymbolIsFreshAfterAttempt(t *testing.T) { + c, calls := mockKraken(t, "halted") + if s, e := c.Fetch(context.Background(), []string{"BTC"}); e != nil { + t.Fatal(e) + } else if _, ok := s.Quotes["BTC"]; ok { + t.Fatal("halted symbol unexpectedly quoted") + } + first := calls.Load() + if first != 4 { + t.Fatalf("first fetch calls = %d, want 4", first) + } + // A halted/delisted pair has no quote, but the attempt must be cached so + // the next command does not re-run the full request chain forever. + if _, e := c.Fetch(context.Background(), []string{"BTC"}); e != nil { + t.Fatal(e) + } + if calls.Load() != first { + t.Fatalf("halted symbol re-fetched: %d -> %d", first, calls.Load()) + } +} -- cgit v1.2.3