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

onDeploy does not work for predicates and scripts in fuels deploy #3356

Closed
luisburigo opened this issue Oct 23, 2024 · 8 comments · Fixed by #3383
Closed

onDeploy does not work for predicates and scripts in fuels deploy #3356

luisburigo opened this issue Oct 23, 2024 · 8 comments · Fixed by #3383
Assignees
Labels
feat Issue is a feature good first issue Suitable for newcomers looking to contribute

Comments

@luisburigo
Copy link
Contributor

It would be interesting to implement this for predicates and scripts to enable some automations. Currently,onDeploy is executed after contracts are deployed.

export async function deploy(config: FuelsConfig) {
/**
* Deploy contract and save their IDs to JSON file.
*/
const contractIds = await deployContracts(config);
await saveContractIds(contractIds, config.output);
config.onDeploy?.(config, contractIds);

My suggestion would be to implement something like this:

export async function deploy(config: FuelsConfig) {
  /**
   * Deploy contract and save their IDs to JSON file.
   */
  const contractIds = await deployContracts(config);
  await saveContractIds(contractIds, config.output);

  /**
   * Deploy scripts and save deployed files to disk.
   */
  const scripts = await deployScripts(config);
  saveScriptFiles(scripts, config);

  /**
   * Deploy predicates and save deployed files to disk.
   */
  const predicates = await deployPredicates(config);
  savePredicateFiles(predicates, config);
  
  config.onDeploy?.(config, {
    scripts,
    predicates,
    contracts: contractIds,
  });

  /**
   * After deploying scripts/predicates, we need to
   * re-generate factory classe with the loader coee
   */
  await generateTypes(config);

  return contractIds;
}
@arboleya arboleya added the feat Issue is a feature label Oct 24, 2024
@arboleya arboleya added the good first issue Suitable for newcomers looking to contribute label Oct 24, 2024 — with Linear
@Chirag-S-Kotian
Copy link

assign this to me

@petertonysmith94
Copy link
Contributor

Hey @Chirag-S-Kotian,

We generally assign to outside contributors once the PR has been created :)

Let us know if you need any assistance.

@Chirag-S-Kotian
Copy link

Assign this to me and give me details for this issue

@nedsalk
Copy link
Contributor

nedsalk commented Nov 12, 2024

Assign this to me

Hey @Chirag-S-Kotian,
We generally assign to outside contributors once the PR has been created :)
Let us know if you need any assistance.

and give me details for this issue

The details of the issue are in the issue's description. Is there something unclear in it?

@petertonysmith94
Copy link
Contributor

@Chirag-S-Kotian It looks like @YaTut1901 has already taken on this piece (#3383); maybe there is a good first issue that you'd like to contribute to.

@YaTut1901
Copy link
Contributor

hello, @petertonysmith94 could you verify if that possible to continue with my PR?

@petertonysmith94
Copy link
Contributor

@YaTut1901 - yes, please continue with your PR 🙏🏼

@YaTut1901
Copy link
Contributor

then, could you please approve? From my side I do not see any changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature good first issue Suitable for newcomers looking to contribute
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants