Skip to content

Prepare for Testing the ABI-Router in PyTeal#49

Merged
tzaffi merged 129 commits intoalgorand:mainfrom
tzaffi:ace-for-pyteal
Feb 6, 2023
Merged

Prepare for Testing the ABI-Router in PyTeal#49
tzaffi merged 129 commits intoalgorand:mainfrom
tzaffi:ace-for-pyteal

Conversation

@tzaffi
Copy link
Copy Markdown
Contributor

@tzaffi tzaffi commented Jan 17, 2023

Summary of changes

  • class ABIMethodCallStrategy (formerly class ABIContractExecutor):
    • This is moved intograviton/abi_strategy.py (from graviton/blackbox.py)
    • Removing the following methods entirely:
      • validate_inputs()
      • dryrun_sequence()
    • New methods:
      • get()
      • num_args()
  • Introducing class Simulation in graviton/sim.py. See below for usage example.
  • New test file tests/integration/abi_router_test.py which contains some tests formerly in tests/integration/abi_test.py but which are -as you might guess- all about testing the Router
  • Fixing DryRunInspector's error() and error_message() which recently broke

PyTeal Sibling PR

algorand/pyteal#634

TODO

  • Timebox expired. Most likely culprit. Figure out the actual PR referenced above and in the CHANGELOG

Zeph Grunschlag and others added 30 commits December 22, 2022 17:37
* small typing fix + EncodingType

* type ignores
Comment thread tests/unit/encode_test.py
)


NONSENSE = "not a valid signature"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to new test file executor_test.py

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
Contributor Author

@tzaffi tzaffi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wip

Comment thread graviton/abi_strategy.py
Comment thread graviton/abi_strategy.py
Comment thread graviton/abi_strategy.py
Copy link
Copy Markdown
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think abi_strategy.py looks neat, looking into sim.py and related test. Hopefully we can wrap this up this week

Comment thread graviton/sim.py
Copy link
Copy Markdown
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread CHANGELOG.md Outdated
| 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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error messages have changed

Comment thread .github/workflows/build.yml
Copy link
Copy Markdown
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread graviton/abi_strategy.py
Comment on lines +20 to +22
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tzaffi tzaffi merged commit 86c9bc4 into algorand:main Feb 6, 2023
@tzaffi tzaffi deleted the ace-for-pyteal branch February 6, 2023 21:42
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

Successfully merging this pull request may close these issues.

2 participants