AccountSharedData construction (#15790)

This commit is contained in:
Jeff Washington (jwash)
2021-03-11 18:09:04 -06:00
committed by GitHub
parent 3419a5446e
commit 952c3bcbb7
21 changed files with 161 additions and 151 deletions

View File

@@ -5,7 +5,7 @@ use log::*;
use memmap2::MmapMut;
use serde::{Deserialize, Serialize};
use solana_sdk::{
account::{AccountSharedData, ReadableAccount},
account::{Account, AccountSharedData, ReadableAccount},
clock::{Epoch, Slot},
hash::Hash,
pubkey::Pubkey,
@@ -84,13 +84,13 @@ pub struct StoredAccountMeta<'a> {
impl<'a> StoredAccountMeta<'a> {
/// Return a new Account by copying all the data referenced by the `StoredAccountMeta`.
pub fn clone_account(&self) -> AccountSharedData {
AccountSharedData {
AccountSharedData::from(Account {
lamports: self.account_meta.lamports,
owner: self.account_meta.owner,
executable: self.account_meta.executable,
rent_epoch: self.account_meta.rent_epoch,
data: self.data.to_vec(),
}
})
}
fn sanitize(&self) -> bool {