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

Accept parameter in object format for contract method calls #915

Closed
roxaneletourneau opened this issue Jun 8, 2021 · 0 comments · Fixed by #1029
Closed

Accept parameter in object format for contract method calls #915

roxaneletourneau opened this issue Jun 8, 2021 · 0 comments · Fixed by #1029
Assignees
Labels
ux/dx Related to Developer Experience
Milestone

Comments

@roxaneletourneau
Copy link
Collaborator

roxaneletourneau commented Jun 8, 2021

As a user I want to pass a complex parameter as an object when calling contract entrypoints so that I don't have to format flat list of parameters one by one without annotations.

Background
When calling a smart contract entry point having a complex parameter, even with the abstraction over the Michelson syntax, it might be hard for the user to write the parameters.

We would have two implementations that have the same purpose. The difference would be that they accept a different parameter format and the users could choose between their preferred one. We could deprecate the methods member in the future if there is more enthusiasm over the new methodsObject member.
The same logic as the one used for the storage parameter when deploying a contract is used, i.e.
the keys of the object are the annotations or indexes when the Michelson type does not contain annotation. Note, this is the same logic as the one used for the storage parameter when deploying a contract is used.
See details: #840

Acceptance criteria:

  • Add a new property on the ContractAbstraction named methodsObject that accepts an object with annotations and indexes.
  • Use EncodeObjectMethod that is also used for the storage
  • Update documentation to include this new method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux/dx Related to Developer Experience
Projects
Status: Done
2 participants