Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Jul 16, 2024

isscript is unknown for unknown witness versions, so it should be marked optional in the docs

Fixes #30456

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 16, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK stickies-v, tdb3

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Docs label Jul 16, 2024
Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

code LGTM fa63ecc but I think the test needs to be fixed

@@ -534,7 +534,7 @@ RPCHelpMan getaddressinfo()
{RPCResult::Type::BOOL, "solvable", "If we know how to spend coins sent to this address, ignoring the possible lack of private keys."},
{RPCResult::Type::STR, "desc", /*optional=*/true, "A descriptor for spending coins sent to this address (only when solvable)."},
{RPCResult::Type::STR, "parent_desc", /*optional=*/true, "The descriptor used to derive this address if this is a descriptor wallet"},
{RPCResult::Type::BOOL, "isscript", "If the key is a script."},
{RPCResult::Type::BOOL, "isscript", /*optional=*/true, "If the key is a script."},
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated: that is quite the field description 😳 Time to start thinking about deprecating isscript and iswitness, perhaps?

Copy link
Member

Choose a reason for hiding this comment

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

yeah I was having a real hard time understanding what a lot of these fields actually mean...

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it means "some kind of pay to script hash", that is SH or WSH.

I guess it would be clearer to just return an enum as string, rather than a collection of boolean fields.

Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

Approach ACK
Thanks for increasing clarity in RPC.
Looks like there's a missing assert in test_getaddressinfo().
Left a nit.

@@ -12,6 +12,7 @@
)

BECH32_VALID = 'bcrt1qtmp74ayg7p24uslctssvjm06q5phz4yrxucgnv'
BECH32_VALID_UNKNOWN_WITNESS = 'bcrt1p424qxxyd0r'
Copy link
Contributor

@tdb3 tdb3 Jul 17, 2024

Choose a reason for hiding this comment

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

Maybe it's worth adding a line for segwit v0 as well? (e.g. witness program not 20 or 32 bytes long)?

also

nit: might increase clarity

- BECH32_VALID_UNKNOWN_WITNESS = 'bcrt1p424qxxyd0r'
+ BECH32_VALID_UNKNOWN_WITNESS_PROG = 'bcrt1p424qxxyd0r'

Copy link
Member Author

Choose a reason for hiding this comment

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

Left the nit for now.

Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

ACK fa6390d

@DrahtBot DrahtBot requested a review from tdb3 July 17, 2024 10:19
Copy link
Contributor

@tdb3 tdb3 left a comment

Choose a reason for hiding this comment

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

ACK fa6390d

@fanquake fanquake merged commit 3799224 into bitcoin:master Jul 17, 2024
@maflcko maflcko deleted the 2407-doc branch July 17, 2024 13:20
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Aug 1, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Jul 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getaddressinfo: complains missing isscript when called on unknown witness version
6 participants