Rent tangential stuff (#5910)
* rename rent.rs to rent_calculator.rs * add rent sysvar * integrate rent_calculator with bank * rent_calculator integration with genesis * add test for rent sysvar
This commit is contained in:
@@ -74,9 +74,9 @@ fn initialize_account(vote_pubkey: &Pubkey, node_pubkey: &Pubkey, commission: u8
|
||||
}
|
||||
|
||||
pub fn minimum_balance() -> u64 {
|
||||
let rent = solana_sdk::rent::Rent::default();
|
||||
let rent_calculator = solana_sdk::rent_calculator::RentCalculator::default();
|
||||
|
||||
rent.minimum_balance(VoteState::size_of())
|
||||
rent_calculator.minimum_balance(VoteState::size_of())
|
||||
}
|
||||
|
||||
pub fn create_account(
|
||||
@@ -279,8 +279,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_minimum_balance() {
|
||||
let rent = solana_sdk::rent::Rent::default();
|
||||
let minimum_balance = rent.minimum_balance(VoteState::size_of());
|
||||
let rent_calculator = solana_sdk::rent_calculator::RentCalculator::default();
|
||||
let minimum_balance = rent_calculator.minimum_balance(VoteState::size_of());
|
||||
// vote state cheaper than "my $0.02" ;)
|
||||
assert!(minimum_balance as f64 / 2f64.powf(34.0) < 0.02)
|
||||
}
|
||||
|
Reference in New Issue
Block a user