Skip to content

getKeyRecoveryParam method reusing variable e, type incorrect#232

Open
bradlhart wants to merge 1 commit into
indutny:masterfrom
bradlhart:master
Open

getKeyRecoveryParam method reusing variable e, type incorrect#232
bradlhart wants to merge 1 commit into
indutny:masterfrom
bradlhart:master

Conversation

@bradlhart
Copy link
Copy Markdown

@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
Copy Markdown

Coverage Status

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

@irfan798
Copy link
Copy Markdown

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.

3 participants