Revert "require stake, vote and executable accounts to be rent exempt (#5928)" (#6005)

This reverts commit 11e6197a83.
This commit is contained in:
Michael Vines
2019-09-20 14:10:39 -07:00
committed by GitHub
parent 558a362c46
commit a60a3efc1a
11 changed files with 18 additions and 199 deletions

View File

@@ -15,55 +15,10 @@ pub fn create_account(
lamports: u64,
space: u64,
program_id: &Pubkey,
) -> Transaction {
generate_create_account_tx(
from_keypair,
to,
recent_blockhash,
lamports,
space,
program_id,
false,
)
}
pub fn create_rent_exempted_account(
from_keypair: &Keypair,
to: &Pubkey,
recent_blockhash: Hash,
lamports: u64,
space: u64,
program_id: &Pubkey,
) -> Transaction {
generate_create_account_tx(
from_keypair,
to,
recent_blockhash,
lamports,
space,
program_id,
true,
)
}
fn generate_create_account_tx(
from_keypair: &Keypair,
to: &Pubkey,
recent_blockhash: Hash,
lamports: u64,
space: u64,
program_id: &Pubkey,
require_rent_exemption: bool,
) -> Transaction {
let from_pubkey = from_keypair.pubkey();
let create_instruction = system_instruction::generate_create_account_instruction(
&from_pubkey,
to,
lamports,
space,
program_id,
require_rent_exemption,
);
let create_instruction =
system_instruction::create_account(&from_pubkey, to, lamports, space, program_id);
let instructions = vec![create_instruction];
Transaction::new_signed_instructions(&[from_keypair], instructions, recent_blockhash)
}