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

feat!: improve transaction builders wrt TxPolicies #1212

Merged
merged 5 commits into from
Nov 24, 2023

Conversation

hal3e
Copy link
Contributor

@hal3e hal3e commented Nov 23, 2023

This PR improves the usage of TxPolicies and fixes some of the issues that remained after their were introduced.

BREAKING CHANGE:

  • ScriptTransactionBuilder and CreateTransactionBuilder do not have with_maturity and with_gas_price, (with_gas_limit). They are set through the with_tx_policies method.
  • Maturity is not set to 0 by default - instead we use an Option<u64> and None if it was not set. This saves bytes as it is not serialized if None
  • WitnessLimit is set to the size of all witnesses in the builder. If the user uses append_witnesses after finalizing the transaction a new error will be returned that helps the user set the witness limit manually.

Checklist

  • I have updated the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary labels.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@hal3e hal3e added the enhancement New feature or request label Nov 23, 2023
@hal3e hal3e self-assigned this Nov 23, 2023
Copy link
Contributor

@MujkicA MujkicA left a comment

Choose a reason for hiding this comment

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

I left some questions

@hal3e hal3e requested a review from MujkicA November 23, 2023 12:31
Copy link
Member

@digorithm digorithm left a comment

Choose a reason for hiding this comment

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

Super clean, great job!

@hal3e hal3e merged commit d19d1d4 into master Nov 24, 2023
@hal3e hal3e deleted the hal3e/improve-tx-policies branch November 24, 2023 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants