@@ -55,6 +55,12 @@ impl CommandLineTest {
55
55
}
56
56
57
57
fn run_with_zero_port ( & mut self ) -> CompletedTest < Config > {
58
+ // Required since Deneb was enabled on mainnet.
59
+ self . cmd . arg ( "--allow-insecure-genesis-sync" ) ;
60
+ self . run_with_zero_port_and_no_genesis_sync ( )
61
+ }
62
+
63
+ fn run_with_zero_port_and_no_genesis_sync ( & mut self ) -> CompletedTest < Config > {
58
64
self . cmd . arg ( "-z" ) ;
59
65
self . run ( )
60
66
}
@@ -93,16 +99,16 @@ fn staking_flag() {
93
99
}
94
100
95
101
#[ test]
96
- fn allow_insecure_genesis_sync ( ) {
97
- CommandLineTest :: new ( )
98
- . run_with_zero_port ( )
99
- . with_config ( |config| {
100
- assert_eq ! ( config. allow_insecure_genesis_sync, false ) ;
101
- } ) ;
102
+ #[ should_panic]
103
+ fn allow_insecure_genesis_sync_default ( ) {
104
+ CommandLineTest :: new ( ) . run_with_zero_port_and_no_genesis_sync ( ) ;
105
+ }
102
106
107
+ #[ test]
108
+ fn allow_insecure_genesis_sync_enabled ( ) {
103
109
CommandLineTest :: new ( )
104
110
. flag ( "allow-insecure-genesis-sync" , None )
105
- . run_with_zero_port ( )
111
+ . run_with_zero_port_and_no_genesis_sync ( )
106
112
. with_config ( |config| {
107
113
assert_eq ! ( config. allow_insecure_genesis_sync, true ) ;
108
114
} ) ;
@@ -851,6 +857,7 @@ fn network_port_flag_over_ipv4() {
851
857
let port = 0 ;
852
858
CommandLineTest :: new ( )
853
859
. flag ( "port" , Some ( port. to_string ( ) . as_str ( ) ) )
860
+ . flag ( "allow-insecure-genesis-sync" , None )
854
861
. run ( )
855
862
. with_config ( |config| {
856
863
assert_eq ! (
@@ -867,6 +874,7 @@ fn network_port_flag_over_ipv4() {
867
874
let port = 9000 ;
868
875
CommandLineTest :: new ( )
869
876
. flag ( "port" , Some ( port. to_string ( ) . as_str ( ) ) )
877
+ . flag ( "allow-insecure-genesis-sync" , None )
870
878
. run ( )
871
879
. with_config ( |config| {
872
880
assert_eq ! (
@@ -886,6 +894,7 @@ fn network_port_flag_over_ipv6() {
886
894
CommandLineTest :: new ( )
887
895
. flag ( "listen-address" , Some ( "::1" ) )
888
896
. flag ( "port" , Some ( port. to_string ( ) . as_str ( ) ) )
897
+ . flag ( "allow-insecure-genesis-sync" , None )
889
898
. run ( )
890
899
. with_config ( |config| {
891
900
assert_eq ! (
@@ -903,6 +912,7 @@ fn network_port_flag_over_ipv6() {
903
912
CommandLineTest :: new ( )
904
913
. flag ( "listen-address" , Some ( "::1" ) )
905
914
. flag ( "port" , Some ( port. to_string ( ) . as_str ( ) ) )
915
+ . flag ( "allow-insecure-genesis-sync" , None )
906
916
. run ( )
907
917
. with_config ( |config| {
908
918
assert_eq ! (
@@ -925,6 +935,7 @@ fn network_port_flag_over_ipv4_and_ipv6() {
925
935
. flag ( "listen-address" , Some ( "::1" ) )
926
936
. flag ( "port" , Some ( port. to_string ( ) . as_str ( ) ) )
927
937
. flag ( "port6" , Some ( port6. to_string ( ) . as_str ( ) ) )
938
+ . flag ( "allow-insecure-genesis-sync" , None )
928
939
. run ( )
929
940
. with_config ( |config| {
930
941
assert_eq ! (
@@ -954,6 +965,7 @@ fn network_port_flag_over_ipv4_and_ipv6() {
954
965
. flag ( "listen-address" , Some ( "::1" ) )
955
966
. flag ( "port" , Some ( port. to_string ( ) . as_str ( ) ) )
956
967
. flag ( "port6" , Some ( port6. to_string ( ) . as_str ( ) ) )
968
+ . flag ( "allow-insecure-genesis-sync" , None )
957
969
. run ( )
958
970
. with_config ( |config| {
959
971
assert_eq ! (
@@ -983,6 +995,7 @@ fn network_port_and_discovery_port_flags_over_ipv4() {
983
995
CommandLineTest :: new ( )
984
996
. flag ( "port" , Some ( tcp4_port. to_string ( ) . as_str ( ) ) )
985
997
. flag ( "discovery-port" , Some ( disc4_port. to_string ( ) . as_str ( ) ) )
998
+ . flag ( "allow-insecure-genesis-sync" , None )
986
999
. run ( )
987
1000
. with_config ( |config| {
988
1001
assert_eq ! (
@@ -1003,6 +1016,7 @@ fn network_port_and_discovery_port_flags_over_ipv6() {
1003
1016
. flag ( "listen-address" , Some ( "::1" ) )
1004
1017
. flag ( "port" , Some ( tcp6_port. to_string ( ) . as_str ( ) ) )
1005
1018
. flag ( "discovery-port" , Some ( disc6_port. to_string ( ) . as_str ( ) ) )
1019
+ . flag ( "allow-insecure-genesis-sync" , None )
1006
1020
. run ( )
1007
1021
. with_config ( |config| {
1008
1022
assert_eq ! (
@@ -1028,6 +1042,7 @@ fn network_port_and_discovery_port_flags_over_ipv4_and_ipv6() {
1028
1042
. flag ( "discovery-port" , Some ( disc4_port. to_string ( ) . as_str ( ) ) )
1029
1043
. flag ( "port6" , Some ( tcp6_port. to_string ( ) . as_str ( ) ) )
1030
1044
. flag ( "discovery-port6" , Some ( disc6_port. to_string ( ) . as_str ( ) ) )
1045
+ . flag ( "allow-insecure-genesis-sync" , None )
1031
1046
. run ( )
1032
1047
. with_config ( |config| {
1033
1048
assert_eq ! (
@@ -1067,6 +1082,7 @@ fn network_port_discovery_quic_port_flags_over_ipv4_and_ipv6() {
1067
1082
. flag ( "port6" , Some ( tcp6_port. to_string ( ) . as_str ( ) ) )
1068
1083
. flag ( "discovery-port6" , Some ( disc6_port. to_string ( ) . as_str ( ) ) )
1069
1084
. flag ( "quic-port6" , Some ( quic6_port. to_string ( ) . as_str ( ) ) )
1085
+ . flag ( "allow-insecure-genesis-sync" , None )
1070
1086
. run ( )
1071
1087
. with_config ( |config| {
1072
1088
assert_eq ! (
@@ -1293,6 +1309,7 @@ fn enr_match_flag_over_ipv4() {
1293
1309
. flag ( "listen-address" , Some ( "127.0.0.2" ) )
1294
1310
. flag ( "discovery-port" , Some ( udp4_port. to_string ( ) . as_str ( ) ) )
1295
1311
. flag ( "port" , Some ( tcp4_port. to_string ( ) . as_str ( ) ) )
1312
+ . flag ( "allow-insecure-genesis-sync" , None )
1296
1313
. run ( )
1297
1314
. with_config ( |config| {
1298
1315
assert_eq ! (
@@ -1324,6 +1341,7 @@ fn enr_match_flag_over_ipv6() {
1324
1341
. flag ( "listen-address" , Some ( ADDR ) )
1325
1342
. flag ( "discovery-port" , Some ( udp6_port. to_string ( ) . as_str ( ) ) )
1326
1343
. flag ( "port" , Some ( tcp6_port. to_string ( ) . as_str ( ) ) )
1344
+ . flag ( "allow-insecure-genesis-sync" , None )
1327
1345
. run ( )
1328
1346
. with_config ( |config| {
1329
1347
assert_eq ! (
@@ -1364,6 +1382,7 @@ fn enr_match_flag_over_ipv4_and_ipv6() {
1364
1382
. flag ( "listen-address" , Some ( IPV6_ADDR ) )
1365
1383
. flag ( "discovery-port6" , Some ( udp6_port. to_string ( ) . as_str ( ) ) )
1366
1384
. flag ( "port6" , Some ( tcp6_port. to_string ( ) . as_str ( ) ) )
1385
+ . flag ( "allow-insecure-genesis-sync" , None )
1367
1386
. run ( )
1368
1387
. with_config ( |config| {
1369
1388
assert_eq ! (
@@ -1490,6 +1509,7 @@ fn http_port_flag() {
1490
1509
. flag ( "http" , None )
1491
1510
. flag ( "http-port" , Some ( port1. to_string ( ) . as_str ( ) ) )
1492
1511
. flag ( "port" , Some ( port2. to_string ( ) . as_str ( ) ) )
1512
+ . flag ( "allow-insecure-genesis-sync" , None )
1493
1513
. run ( )
1494
1514
. with_config ( |config| assert_eq ! ( config. http_api. listen_port, port1) ) ;
1495
1515
}
@@ -1647,6 +1667,7 @@ fn metrics_port_flag() {
1647
1667
. flag ( "metrics" , None )
1648
1668
. flag ( "metrics-port" , Some ( port1. to_string ( ) . as_str ( ) ) )
1649
1669
. flag ( "port" , Some ( port2. to_string ( ) . as_str ( ) ) )
1670
+ . flag ( "allow-insecure-genesis-sync" , None )
1650
1671
. run ( )
1651
1672
. with_config ( |config| assert_eq ! ( config. http_metrics. listen_port, port1) ) ;
1652
1673
}
0 commit comments