AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

btcjson: add tests for StringOrArray and Warnings field

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

96/100 · Strong
btcjson: add tests for StringOrArray and Warnings field

Add a regression test for the StringOrArray.MarshalJSON infinite-recursion
fix that exercises both the direct method call and the path through
json.Marshal. Without the fix, the test triggers a goroutine stack
overflow.

Also add a round-trip test and tests for the new Warnings field on
GetBlockChainInfoResult, covering both the legacy single-string form and
the post-bitcoin#29845 array form.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit only adds new test code for a previously fixed bug. It does not change any production code, so it cannot introduce or fix a live security issue on its own. The tests verify that a type called StringOrArray can be safely converted to JSON without getting stuck in infinite recursion, and that a 'warnings' field can accept either a single string or a list of strings.

Recommended action

No action required; this is a test-only change. Review the prior commit that fixed the StringOrArray.MarshalJSON infinite recursion if assessing the original defect.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.