Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btcjson, rpcclient: revamp package and eliminate duplication #2014

Closed

Conversation

Eoous
Copy link
Contributor

@Eoous Eoous commented Jul 29, 2023

Implemented New Method, used proper Deprecated comment for Deprecated Method, renamed account named parameter to label for Change Method.

For more APIs: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.17.0.md#label-and-account-apis-for-wallet

Related: #1974

@coveralls
Copy link

coveralls commented Jul 29, 2023

Pull Request Test Coverage Report for Build 5703063476

  • 49 of 241 (20.33%) changed or added relevant lines in 2 files are covered.
  • 29 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.2%) to 55.154%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcclient/wallet.go 0 192 0.0%
Files with Coverage Reduction New Missed Lines %
mempool/mempool.go 1 66.75%
txscript/taproot.go 5 95.31%
rpcclient/wallet.go 10 0%
peer/peer.go 13 73.2%
Totals Coverage Status
Change from base Build 5636859000: -0.2%
Covered Lines: 26758
Relevant Lines: 48515

💛 - Coveralls

@Roasbeef
Copy link
Member

See #1934

The changes here would introduce breaking changes for any existing clients. The current btcjson package allows one to define custom messages for encoding/decoding, which means an independent codebase can always keep up with the latest set of breaking changes that bitcoind implements for their JSON-RPC interface. The goal of the linked issue above is to give callers more freedom to define w/e arbitrary JSON-RPC methods. btcd no longer makes it an explicit goal to keep up with bitcoind's RPC interface, but the package as is allows a user to track all changes if they wish.

@Eoous
Copy link
Contributor Author

Eoous commented Jul 31, 2023

Yes, i agree. Current style of btcjson and rpcclient has a lot of duplicated code. I'll refactor it.

@dstadulis
Copy link

Yes, i agree. Current style of btcjson and rpcclient has a lot of duplicated code. I'll refactor it.

much appreciated, thank you

@Eoous Eoous force-pushed the label_and_account_apis_for_wallet branch from 161a693 to 5f65bd7 Compare August 15, 2023 09:24
@Eoous
Copy link
Contributor Author

Eoous commented Aug 15, 2023

Added an example based on the sketch. How about new sketch? PTAL @Roasbeef

This reverts commit 13cef727d20371dabb9d5bf07a4b7cf89f0f13d6.

btcjson, rpcclient: rename Account to Dummy in SendManyCmd

btcjson, rpcclient: use proper Deprecated comment format for `GetAccountCmd`

btcjson, rpcclient: use proper Deprecated comment format for `GetAccountAddressCmd`

btcjson, rpcclient: implement getaddressesbylabel command

btcjson, rpcclient: implement getreceivedbylabel command

rpcclient: add comments for GetAddressesByLabel

btcjson, rpcclient: implement listlabels command

btcjson, rpcclient: use proper Deprecated comment

btcjson, rpcclient: implement listreceivedbylabel command

btcjson: use proper Deprecated comment

btcjson, rpcclient: implement setlabel command

btcjson, rpcclient: rename account to label in addmultisigaddress command

btcjson, rpcclient: rename account to label in getnewaddress command

btcjson: rename account to label in ListUnspentResult

btcjson, rpcclient: rename FromAccount to Dummy in SendManyCmd

btcjson, rpcclient: rename Account to Label in ListTransactionsCmd

btcjson, rpcclient: rename Account to Dummy in ListTransactionsCmd

Revert "btcjson, rpcclient: rename FromAccount to Dummy in SendManyCmd"

This reverts commit 8a5ff94.

feat: generic rpcclient example

feat: generic rpcclient example
@Eoous Eoous force-pushed the label_and_account_apis_for_wallet branch from 5f65bd7 to f53d642 Compare August 25, 2023 15:58
@Eoous Eoous changed the title btcjson, rpcclient: compatible with methods in bitcoind btcjson, rpcclient: revamp package and eliminate duplication Aug 26, 2023
@Eoous Eoous closed this Aug 26, 2023
@Eoous Eoous deleted the label_and_account_apis_for_wallet branch August 26, 2023 16:25
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.

4 participants