Skip to content

Commit 290e665

Browse files
committed
Merge branch 'mainnet' of github.com:ProvableHQ/sdk into rr-patch-delegating-proving-auth
2 parents 7ac9826 + 046c371 commit 290e665

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sdk/src/network-client.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,7 @@ class AleoNetworkClient {
16111611
* Submit a `ProvingRequest` to a remote proving service for delegated proving. If the broadcast flag of the `ProvingRequest` is set to `true` the remote service will attempt to broadcast the result `Transaction` on behalf of the requestor.
16121612
*
16131613
* @param {DelegatedProvingParams} options - The optional parameters required to submit a proving request.
1614+
* @param {DelegatedProvingParams} options - The optional parameters required to submit a proving request.
16141615
* @returns {Promise<ProvingResponse>} The ProvingResponse containing the transaction result and the result of the broadcast if the `broadcast` flag was set to `true`.
16151616
*/
16161617
async submitProvingRequest(options: DelegatedProvingParams): Promise<ProvingResponse> {
@@ -1639,6 +1640,17 @@ class AleoNetworkClient {
16391640
})
16401641
);
16411642

1643+
const responseText = await response.text();
1644+
return parseJSON(responseText);
1645+
} catch (error) {
1646+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
1647+
throw new Error(`Failed to submit proving request: ${errorMessage}`);
1648+
post(`${proverUri}/prove`, {
1649+
body: provingRequestString,
1650+
headers
1651+
})
1652+
);
1653+
16421654
const responseText = await response.text();
16431655
return parseJSON(responseText);
16441656
} catch (error) {

0 commit comments

Comments
 (0)