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

Error when parsing empty args array #202

Closed
AlexD10S opened this issue Apr 25, 2024 · 2 comments
Closed

Error when parsing empty args array #202

AlexD10S opened this issue Apr 25, 2024 · 2 comments

Comments

@AlexD10S
Copy link

AlexD10S commented Apr 25, 2024

I am not sure if this is an issue with the SDK or is something that shouldn't be in the Config file.

When I try to parse a Config file that contains an empty array for args: args = [""], it throws an error (The config file is the one in the frontier-parachain-template):

TOML parse error at line 30, column 11
   |
30 |   args = [""]
   |           ^^
the provided argument is invalid and doesn't match Arg::Option or Arg::Flag

After some researching I can see the error is when parsing the Config file in the function load_from_toml (line):

let mut network_config: NetworkConfig = toml::from_str(
            re.replace_all(&file_str, "$field_name = \"$u128_value\"")
                .as_ref(),
        )?;

Should be ignored if the array is empty?

Thanks for this amazing SDK!! We are using it in our tool pop-cli.

@pepoviola
Copy link
Collaborator

pepoviola commented Apr 25, 2024

Hi @AlexD10S, thanks for your feedback! I will update the toml in that repo since an empty string can not be deserialized to a valid argument (and I'm not sure if we want to deserialize to an empty arg). That make sense to you?

Thanks again for your feedback :)

paritytech/frontier-parachain-template#38

@AlexD10S
Copy link
Author

It makes sense, thanks @pepoviola

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

2 participants