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

0.11.2/redeclare ts #660

Merged
merged 4 commits into from
Jun 26, 2023
Merged

0.11.2/redeclare ts #660

merged 4 commits into from
Jun 26, 2023

Conversation

tabaktoni
Copy link
Collaborator

@tabaktoni tabaktoni commented Jun 23, 2023

Motivation and Resolution

Fix #588

Usage related changes

Because of cairo0 back compatibility, we left formatting to be compressed program in response class, so it needs to be decompressed for declare and also typecast to legacy.
An example of redeclare cairo0 without a helper will be:
Screenshot 2023-06-23 at 14 13 47

Redeclare cairo0 contract helper:
contractClassResponseToLegacyCompiledContract();

Example Cairo0 redeclare:
https://github.com/0xs34n/starknet.js/blob/a5b628fb0248a5c8caddc985cf93b6d53a69bf04/__tests__/account.test.ts#L75
Example Cairo1 redeclare:
https://github.com/0xs34n/starknet.js/blob/a5b628fb0248a5c8caddc985cf93b6d53a69bf04/__tests__/cairo1.test.ts#L60

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

@netlify
Copy link

netlify bot commented Jun 23, 2023

Deploy Preview for starknetjs canceled.

Name Link
🔨 Latest commit 00b7bdf
🔍 Latest deploy log https://app.netlify.com/sites/starknetjs/deploys/6495b4d2c710af000819c59d

@PhilippeR26
Copy link
Collaborator

PhilippeR26 commented Jun 23, 2023

@tabaktoni I didn't succeed to import in my test script the exports of utils/contract and utils/provider.
How to import them?

@tabaktoni
Copy link
Collaborator Author

tabaktoni commented Jun 23, 2023

@tabaktoni I didn't succeed to import in my test script the exports of utils/contract and utils/provider. How to import them?

Added missing utils exports.

I would be happiest to set all utils under the utils module and auto-export all, so that usage would be like this:

 import 'utils' from 'starknet'
utils.num...

But this would be a huge refactor to everyone. Maybe something to do in v6.

@tabaktoni tabaktoni merged commit be8ba99 into develop Jun 26, 2023
8 checks passed
@github-actions
Copy link

🎉 This PR is included in version 5.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 5.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@penovicp penovicp deleted the 0.11.2/redeclare-ts branch September 16, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

account.declare do not like compressed Cairo programs
3 participants