-
Notifications
You must be signed in to change notification settings - Fork 20
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
🐛 Bug ➾ optional parameter on entrypoint not correctly generated by Taqueria makes Typescript wrong #1861
Comments
@michaelkernaghan Is it possible to put high priority on this ticket ? It is just impossible to pass any call to the smart contract if it contains an entrypoint with I am totally stuck right now, because I cannot trick the type definition in main.types.ts, if I do this, when taquito will pass the methods arguments, it will be in different order than the one expected by the smart contract and always fails. This is more than annoying, because in my case, I cannot cheat with an empty string to simulate an empty value, the Tezos node is expecting an address type I could not find a workaround Thanks |
Ok, I found a woraround, maybe it is also the way to fix it quickly Keep same order, but change how Typescript generates the type definition Do this
Instead of
Can you do this fix ? On tzkt indexer, it says when |
I saw you choose the reorder the fields, I am not sure it is working as Michelson contract field ordering has to be the same on the node side ... I would recommend replace |
@michaelkernaghan @mweichert For me the bug is still here. We should reopen this ticket as I need to manually process all generated files I recommend to fix this with |
OK, thanks for the additional feedback, @zamrokk. I had tested this but perhaps the contract I was using was not sufficient for this case. Btw, Michael K and others from the ECAD Labs team are no longer working on Taqueria. |
Published Binaries & Packages
|
🚥 Status (Internal Taqueria Team Use Only)
🆘 What happened?
My entrypoint contains an optional, when I run the taqueria type generation it creates the fields in random postiion, so my optional field here appear on first position. On Typescript, we should list all mandatory fields first
Here the parameter in jsligo from the smart contract :
export type removeMemberRequest = { member : address, orgName : string, lastAdmin : option<address> };
Here the portion of the file generated by Taqueria
type Methods = { removeMember: ( lastAdmin?: address, member: address, orgName: string, ) => Promise<void>; ...
🆘 Steps to Reproduce?
add on optionla field on an entrypoint parameter and generate the type via taqueria plugin
🪵 Relevant log output
No response
🐘 How impactful is this bug?
🤔 Notable but managable
⏱️ Prevalance
No response
💻 Operating System
None
🕸️ System Architecture
None
🌮 Taqueria Version
v0.28.4
🌿 Node.js Version
No response
☎️ Contact Details
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: