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: looser type for allowedSighash #54

Closed
wants to merge 1 commit into from

Conversation

kyranjamie
Copy link
Contributor

@kyranjamie kyranjamie commented Jul 26, 2023

SignatureHash is the three sig hash values, a default, and the ANYONECANPAY modifier.

As far as I understand, the sighash can be any of the possible 6 resulting combinations [0x01, 0x02, 0x03, 0x80, 0x81, 0x82, 0x83], meaning this type on signIdx is too strict, as say it doesn't except, say 0x82.

In this PR I've just loosened the type, but maybe library should check for these possible 6 values, either as a type or runtime check?

Or, might it make sense to update the enum?

export enum SigHash {
  ALL = 0x01,
  NONE = 0x02,
  SINGLE = 0x03,
  ALL_ANYONECANPAY = 0x81,
  NONE_ANYONECANPAY = 0x82,
  SINGLE_ANYONECANPAY = 0x83,
}

cc/ @fbwoolf

@paulmillr
Copy link
Owner

Thanks, incorporated in 07581a7

@paulmillr paulmillr closed this Sep 3, 2023
@kyranjamie kyranjamie deleted the fix/wrong-sighash-type branch September 11, 2023 08:31
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