@@ -126,7 +126,7 @@ async fn main() -> Result<(), ClientError> {
126126 // -------------------------------------------------------------------------
127127 let remote_tx_prover : RemoteTransactionProver =
128128 RemoteTransactionProver :: new (" https://tx-prover.testnet.miden.io" );
129- let _tx_prover : Arc <dyn TransactionProver > = Arc :: new (remote_tx_prover );
129+ let tx_prover : Arc <dyn TransactionProver > = Arc :: new (remote_tx_prover );
130130
131131 // We use a dummy transaction request to showcase delegated proving.
132132 // The only effect of this tx should be increasing Alice's nonce.
@@ -142,18 +142,28 @@ async fn main() -> Result<(), ClientError> {
142142 . build ()
143143 . unwrap ();
144144
145- // Note: The delegated prover API has changed in v0.12
146- // The new API would be:
147- // 1. Execute transaction locally to get execution result
148- // 2. Use prove_transaction_with() to generate proof with remote prover
149- // 3. Submit the proven transaction
150- // However, since the delegated prover is not live yet, we'll use the standard flow
145+ // Step 1: Execute the transaction locally
146+ println! (" Executing transaction..." );
147+ let tx_result = client
148+ . execute_transaction (alice_account . id (), transaction_request )
149+ . await ? ;
150+
151+ // Step 2: Prove the transaction using the remote prover
152+ println! (" Proving transaction with remote prover..." );
153+ let proven_transaction = client . prove_transaction_with (& tx_result , tx_prover ). await ? ;
154+
155+ // Step 3: Submit the proven transaction
156+ println! (" Submitting proven transaction..." );
157+ let submission_height = client
158+ . submit_proven_transaction (proven_transaction , & tx_result )
159+ . await ? ;
151160
152- let _tx_id = client
153- . submit_new_transaction (alice_account . id (), transaction_request )
161+ // Step 4: Apply the transaction to local store
162+ client
163+ . apply_transaction (& tx_result , submission_height )
154164 . await ? ;
155165
156- println! (" Transaction submitted (delegated proving not available yet) " );
166+ println! (" Transaction submitted successfully using delegated prover! " );
157167
158168 client . sync_state (). await . unwrap ();
159169
0 commit comments