Skip to content

Commit

Permalink
fix(storage-provider-server): better error message for missing deal p…
Browse files Browse the repository at this point in the history
…roposal
  • Loading branch information
jmg-duarte committed Nov 25, 2024
1 parent 6bf63e9 commit 2ebe419
Showing 1 changed file with 11 additions and 1 deletion.
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

0 comments on commit 2ebe419

Please sign in to comment.