AccountSharedData.set_data (#15781)

* account.set_data and resize_data

* remove data_resize
This commit is contained in:
Jeff Washington (jwash)
2021-03-11 16:40:45 -06:00
committed by GitHub
parent e1ceb430e3
commit 3419a5446e
9 changed files with 43 additions and 25 deletions

View File

@ -84,12 +84,14 @@ pub fn load_genesis_accounts(file: &str, genesis_config: &mut GenesisConfig) ->
let mut account = AccountSharedData::new(account_details.balance, 0, &owner_program_id);
if account_details.data != "~" {
account.data = base64::decode(account_details.data.as_str()).map_err(|err| {
io::Error::new(
io::ErrorKind::Other,
format!("Invalid account data: {}: {:?}", account_details.data, err),
)
})?;
account.set_data(
base64::decode(account_details.data.as_str()).map_err(|err| {
io::Error::new(
io::ErrorKind::Other,
format!("Invalid account data: {}: {:?}", account_details.data, err),
)
})?,
);
}
account.executable = account_details.executable;
lamports += account.lamports;