-
Notifications
You must be signed in to change notification settings - Fork 391
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
web3.toBigNumber() is not a function #280
Comments
The test-suite executed via And for Web3 v0.x, I'm not sure how else you are trying to run the tests, but the error which you describe implies that your setup uses Web3 v1.x instead, where Be cautious - these two functions are different not only in name, but also in behavior (if I remember correctly, the former truncates non-integer values while the latter throws exception on such input). Note that in either case, it has nothing to do with Ganache. |
Yeah, sorry for the confusion, have figured it out and should be able to push a proper Embark test suite to the above repo shortly 👍 |
@barakman status-im/discover-dapps@3609bf9 So close! All I need now is to figure out how to handle decimals with a different BigNumber library 😓 Any helpful leads? |
In file
In any test script that you need to update:
See here for the official documentation of this module. |
@barakman yeah, that's what that commit above does, it's the decimals I am struggling with now: https://github.com/status-im/discover-dapps/blob/develop/test/BancorFormula_spec.js#L203 (The
|
@andytudhope : If you want to get the floor value of a Also, I believe that you should use As to the problem that you're describing - I believe that you are actually getting the error for one of the lines above the line which you have marked, because function |
Yeah, I know, but Thanks for the tip on My issue is 2-fold:
Somewhere between removing BTW, I should just say that this test suite is an inspiration and you, @barakman, are a wizard ❤️ |
@andytudhope : What You can get it by entering the command-line |
|
@andytudhope : The difference between You might find the official documentation quite useful. |
Running the test script, i.e. using Ganache under the hood works well.
However, even after looking at #268 and changing the web3-utils version to either
1.0.0-beta37
or1.0.0-beta41
, I still cannot get this test suite to pass when not using the script, but rather runningtruffle develop
and thentruffle test
from within thesolidity
directory. When I do, I always get:Why does
truffle develop
differ fromganache
? I ask because I am trying to solve this issue currently: status-im/discover-dapps#14The text was updated successfully, but these errors were encountered: