Skip to content

Commit 417cc36

Browse files
MrPredicclaude
andcommitted
test: pin solana empty-watch RPC-skip (mutation-testing finding)
Ran mutation testing (mutmut) over the suite. Most "survivors" were either descriptive message-string mutations we intentionally don't pin, or mutmut 3.6 false positives (its class-method mutant dispatch mis-reports lethal mutations as survived — verified by hand: applying them does fail the suite). A trustworthy by-hand mutation check of 12 security-critical comparisons killed 11 outright. The one genuine gap: removing the empty-watch guard in SolanaAdapter.simulate left behavior unchanged (the extract_delta guard is a redundant safety net), so no test caught that the guard's real job — skipping the RPC for a degenerate input — had been removed. Added a test that observes the injected rpc is never called. 106 tests pass, coverage stays 100%. .gitignore: ignore mutmut's mutants/ working dir. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8d29e8f commit 417cc36

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ build/
99
venv/
1010
.DS_Store
1111
.hypothesis/
12+
mutants/
13+
.mutmut-cache

tests/test_hardening.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,18 @@ def rpc(method, params):
178178
delta = simdiff(SolanaTransaction("AA==", watch=[]), SolanaAdapter(rpc=rpc))
179179
assert delta.fully_classified is False
180180
assert delta.unknown
181+
182+
183+
def test_solana_empty_watch_skips_the_rpc_entirely():
184+
# the guard's distinct job is to not hit the network for a degenerate input;
185+
# observe the calls directly (a raised error would be swallowed fail-closed).
186+
called = []
187+
188+
def rpc(method, params):
189+
called.append(method)
190+
if method == "getMultipleAccounts":
191+
return {"value": []}
192+
return {"value": {"err": None, "accounts": []}}
193+
194+
simdiff(SolanaTransaction("AA==", watch=[]), SolanaAdapter(rpc=rpc))
195+
assert called == []

0 commit comments

Comments
 (0)