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

[BUG]: Arguments to chaincode has text of a function appended to it and fails with error about a '\n' in args #266

Open
Nova38 opened this issue Jan 3, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Nova38
Copy link

Nova38 commented Jan 3, 2024

Describe the bug
For some reason the extention is appending a function onto the end of the list of my arguments when calling a chaincode.

To Reproduce
Steps to reproduce the behavior:
I tried my own .fabric files and just copying the example and they both caused the issue with it claimg there was a '\n' in the argument

[
    {
        "query": "ReadAsset",
        "args": ["asset1"]
    }
]

Expected behavior
A clear and concise description of what you expected to happen.

Environment:

  • OS: Windows 11
  • Docker version v24.0.7
  • Extension version 1.0.0

Screenshots
If applicable, add screenshots to help explain your problem.

Logger Output


2024-01-03T06:47:34.109Z [Error] Syntax error in query/invoke request. Chaincode arguments supplied: ['"asset1"','"function (old_index, new_index) {
    // Shortcut helper to move item to end of array
    if (-1 === new_index) {
        new_index = this.length - 1;
    }

    if (new_index >= this.length) {
        var k = new_index - this.length;
        while (k-- + 1) {
            this.push(undefined);
        }
    }
    this.splice(new_index, 0, this.splice(old_index, 1)[0]);
    return this; // for testing purposes
}"'].
@Nova38 Nova38 added the bug Something isn't working label Jan 3, 2024
@ashwath-spdr
Copy link
Contributor

@Nova38 , Thanks for reporting the issue.

This is pretty weird.. I am thinking that there could be some special character in the file which might be messing up with the parsing of the .fabric file.

Can you please attach the actual .fabric file to the issue so that I can take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants