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

getKeyRecoveryParam method reusing variable e, type incorrect #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bradlhart
Copy link

@bradlhart bradlhart commented Aug 14, 2020

@types/elliptic states that getKeyRecoveryParam e variable is Error | undefined: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a9f3af6e4416678bad8027c15627683621f532f1/types/elliptic/index.d.ts#L219

However, other than within the scope of the catch (e) {...} where it is Error | undefined, the type is more likely BNInput (or one of the types BNInput represents) as it is passed into recoverPubKey's msg argument: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a9f3af6e4416678bad8027c15627683621f532f1/types/elliptic/index.d.ts#L213

Likely why the @types/elliptic has the type wrong is due to e being redeclared in the catch statement. This PR is just to fix the redeclaration.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.928% when pulling 74b774f on bradlhart:master into e71b2d9 on indutny:master.

@irfan798
Copy link

I'm having the same issue with typescript, thank you for pointing that out @bradlhart

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.

None yet

3 participants