Skip to content
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

Add tracing versions of all partial plutarch functions #675

Open
peter-mlabs opened this issue May 31, 2024 · 0 comments
Open

Add tracing versions of all partial plutarch functions #675

peter-mlabs opened this issue May 31, 2024 · 0 comments

Comments

@peter-mlabs
Copy link

In a test suite I am working on, we are testing both "nominal cases" ("happy path") and "attack cases" (non-happy-path, where we expect script failure).

The attack cases require triggering specific failures, and those failures must emit error codes into the logs. We parse the logs, and if we don't find the specific failure code we expected to trigger, then the test fails.

We are taking this approach because without matching on error codes, the alwaysFail validator (for instance) would pass every attack case. This clearly doesn't mean that the alwaysFail validator matches the specification of some foo script.

Taking this approach is complicated by the presence of functions that are partial, but either fail silently (emitting no logs) or fail with a hard-coded error message, since we can't emit a particular error code.

I would like to see tracing versions of partial functions that allow us to log a custom error code at a specified logging level.

We'll be writing versions for this project on an as-needed basis -- specifically, when we realize we can't trigger a specific error code. @kozross's work on the PTryFrom update is such a case -- guidelines on naming or other conventions are appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant