Skip to content

Refactor DryRunExecutor #45

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

Merged
merged 82 commits into from
Jan 17, 2023
Merged

Refactor DryRunExecutor #45

merged 82 commits into from
Jan 17, 2023

Conversation

tzaffi
Copy link
Contributor

@tzaffi tzaffi commented Jan 3, 2023

The diff in graviton/blackbox.py is difficult to read through. Instead of looking at the diff, I encourage looking at the actual code. Additionally, this is a testing library, and therefore (IMO) we can gain most of the confidence by looking at the test results both here and in the companion pyteal PR.

Former PR

#44

Issues Addressed

Summary of changes

  • graviton/blackbox.py:
    • Introducing class DryRunTransactionParams for better grouping of some variables
    • Trimming stale comments
    • class DryRunExecutor:
      • Removed all the static dryrun_* methods and consolidated functionality as follows:
      • It is now expected that the user will instantiate a DryRunExecutor object and call run() on it. Convenience methods run_one() and run_sequence() are also provided, and these have better type guarantees.
  • *_test.py and quadratic_factoring_game.ipynb - Migrating all the tests to use run_one() and run_sequence() methods (except for the usage of AbiContractExecutor.dry_run_on_sequence() which remains unaffected)
  • Adding unit tests in tests/unit/encode_test.py
    • test_executor_init
    • test_executor_prep

TODO's

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

* type ignores
Zeph Grunschlag added 2 commits January 13, 2023 14:02
CREATION_APP_CALL: Final[int] = 0
EXISTING_APP_CALL: Final[int] = 42
@dataclass(frozen=True)
class DryRunTransactionParams:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New class

@tzaffi tzaffi marked this pull request as ready for review January 17, 2023 03:53
Copy link
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.

generally looks good, I am going to take a final pass, if there's nothing off I notice, I will approve.

Copy link
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.

the last comment still holds, but once that is done, let's ship it.

@tzaffi tzaffi merged commit 1291adb into algorand:main Jan 17, 2023
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.

3 participants