-
Notifications
You must be signed in to change notification settings - Fork 138
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
Fix contract update error when old program has errors #3554
Conversation
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 50f44aa Collapsed results for better readability
|
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.
I have a deja-vu, didn't we already fix this? (or something similar?)
@SupunS maybe? As far as I can remember, we fixed some related issues before. This one is special because of v1.0 is now reporting parsing errors for v0.42 programs |
Description
Fixes the error encountered in https://testnet.flowdiver.io/tx/5480ce5f9f81a976be1d2232c4d33ebef02f02204a6e4dbace8319d4917c819a.
When reporting a contract update error, the error is not always for the new program:
When updating, we parse the old program, and even though it was at some point valid, it may no longer is.
Currently the new code is used, and the parser error for the old program is not wrapped with the location of the old program, so instead the location performing the update (most of the time the transaction location) is used and its code is used for error pretty printing. This effectively results in the transaction code being used when pretty printing parsing errors for the old program.
Use the correct code, i.e. the old program's code, and the correct location for the error, i.e the old program's location and not the transaction location.
master
branchFiles changed
in the Github PR explorer