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!: onDeploy fuels config supports all Sway program types #3383

Conversation

YaTut1901
Copy link
Contributor

@YaTut1901 YaTut1901 commented Nov 12, 2024

Breaking Changes

  • Changed the outputted data from the onDeploy callback method for the fuels.config.ts. Instead of just emitting the deployed contracts (as an array), it will now emit an object with contracts, predicates and scripts.
// Before (fuels.config.ts)
import { createConfig, FuelsConfig, DeployedContract } from 'fuels';

export default createConfig({
  output: 'dir/out',
  onDeploy: (config: FuelsConfig, deployedContracts: DeployedContract[]) => {
    console.log('contracts', deployedContracts);
  }
});
// After (fuels.config.ts)
import { createConfig, FuelsConfig, DeployedData } from 'fuels';

export default createConfig({
  output: 'dir/out',
  onDeploy: (config: FuelsConfig, deployed: DeployedData[]) => {
    console.log('contracts', deployed.contracts);
    console.log('predicates', deployed.predicates);
    console.log('scripts', deployed.scripts);
  }
});

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)

…ipts and predicates additionally to contracts
Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 3:22am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 3:22am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
ts-docs-api ⬜️ Ignored (Inspect) Nov 14, 2024 3:22am

Copy link

vercel bot commented Nov 12, 2024

@YaTut1901 is attempting to deploy a commit to the Fuel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@YaTut1901 YaTut1901 changed the title feat(fuels): onDeploy callback updated to support automation with scr… feat(fuels): onDeploy callback updated to support automation with scripts and predicates additionally to contracts Nov 12, 2024
Copy link

codspeed-hq bot commented Nov 12, 2024

CodSpeed Performance Report

Merging #3383 will degrade performances by 36.8%

Comparing YaTut1901:YaTut1901/feature/update-onDeploy-callback (69bb8d9) with master (0585ee4)

Summary

❌ 1 regressions
✅ 17 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark master YaTut1901:YaTut1901/feature/update-onDeploy-callback Change
should successfully conduct a custom transfer between wallets (x20 times) 49 ms 77.6 ms -36.8%

Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

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

@YaTut1901 lovely work 🚀

You may want to update the description to include a section on breaking changes.

This forms part of our migration guides in the docs, we generally have a before and after section to show the migration steps :)

.changeset/khaki-trees-wink.md Outdated Show resolved Hide resolved
Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>
@YaTut1901 YaTut1901 changed the title feat(fuels): onDeploy callback updated to support automation with scripts and predicates additionally to contracts feat!: onDeploy callback now supports contracts, scripts and predicates Nov 12, 2024
@github-actions github-actions bot added the feat Issue is a feature label Nov 12, 2024
Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>
@YaTut1901 YaTut1901 changed the title feat!: onDeploy callback now supports contracts, scripts and predicates feat!: onDeploy fuels config supports all Sway program types Nov 13, 2024
Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

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

Nice job @YaTut1901 - thanks for the contribution 🙏🏼

apps/demo-fuels/fuels.config.full.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@nedsalk nedsalk left a comment

Choose a reason for hiding this comment

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

Good job! Thanks for the contribution.

@petertonysmith94 petertonysmith94 enabled auto-merge (squash) November 14, 2024 03:22
@petertonysmith94 petertonysmith94 merged commit 5dee7ff into FuelLabs:master Nov 14, 2024
22 of 25 checks passed
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.

onDeploy does not work for predicates and scripts in fuels deploy
4 participants