Closed dzegel-blockcrowd closed 4 years ago
Hi @dzegel-blockcrowd,
two ideas on how to debug this:
truffle compile
, can you see the MockContract.sol
being compiled?const MockContract = artifacts.require("MockContract")
makes any difference (it shouldn't but maybe the pass specifier is not working correctly und Windows)Also, feel free to send a link to a github repo/branch with the code, so I can take a look and try to get it to run locally.
Hey @fleupold thanks for the quick response.
MockContract.sol
2 I did try const MockContract = artifacts.require("MockContract")
as well as const MockContract = artifacts.require("@gnosis.pm/mock-contract/contracts/MockContract.sol");
and they both have the same problem.Unfortunately the repo I'm working on is a private one so I cant share the code itself, but if we cant figure this out perhaps I'll try to reproduce the issue in a public repo.
Oh actually I just managed to get it to compile MockContract.sol and it works now.
Not exactly sure why truffle compile
didn't pick it up before but its working now.
Thanks again for the quick response.
Glad you got it working. Is it possible that Imports.sol
was missing an empty contract definition? Maybe truffle doesn't pick up the dependency if the file itself doesn't contain a contract.
I realize the README doesn't mention this but in the projects where we use the library we always have
import "@gnosis.pm/mock-contract/contracts/MockContract.sol";
contract DevDependencies {}
it did not have an empty contract definition
I got truffle to pick it up by clearing out all the build directory, and recompiling 🤷♂
I'm trying to use
mock-contract
and getting the following error:Steps Iv'e taken:
"@gnosis.pm/mock-contract": "^3.0.8",
to mypackage.json
(and of course rannpm i
)Imports.sol
to mycontracts
folder with the following contents:// We import the contract so truffle compiles it, and we have the ABI // available when working from truffle console. import "@gnosis.pm/mock-contract/contracts/MockContract.sol";