Skip to content

bip-0352: do not require the optional expected argument - #2279

Open
fametrano wants to merge 1 commit into
bitcoin:masterfrom
fametrano:bip352-guard-optional-expected
Open

bip-0352: do not require the optional expected argument#2279
fametrano wants to merge 1 commit into
bitcoin:masterfrom
fametrano:bip352-guard-optional-expected

Conversation

@fametrano

Copy link
Copy Markdown
Contributor

create_outputs and scanning declare expected with a default of None but dereference expected.get(...) unconditionally, so calling either without it raises AttributeError, although the parameter is documented optional.

Guard the expected-value checks with if expected is not None:. The self-test, which always passes expected, is unaffected; a standalone call with expected=None now returns its result instead of raising.

If the harness coupling is intentional, I am happy to close this or turn it into a docs note instead.

create_outputs and scanning declare expected with a default of None but
dereference it unconditionally (expected.get(...)), so calling either
without it raises AttributeError, although the parameter is documented
optional. Guard the expected-value checks with `if expected is not None:`.

The self-test, which always passes expected, is unaffected.
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.

1 participant