@@ -69,18 +69,18 @@ async def run(
69
69
initial : bool ,
70
70
) -> None :
71
71
for plot_info in loaded :
72
- assert plot_info .prover .get_filename () not in self .plots
72
+ assert plot_info .prover .get_filepath () not in self .plots
73
73
for plot_info in removed :
74
- assert plot_info .prover .get_filename () in self .plots
74
+ assert plot_info .prover .get_filepath () in self .plots
75
75
76
76
self .invalid = invalid
77
77
self .keys_missing = keys_missing
78
78
self .duplicates = duplicates
79
79
80
- removed_paths : list [Path ] = [p .prover .get_filename () for p in removed ] if removed is not None else []
81
- invalid_dict : dict [Path , int ] = {p .prover .get_filename (): 0 for p in self .invalid }
82
- keys_missing_set : set [Path ] = {p .prover .get_filename () for p in self .keys_missing }
83
- duplicates_set : set [str ] = {p .prover .get_filename_str () for p in self .duplicates }
80
+ removed_paths : list [Path ] = [p .prover .get_filepath () for p in removed ] if removed is not None else []
81
+ invalid_dict : dict [Path , int ] = {p .prover .get_filepath (): 0 for p in self .invalid }
82
+ keys_missing_set : set [Path ] = {p .prover .get_filepath () for p in self .keys_missing }
83
+ duplicates_set : set [str ] = {p .prover .get_filename () for p in self .duplicates }
84
84
85
85
# Inject invalid plots into `PlotManager` of the harvester so that the callback calls below can use them
86
86
# to sync them to the farmer.
@@ -91,7 +91,7 @@ async def run(
91
91
# Inject duplicated plots into `PlotManager` of the harvester so that the callback calls below can use them
92
92
# to sync them to the farmer.
93
93
for plot_info in loaded :
94
- plot_path = Path (plot_info .prover .get_filename ())
94
+ plot_path = Path (plot_info .prover .get_filepath ())
95
95
self .harvester .plot_manager .plot_filename_paths [plot_path .name ] = (str (plot_path .parent ), set ())
96
96
for duplicate in duplicates_set :
97
97
plot_path = Path (duplicate )
@@ -123,39 +123,39 @@ async def sync_done() -> bool:
123
123
await time_out_assert (60 , sync_done )
124
124
125
125
for plot_info in loaded :
126
- self .plots [plot_info .prover .get_filename ()] = plot_info
126
+ self .plots [plot_info .prover .get_filepath ()] = plot_info
127
127
for plot_info in removed :
128
- del self .plots [plot_info .prover .get_filename ()]
128
+ del self .plots [plot_info .prover .get_filepath ()]
129
129
130
130
def validate_plot_sync (self ) -> None :
131
131
assert len (self .plots ) == len (self .plot_sync_receiver .plots ())
132
132
assert len (self .invalid ) == len (self .plot_sync_receiver .invalid ())
133
133
assert len (self .keys_missing ) == len (self .plot_sync_receiver .keys_missing ())
134
134
for _ , plot_info in self .plots .items ():
135
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .invalid ()
136
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .keys_missing ()
137
- assert plot_info .prover .get_filename_str () in self .plot_sync_receiver .plots ()
138
- synced_plot = self .plot_sync_receiver .plots ()[plot_info .prover .get_filename_str ()]
139
- assert plot_info .prover .get_filename_str () == synced_plot .filename
135
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .invalid ()
136
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .keys_missing ()
137
+ assert plot_info .prover .get_filename () in self .plot_sync_receiver .plots ()
138
+ synced_plot = self .plot_sync_receiver .plots ()[plot_info .prover .get_filename ()]
139
+ assert plot_info .prover .get_filename () == synced_plot .filename
140
140
assert plot_info .pool_public_key == synced_plot .pool_public_key
141
141
assert plot_info .pool_contract_puzzle_hash == synced_plot .pool_contract_puzzle_hash
142
142
assert plot_info .plot_public_key == synced_plot .plot_public_key
143
143
assert plot_info .file_size == synced_plot .file_size
144
144
assert uint64 (int (plot_info .time_modified )) == synced_plot .time_modified
145
145
for plot_info in self .invalid :
146
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .plots ()
147
- assert plot_info .prover .get_filename_str () in self .plot_sync_receiver .invalid ()
148
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .keys_missing ()
149
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .duplicates ()
146
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .plots ()
147
+ assert plot_info .prover .get_filename () in self .plot_sync_receiver .invalid ()
148
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .keys_missing ()
149
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .duplicates ()
150
150
for plot_info in self .keys_missing :
151
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .plots ()
152
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .invalid ()
153
- assert plot_info .prover .get_filename_str () in self .plot_sync_receiver .keys_missing ()
154
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .duplicates ()
151
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .plots ()
152
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .invalid ()
153
+ assert plot_info .prover .get_filename () in self .plot_sync_receiver .keys_missing ()
154
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .duplicates ()
155
155
for plot_info in self .duplicates :
156
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .invalid ()
157
- assert plot_info .prover .get_filename_str () not in self .plot_sync_receiver .keys_missing ()
158
- assert plot_info .prover .get_filename_str () in self .plot_sync_receiver .duplicates ()
156
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .invalid ()
157
+ assert plot_info .prover .get_filename () not in self .plot_sync_receiver .keys_missing ()
158
+ assert plot_info .prover .get_filename () in self .plot_sync_receiver .duplicates ()
159
159
160
160
161
161
@dataclass
@@ -417,16 +417,16 @@ async def test_sync_reset_cases(
417
417
# Inject some data into `PlotManager` of the harvester so that we can validate the reset worked and triggered a
418
418
# fresh sync of all available data of the plot manager
419
419
for plot_info in plots [0 :10 ]:
420
- test_data .plots [plot_info .prover .get_filename ()] = plot_info
420
+ test_data .plots [plot_info .prover .get_filepath ()] = plot_info
421
421
plot_manager .plots = test_data .plots
422
422
test_data .invalid = plots [10 :20 ]
423
423
test_data .keys_missing = plots [20 :30 ]
424
424
test_data .plot_sync_receiver .simulate_error = simulate_error # type: ignore[attr-defined]
425
425
sender : Sender = test_runner .test_data [0 ].plot_sync_sender
426
426
started_sync_id : uint64 = uint64 (0 )
427
427
428
- plot_manager .failed_to_open_filenames = {p .prover .get_filename (): 0 for p in test_data .invalid }
429
- plot_manager .no_key_filenames = {p .prover .get_filename () for p in test_data .keys_missing }
428
+ plot_manager .failed_to_open_filenames = {p .prover .get_filepath (): 0 for p in test_data .invalid }
429
+ plot_manager .no_key_filenames = {p .prover .get_filepath () for p in test_data .keys_missing }
430
430
431
431
async def wait_for_reset () -> bool :
432
432
assert started_sync_id != 0
0 commit comments