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

fix: remove quotes from libwaku's returned enr string #3097

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

gabrielmer
Copy link
Contributor

Description

In libwaku, when processing a RETRIEVE_MY_ENR request we are adding an extra " in the beginning and in the end of the string.

This is necessary for RETRIEVE_LISTENING_ADDRESSES because we have to convert a sequence to a string, but forRETRIEVE_MY_ENR which already has a return type of type string, this ends up adding extra quotes.

Changes

  • returning string in RETRIEVE_MY_ENR as is

Issue

#3039

Copy link

github-actions bot commented Oct 7, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3097

Built from eb46d96

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks! 🙌

@@ -30,7 +30,7 @@ proc process*(
of RETRIEVE_LISTENING_ADDRESSES:
return ok($(%*waku.node.getMultiaddresses()))
of RETRIEVE_MY_ENR:
return ok($(%*waku.node.enr.toURI()))
return ok(waku.node.enr.toURI())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to do the same with the other cases

Copy link
Contributor Author

@gabrielmer gabrielmer Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's only one additional case, RETRIEVE_LISTENING_ADDRESSES, and I think it's needed there because the result of getMultiaddresses()is a sequence, so we need to convert the sequence to a string. However, I'm not sure why it was implemented this way and not just used the $ operator on the sequence

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go ahead and merge this change, and once we get to the usage of RETRIEVE_LISTENING_ADDRESSES will revisit if the %* is necessary or not, but their case is definitely different and makes more sense

@gabrielmer gabrielmer merged commit 4aabd64 into master Oct 8, 2024
10 of 11 checks passed
@gabrielmer gabrielmer deleted the fix-libwaku-enr-string branch October 8, 2024 14:22
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.

4 participants