Tiny add_native_program bug fixes with cleanups (#14042)

* Tiny add_native_program bug fixes with cleanups

* Fix typo
This commit is contained in:
Ryo Onodera
2020-12-11 11:03:31 +09:00
committed by GitHub
parent d33ab34d75
commit 164b7895b3
4 changed files with 225 additions and 87 deletions

View File

@ -3,9 +3,9 @@ use crate::account::Account;
crate::declare_id!("NativeLoader1111111111111111111111111111111");
/// Create an executable account with the given shared object name.
pub fn create_loadable_account(name: &str) -> Account {
pub fn create_loadable_account(name: &str, lamports: u64) -> Account {
Account {
lamports: 1,
lamports,
owner: id(),
data: name.as_bytes().to_vec(),
executable: true,