diff --git a/cli/polka-storage-provider/server/src/rpc.rs b/cli/polka-storage-provider/server/src/rpc.rs index c8df6bb61..c44e2c400 100644 --- a/cli/polka-storage-provider/server/src/rpc.rs +++ b/cli/polka-storage-provider/server/src/rpc.rs @@ -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) @@ -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, )); } @@ -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"