solana_sdk/
native_loader.rs

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