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 provider.decodeParameters #932

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

PhilippeR26
Copy link
Collaborator

Motivation and Resolution

Solve issue #929
Add a method that decodes a list of field elements into Javascript objects.

Usage related changes

myCallData.decodeParameters() has been added :

const helloCallData=new CallData(compiledSierra.abi);
const res2=helloCallData.decodeParameters("hello::hello::UserData",["0x123456","0x1"]);
const res3=helloCallData.decodeParameters(
    ["hello::hello::UserData","hello::hello::UserData"],
    ["0x123456","0x1","0x98765","0x0"]
);

Development related changes

A method has been added to the CallData class.
@penovicp : this PR is based on v6.0.0-beta.11, and will merge in beta branch. Frederico would like to have it also in v5 ; I don't know exactly how to handle this case.

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

Copy link
Collaborator

@tabaktoni tabaktoni left a comment

Choose a reason for hiding this comment

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

lgtm, but @fracek should check it

Copy link
Contributor

@fracek fracek 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!

@tabaktoni tabaktoni merged commit 5f20945 into starknet-io:beta Jan 23, 2024
3 checks passed
Copy link

🎉 This PR is included in version 6.0.0-beta.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

@penovicp
Copy link
Collaborator

penovicp commented Feb 2, 2024

@penovicp : this PR is based on v6.0.0-beta.11, and will merge in beta branch. Frederico would like to have it also in v5 ; I don't know exactly how to handle this case.

@PhilippeR26 I apologise for getting late to this, I was away when you asked and the SNIP-12 PR was a priority once I was back. To answer your question, since the all the used features of the code were present in v5 a git cherry-pick of the relevant commit was sufficient to enable a backport which was done with #945.

Copy link

github-actions bot commented Feb 5, 2024

🎉 This PR is included in version 6.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented Jul 3, 2024

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

4 participants