Skip to content

Refactor DryRunExecutor#45

Merged
tzaffi merged 82 commits intoalgorand:mainfrom
tzaffi:exec-multi-dispatch
Jan 17, 2023
Merged

Refactor DryRunExecutor#45
tzaffi merged 82 commits intoalgorand:mainfrom
tzaffi:exec-multi-dispatch

Conversation

@tzaffi
Copy link
Copy Markdown
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
Comment thread graviton/blackbox.py
CREATION_APP_CALL: Final[int] = 0
EXISTING_APP_CALL: Final[int] = 42
@dataclass(frozen=True)
class DryRunTransactionParams:
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.

New class

Comment thread graviton/blackbox.py
@tzaffi tzaffi marked this pull request as ready for review January 17, 2023 03:53
Comment thread tests/unit/encode_test.py Outdated
Comment thread tests/unit/encode_test.py
Comment thread tests/unit/encode_test.py Outdated
Co-authored-by: Hang Su <87964331+ahangsu@users.noreply.github.com>
Comment thread graviton/blackbox.py
Comment thread graviton/blackbox.py Outdated
Comment thread graviton/inspector.py
Comment thread graviton/inspector.py Outdated
Comment thread graviton/blackbox.py
Comment thread graviton/blackbox.py Outdated
Comment thread graviton/blackbox.py Outdated
Comment thread tests/unit/encode_test.py Outdated
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.

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

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.

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