mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Add requires --http when using vc subcommands --http-port (#7405)
Prevent running `lighthouse vc --http-port <PORT>` without `--http`. Issue: https://github.com/sigp/lighthouse/issues/7402 Added requires `--http` when using `lighthouse vc --http-port <PORT>`. Implemented a test code for this issue.
This commit is contained in:
@@ -317,6 +317,14 @@ fn missing_unencrypted_http_transport_flag() {
|
||||
.with_config(|config| assert_eq!(config.http_api.listen_addr, addr));
|
||||
}
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn missing_http_http_port_flag() {
|
||||
CommandLineTest::new()
|
||||
.flag("http-port", Some("9090"))
|
||||
.run()
|
||||
.with_config(|config| assert_eq!(config.http_api.listen_port, 9090));
|
||||
}
|
||||
#[test]
|
||||
fn http_port_flag() {
|
||||
CommandLineTest::new()
|
||||
.flag("http", None)
|
||||
|
||||
@@ -219,6 +219,7 @@ pub struct ValidatorClient {
|
||||
|
||||
#[clap(
|
||||
long,
|
||||
requires = "http",
|
||||
value_name = "PORT",
|
||||
default_value_t = 5062,
|
||||
help = "Set the listen TCP port for the RESTful HTTP API server.",
|
||||
|
||||
Reference in New Issue
Block a user