@@ -41,9 +41,13 @@ 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 response =
45- request_ssv_pubkeys_from_public_api ( url, Duration :: from_secs ( HTTP_TIMEOUT_SECONDS_DEFAULT ) )
46- . await ?;
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 ?;
4751
4852 // Make sure the response is correct
4953 // NOTE: requires that ssv_valid_public.json doesn't change
@@ -78,7 +82,13 @@ async fn test_ssv_network_fetch_big_data() -> Result<()> {
7882 let server_handle =
7983 cb_tests:: mock_ssv_public:: create_mock_public_ssv_server ( port, None ) . await ?;
8084 let url = Url :: parse ( & format ! ( "http://localhost:{port}/big_data" ) ) . unwrap ( ) ;
81- let response = request_ssv_pubkeys_from_public_api ( url. clone ( ) , Duration :: from_secs ( 120 ) ) . await ;
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 ;
8292
8393 // The response should fail due to content length being too big
8494 match response {
@@ -90,13 +100,12 @@ async fn test_ssv_network_fetch_big_data() -> Result<()> {
90100 max,
91101 content_length,
92102 request_url,
93- request_id ,
103+ request_context ,
94104 } ) => {
95105 assert_eq ! ( * max, MUXER_HTTP_MAX_LENGTH ) ;
96106 assert ! ( * content_length > MUXER_HTTP_MAX_LENGTH ) ;
97107 assert_eq ! ( url. as_str( ) , request_url. as_str( ) ) ;
98- // url used as request id
99- assert_eq ! ( request_id. as_str( ) , request_url. as_str( ) ) ;
108+ assert_eq ! ( request_context. as_str( ) , node_operator_id. to_string( ) ) ;
100109 }
101110 _ => panic ! ( "Expected PayloadTooLarge error, got: {}" , e) ,
102111 } ,
@@ -122,8 +131,13 @@ async fn test_ssv_network_fetch_timeout() -> Result<()> {
122131 let url =
123132 Url :: parse ( & format ! ( "http://localhost:{port}/api/v4/test_chain/validators/in_operator/1" ) )
124133 . unwrap ( ) ;
125- let response =
126- request_ssv_pubkeys_from_public_api ( url, Duration :: from_secs ( TEST_HTTP_TIMEOUT ) ) . await ;
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 ;
127141
128142 // The response should fail due to timeout
129143 assert ! ( response. is_err( ) , "Expected timeout error, but got success" ) ;
@@ -146,7 +160,13 @@ async fn test_ssv_network_fetch_big_data_without_content_length() -> Result<()>
146160 set_ignore_content_length ( true ) ;
147161 let server_handle = create_mock_public_ssv_server ( port, None ) . await ?;
148162 let url = Url :: parse ( & format ! ( "http://localhost:{port}/big_data" ) ) . unwrap ( ) ;
149- let response = request_ssv_pubkeys_from_public_api ( url. clone ( ) , Duration :: from_secs ( 120 ) ) . await ;
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 ;
150170
151171 // The response should fail due to the body being too big
152172 match response {
@@ -158,13 +178,12 @@ async fn test_ssv_network_fetch_big_data_without_content_length() -> Result<()>
158178 max,
159179 content_length,
160180 request_url,
161- request_id ,
181+ request_context ,
162182 } ) => {
163183 assert_eq ! ( * max, MUXER_HTTP_MAX_LENGTH ) ;
164184 assert_eq ! ( * content_length, 0 ) ;
165185 assert_eq ! ( url. as_str( ) , request_url. as_str( ) ) ;
166- // url used as request id
167- assert_eq ! ( request_id. as_str( ) , request_url. as_str( ) ) ;
186+ assert_eq ! ( request_context. as_str( ) , node_operator_id. to_string( ) ) ;
168187 }
169188 _ => panic ! ( "Expected PayloadTooLarge error, got: {}" , e) ,
170189 } ,
0 commit comments