solana_sdk/
native_loader.rs1use crate::{
2 account::{
3 Account, AccountSharedData, InheritableAccountFields, DUMMY_INHERITABLE_ACCOUNT_FIELDS,
4 },
5 clock::INITIAL_RENT_EPOCH,
6};
7
8crate::declare_id!("NativeLoader1111111111111111111111111111111");
9
10#[deprecated(
12 since = "1.5.17",
13 note = "Please use `create_loadable_account_for_test` instead"
14)]
15pub fn create_loadable_account(name: &str, lamports: u64) -> AccountSharedData {
16 create_loadable_account_with_fields(name, (lamports, INITIAL_RENT_EPOCH))
17}
18
19pub fn create_loadable_account_with_fields(
20 name: &str,
21 (lamports, rent_epoch): InheritableAccountFields,
22) -> AccountSharedData {
23 AccountSharedData::from(Account {
24 lamports,
25 owner: id(),
26 data: name.as_bytes().to_vec(),
27 executable: true,
28 rent_epoch,
29 })
30}
31
32pub fn create_loadable_account_for_test(name: &str) -> AccountSharedData {
33 create_loadable_account_with_fields(name, DUMMY_INHERITABLE_ACCOUNT_FIELDS)
34}