solana_sdk/
native_loader.rs1use solana_account::{
4 Account, AccountSharedData, InheritableAccountFields, DUMMY_INHERITABLE_ACCOUNT_FIELDS,
5};
6pub use solana_sdk_ids::native_loader::{check_id, id, ID};
7
8pub fn create_loadable_account_with_fields(
10 name: &str,
11 (lamports, rent_epoch): InheritableAccountFields,
12) -> AccountSharedData {
13 AccountSharedData::from(Account {
14 lamports,
15 owner: id(),
16 data: name.as_bytes().to_vec(),
17 executable: true,
18 rent_epoch,
19 })
20}
21
22pub fn create_loadable_account_for_test(name: &str) -> AccountSharedData {
23 create_loadable_account_with_fields(name, DUMMY_INHERITABLE_ACCOUNT_FIELDS)
24}