Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def get_filename(fork: Fork, seed: int) -> str:
return (
"blob_"
+ str(seed)
+ "_"
+ fork.name().lower()
+ "_cell_proofs_"
+ str(amount_cell_proofs)
+ ".json"
Expand All @@ -96,11 +98,7 @@ def get_filepath(fork: Fork, seed: int) -> Path:
Return the Path to the blob that would be created with these
parameters.
"""
# determine amount of cell proofs for this fork (0 or 128)
would_be_filename: str = Blob.get_filename(fork, seed)

# return path to blob
return CACHED_BLOBS_DIRECTORY / would_be_filename
return CACHED_BLOBS_DIRECTORY / Blob.get_filename(fork, seed)

@staticmethod
def from_fork(fork: Fork, seed: int = 0, timestamp: int = 0) -> "Blob":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,7 @@ def test_blob_creation_and_writing_and_reading(
b = Blob.from_fork(fork=fork, seed=seed, timestamp=timestamp)
b.write_to_file()

# read from file
# determine what filename would be
cell_proof_amount = str(fork.get_blob_constant("AMOUNT_CELL_PROOFS"))
file_name = (
"blob_" + str(seed) + "_cell_proofs_" + cell_proof_amount + ".json"
)
# read
file_name = Blob.get_filename(fork, seed)
restored = Blob.from_file(file_name)

# ensure file you read equals file you wrote
Expand Down
Loading