Skip to content

SignRawTransactionWithKey - #1885

Open
galileo-pkm wants to merge 1 commit into
btcsuite:masterfrom
galileo-pkm:txwithkey
Open

galileo-pkm wants to merge 1 commit into
btcsuite:masterfrom
galileo-pkm:txwithkey

Conversation

@galileo-pkm

Copy link
Copy Markdown

More or less a copy of SignRawTransactionWithWallet method that implements
the signrawtransactionwithkey bitcoind RPC.

@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 3039397202

  • 9 of 74 (12.16%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-3.0%) to 52.137%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcclient/rawtransactions.go 0 65 0.0%
Files with Coverage Reduction New Missed Lines %
btcutil/gcs/gcs.go 1 81.25%
Totals Coverage Status
Change from base Build 2836573928: -3.0%
Covered Lines: 23312
Relevant Lines: 44713

💛 - Coveralls

@galileo-pkm

Copy link
Copy Markdown
Author

Can someone please review this?

@DhananjayPurohit

Copy link
Copy Markdown

Thanks @galileo-pkm, I also need this function in a project. It would be great if it could be merged (as maintaining another version of this package in a fork can be tedious). I would love to take this PR ahead along with @galileo-pkm if it needs any other work. @guggero @Roasbeef

@guggero

guggero commented Jan 3, 2024

Copy link
Copy Markdown
Collaborator

@DhananjayPurohit you're welcome to review and test this PR to help move it along.

@galileo-pkm I know this isn't consistently done throughout all code in btcd yet, but we're trying to use the same formatting and code guidelines as we do in lnd, at least in new code: https://github.com/lightningnetwork/lnd/blob/master/docs/code_formatting_rules.md

@galileo-pkm

Copy link
Copy Markdown
Author

I'm recovering from surgery and won't be able to work for quite some time, if anyone else wants to take over feel free to do so.

@galileo-pkm I know this isn't consistently done throughout all code in btcd yet, but we're trying to use the same formatting and code guidelines as we do in lnd, at least in new code: https://github.com/lightningnetwork/lnd/blob/master/docs/code_formatting_rules.md

@allocz allocz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests passing, but needs rebase with conflict resolution. Also, why don't you add the command through the btcjson.RegisterCmd() procedure directly in the project under your control?

// This function should only be used if a non-default signature hash type is
// desired. Otherwise, see SignRawTransactionWithKey if the RPC server already
// knows the input transactions, or SignRawTransactionWithKey2 if it does not.
func (c *Client) SignRawTransactionWithKey3(tx *wire.MsgTx, privKeysWIF []string,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep only this procedure as SignRawTransactionWithKey() instead of adding 3 versions of the same command?

@rhmatzeka

Copy link
Copy Markdown

Thanks for starting this, @galileo-pkm, and I hope you've recovered well. Since you offered it up for someone to take over, I've continued it in #2677. It's rebased onto master, has @allocz's review applied (one SignRawTransactionWithKey instead of three variants), and credits your commit with a Co-authored-by trailer.

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.

6 participants