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: add a non-blocking call for deploy contract #2597

Open
wants to merge 66 commits into
base: master
Choose a base branch
from

Conversation

Torres-ssf
Copy link
Contributor

@Torres-ssf Torres-ssf commented Jun 24, 2024

Release notes

  • Added a deployContractAsync() method for async deployments

Summary

The deployContractAsync method was implemented to support deploying contracts in a non-blocking manner

const {
  transactionResponse,  // Instance of TransactionResponse,
  transactionResult,  // The transaction result of the deployment (status is submitted)
  waitForDeploy,  // Callback to wait for the contract to be deployed
} = await factory.deployContractAsync();

// It will only resolve once the contract is deployed
const contract = await waitForDeploy();

 // Now the contract can be used
const { value } = await contract.functions.xyz().call();

Checklist

  • I addedtests to prove my changes
  • I updated — all the necessary docs
  • I reviewed — the entire PR myself, using the GitHub UI
  • I described — all breaking changes and the Migration Guide

@Torres-ssf Torres-ssf added feat Issue is a feature p0 High priority labels Jun 24, 2024
@Torres-ssf Torres-ssf added this to the 0.x mainnet milestone Jun 24, 2024
@Torres-ssf Torres-ssf self-assigned this Jun 24, 2024
Copy link
Contributor

@danielbate danielbate left a comment

Choose a reason for hiding this comment

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

Nice one, couple comments

apps/docs/src/guide/contracts/deploying-contracts.md Outdated Show resolved Hide resolved
apps/docs/src/guide/contracts/deploying-contracts.md Outdated Show resolved Hide resolved
packages/contract/src/contract-factory.ts Outdated Show resolved Hide resolved
packages/contract/src/contract-factory.ts Outdated Show resolved Hide resolved
@Torres-ssf Torres-ssf changed the title feat!: add a non-blocking call for deploy contract feat: add a non-blocking call for deploy contract Jul 3, 2024
arboleya
arboleya previously approved these changes Jul 5, 2024
Copy link
Member

@maschad maschad 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, just one minor nit.

Copy link
Member

@maschad maschad left a comment

Choose a reason for hiding this comment

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

Awesome job on this @Torres-ssf

Copy link
Contributor

github-actions bot commented Jul 5, 2024

Coverage Report:

Lines Branches Functions Statements
79.55%(-0.07%) 71.37%(-0.03%) 77.22%(-0.06%) 79.64%(-0.07%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-response/transaction-response.ts 72.72%
(+0.5%)
50%
(+0%)
88.88%
(+1.38%)
72.72%
(+0.5%)
🔴 packages/contract/src/contract-factory.ts 47.61%
(-3.41%)
44.44%
(-1.71%)
41.66%
(+4.16%)
47.61%
(-3.41%)

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

Successfully merging this pull request may close these issues.

Make deployContract Method a Non-Blocking Call
7 participants