@@ -23,6 +23,7 @@ use config::Config;
2323use fetcher:: { ProofsFetcher , ProofsFetcherError } ;
2424use merkle_tree:: compute_proofs_merkle_root;
2525use risc0_ethereum_contracts:: encode_seal;
26+ use sqlx:: types:: Uuid ;
2627use std:: thread:: sleep;
2728use std:: { str:: FromStr , time:: Duration } ;
2829use tracing:: { error, info, warn} ;
@@ -213,9 +214,9 @@ impl ProofAggregator {
213214 ) ;
214215
215216 info ! ( "Storing merkle paths for each task..." , ) ;
216- let mut merkle_paths_for_tasks = vec ! [ ] ;
217- for task_id in tasks_id {
218- let Some ( proof) = merkle_tree. get_proof_by_pos ( 0 ) else {
217+ let mut merkle_paths_for_tasks: Vec < ( Uuid , Vec < u8 > ) > = vec ! [ ] ;
218+ for ( idx , task_id) in tasks_id. into_iter ( ) . enumerate ( ) {
219+ let Some ( proof) = merkle_tree. get_proof_by_pos ( idx ) else {
219220 warn ! ( "Proof not found for task id {task_id}" ) ;
220221 continue ;
221222 } ;
@@ -228,7 +229,7 @@ impl ProofAggregator {
228229 merkle_paths_for_tasks. push ( ( task_id, proof_bytes) )
229230 }
230231 self . db
231- . insert_tasks_merkle_path_and_mark_them_as_submitted ( merkle_paths_for_tasks)
232+ . insert_tasks_merkle_path_and_mark_them_as_verified ( merkle_paths_for_tasks)
232233 . await
233234 . map_err ( AggregatedProofSubmissionError :: StoringMerklePaths ) ?;
234235 info ! ( "Merkle path inserted sucessfully" , ) ;
0 commit comments