From bef59c3bd75dfd3ec2a80edf2f0ddd16dc70c34c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2020 15:03:05 -0700 Subject: [PATCH] Rpc: remove unwraps (#9793) (#9797) automerge --- core/src/rpc.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 6bfdc0ec24..019ab1c23e 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -172,7 +172,9 @@ impl JsonRpcRequestProcessor { pub fn get_epoch_schedule(&self) -> Result { // Since epoch schedule data comes from the genesis config, any commitment level should be // fine - Ok(*self.bank(None)?.epoch_schedule()) + Ok(*self + .bank(Some(CommitmentConfig::recent()))? + .epoch_schedule()) } pub fn get_balance( @@ -903,22 +905,15 @@ impl RpcSol for RpcSolImpl { commitment: Option, ) -> Result { debug!("get_inflation rpc request received"); - Ok(meta - .request_processor + meta.request_processor .read() .unwrap() .get_inflation(commitment) - .unwrap()) } fn get_epoch_schedule(&self, meta: Self::Metadata) -> Result { debug!("get_epoch_schedule rpc request received"); - Ok(meta - .request_processor - .read() - .unwrap() - .get_epoch_schedule() - .unwrap()) + meta.request_processor.read().unwrap().get_epoch_schedule() } fn get_balance(