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

Add support of AnyStruct type as arguments #72

Open
ObjectPlayer opened this issue Jun 7, 2022 · 1 comment
Open

Add support of AnyStruct type as arguments #72

ObjectPlayer opened this issue Jun 7, 2022 · 1 comment
Assignees

Comments

@ObjectPlayer
Copy link

Support for AnyStruct as arg in transactions and scripts

Hey Team, I am working on flow testcases in js using flow-js-testing library. I am trying to pass AnyStruct as an argument for my transactions and scripts but I am unable to pass it and getting some errors.

I have passed AnyStruct as dictionary as:
transaction(data:{String:AnyStruct})

than I got following error:
image

Also I have passed AnyStruct as an argument directly as:
transaction(data:AnyStruct)

than I got this error:
image

After debugging the my code and node_modules libraries, I got that flow-js-testing is using flow-cadut.
flow-cadut has a resolveArguments method at args.js file which resolve and validate arguments, but it doesn't seem to support AnyStruct for now.

Issue To Be Solved

To solve this issue, we need to support AnyStruct as an argument of transaction and script.

Suggest A Solution

In type-checker.js we can add a new type-checker method for AnyStruct than we can use that method in args.js and relevant files to support AnyStruct. It is not complete solution but we can work on that and add support to AnyStruct as an argument.

Let me know if it is supported already or work in progress to support it.

Thanks

@JeffreyDoyle
Copy link
Member

Responded on the associated FCL Issue: onflow/fcl-js#1237 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants