Add rent estimation rpc (#6109)

* server side new rpc endpoint

* client side rpc

* take data_len as usize

Co-Authored-By: Tyera Eulberg <teulberg@gmail.com>

* add test and documentation
This commit is contained in:
Parth
2019-09-26 23:27:13 +05:30
committed by GitHub
parent 74a648accb
commit 67d07254c2
5 changed files with 120 additions and 1 deletions

View File

@@ -679,6 +679,12 @@ impl Bank {
self.blockhash_queue.read().unwrap().last_hash()
}
pub fn get_minimum_balance_for_rent_exemption(&self, data_len: usize) -> u64 {
self.rent_collector
.rent_calculator
.minimum_balance(data_len)
}
pub fn last_blockhash_with_fee_calculator(&self) -> (Hash, FeeCalculator) {
let blockhash_queue = self.blockhash_queue.read().unwrap();
let last_hash = blockhash_queue.last_hash();