Skip to content

rpcserver: test null getblock verbosity - #2605

Open
Roasbeef wants to merge 1 commit into
masterfrom
rpc-getblock-null-test
Open

rpcserver: test null getblock verbosity#2605
Roasbeef wants to merge 1 commit into
masterfrom
rpc-getblock-null-test

Conversation

@Roasbeef

Copy link
Copy Markdown
Member

In this PR, we add the missing end-to-end regression test for #2597 and the fix merged in #2600. The test sends getblock through RawRequest with an explicit JSON null verbosity, then verifies that btcd applies the default verbose response rather than disconnecting the WebSocket client.

The same test fails on #2600 parent with websocket: close 1006 unexpected EOF and the client has been disconnected, and passes on current master.

Testing

make unit

golangci-lint run --timeout=5m --new-from-rev=a3f203843

In this commit, we add an RPC integration test for an explicit null
getblock verbosity parameter. The request must use the documented default
verbosity, return the verbose block result, and keep the WebSocket client
connected.

This covers the panic fixed in #2600 through the same raw JSON-RPC decoding
path that exposed it.
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 34551838430

Coverage decreased (-0.02%) to 54.006%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 22 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

22 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
btcec/v2/ellswift/ellswift.go 18 78.42%
database/ffldb/blockio.go 4 88.81%

Coverage Stats

Coverage Status
Relevant Lines: 70416
Covered Lines: 38029
Line Coverage: 54.01%
Coverage Strength: 350013.87 hits per line

💛 - Coveralls

@allocz allocz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that reverting #2600 causes the test to fail. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants