-
Notifications
You must be signed in to change notification settings - Fork 12k
Make tests run against Geth or Parity nodes #355
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
Comments
Thank you for reporting this. We will have to look into it. |
I believe it also has a lot to do with: |
Here is my suggestion:
which doesn't exist in parity/geth, we refactor every single occurence of
that would allows us to create MockContracts with 1 additional setter:
|
It's an interesting proposal. Even if we don't migrate to it just now, I think it would make a nice addition to the library for people who want to run their tests on actual blockchains (which arguably should be everyone). Do you want to make a PR for it? Do you know how many of the failing tests are due to this? |
Accidentally closed the issue, sorry. I would maybe rename It would be nice to see how it will affect the codebase including the tests. I fear it will be too burdensome to have a new parent class for every contract that makes use of block numbers or timestamps. |
@frangio thank you for your feedback. Almost all non-helper, non-interface contract already has a relative MockContract. So I don't think it would be a problem. For setting values, sure, setters need to check |
@frangio I found another problem:
so, in geth mode, every transaction goes thru, and mined, whether it throws or not. Any ideas what could be done about it? |
Hm, I had heard about that. We should define the necessary helper functions to abstract away the details. Last time I checked, given a mined transaction we can look at the used gas to infer whether it succeeded or failed. Maybe we can also use the |
@frangio could you explain a bit more on how to read in geth if transaction was failed? I was also thinking of something like:
then in test:
|
We don't need to pass the method and params separately because method calls return promises. Something like Sorry I can't write a proof of concept myself at the moment. |
Still curious how to trace a tx in geth if it actually failed |
We've also discussed having contracts providing |
There is a PR in geth that might enable this soon. ethereum/go-ethereum#16834 |
It is not easy and I don't think it's worth the effort to run our unit test suite against Geth. The test suite executes on the EthereumJS VM and I think it's very reasonable to assume that it is a compliant execution client. |
I am not sure how you trust
testrpc
but I'd expect all tests pass ingeth/parity
dev chains. For now, it only works if ran against testrpc.There are 86 failures.
1 that happens a lot is https://github.com/OpenZeppelin/zeppelin-solidity/blob/a344d42a00f47c82cb6ff1abbf39841114c362f6/test/helpers/expectThrow.js - doesn't work with the parity/geth.
The text was updated successfully, but these errors were encountered: