Prepare for Testing the ABI-Router in PyTeal#49
Conversation
…ate, remove the deprecated dry run mixins
…d... but still need the multidispatcher
* small typing fix + EncodingType * type ignores
| ) | ||
|
|
||
|
|
||
| NONSENSE = "not a valid signature" |
There was a problem hiding this comment.
Moved to new test file executor_test.py
ahangsu
left a comment
There was a problem hiding this comment.
I think abi_strategy.py looks neat, looking into sim.py and related test. Hopefully we can wrap this up this week
ahangsu
left a comment
There was a problem hiding this comment.
I finished my pass on sim.py, should be almost good to go, some TODOs in code (mostly comments and documentation) need to be done.
| | assert\ failed\ pc= # pyteal generated assert's ok | ||
| | invalid\ ApplicationArgs\ index # failing because an app arg wasn't provided | ||
| | extract\ range\ beyond\ length\ of\ string # failing because couldn't extract when omitted final arg or jammed in tuple | ||
| | extraction\ end\ 16\ is\ beyond\ length # failing because couldn't extract when omitted final arg or jammed in tuple |
There was a problem hiding this comment.
error messages have changed
ahangsu
left a comment
There was a problem hiding this comment.
I am leaning towards approving and merging, just one question on hypothesis and related TODO, but I don't expect we will take any action here (for it would be non trivial).
| TODO: when incorporating hypothesis strategies, we'll need a more holistic | ||
| approach that looks at relationships amongst various args. | ||
| Current approach only looks at each argument as a completely independent entity. |
There was a problem hiding this comment.
no action needed, I see hypothesis cross the PR, together with TODO, are you referring to hypothesis https://hypothesis.readthedocs.io/en/latest/data.html?
There was a problem hiding this comment.
Yes. Here's a nice video intro about it: https://www.youtube.com/watch?v=mkgd9iOiICc&ab_channel=ArjanCodes
Summary of changes
class ABIMethodCallStrategy(formerlyclass ABIContractExecutor):graviton/abi_strategy.py(fromgraviton/blackbox.py)validate_inputs()dryrun_sequence()get()num_args()class Simulationingraviton/sim.py. See below for usage example.tests/integration/abi_router_test.pywhich contains some tests formerly intests/integration/abi_test.pybut which are -as you might guess- all about testing theRouterDryRunInspector'serror()anderror_message()which recently brokePyTeal Sibling PR
algorand/pyteal#634
TODO
Figure out the actual PR referenced above and in the CHANGELOG