Skip to content
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

Update DryRun cost fields and expose DryRun accounts to users #31

Closed
wants to merge 11 commits into from

Conversation

algoidurovic
Copy link

For certain use cases, it's necessary to set the balance of the app account to some nonzero value. One example is testing inner app calls. This PR allows the users to set balances for accounts and updates the existing dryrun cost field (which is now deprecated) and adds support for the new cost fields BudgetAdded and BudgetConsumed.

Testing: Unit tests.

Copy link
Contributor

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

Thanks for this great addition. I made a few minor suggestions. There is another suggestion that I'd like to make:
class ABIContractExecutor in blackbox.py has the method dry_run_on_sequence() which would also benefit from allowing a new optional dryrun_accounts (or just accounts) parameter. So I recommend modifying this method as well.

graviton/blackbox.py Show resolved Hide resolved
graviton/blackbox.py Show resolved Hide resolved
tests/integration/blackbox_test.py Outdated Show resolved Hide resolved
graviton/models.py Outdated Show resolved Hide resolved
graviton/blackbox.py Show resolved Hide resolved
graviton/dryrun.py Outdated Show resolved Hide resolved
tests/integration/blackbox_test.py Show resolved Hide resolved
Copy link
Contributor

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

Looks good. There are a number of minor suggestions that I don't feel strongly about. In particular of note:

  • a suggestion to remove a print statement
  • removal of Account() info from pre-existing test that doesn't need it
  • suggested assertion about the error message received in the case that app account for inner txn call wasn't funded

@tzaffi
Copy link
Contributor

tzaffi commented Oct 27, 2022

Looks good. There are a number of minor suggestions that I don't feel strongly about. In particular of note:

  • a suggestion to remove a print statement
  • removal of Account() info from pre-existing test that doesn't need it
  • suggested assertion about the error message received in the case that app account for inner txn call wasn't funded

Also, I just realized that I still have the outstanding suggestion to create a new type alias DryRunAccountType = Union[str, Account]

@tzaffi tzaffi mentioned this pull request Oct 31, 2022
@tzaffi
Copy link
Contributor

tzaffi commented Oct 31, 2022

Closing in favor of #33

@tzaffi tzaffi closed this Oct 31, 2022
tzaffi pushed a commit that referenced this pull request Nov 1, 2022
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.

None yet

2 participants