Better logging for contract deployment #46
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the logging for contract deployment to get better errors for some of the things I encountered while working on #10.
Description
I recently encountered the following error:
Without any extra information on which parts of the code this error originated from. After doing some debugging it turned out that it was an issue with the
hex::decodeof the compiled contracts code where the placeholders for libraries are not hex strings but UTF-8 encoded strings.This PR solves this issue with logging until we fix the issues we have around linking. I realize that linking might be somewhat complex as a quick search lead me to think that linking forms a DAG where we could have
ContractA -> LibraryA -> LibraryBand we would need to handle these cases correctly. So, I have elected to not solve that in this PR, and I might look into the matterlabs tester to see how they handle the linking and borrow some ideas from there in terms of the ordering of the linking, and such.What do you think? @xermicus