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

Proposal to Simplify Provider.getTransactionCost #2362

Closed
Torres-ssf opened this issue May 21, 2024 · 2 comments · Fixed by #2643
Closed

Proposal to Simplify Provider.getTransactionCost #2362

Torres-ssf opened this issue May 21, 2024 · 2 comments · Fixed by #2643
Assignees
Labels
chore Issue is a chore

Comments

@Torres-ssf
Copy link
Contributor

We should consider refactoring Provider.getTransactionCost by removing the responsibility of adding fake funds to the TransactionRequest before the dry-run to get the gasUsed.

This change will delegate this task to the caller of getTransactionCost, therefore reducing unnecessary parameter flags.

The current implementation of getTransactionCost handles multiple tasks, including adding fake funds for transaction requests.

By offloading the fake fund's addition to the caller, we can eliminate the need for specific parameter flags associated with the funding step:

  1. resourcesOwner: Represents the Account instance that owns the fake resources and it is also used to validate if it is a predicate, which is required for populating the predicate and predicateData for the fake resources.
  2. quantitiesToContract: This includes the amount and assetId of a coin that could be forwarded to a contract.
@Torres-ssf Torres-ssf added the chore Issue is a chore label May 21, 2024
@Torres-ssf Torres-ssf changed the title Consider Funding TX Proposal to Simplify Provider.getTransactionCost May 21, 2024
@arboleya arboleya added p1 and removed mainnet labels Jun 9, 2024
@arboleya arboleya added this to the Mainnet milestone Jun 9, 2024
@mvares
Copy link
Contributor

mvares commented Jun 26, 2024

hey @petertonysmith94, is that issue still on your radar? 🦅

@petertonysmith94
Copy link
Contributor

Hey @mvares - yes it is 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants