feat: chunk put allow retrying un-get-able chunks #1047
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Depends on #1022, please merge #1022 first!
Summary generated by Reviewpad on 05 Dec 23 09:36 UTC
This pull request includes the following changes:
verify_uploaded_chunks
method has been removed from theFiles
struct. Instead, the logic of this method has been moved to theupload_file
method of the same struct, which now calls theverify_uploaded_chunks
method on theclient
field.verify_uploaded_chunks
has been added to theClient
struct. This method takes a vector of chunk paths and a batch size, and returns a vector of chunks that could not be verified.get_register_from_record
has been implemented, which converts a record into a signed register.upload_files
function in thesn_cli/src/subcommands/files/mod.rs
file has been modified. The changes include adding error handling to check if the wallet is empty before uploading files, initializing theChunkManager
with the providedroot_dir
, adding a call to determine the chunk path for the given files path, printing messages for uploaded and verified files, handling different scenarios based on the existence of chunks to upload, and logging and printing payment and upload information.io::BufRead
andio::BufReader
have been removed.child
has been assigned but is unused.These changes aim to refactor the code, improve the upload process, handle failed chunks, provide better information about the upload and payment details, and remove unused imports and variables.