solana/sdk/src/native_loader.rs

19 lines
536 B
Rust
Raw Normal View History

2019-02-13 19:43:56 -08:00
use crate::account::Account;
2018-12-03 13:31:11 -08:00
const ID: [u8; 32] = [
5, 135, 132, 191, 20, 139, 164, 40, 47, 176, 18, 87, 72, 136, 169, 241, 83, 160, 125, 173, 247,
101, 192, 69, 92, 154, 151, 3, 128, 0, 0, 0,
2018-12-03 13:31:11 -08:00
];
crate::solana_name_id!(ID, "NativeLoader1111111111111111111111111111111");
2019-02-13 19:43:56 -08:00
/// Create an executable account with the given shared object name.
pub fn create_loadable_account(name: &str) -> Account {
2019-02-13 19:43:56 -08:00
Account {
2019-03-05 16:28:14 -08:00
lamports: 1,
owner: id(),
data: name.as_bytes().to_vec(),
2019-02-13 19:43:56 -08:00
executable: true,
}
}