turn on rent (#7368)

* turn on rent

* add rent exempt balances for bootstrap accounts

* use Rent::free() when not testing rent
This commit is contained in:
Rob Walker
2019-12-09 21:56:43 -08:00
committed by GitHub
parent ed9cf3566c
commit 39cd6dff7d
12 changed files with 89 additions and 48 deletions

View File

@@ -163,14 +163,20 @@ pub fn process_create_storage_account(
"storage_account_pubkey".to_string(),
),
)?;
let (recent_blockhash, fee_calculator) = rpc_client.get_recent_blockhash()?;
use solana_storage_program::storage_contract::STORAGE_ACCOUNT_SPACE;
let required_balance = rpc_client
.get_minimum_balance_for_rent_exemption(STORAGE_ACCOUNT_SPACE as usize)?
.max(1);
let ixs = storage_instruction::create_storage_account(
&config.keypair.pubkey(),
&account_owner,
&storage_account_pubkey,
1,
required_balance,
account_type,
);
let (recent_blockhash, fee_calculator) = rpc_client.get_recent_blockhash()?;
let mut tx = Transaction::new_signed_instructions(
&[&config.keypair, &storage_account],
ixs,