btcsuite / btcd

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

Add `gettxspendingprevout` for `btcd` and fix version check #2125

Closed yyforyongyu closed 7 months ago

yyforyongyu commented 7 months ago

This PR adds the RPC gettxspendingprevout for btcd so we can do mempool lookups. This RPC is also ported to the rpcclient to replace the raw request made on the btcwallet side.

In addition, we now start to track btcd versions in rpcclient to make sure RPC updates are handled properly.

coveralls commented 7 months ago

Pull Request Test Coverage Report for Build 8077551462

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcclient/infrastructure.go 0 9 0.0%
rpcclient/backend_version.go 43 65 66.15%
rpcclient/rawtransactions.go 0 45 0.0%
<!-- Total: 93 169 55.03% -->
Files with Coverage Reduction New Missed Lines %
rpcclient/infrastructure.go 1 39.21%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 8057525961: 0.03%
Covered Lines: 29284
Relevant Lines: 51599

💛 - Coveralls
saubyk commented 7 months ago

cc: @Crypt-iQ for review

saubyk commented 7 months ago

cc: @guggero

Chinwendu20 commented 7 months ago

Nice pr @yyforyongyu I like the progression.

question/suggestion: Do you think we should separate the implementations of the Backend version interface into separate files? like bitcoin.go and btcd.go in the same folder. In the future if we want to track more backends we just create a new file and that way it is easier to follow?

Roasbeef commented 7 months ago

Do you think we should separate the implementations of the Backend version interface into separate files? like bitcoin.go and btcd.go in the same folder. In the future if we want to track more backends we just create a new file and that way it is easier to follow?

@Chinwendu20, I think if we did that, we'd want to add a version prefix/suffix to the file names, so it's clear that this is code for parsing the versions, rather than a bitcoind specific implementation of something.