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

Script/transaction arguments of type string not accepted if quotes are missing #202

Closed
alxflw opened this issue Jan 21, 2022 · 3 comments · Fixed by #211
Closed

Script/transaction arguments of type string not accepted if quotes are missing #202

alxflw opened this issue Jan 21, 2022 · 3 comments · Fixed by #211
Assignees

Comments

@alxflw
Copy link

alxflw commented Jan 21, 2022

Describe the bug
If a user is required to enter a script/transaction argument of type String, they will do so without using quotes. As a result, and error is returned.

To Reproduce
Steps to reproduce the behavior:

  • Open playground
  • Update script to have a String argument
  • Run script and enter test
  • Spinner is shown and console error is logged

Expected behavior
String is accepted

Screenshots
Screen Shot 2022-01-20 at 7 12 19 PM

@alxflw alxflw changed the title Script arguments of type string not accepted if quotes are missing Script/transaction arguments of type string not accepted if quotes are missing Jan 21, 2022
@ObjectPlayer
Copy link

I am also facing same issue, also I am trying to concatenate strings so if I pass quotation marks than that will also be the part of string which is causing issue, so I am using static values instead of passing arguments in scripts ans transaction for string.

e.g:

image

@ObjectPlayer
Copy link

After running playground locally I found that there was an exception in the send method at src/components/Arguments/index.tsx in the following line

const formatted = await props.languageClient.sendRequest(
      ExecuteCommandRequest.type,
      {
        command: 'cadence.server.parseEntryPointArguments',
        arguments: [
          props.editor.getModel().uri.toString(),
          fixed
        ],
      },
    );

that's why it is showing infinite loader, I have added try and catch block after it was working fine.

@MaxStalker
Copy link
Contributor

As a matter of fact it was more about how language server is processing string literals. I believe I was able to fix the issue and now it should work as designed.

This should be addresses, when #211 will be merged :)

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

Successfully merging a pull request may close this issue.

4 participants