From 38490a6163002f9a8d42c70afab8fe115e112fc7 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Tue, 18 Nov 2025 00:04:53 -0300 Subject: [PATCH] wip --- .../guest/src/bin/privacy_preserving_circuit.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nssa/program_methods/guest/src/bin/privacy_preserving_circuit.rs b/nssa/program_methods/guest/src/bin/privacy_preserving_circuit.rs index 9efd77e..223229f 100644 --- a/nssa/program_methods/guest/src/bin/privacy_preserving_circuit.rs +++ b/nssa/program_methods/guest/src/bin/privacy_preserving_circuit.rs @@ -56,12 +56,11 @@ fn main() { { if !state_diff.contains_key(&pre.account_id) { pre_states.push(pre.clone()); - } else { - state_diff.insert(pre.account_id, post.clone()); } + state_diff.insert(pre.account_id.clone(), post.clone()); } - if let Some(next_chained_call) = program_output.chained_call { + if let Some(next_chained_call) = &program_output.chained_call { program_id = next_chained_call.program_id; // // Build post states with metadata for next call @@ -115,7 +114,7 @@ fn main() { // Public account public_pre_states.push(pre_states[i].clone()); - let mut post = post_states[i].clone(); + let mut post = state_diff.get(&pre_states[i].account_id).unwrap().clone(); if pre_states[i].is_authorized { post.nonce += 1; } @@ -171,7 +170,8 @@ fn main() { } // Update post-state with new nonce - let mut post_with_updated_values = post_states[i].clone(); + let mut post_with_updated_values = + state_diff.get(&pre_states[i].account_id).unwrap().clone(); post_with_updated_values.nonce = *new_nonce; if post_with_updated_values.program_owner == DEFAULT_PROGRAM_ID {