File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
aggregation_mode/src/backend Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,23 @@ pub enum GetBatchProofsError {
66 Deserialization ,
77 EmptyBody ,
88 StatusFailed ,
9+ ReqwestClientFailed
910}
1011
12+ // needed to make S3 bucket work
13+ const DEFAULT_USER_AGENT : & str = "proof-aggregator/aligned-layer" ;
14+
1115pub async fn get_aligned_batch_from_s3 (
1216 url : String ,
1317) -> Result < Vec < VerificationData > , GetBatchProofsError > {
14- let response = reqwest:: get ( url)
18+ let client = reqwest:: Client :: builder ( )
19+ . user_agent ( DEFAULT_USER_AGENT )
20+ . build ( )
21+ . map_err ( |_| GetBatchProofsError :: ReqwestClientFailed ) ?;
22+
23+ let response = client. get ( url) . send ( )
1524 . await
1625 . map_err ( |_| GetBatchProofsError :: Fetching ) ?;
17-
1826 if !response. status ( ) . is_success ( ) {
1927 return Err ( GetBatchProofsError :: StatusFailed ) ;
2028 }
You can’t perform that action at this time.
0 commit comments