-
Notifications
You must be signed in to change notification settings - Fork 15
compiler hang when using openzeppelin-solidity #5
Comments
Same here |
Workaround: Create a new file: test.sh #!/usr/bin/env bash
# Exit script as soon as a command fails.
set -o errexit
# Executes cleanup function at script exit.
trap cleanup EXIT
cleanup() {
# Kill the ganache instance that we started (if we started one and if it's still running).
if [ -n "$ganache_pid" ] && ps -p $ganache_pid > /dev/null; then
kill -9 $ganache_pid
fi
}
ganache_port=8545
ganache_running() {
nc -z localhost "$ganache_port"
}
start_ganache() {
# We define 10 accounts with balance 1M ether, needed for high-value tests.
local accounts=(
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501200,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501201,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501202,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501203,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501204,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501205,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501206,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501207,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501208,1000000000000000000000000"
--account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501209,1000000000000000000000000"
)
ganache-cli --gasLimit 0xfffffffffff "${accounts[@]}" --port "$ganache_port" > /dev/null &
ganache_pid=$!
}
if ganache_running; then
echo "Using existing ganache instance"
else
echo "Starting our own ganache instance"
start_ganache
fi
truffle test "$@" package.json
And change your contract from ./0x-artifacts "sources": {
"node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol": {
"id": 0
}
}, to "sources": {
"../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol": {
"id": 0
}
}, |
Hi @cedricwalter @nachomazzara . |
This is not limited to open zeppelin. Just did a fresh clone of your repo and have two separate projects that hang when running The |
@NoahMarconi Which projects? I'd like to debug that, but I don't have a repro. |
It's the beforeEach causing it to hang. Even try using your current repo but add a before each and 10 or so tests. It will hang before hitting the 10th. I got it to hang with this gist https://gist.github.com/NoahMarconi/cc58948ce86efbf325b34119df8ac9ee |
@NoahMarconi Thanks. I have a repro now. Will work on that |
Ok. I figured it out. Truffle uses |
awesome, that was fast! :) |
I switched to use WebSocket in my branch: https://github.com/PaulRBerg/dev-tools-truffle-example/blob/master/truffle-config.js However, I get the following error:
This is how I start my @0xorg/devnet container: docker run -it -d --rm -p 8545:8501 -p 8546:8546 0xorg/devnet:latest /bin/bash |
After trufflesuite/ganache#280 got fixed - the only tool that still requires Geth is sol-profiler. Tracing and coverage should work with ganache. I've updated the example repo. |
To all the people in the thread. If the tools you're interested in are sol-trace of sol-coverage (not sol-profiler) - you can now use those with Ganache. It should solve your issues. I've upgraded the example repo. |
That is awesome, thanks @LogvinovLeon! |
@cedricwalter Do you still experience that with Ganache? |
|
Using your dev-tools-truffle-example sample project and changing metacoin.sol to use openzeppelin
and adding in package.json in dependencies
"openzeppelin-solidity": "^2.1.2"
run
npm run trace
Stacktrace
Interestingly,
truffle compile
work as expectedThe text was updated successfully, but these errors were encountered: