2021-03-15 17:27:17 -07:00
|
|
|
use crate::account::{Account, AccountSharedData};
|
2018-12-03 13:31:11 -08:00
|
|
|
|
2019-11-21 16:34:40 -08:00
|
|
|
crate::declare_id!("NativeLoader1111111111111111111111111111111");
|
2019-02-13 19:43:56 -08:00
|
|
|
|
2019-02-13 20:16:26 -08:00
|
|
|
/// Create an executable account with the given shared object name.
|
2021-03-09 13:06:07 -08:00
|
|
|
pub fn create_loadable_account(name: &str, lamports: u64) -> AccountSharedData {
|
2021-03-15 17:27:17 -07:00
|
|
|
AccountSharedData::from(Account {
|
2020-12-10 18:03:31 -08:00
|
|
|
lamports,
|
2019-02-13 20:16:26 -08:00
|
|
|
owner: id(),
|
2020-04-08 14:36:18 -07:00
|
|
|
data: name.as_bytes().to_vec(),
|
2019-02-13 19:43:56 -08:00
|
|
|
executable: true,
|
2019-08-23 14:04:53 -07:00
|
|
|
rent_epoch: 0,
|
2021-03-15 17:27:17 -07:00
|
|
|
})
|
2019-02-13 19:43:56 -08:00
|
|
|
}
|