btcsuite / btcd

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

Added tests for FutureGetBestBlockHashResult.Receive #2048

Closed ClaytonNorthey92 closed 8 months ago

ClaytonNorthey92 commented 8 months ago

Adding a few tests to cover func (f FutureGetBestBlockHashResult) Receive(). I've noticed that rpcclient has 0.6% test coverage (before this PR):

$ git log -1
commit ad26585576912588d213dbe973b222fcec621546 (HEAD, origin/master, origin/HEAD)
Author: David Cardenas <47157243+davidcardenasus@users.noreply.github.com>
Date:   Tue Oct 17 02:47:09 2023 -0700

$ go-acc ./rpcclient
ok      github.com/btcsuite/btcd/rpcclient  0.148s  coverage: 0.6% of statements in ./rpcclient

this PR bumps it up to 0.9%

$ go-acc ./rpcclient
ok      github.com/btcsuite/btcd/rpcclient  0.234s  coverage: 0.9% of statements in ./rpcclient

I want to keep adding tests but I want to do them in their own PRs: as some tests will be larger than others, I don't want the PR(s) to be too big and unreadable.

jcvernaleo commented 8 months ago

One test per PR to keep them small makes perfect sense to me.