Use a better name for new api
This commit is contained in:
parent
1db80d79fc
commit
1e8f83a74a
|
@ -74,7 +74,7 @@ impl JsonRpcRequestProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_recent_blockhash(&self) -> String {
|
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()
|
bs58::encode(id).into_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ impl RpcSol for RpcSolImpl {
|
||||||
.read()
|
.read()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.bank()
|
.bank()
|
||||||
.get_confirmed_blockhash();
|
.confirmed_last_blockhash();
|
||||||
let transaction = request_airdrop_transaction(&drone_addr, &pubkey, lamports, blockhash)
|
let transaction = request_airdrop_transaction(&drone_addr, &pubkey, lamports, blockhash)
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
info!("request_airdrop_transaction failed: {:?}", err);
|
info!("request_airdrop_transaction failed: {:?}", err);
|
||||||
|
@ -450,7 +450,7 @@ mod tests {
|
||||||
let bank = bank_forks.read().unwrap().working_bank();
|
let bank = bank_forks.read().unwrap().working_bank();
|
||||||
let exit = Arc::new(AtomicBool::new(false));
|
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);
|
let tx = system_transaction::transfer(&alice, pubkey, 20, blockhash, 0);
|
||||||
bank.process_transaction(&tx).expect("process transaction");
|
bank.process_transaction(&tx).expect("process transaction");
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ mod tests {
|
||||||
&exit,
|
&exit,
|
||||||
);
|
);
|
||||||
thread::spawn(move || {
|
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);
|
let tx = system_transaction::transfer(&alice, &bob_pubkey, 20, blockhash, 0);
|
||||||
bank.process_transaction(&tx).expect("process transaction");
|
bank.process_transaction(&tx).expect("process transaction");
|
||||||
})
|
})
|
||||||
|
|
|
@ -383,7 +383,7 @@ impl Bank {
|
||||||
self.blockhash_queue.read().unwrap().last_hash()
|
self.blockhash_queue.read().unwrap().last_hash()
|
||||||
}
|
}
|
||||||
/// Return the root bank's blockhash
|
/// 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() {
|
if let Some(bank) = self.parents().last() {
|
||||||
bank.last_blockhash()
|
bank.last_blockhash()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue