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 client API to support new cost fields in dryrun result #336

Merged
merged 2 commits into from
Jun 2, 2022

Conversation

algoidurovic
Copy link
Contributor

@algoidurovic algoidurovic changed the title Generate updated client API code Update client API to support new cost fields in dryrun result May 11, 2022
Copy link
Contributor

@jasonpaulos jasonpaulos 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 to me, but I expect the blackbox testing code that @tzaffi has added also needs to be updated because of this change. It seems to reference cost in many places.

@tzaffi
Copy link
Contributor

tzaffi commented May 13, 2022

Perhaps cost is a synonym to budget-debit? In that case I would ask that cost be kept as an additional redundant field (which keeps the same behavior as currently), but that an issue be created in this repo to mark cost as deprecated. When this issue is created, I'll create an issues in the graviton and pyteal repos to stop using cost and which block the issue in this repo.

If I'm wrong in my assumption, then I'll need to understand a bit better the relationship between cost and the new fields.

@algoidurovic
Copy link
Contributor Author

Perhaps cost is a synonym to budget-debit? In that case I would ask that cost be kept as an additional redundant field (which keeps the same behavior as currently), but that an issue be created in this repo to mark cost as deprecated. When this issue is created, I'll create an issues in the graviton and pyteal repos to stop using cost and which block the issue in this repo.

If I'm wrong in my assumption, then I'll need to understand a bit better the relationship between cost and the new fields.

Close, but budget-credit is more similar to the old cost field, although you can't rely on the values being equal. I can bring back the old field as it was (with the strange underflow behavior) or make it exactly equal to budget-credit. The distinction is only relevant when the app being tested has inner app calls that increase budget.

@tzaffi
Copy link
Contributor

tzaffi commented May 16, 2022

Perhaps cost is a synonym to budget-debit? In that case I would ask that cost be kept as an additional redundant field (which keeps the same behavior as currently), but that an issue be created in this repo to mark cost as deprecated. When this issue is created, I'll create an issues in the graviton and pyteal repos to stop using cost and which block the issue in this repo.
If I'm wrong in my assumption, then I'll need to understand a bit better the relationship between cost and the new fields.

Close, but budget-credit is more similar to the old cost field, although you can't rely on the values being equal. I can bring back the old field as it was (with the strange underflow behavior) or make it exactly equal to budget-credit. The distinction is only relevant when the app being tested has inner app calls that increase budget.

Is the cost the same as budget-credit for apps that don't have inner transactions, and in this case, there is no "underflow" issue?

If that's the case, I think there's no need to try and re-create the strange and buggy underflow behavior. This isn't something I was using, and requiring community members to rewrite tests that relied on this wrong value is not too much to ask, in my opinion.

In short, assuming that budget-credit is the same as cost for simple apps with no inner transactions, then I advocate making cost a synonym of budget-credit. But then this leaves me wondering if the budget-credit field is even necessary or can be renamed cost.

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.

As the repo has no existing tests that validate cost in dry-run, I think it's ok to accept as is. @barnjamin may want to have a look as well.

@algoidurovic algoidurovic merged commit 137ad36 into algorand:develop Jun 2, 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.

3 participants