Tiny add_native_program bug fixes with cleanups (#14042) (#14057)

* Tiny add_native_program bug fixes with cleanups

* Fix typo

(cherry picked from commit 164b7895b3)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
mergify[bot]
2020-12-10 18:46:57 -08:00
committed by GitHub
parent bfc9932b17
commit 13527fc937
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,