mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
nonce code shifting
This commit is contained in:
parent
abb1fc5e45
commit
2d8722b7d0
@ -141,9 +141,7 @@ fn main() {
|
||||
public_pre_states.push(pre_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;
|
||||
}
|
||||
|
||||
if post.program_owner == DEFAULT_PROGRAM_ID {
|
||||
// Claim account
|
||||
post.program_owner = program_id;
|
||||
|
||||
@ -195,7 +195,7 @@ mod tests {
|
||||
let expected_sender_post = Account {
|
||||
program_owner: program.id(),
|
||||
balance: 100 - balance_to_move,
|
||||
nonce: 1,
|
||||
nonce: 0,
|
||||
data: Data::default(),
|
||||
};
|
||||
|
||||
|
||||
@ -154,6 +154,12 @@ impl V02State {
|
||||
*current_account = post;
|
||||
}
|
||||
|
||||
// 5. Increment nonces for public signers
|
||||
for account_id in tx.signer_account_ids() {
|
||||
let current_account = self.get_account_by_id_mut(account_id);
|
||||
current_account.nonce += 1;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user