Page MenuHomePhabricator

[electrum] network_dialog: Validate hosts and ports
ClosedPublic

Authored by PiRK on Jan 18 2024, 10:48.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC8cb7218e929b: [electrum] network_dialog: Validate hosts and ports
Summary

This adds a new HostValidator class to validate hostnames and IP
addresses entered into a QLineEdit. We use this class to validate the
server and proxy host.

This also adds the existing PortValidator class to the server and
proxy port widgets.

fixes electroncash#2743

This is a backport of electroncash#2744

Test Plan

Run the GUI, test the server host, server port, proxy host and proxy port fields. Invalid hostnames or ports should cause the widget to have a red border.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Jan 18 2024, 10:48
PiRK retitled this revision from network_dialog: Validate hosts and ports to [electrum] network_dialog: Validate hosts and ports.Jan 18 2024, 10:49
electrum/electrumabc_gui/qt/utils/__init__.py
31 ↗(On Diff #44314)

The utils.PortValidator and utils.UserPortValidator aliases are no longer needed as I used the fully qualified name in the 2 callsites

This revision is now accepted and ready to land.Jan 18 2024, 11:17
This revision was automatically updated to reflect the committed changes.