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

Error: utils.isBN returns wrong boolean with an fake object #205

Closed
skqksh opened this issue Dec 30, 2019 · 2 comments · Fixed by #207
Closed

Error: utils.isBN returns wrong boolean with an fake object #205

skqksh opened this issue Dec 30, 2019 · 2 comments · Fixed by #207
Assignees
Labels
open/approved The issue is confirmed as being a bug to be fixed or enhancement to be developed.

Comments

@skqksh
Copy link
Contributor

skqksh commented Dec 30, 2019

Describe the bug

caver.utils.isBN returns 'true' but it should have to return 'false'

 const notBn = {}
notBn.constructor = {}
notBn.constructor.name = 'BN'
console.log(caver.utils.isBN(test))

How to reproduce
same with above

Expected behavior
caver.utils.isBN should work as like as BN.js works

Attachments
web3.js already covered that

Environment (please complete the following information)

  • caver-js ver 1.3.1

Additional context
NA

@jimni1222
Copy link
Contributor

Hi :)

Is this issue related with web3/web3.js#1777?
I will apply this modification to caver-js.
And also i will add test case what you describe above.

Thank you for reporting this issue !

@jimni1222 jimni1222 added the open/approved The issue is confirmed as being a bug to be fixed or enhancement to be developed. label Jan 1, 2020
@jimni1222 jimni1222 self-assigned this Jan 1, 2020
@jimni1222
Copy link
Contributor

@skqksh
Hi, PR is uploaded :)
#207

If there is any opinion about this change, please feel free to comments on PR.

@skqksh skqksh mentioned this issue Jan 2, 2020
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open/approved The issue is confirmed as being a bug to be fixed or enhancement to be developed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants