solana_sdk/
native_loader.rs

1//! The native loader native program.
2use solana_account::{
3    Account, AccountSharedData, InheritableAccountFields, DUMMY_INHERITABLE_ACCOUNT_FIELDS,
4};
5pub use solana_sdk_ids::native_loader::{check_id, id, ID};
6
7/// Create an executable account with the given shared object name.
8pub fn create_loadable_account_with_fields(
9    name: &str,
10    (lamports, rent_epoch): InheritableAccountFields,
11) -> AccountSharedData {
12    AccountSharedData::from(Account {
13        lamports,
14        owner: id(),
15        data: name.as_bytes().to_vec(),
16        executable: true,
17        rent_epoch,
18    })
19}
20
21pub fn create_loadable_account_for_test(name: &str) -> AccountSharedData {
22    create_loadable_account_with_fields(name, DUMMY_INHERITABLE_ACCOUNT_FIELDS)
23}