Skip to content

Conversation

@danielbate
Copy link
Contributor

@danielbate danielbate commented Aug 13, 2024

Release notes

In this release, we:

  • Made ContractFactory.deployAsBlobTx a non-blocking call

Summary

In #2827 ContractFactory.deployAsBlobTx was introduced as a blocking call. This is because we need to await the blob transactions before submitting a non-blocking create transaction.

This PR makes the blob txs non blocking, however we now need to make the transaction ID returned from contract deployment into a promise. This is because we do not have access to the transaction ID until we have funded the create call, due to potentially changing UTXOs.

Breaking Changes

The transaction ID from a contract deployment is now returned as a promise.

// before
import { ContractFactory } from 'fuels'; 

const factory = new ContractFactory(bytecode, abi, wallet);
const { waitForResult, contractId, transactionId } = await factory.deploy();
console.log(transactionId); // 0x123....
// after
import { ContractFactory } from 'fuels'; 

const factory = new ContractFactory(bytecode, abi, wallet);
const { waitForResult, contractId, waitForTransactionId } = await factory.deploy();
const transactionId = await waitForTransactionId();
console.log(transactionId); // 0x123....

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

danielbate and others added 30 commits July 24, 2024 13:33
Torres-ssf
Torres-ssf previously approved these changes Aug 14, 2024
Copy link
Contributor

@Torres-ssf Torres-ssf left a comment

Choose a reason for hiding this comment

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

Great job 🚀

@danielbate danielbate enabled auto-merge (squash) August 14, 2024 15:43
@github-actions
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
79.24%(-0.09%) 71.53%(-0.04%) 77.41%(-0.14%) 79.38%(-0.1%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.48%
(+0%)
78.26%
(-1.45%)
84%
(+0%)
88.73%
(+0%)
🔴 packages/contract/src/contract-factory.ts 33.08%
(-2.35%)
27.58%
(+0%)
36.36%
(-5.74%)
32.6%
(-2.55%)

@danielbate danielbate merged commit 48ec97c into master Aug 14, 2024
@danielbate danielbate deleted the db/feat/blob-sync-deploys branch August 14, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Issue is a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants