@@ -201,22 +201,19 @@ async fn test_put_contract() -> TestResult {
201
201
make_put ( & mut client_api_a, wrapped_state. clone ( ) , contract. clone ( ) ) . await ?;
202
202
203
203
// Wait for put response
204
- loop {
205
- let resp = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , client_api_a. recv ( ) ) . await ;
206
- match resp {
207
- Ok ( Ok ( HostResponse :: ContractResponse ( ContractResponse :: PutResponse { key } ) ) ) => {
208
- assert_eq ! ( key, contract_key) ;
209
- break ;
210
- }
211
- Ok ( Ok ( other) ) => {
212
- tracing:: warn!( "unexpected response while waiting for put: {:?}" , other) ;
213
- }
214
- Ok ( Err ( e) ) => {
215
- bail ! ( "Error receiving put response: {}" , e) ;
216
- }
217
- Err ( _) => {
218
- bail ! ( "Timeout waiting for put response" ) ;
219
- }
204
+ let resp = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , client_api_a. recv ( ) ) . await ;
205
+ match resp {
206
+ Ok ( Ok ( HostResponse :: ContractResponse ( ContractResponse :: PutResponse { key } ) ) ) => {
207
+ assert_eq ! ( key, contract_key) ;
208
+ }
209
+ Ok ( Ok ( other) ) => {
210
+ tracing:: warn!( "unexpected response while waiting for put: {:?}" , other) ;
211
+ }
212
+ Ok ( Err ( e) ) => {
213
+ bail ! ( "Error receiving put response: {}" , e) ;
214
+ }
215
+ Err ( _) => {
216
+ bail ! ( "Timeout waiting for put response" ) ;
220
217
}
221
218
}
222
219
@@ -362,22 +359,19 @@ async fn test_update_contract() -> TestResult {
362
359
make_put ( & mut client_api_a, wrapped_state. clone ( ) , contract. clone ( ) ) . await ?;
363
360
364
361
// Wait for put response
365
- loop {
366
- let resp = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , client_api_a. recv ( ) ) . await ;
367
- match resp {
368
- Ok ( Ok ( HostResponse :: ContractResponse ( ContractResponse :: PutResponse { key } ) ) ) => {
369
- assert_eq ! ( key, contract_key, "Contract key mismatch in PUT response" ) ;
370
- break ;
371
- }
372
- Ok ( Ok ( other) ) => {
373
- tracing:: warn!( "unexpected response while waiting for put: {:?}" , other) ;
374
- }
375
- Ok ( Err ( e) ) => {
376
- bail ! ( "Error receiving put response: {}" , e) ;
377
- }
378
- Err ( _) => {
379
- bail ! ( "Timeout waiting for put response" ) ;
380
- }
362
+ let resp = tokio:: time:: timeout ( Duration :: from_secs ( 30 ) , client_api_a. recv ( ) ) . await ;
363
+ match resp {
364
+ Ok ( Ok ( HostResponse :: ContractResponse ( ContractResponse :: PutResponse { key } ) ) ) => {
365
+ assert_eq ! ( key, contract_key, "Contract key mismatch in PUT response" ) ;
366
+ }
367
+ Ok ( Ok ( other) ) => {
368
+ tracing:: warn!( "unexpected response while waiting for put: {:?}" , other) ;
369
+ }
370
+ Ok ( Err ( e) ) => {
371
+ bail ! ( "Error receiving put response: {}" , e) ;
372
+ }
373
+ Err ( _) => {
374
+ bail ! ( "Timeout waiting for put response" ) ;
381
375
}
382
376
}
383
377
0 commit comments