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
Update to Truffle 4.1.5 and Ganache 6.1.0 #876
Conversation
The |
8e1b367
to
c95443d
Compare
- Fix event emission warnings for solidity 4.21 after truffle has been updated to use this version
@cgewecke How can I go about debugging tests that normally pass but don't do so with |
I did some (terrible) grepping to make sure that all of the events were found and I didn't find any missing so this looks good to me π if anyone wants to test themselves, you can find all of the events with something like
and then construct a regex like
and then manually verify that they've all got |
I was just introduced to https://0xproject.com/docs/sol-cov via OpenZeppelin#zeppelin_os; it might be a reasonable approach if solidity-coverage is breaking on this upgrade. We'd have to add a custom provider to the |
@frangio I will look into this this weekend. Am planning a version upgrade that preprends @shrugs sol-cov is really well executed and uses an in-memory opcode trace to generate the coverage mapping. Ultimately, this is the direction any coverage tool in this space needs to move if it's going to be sustainable. It would be great to run it against Zeppelin which is large and has an existing coverage measurement in order to get a sense of it's accuracy and usability and propose improvements (if any) etc. Would strongly encourage that - may merit an issue here or over at 0xProject where findings are listed. |
@frangio The problem with MerkleProof is caused by coverage event injection, but this might be a contract MerkleProof {
event LibraryEvent();
function verifyProof() public {
LibraryEvent();
}
} and call it in a regular await merkleProof.verifyProof(); I get revert. Running the above in Remix, with the JS vm:
Do you know anything about this? You follow Coverage will pass if you change [EDIT] - Also notice that there are a couple other libraries like ECRecover that aren't having this problem. They're intermediated by mocks, so one solution might be to make a mock that consumes MerkleProof? |
@cgewecke Aha! What changed from 0.4.19 to 0.4.20 was the following:
That was after the Parity wallet So the problem is not that the library is emitting an event, but that the test is calling the library directly and not through a wrapper. Thanks for figuring this out! Apologies that the problem was not really solidity-coverage. |
@frangio Oh excellent - thanks for the explanation, that makes sense :) |
Okay I fixed it by making @shrugs Would you mind reviewing these changes please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another round of grepping
grep -r -P "pragma solidity" --exclude-dir node_modules --include=*.sol
ensures that all of the pragmas are good
the library change makes sense to me, too.
Resolves #800 by building on it and fixing the pending review comments there. Thanks @benjamincburns!
Resolves #863 by including the relevant commit here. Thanks @DumasV!
Fixes #868.
π Description
Updates to Truffle 4.1.5 (includes update to Solidity 0.4.21), Ganache 6.1.0, and solidity-coverage 0.4.15 (necessary for newer syntax).
There are quite a lot of changes to package-lock.json. I generated it by copying the lockfile from
master
and runningnpm install
with the new package.json.The Solidity update brings a lot of new warnings that we should tackle before the next release. Those related to the
emit
keyword are fixed in this PR.Had to change the
MerkleProof
tests to run through a contract wrapper instead of testing against the library contract directly (better explained in this PR's comments). And additionally I madeMerkleProof.verifyProof
an internal function because I think it makes sense? But it may be controversial.npm run lint:all:fix
).