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

Convert witnessToHex into a method ToHexStrings on TxWitness #1991

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

ffranr
Copy link
Contributor

@ffranr ffranr commented Jun 5, 2023

Add a method ToHexStrings to TxWitness. Remove stand alone function witnessToHex(witness wire.TxWitness) []string.

Motivation: witnessToHex is hard to access and to find.

@coveralls
Copy link

coveralls commented Jun 5, 2023

Pull Request Test Coverage Report for Build 8420439676

Details

  • 0 of 14 (0.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.002%) to 56.879%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcserver.go 0 3 0.0%
wire/msgtx.go 0 11 0.0%
Files with Coverage Reduction New Missed Lines %
connmgr/connmanager.go 1 86.27%
Totals Coverage Status
Change from base Build 8420351557: -0.002%
Covered Lines: 29430
Relevant Lines: 51741

💛 - Coveralls

@ffranr ffranr changed the title Add JSON (un)marshal support Add TxWitness JSON (un)marshal support Jun 9, 2023
Copy link
Collaborator

@halseth halseth left a comment

Choose a reason for hiding this comment

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

ACK

@ffranr ffranr marked this pull request as ready for review November 3, 2023 15:04
Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I think we should just have the helper method (ToHexStrings() and perhaps a ParseWitness() function) but skip the JSON (un)marshal support (see inline comment for the reason).

wire/msgtx.go Outdated Show resolved Hide resolved
wire/msgtx.go Outdated Show resolved Hide resolved
@ffranr ffranr changed the title Add TxWitness JSON (un)marshal support Add method ToHexStrings to TxWitness Mar 25, 2024
@ffranr ffranr changed the title Add method ToHexStrings to TxWitness Make witnessToHex a method ToHexStrings on TxWitness Mar 25, 2024
@ffranr
Copy link
Contributor Author

ffranr commented Mar 25, 2024

I've reduced the scope of this PR to just converting witnessToHex into a method ToHexStrings on TxWitness`.

@ffranr ffranr changed the title Make witnessToHex a method ToHexStrings on TxWitness Convert witnessToHex into a method ToHexStrings on TxWitness Mar 25, 2024
@ffranr ffranr requested review from guggero and halseth March 25, 2024 12:59
Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Very nice, LGTM 🎉

Something that's also on my wish list is a simple Serialize() ([]byte, error) method for TxWitness, if you feel like adding that as well (new PR or this one, your call).

Copy link
Collaborator

@sputn1ck sputn1ck left a comment

Choose a reason for hiding this comment

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

LGTM

@guggero guggero merged commit a03259b into btcsuite:master Mar 26, 2024
3 checks passed
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.

5 participants