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

config: trim leading/trailing white space priv key #275

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

jchappelow
Copy link
Member

It can be difficult to create a text file in many text editors without a trailing newline. To support this, this PR trims leading and trailing whitespace from the contents of the private key file when loading it.

Issue:

Loading config from:  /home/jon/kwil/nodes/n0/config.toml
Loading private key from file:  /home/jon/kwil/nodes/n0/private_key.txt
Error: failed to load genesis and private key: error decoding private key: error decoding private key: encoding/hex: invalid byte: U+000A

@charithabandi
Copy link
Contributor

Interesting find. Wasn't seeing this on my editor.

@jchappelow
Copy link
Member Author

jchappelow commented Sep 6, 2023

Interesting find. Wasn't seeing this on my editor.

Depends on the editor I guess. nano won't even let me omit the trailing newline, probably being overly pedantic about the definition of a text file

@Yaiba Yaiba mentioned this pull request Sep 12, 2023
5 tasks
@jchappelow jchappelow merged commit ecf08ae into main Sep 12, 2023
2 checks passed
@jchappelow jchappelow deleted the fix/priv-key-file-white-space branch September 12, 2023 19:55
@jchappelow jchappelow added this to the v0.6.0 milestone Sep 28, 2023
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 this pull request may close these issues.

2 participants