Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dryrun: Improve assembler error reporting #5889

Merged

Conversation

jasonpaulos
Copy link
Contributor

Summary

I know this code is not necessarily in heavy use anymore, but I had a frustrating experience debugging a pyteal integration test that uses dryrun.

If there's more than one assembler error in a TEAL dryrun source, dryrun returns the error directly from logic.AssembleString, which unhelpfully only tells you the number of errors:

return fmt.Errorf("%d errors", l)

I fixed this by using the ReportMultipleErrors function to build a more informative string, like other callsites do.

Test Plan

Unit test added

@jasonpaulos jasonpaulos changed the title Improve dryrun assembler error reporting Dryrun: Improve assembler error reporting Jan 2, 2024
@jasonpaulos jasonpaulos self-assigned this Jan 2, 2024
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (3a80a40) 55.92% compared to head (57d654c) 55.93%.

Files Patch % Lines
daemon/algod/api/server/v2/dryrun.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5889   +/-   ##
=======================================
  Coverage   55.92%   55.93%           
=======================================
  Files         477      477           
  Lines       67432    67436    +4     
=======================================
+ Hits        37713    37718    +5     
+ Misses      27164    27163    -1     
  Partials     2555     2555           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jasonpaulos jasonpaulos merged commit e7aa0d4 into algorand:master Jan 3, 2024
@jasonpaulos jasonpaulos deleted the dryrun-assembler-error-reporting branch January 3, 2024 16:01
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants