-
Notifications
You must be signed in to change notification settings - Fork 906
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
devtools/onion: fixed argument passing for generate and decode methods #3250
Conversation
devtools/onion.c
Outdated
@@ -109,7 +109,7 @@ static void do_generate(int argc, char **argv, | |||
u8 *serialized = serialize_onionpacket(ctx, res); | |||
if (!serialized) | |||
errx(1, "Error serializing message."); | |||
printf("%s\n", tal_hex(ctx, serialized)); | |||
printf("%s", tal_hex(ctx, serialized)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is a bit awkward if you run it on the cmdline though?
Can we instead fix it up on the input side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point; I've rebased to leave the trailing newline but instead trim whitespace with 6a078de . Is this better?
Nice work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack 6a078de
Thanks! and ht to @willcl-ark for the testing that lead to these fixes. |
Fixed 'generate' and 'decode' methods to properly parse argv arguments.
Fixed so methods correctly use the associated data set by the --assoc-data flag.
I also added some examples to -h to better show how these methods work with real onion data.
Introduced a behavioral change to read the onion from a file instead of stdin; this makes it easier to debug in some IDEs (eg. vscode).