-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Truffle tests fail on Solidity 0.4.23 but work on Remix #936
Comments
@arnoudbevers Could you show the code where you are instantiating a |
Truffle uses this to deploy a contract to run the tests, in my own project I have created a contract handler that uses the web3 methods, but this is not used in truffle. Is this what you mean? 2_person_migration.js
|
@arnoudbevers Yes. Will investigate this - thanks for such a detailed and clear report! |
@cgewecke Thank you! I've been scratching my head for the last two days... If you're not planning on doing so, I can maybe test it on a Ganache network? Or are you doing that as well? |
@arnoudbevers Yes I will test on ganache, and if the problem isn't present there I'll test on |
@arnoudbevers Hi. I couldn't find any variance around compiler version and was able to get the tests passing on In the tests, you are assigning a // 2.2 Save root instance
rootInstance = deployedInstance.contract; // <-- web3 instance, not TruffleContract instance
...
// 4.2 Save Person instance
personInstance = deployedInstance.contract; // <-- web3 instance, not TruffleContract instance
...
// 5. Call addPerson()-function on root contract - transaction function!
return rootInstance.addPerson(personInstance.address, { from: develop }); That's fine, but one thing rootInstance = deployedInstance;
personInstance = deployedInstance; |
@cgewecke I changed my migrations, and changed the two instances in my tests, but the methods still do not return values. What do you mean by |
@cgewecke I've talked a bit with others, and we think the issue lies with Quorum. The network is running on Geth 1.7.2, but Quorum is not up to date with the latest geth version, so updating Geth is not an option I think - which is also the reason it works on Remix/Ganache, since that uses Ethereum instead of Quorum. Do you have any idea what I can do to remedy this? |
@cgewecke I have also tried it on the Ropsten network to eliminate another possibility, and it worked as expected, so I think the issue really lies with Quorum, and that it is not up to date with the latest geth version/Solidity version. |
Thanks @arnoudbevers, unfortunately I don't know of a remedy. You might raise this at Quorum in case they know of a work around. Is it ok if we close this issue since it's specific to an older Geth version? |
@arnoudbevers Just leaving a note here about $ docker pull ethereum/client-go:latest #`latest` is a version. See hub.docker for more.
$ docker run -it -p 8545:8545 \
-p 30303:30303 \
ethereum/client-go:latest \
--rpc --rpcaddr "0.0.0.0" \
--dev --dev.period 2 It comes with a single funded unlocked account. It's slower than |
Yes, this is fine. I will try to check with Quorum when support for newer versions is coming.
Thank you! I will keep this in mind, will be really useful in my development. Thanks for your help! |
Issue
Methods that worked in Solidity version 0.4.20 do not work in 0.4.23, while they do work in Remix.
Only thing that has been changed in a contract is constructor - rest stayed the same.
Steps to Reproduce
Run the ./testRootPerson.js test with both 0.4.20 and 0.4.23 compiler (changing pragma's in contracts).
Expected Behavior
Calling get functions on contracts work, all tests should run.
Actual Results
Tests fail, due to get methods returning 0x values instead of actual values.
Code supplied at bottom of issue
0.4.20:

0.4.23:

Environment
truffle version
): Truffle v4.1.7 (core: 4.1.7) - Solidity v0.4.23 (solc-js)node --version
): v8.9.4npm --version
): 5.6.0Person.sol
Root.sol
testRootPerson.js
The text was updated successfully, but these errors were encountered: