@@ -273,17 +273,18 @@ fn check_circuit(circuit: &BlobCircuit) -> Result<(), Vec<VerifyFailure>> {
273
273
274
274
#[ test]
275
275
fn blob_circuit_completeness ( ) {
276
- // TODO: enable this once we have another deterministic case of batch -> blob (fully packed).
276
+ // now batch274 is an deterministic case of batch -> blob (fully packed).
277
277
// Full blob test case
278
278
// batch274 contains batch bytes that will produce a full blob
279
- // let full_blob = hex::decode(
280
- // fs::read_to_string("./data/test_batches/batch274.hex")
281
- // .expect("file path exists")
282
- // .trim(),
283
- // )
284
- // .expect("should load full blob batch bytes");
285
- // batch274 contains metadata
286
- // let segmented_full_blob_src = BatchData::<MAX_AGG_SNARKS>::segment_with_metadata(full_blob);
279
+ let full_blob = hex:: decode (
280
+ fs:: read_to_string ( "./data/test_batches/batch274.hex" )
281
+ . expect ( "file path exists" )
282
+ . trim ( ) ,
283
+ )
284
+ . expect ( "should load full blob batch bytes" ) ;
285
+
286
+ // batch274 contains metadatas
287
+ let segmented_full_blob_src = BatchData :: < MAX_AGG_SNARKS > :: segment_with_metadata ( full_blob) ;
287
288
288
289
let all_empty_chunks: Vec < Vec < u8 > > = vec ! [ vec![ ] ; MAX_AGG_SNARKS ] ;
289
290
let one_chunk = vec ! [ vec![ 2 , 3 , 4 , 100 , 1 ] ] ;
@@ -305,8 +306,8 @@ fn blob_circuit_completeness() {
305
306
. chain ( std:: iter:: once ( vec ! [ 3 , 100 , 24 , 30 ] ) )
306
307
. collect :: < Vec < _ > > ( ) ;
307
308
308
- for blob in [
309
- // segmented_full_blob_src,
309
+ for ( idx , blob) in [
310
+ segmented_full_blob_src,
310
311
one_chunk,
311
312
two_chunks,
312
313
max_chunks,
@@ -317,19 +318,21 @@ fn blob_circuit_completeness() {
317
318
all_empty_except_last,
318
319
]
319
320
. into_iter ( )
321
+ . enumerate ( )
320
322
{
321
323
let batch_data = BatchData :: from ( & blob) ;
322
324
323
- // TODO: enable this once we have another deterministic case of batch -> blob (fully
324
- // packed).
325
- // First blob is purposely constructed to take full blob space
326
- // if idx == 0 {
327
- // let blob_data_bytes_len = batch_data.get_blob_data_bytes().len();
328
- // assert_eq!(
329
- // blob_data_bytes_len, N_BLOB_BYTES,
330
- // "should be full blob: expected={N_BLOB_BYTES}, got={blob_data_bytes_len}",
331
- // );
332
- // }
325
+ // First blob(batch274's blob data) is purposely constructed to take full blob space
326
+ if idx == 0 {
327
+ let batch_data_bytes = batch_data. get_batch_data_bytes ( ) ;
328
+ let blob_data_bytes = get_blob_bytes ( & batch_data_bytes) ;
329
+ let blob_data_bytes_len = blob_data_bytes. len ( ) ;
330
+
331
+ assert_eq ! (
332
+ blob_data_bytes_len, N_BLOB_BYTES ,
333
+ "should be full blob: expected={N_BLOB_BYTES}, got={blob_data_bytes_len}" ,
334
+ ) ;
335
+ }
333
336
334
337
assert_eq ! ( check_data( batch_data) , Ok ( ( ) ) , "{:?}" , blob) ;
335
338
}
0 commit comments