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

refactor(simln-lib): Parse address detecting if starts with https #212

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

f3r10
Copy link
Collaborator

@f3r10 f3r10 commented Jan 24, 2025

fix #154
Detect if the parsed address starts with the https protocol; if not, add it without requiring a user to do it.

Copy link
Contributor

@carlaKC carlaKC left a comment

Choose a reason for hiding this comment

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

One approach comment - I think we can live without the type alias (but this opinion is not strongly held so open to motivation for is).

Let's also update the readme to remove all the https prefixes from our examples and the requirement "Note that node addresses must be declare with HTTPS transport". Generally try to keep in the good habit of updating readme along with code so that we don't get too out of date.

@@ -48,6 +48,9 @@ pub enum NodeId {
Alias(String),
}

#[derive(Serialize, Debug, Clone)]
pub struct Address(String);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we can live without this type alias and just use #[serde(with = "serializers::serde_address")] to point to custom serialization/deserialization of a String to reduce LOC a little.

@carlaKC
Copy link
Contributor

carlaKC commented Jan 27, 2025

Also a small nitpick on commit naming (which is unconventional mostly personal preference, so feel free to ignore), generally we've been using the structure: scope/{action}, eg sim-ln/refactor, sim-cli/test followed by message.

Also in this case it's not actually a refactor, it's a (tiny) feat!

@f3r10 f3r10 force-pushed the do_not_require_https_in_address branch from 6a2fa2c to 07be566 Compare January 29, 2025 21:21
@f3r10 f3r10 force-pushed the do_not_require_https_in_address branch from 4befd29 to 27600ce Compare January 29, 2025 21:27
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.

Do not require https in address fields on the simulation file
2 participants