You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The block template generator does not have high test coverage. As a result, making non-trivial changes to the mining strategy without breaking assumptions is more difficult than it could be. There need to be additional tests around NewBlockTemplate to anchor existing behavior and related consensus rules. Splitting this work across multiple pull requests should make changes easier to review since there are many scenarios to account for.
Agreed that this would be ideal. I suspect that splitting out the mining code into the the mining package would significantly help make it more testable.
A testing framework was added for this in #2480, and additional test coverage was added alongside the automatic ticket revocations agenda in #2720. As of #2720, this hits about 70% coverage of NewBlockTemplate:
go test -run="TestNewBlockTemplate" -coverprofile=cov.out &&
go tool cover -func=cov.out | grep -E "NewBlockTemplate"
github.com/decred/dcrd/internal/mining/mining.go:1169: NewBlockTemplate 69.8%
Still plenty of room for further coverage, but linking work that has already been completed toward this.
The block template generator does not have high test coverage. As a result, making non-trivial changes to the mining strategy without breaking assumptions is more difficult than it could be. There need to be additional tests around
NewBlockTemplate
to anchor existing behavior and related consensus rules. Splitting this work across multiple pull requests should make changes easier to review since there are many scenarios to account for.This issue partially blocks #1556
The text was updated successfully, but these errors were encountered: