fix nonce in circuit

This commit is contained in:
Sergio Chouhy 2025-08-22 18:49:46 -03:00
parent 96ca181f2d
commit f2a7c574e5
2 changed files with 6 additions and 3 deletions

View File

@ -54,13 +54,15 @@ fn main() {
for i in 0..n_accounts { for i in 0..n_accounts {
match visibility_mask[i] { match visibility_mask[i] {
0 => { 0 => {
// Public account
public_pre_states.push(pre_states[i].clone());
let mut post = post_states[i].clone(); let mut post = post_states[i].clone();
post.nonce += 1;
if post.program_owner == DEFAULT_PROGRAM_ID { if post.program_owner == DEFAULT_PROGRAM_ID {
// Claim account // Claim account
post.program_owner = program_id; post.program_owner = program_id;
} }
// Public account
public_pre_states.push(pre_states[i].clone());
public_post_states.push(post); public_post_states.push(post);
} }
1 | 2 => { 1 | 2 => {

View File

@ -136,7 +136,8 @@ mod tests {
let expected_sender_post = Account { let expected_sender_post = Account {
program_owner: program.id(), program_owner: program.id(),
balance: 100 - balance_to_move, balance: 100 - balance_to_move,
..Account::default() nonce: 1,
data: vec![],
}; };
let expected_recipient_post = Account { let expected_recipient_post = Account {