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

fix: differentiate max witness script size upon context #758

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

ChrisCho-H
Copy link
Contributor

MaxWitnessScriptSizeExceeded is used in the context of SegwitV0 and Tap, where each of max witness script size differs. Moreover, even in the same context of SegwitV0, max witness script size differ whether it's standard or consensus rule. I just let MaxWitnessScriptSizeExceeded receive param usize to differentiate max witness script size upon context, which can fix the wrong err message of "The Miniscript corresponding Script would be larger than MAX_STANDARD_P2WSH_SCRIPT_SIZE bytes." when SegwitV0 consensus and Tap context

@apoelstra
Copy link
Member

In 5a3989c:

Can you instead add two named fields to the error variant, max and got?

@ChrisCho-H
Copy link
Contributor Author

ChrisCho-H commented Oct 18, 2024

Good idea! I've changed the err message including got bytes.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 13a1318; successfully ran local tests

@apoelstra apoelstra merged commit 0f03df0 into rust-bitcoin:master Oct 18, 2024
29 of 30 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.

2 participants