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.
@murchandamus murchandamus added Proposed BIP modification PR by non-owner to update BIP content Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels Sep 9, 2026
@murchandamus

Copy link
Copy Markdown
Member

cc: @theStack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified Proposed BIP modification PR by non-owner to update BIP content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants