Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storage-provider-server): better error message for missing deal proposal #607

Merged
merged 1 commit into from
Nov 25, 2024
Merged
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
12 changes: 11 additions & 1 deletion cli/polka-storage-provider/server/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ impl StorageProviderRpcServer for RpcServerState {
));
}

// TODO(@jmg-duarte,25/11/2024): Add sanity validations
// end_block > start_block
// available balance (sp & client)
// the provider matches us
// storage price per block > 0
// piece size <= 2048 && power of two
// check the piece_cid code

let cid = self
.deal_db
.add_accepted_proposed_deal(&deal)
Expand Down Expand Up @@ -80,7 +88,7 @@ impl StorageProviderRpcServer for RpcServerState {
.is_none()
{
return Err(RpcError::internal_error(
"proposal has not been accepted",
"proposal has not been found — have you proposed the deal first?",
None,
));
}
Expand All @@ -95,6 +103,8 @@ impl StorageProviderRpcServer for RpcServerState {
));
}

// TODO(@jmg-duarte,25/11/2024): don't batch the deals for better errors

let deal_proposal = deal.deal_proposal.clone();
// TODO(@jmg-duarte,#428,04/10/2024):
// There's a small bug here, currently, xt_client waits for a "full extrisic submission"
Expand Down
Loading