@@ -437,73 +437,6 @@ def corrupt_byte(b: bytes) -> Bytes:
437437 self .proof = Bytes (b"" .join (corrupt_byte (bytes ([byte ])) for byte in self .proof ))
438438
439439
440- # --------- generate static blobs ------------
441- # fork_list = [Cancun, Prague, Osaka]
442- # amount_static_blobs_per_fork = 10
443- # for f in fork_list:
444- # for seed in range(amount_static_blobs_per_fork):
445- # if seed < 4:
446- # timestamp = 0
447- # elif seed < 7:
448- # timestamp = 1000000000
449- # else:
450- # timestamp = 1747905411
451-
452- # static_blob: Blob = Blob.from_fork(f, seed, timestamp)
453- # static_blob.write_to_file()
454- # --------------------------------------------
455-
456- # myosaka: Fork = Osaka
457- # start = time.perf_counter()
458- # amount_of_blobs = 1000
459- # for s in range(amount_of_blobs):
460- # b: Blob = Blob.from_fork(myosaka, s)
461- # b.write_to_file()
462- # end = time.perf_counter()
463- # duration_ms = (end - start) * 1000
464- # print(f"Generated and wrote {amount_of_blobs} blobs to disk in: {duration_ms:.3f} ms")
465-
466-
467- # myosaka: Fork = Osaka
468- # print(f"Fork test print: {myosaka.name()}")
469- # myprague: Fork = Prague
470- # mycancun: Fork = Cancun
471- # myseed: int = 1337 # fork+seed is the unique ID of a blob
472- # mytimestamp: int = 168123123
473- # # test 1: blob construction
474- # b: Blob = Blob.from_fork(myosaka, myseed, mytimestamp)
475- # # test 2: reconstruction from json
476- # json_str: str = b.write_to_file()
477- # restored: Blob = Blob.from_file("blob_1337_cell_proofs_128")
478- # assert b.data == restored.data
479- # assert b.commitment == restored.commitment
480- # assert b.proof == restored.proof
481- # assert b.cells == restored.cells
482- # assert b.versioned_hash == restored.versioned_hash
483- # assert b.name == restored.name
484- # assert b.fork == restored.fork
485- # assert b.seed == restored.seed
486- # assert b.timestamp == restored.timestamp
487- # print(type(b.proof), len(b.proof))
488- # # test 3: write to file
489- # b.write_to_file()
490- # # test 4: read from file
491- # bzzz = Blob.from_file("blob_1337_cell_proofs_128")
492- # print("read osaka blob file from cache dir")
493- # # test 5: prague blob creation + write
494- # d: Blob = Blob.from_fork(myprague, myseed, 123)
495- # d.write_to_file()
496- # # test 6: reading prague from file
497- # e: Blob = Blob.from_file("blob_1337_cell_proofs_0")
498- # print("read prague blob file from cache dir")
499- # # test 7: cancun (will overwrite prague blob cuz same target filename)
500- # dddddde: Blob = Blob.from_fork(mycancun, myseed, 123)
501- # dddddde.write_to_file()
502- # print("line above should say file existed already (cancun overwrites prague)")
503- # # test 8: non-blob forks can't create blobs
504- # # myparis: Fork = Paris
505- # # parisapriaparip: Blob = Blob.from_fork(myparis, myseed, 123)
506-
507440# test fork_at for when timestamp > 0
508441# transitionfork: Fork = Cancun
509442# new_timestamp = 15000 # is supposed to return prague, but still returns cancun.. TODO: ?
@@ -519,21 +452,3 @@ def corrupt_byte(b: bytes) -> Bytes:
519452# assert transitionforkblob.fork == restored_transitionforkblob.fork
520453# assert transitionforkblob.seed == restored_transitionforkblob.seed
521454# assert transitionforkblob.timestamp == restored_transitionforkblob.timestamp
522-
523- # # test proof corruption
524- # # osaka
525- # testseed = 55
526- # ddd: Blob = Blob.from_fork(Osaka, testseed + 10)
527- # assert isinstance(ddd.proof[0], bytes) # mypy fix
528- # oldValue = ddd.proof[0][5]
529- # for m in Blob.ProofCorruptionMode:
530- # ddd.corrupt_proof(m)
531- # print("proof corruption works (osaka):", oldValue != ddd.proof[0][5])
532- # # prague
533- # eeeeeeeeee: Blob = Blob.from_fork(Prague, testseed + 11)
534- # assert isinstance(eeeeeeeeee.proof[5], int) # mypy fix
535- # oldValue = eeeeeeeeee.proof[5]
536- # for m in Blob.ProofCorruptionMode:
537- # eeeeeeeeee.corrupt_proof(m)
538- # print("proof corruption works (prague):", oldValue != eeeeeeeeee.proof[5])
539- # print("pydantic model works")
0 commit comments