diff options
| author | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-06 12:57:23 -0400 |
| commit | 9666676766bf21364f4fc4d0d1d336e72f2a91b4 (patch) | |
| tree | 0cade34091d7602790dc38cd44053f0b74bbadf2 /internal/cryptomarket/client_test.go | |
| parent | 4bc1daaf259e0c19c5fe4a12ec8bc7f6e5a735c1 (diff) | |
| download | thehouseoficarus-9666676766bf21364f4fc4d0d1d336e72f2a91b4.tar.gz | |
refactor: split casino.go, dedup helpers, remove audit docs
Diffstat (limited to 'internal/cryptomarket/client_test.go')
| -rw-r--r-- | internal/cryptomarket/client_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
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()) + } +} |
