Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions crates/litesvm/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ impl AccountsDb {
} else {
self.maybe_handle_sysvar_account(pubkey, &account)?;
}
self.add_account_no_checks(pubkey, account);
if account.lamports() == 0 {
self.inner.remove(&pubkey);
} else {
self.add_account_no_checks(pubkey, account);
}
Ok(())
}

Expand Down Expand Up @@ -215,11 +219,7 @@ impl AccountsDb {
&& x.1.data().first().is_some_and(|byte| *byte == 3)
});
for (pubkey, acc) in accounts {
if acc.lamports() == 0 {
self.inner.remove(&pubkey);
} else {
self.add_account(pubkey, acc)?;
}
self.add_account(pubkey, acc)?;
}
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions crates/litesvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,9 @@ impl LiteSVM {
.programs_cache
.replenish(program_id, Arc::new(builtin));

let mut account = AccountSharedData::new(0, 1, &bpf_loader::id());
let mut account = AccountSharedData::new(1, 1, &bpf_loader::id());
account.set_executable(true);
self.accounts.add_account(program_id, account).unwrap();
self.accounts.add_account_no_checks(program_id, account);
}

/// Adds an SBF program to the test environment from the file specified.
Expand Down
Loading