WritableAccount.add/subtract_lamports (#16750)
* add/sub lamports * make add/sub return Result * sample replacements * cleanup * fix up a few tests as examples * move enum, cleanup, impl from * fmt * cleanup * add lamports.rs
This commit is contained in:
committed by
GitHub
parent
be29568318
commit
48c07d32f0
@@ -6194,7 +6194,7 @@ pub mod tests {
|
||||
if let Some((mut account, _)) =
|
||||
accounts.load_without_fixed_root(&ancestors, &pubkeys[idx])
|
||||
{
|
||||
account.lamports += 1;
|
||||
account.checked_add_lamports(1).unwrap();
|
||||
accounts.store_uncached(slot, &[(&pubkeys[idx], &account)]);
|
||||
if account.lamports == 0 {
|
||||
let ancestors = vec![(slot, 0)].into_iter().collect();
|
||||
|
Reference in New Issue
Block a user