From 1e8f83a74aaa4fa305e8a770e078388da75923c9 Mon Sep 17 00:00:00 2001 From: Sagar Dhawan Date: Fri, 12 Apr 2019 14:38:30 -0700 Subject: [PATCH] Use a better name for new api --- core/src/rpc.rs | 8 ++++---- runtime/src/bank.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 309ac141a9..e97d17727b 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -74,7 +74,7 @@ impl JsonRpcRequestProcessor { } fn get_recent_blockhash(&self) -> String { - let id = self.bank().get_confirmed_blockhash(); + let id = self.bank().confirmed_last_blockhash(); bs58::encode(id).into_string() } @@ -329,7 +329,7 @@ impl RpcSol for RpcSolImpl { .read() .unwrap() .bank() - .get_confirmed_blockhash(); + .confirmed_last_blockhash(); let transaction = request_airdrop_transaction(&drone_addr, &pubkey, lamports, blockhash) .map_err(|err| { info!("request_airdrop_transaction failed: {:?}", err); @@ -450,7 +450,7 @@ mod tests { let bank = bank_forks.read().unwrap().working_bank(); let exit = Arc::new(AtomicBool::new(false)); - let blockhash = bank.get_confirmed_blockhash(); + let blockhash = bank.confirmed_last_blockhash(); let tx = system_transaction::transfer(&alice, pubkey, 20, blockhash, 0); bank.process_transaction(&tx).expect("process transaction"); @@ -493,7 +493,7 @@ mod tests { &exit, ); thread::spawn(move || { - let blockhash = bank.get_confirmed_blockhash(); + let blockhash = bank.confirmed_last_blockhash(); let tx = system_transaction::transfer(&alice, &bob_pubkey, 20, blockhash, 0); bank.process_transaction(&tx).expect("process transaction"); }) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 99e46d49ef..27e776c03a 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -383,7 +383,7 @@ impl Bank { self.blockhash_queue.read().unwrap().last_hash() } /// Return the root bank's blockhash - pub fn get_confirmed_blockhash(&self) -> Hash { + pub fn confirmed_last_blockhash(&self) -> Hash { if let Some(bank) = self.parents().last() { bank.last_blockhash() } else {