btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.09k stars 2.31k forks source link

blockchain, fullblocktests, workmath, testhelper: add InvalidateBlock() method to BlockChain #2155

Closed kcalvinalvin closed 1 month ago

kcalvinalvin commented 2 months ago

Depends on #2153

All of the code except for the last two commits are for refactoring code. The vast majority is just moving code from fullblocktests to testhelper so that the testing code for InvalidateBlock() can call the functions instead of having to copy over and duplicate functions.

The InvalidateBlock() method is operational and is tested but is not revealed through rpc in this PR.

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 8891501246

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
blockchain/fullblocktests/generate.go 41 42 97.62%
blockchain/internal/testhelper/common.go 105 113 92.92%
blockchain/chain.go 76 90 84.44%
<!-- Total: 292 315 92.7% -->
Files with Coverage Reduction New Missed Lines %
connmgr/connmanager.go 1 86.27%
peer/peer.go 9 73.72%
<!-- Total: 10 -->
Totals Coverage Status
Change from base Build 8881487645: 0.1%
Covered Lines: 29567
Relevant Lines: 51892

💛 - Coveralls
Roasbeef commented 2 months ago

Dependent PR merged, needs a rebase!