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

fix: typegen and storage slots integration #3396

Merged
merged 18 commits into from
Nov 21, 2024

Conversation

nedsalk
Copy link
Contributor

@nedsalk nedsalk commented Nov 14, 2024

Summary

This PR fixes integration of typegen'd storage slots with the ContractFactory.deployAsCreateTx and ContractFactory.deployAsBlobTx methods by making it possible to specify deployOptions in the ContractFactory constructor, passing the storage slots via the constructor in typegen'd factories, and using them in those methods.

This approach also enables us to remove the override of the deploy method in typegen.

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)

@nedsalk nedsalk self-assigned this Nov 14, 2024
@nedsalk nedsalk added the bug Issue is a bug label Nov 14, 2024
Copy link

vercel bot commented Nov 14, 2024

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

Name Status Preview Comments Updated (UTC)
fuels-template ❌ Failed (Inspect) Nov 21, 2024 1:43pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 1:43pm
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 1:43pm

Copy link

codspeed-hq bot commented Nov 14, 2024

CodSpeed Performance Report

Merging #3396 will improve performances by 16.5%

Comparing ns/fix/typegen-storage-slot-integration (474fc1f) with master (29f5135)

Summary

⚡ 1 improvements
✅ 17 untouched benchmarks

Benchmarks breakdown

Benchmark master ns/fix/typegen-storage-slot-integration Change
should successfully transfer a single asset between wallets (x20 times) 72.9 ms 62.5 ms +16.5%

@nedsalk nedsalk force-pushed the ns/fix/typegen-storage-slot-integration branch from 139be6d to e7d6196 Compare November 15, 2024 09:01
maschad
maschad previously approved these changes Nov 20, 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.

Great work on this @nedsalk 🚀

packages/contract/src/contract-factory.ts 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
.changeset/cyan-panthers-carry.md Show resolved Hide resolved
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.

I meant to request changes with the following comment.

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
64.13%(-0.07%) 69.67%(-0.04%) 72.66%(-0.33%) 64.57%(-0.07%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 apps/docs-snippets2/src/typegend/contracts/MyContractFactory.ts 60%
(-6.66%)
0%
(+0%)
50%
(-16.66%)
60%
(-6.66%)
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
76.71%
(-1.37%)
84%
(+0%)
88.81%
(+0%)
🔴 packages/contract/src/contract-factory.ts 32.85%
(+0.25%)
28.57%
(+1.91%)
32%
(-2.78%)
31.94%
(+0.03%)
🔴 packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts 40%
(+6.67%)
0%
(+0%)
0%
(+0%)
40%
(+6.67%)

@nedsalk nedsalk merged commit 2cef020 into master Nov 21, 2024
23 of 24 checks passed
@nedsalk nedsalk deleted the ns/fix/typegen-storage-slot-integration branch November 21, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typegen'd contract factories don't properly integrate storage slots for deployment methods
5 participants