@@ -41,13 +41,9 @@ async fn test_ssv_public_network_fetch() -> Result<()> {
4141 let url =
4242 Url :: parse ( & format ! ( "http://localhost:{port}/api/v4/test_chain/validators/in_operator/1" ) )
4343 . unwrap ( ) ;
44- let node_operator_id = U256 :: from ( 0 ) ;
45- let response = request_ssv_pubkeys_from_public_api (
46- url,
47- node_operator_id,
48- Duration :: from_secs ( HTTP_TIMEOUT_SECONDS_DEFAULT ) ,
49- )
50- . await ?;
44+ let response =
45+ request_ssv_pubkeys_from_public_api ( url, Duration :: from_secs ( HTTP_TIMEOUT_SECONDS_DEFAULT ) )
46+ . await ?;
5147
5248 // Make sure the response is correct
5349 // NOTE: requires that ssv_valid_public.json doesn't change
@@ -82,30 +78,18 @@ async fn test_ssv_network_fetch_big_data() -> Result<()> {
8278 let server_handle =
8379 cb_tests:: mock_ssv_public:: create_mock_public_ssv_server ( port, None ) . await ?;
8480 let url = Url :: parse ( & format ! ( "http://localhost:{port}/big_data" ) ) . unwrap ( ) ;
85- let node_operator_id = U256 :: from ( 0 ) ;
86- let response = request_ssv_pubkeys_from_public_api (
87- url. clone ( ) ,
88- node_operator_id,
89- Duration :: from_secs ( 120 ) ,
90- )
91- . await ;
81+ let response = request_ssv_pubkeys_from_public_api ( url. clone ( ) , Duration :: from_secs ( 120 ) ) . await ;
9282
9383 // The response should fail due to content length being too big
9484 match response {
9585 Ok ( _) => {
9686 panic ! ( "Expected an error due to big content length, but got a successful response" )
9787 }
9888 Err ( e) => match e. downcast_ref :: < ResponseReadError > ( ) {
99- Some ( ResponseReadError :: PayloadTooLarge {
100- max,
101- content_length,
102- request_url,
103- request_context,
104- } ) => {
89+ Some ( ResponseReadError :: PayloadTooLarge { max, content_length, request_url } ) => {
10590 assert_eq ! ( * max, MUXER_HTTP_MAX_LENGTH ) ;
10691 assert ! ( * content_length > MUXER_HTTP_MAX_LENGTH ) ;
10792 assert_eq ! ( url. as_str( ) , request_url. as_str( ) ) ;
108- assert_eq ! ( request_context. as_str( ) , node_operator_id. to_string( ) ) ;
10993 }
11094 _ => panic ! ( "Expected PayloadTooLarge error, got: {}" , e) ,
11195 } ,
@@ -131,13 +115,8 @@ async fn test_ssv_network_fetch_timeout() -> Result<()> {
131115 let url =
132116 Url :: parse ( & format ! ( "http://localhost:{port}/api/v4/test_chain/validators/in_operator/1" ) )
133117 . unwrap ( ) ;
134- let node_operator_id = U256 :: from ( 0 ) ;
135- let response = request_ssv_pubkeys_from_public_api (
136- url,
137- node_operator_id,
138- Duration :: from_secs ( TEST_HTTP_TIMEOUT ) ,
139- )
140- . await ;
118+ let response =
119+ request_ssv_pubkeys_from_public_api ( url, Duration :: from_secs ( TEST_HTTP_TIMEOUT ) ) . await ;
141120
142121 // The response should fail due to timeout
143122 assert ! ( response. is_err( ) , "Expected timeout error, but got success" ) ;
@@ -160,30 +139,18 @@ async fn test_ssv_network_fetch_big_data_without_content_length() -> Result<()>
160139 set_ignore_content_length ( true ) ;
161140 let server_handle = create_mock_public_ssv_server ( port, None ) . await ?;
162141 let url = Url :: parse ( & format ! ( "http://localhost:{port}/big_data" ) ) . unwrap ( ) ;
163- let node_operator_id = U256 :: from ( 0 ) ;
164- let response = request_ssv_pubkeys_from_public_api (
165- url. clone ( ) ,
166- node_operator_id,
167- Duration :: from_secs ( 120 ) ,
168- )
169- . await ;
142+ let response = request_ssv_pubkeys_from_public_api ( url. clone ( ) , Duration :: from_secs ( 120 ) ) . await ;
170143
171144 // The response should fail due to the body being too big
172145 match response {
173146 Ok ( _) => {
174147 panic ! ( "Expected an error due to excessive data, but got a successful response" )
175148 }
176149 Err ( e) => match e. downcast_ref :: < ResponseReadError > ( ) {
177- Some ( ResponseReadError :: PayloadTooLarge {
178- max,
179- content_length,
180- request_url,
181- request_context,
182- } ) => {
150+ Some ( ResponseReadError :: PayloadTooLarge { max, content_length, request_url } ) => {
183151 assert_eq ! ( * max, MUXER_HTTP_MAX_LENGTH ) ;
184152 assert_eq ! ( * content_length, 0 ) ;
185153 assert_eq ! ( url. as_str( ) , request_url. as_str( ) ) ;
186- assert_eq ! ( request_context. as_str( ) , node_operator_id. to_string( ) ) ;
187154 }
188155 _ => panic ! ( "Expected PayloadTooLarge error, got: {}" , e) ,
189156 } ,
0 commit comments