Extract class FuzzSpec#65
Open
tothtamas28 wants to merge 9 commits intomasterfrom
Open
Conversation
c0ebaeb to
e4fddb3
Compare
33 tasks
83bcad4 to
f1d6027
Compare
Encapsulates the minimal information necessary to fuzz a method.
19e6f11 to
eb3dd51
Compare
44f3bb1 to
7e3523b
Compare
bbyalcinkaya
reviewed
May 5, 2026
| else: | ||
| res = [sig for sig in signatures if sig.name == id] | ||
| if res: | ||
| raise KeyError(f'Test function {id!r} not found.') |
Member
There was a problem hiding this comment.
Makes sense to drop this exception. When this was introduced, we only supported a single test contract per project, so it was reasonable. With multiple test contracts, contracts that don’t have a function with the given name end up causing an exception. Instead, they should be skipped rather than failing the run. Since you are already touching this code, I think it’s a good opportunity to include this small change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactors the contract fuzzing pipeline around two new named tuple types,
SignatureandFuzzSpec.Signature(incontract.py)Replaces direct use of
Methodobjects throughout the fuzzing pipeline. ASignaturecaptures only the information needed to fuzz a method (its contract name, function name, and argument types) and owns the logic that was previously spread across free functions:get_arg_typesbecomes the privateSignature._extract_arg_typesargument_strategybecomesSignature.argument_strategy()qualified_nameproperty replaces repeatedf'{...contract_name}.{...name}'formattingFuzzSpec(inskribe.py)Groups the KORE template pattern and the tuple of
Signatures produced from a contract into a single value. A newcreate_specmethod onSkribeproduces it, andcreate_template_patternis extracted as a helper. Thedictproperty onFuzzSpecserializes the data structure.Other cleanup
run_testintocreate_template_pattern, sorun_testnow takes a readyPatterninstead of a KAST config + substitution pairsrc/tests/is excluded from the source distribution