-
Notifications
You must be signed in to change notification settings - Fork 134
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
feat: session.eval_with_hooks #1580
base: main
Are you sure you want to change the base?
Conversation
"TN:", | ||
"SF:/contract-0.clar", | ||
"FN:1,add", | ||
"FNF:1", | ||
"FNH:0", | ||
"BRF:0", | ||
"BRH:0", | ||
"end_of_record", | ||
"SF:/contract-1.clar", | ||
"FN:1,add", | ||
"FNF:1", | ||
"FNH:0", | ||
"BRF:0", | ||
"BRH:0", | ||
"end_of_record", |
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.
As a side effect, this is the wanted behaviour for code coverage.
Because session.deploy_contract uses the session coverage hook.
This is therefore the initial analysis of the contracts.
If we wanted to pass the eval_hooks to update_session_with_deployment_plan
(here) instead, this would make pass eval_hooks args in a whole lot more of functions (and it comes with some difficulties down the line)
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.
So this a wanted behavior for better coverage handling; It doesn't really impact code coverage % though
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
wip - exploring an other interface for session hooks
With this approach:
eval_hooks
to every functions (eval
,deploy_contract
,call_contract
), the caller only enable an hook oncesession.enable_debug_print_hook
,session.enable_tracer_hook
, etc.eval_with_hooks
that keeps the same behaviour and is backward compatible with exisintg implementation. It allows to evaluated snippets with arbitrary hookseval_with_hooks
methodConcerns: