use idomatic rust
This commit is contained in:
parent
819724c360
commit
419820cde2
|
@ -25,7 +25,9 @@ use solana_rpc_client_api::{
|
||||||
response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo},
|
response::{Response as RpcResponse, RpcBlockhash, RpcResponseContext, RpcVersionInfo},
|
||||||
};
|
};
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
commitment_config::CommitmentConfig, hash::Hash, pubkey::Pubkey,
|
commitment_config::{self, CommitmentConfig},
|
||||||
|
hash::Hash,
|
||||||
|
pubkey::Pubkey,
|
||||||
transaction::VersionedTransaction,
|
transaction::VersionedTransaction,
|
||||||
};
|
};
|
||||||
use solana_transaction_status::TransactionStatus;
|
use solana_transaction_status::TransactionStatus;
|
||||||
|
@ -221,11 +223,9 @@ impl LiteRpcServer for LiteBridge {
|
||||||
&self,
|
&self,
|
||||||
config: Option<RpcContextConfig>,
|
config: Option<RpcContextConfig>,
|
||||||
) -> crate::rpc::Result<RpcResponse<RpcBlockhash>> {
|
) -> crate::rpc::Result<RpcResponse<RpcBlockhash>> {
|
||||||
let commitment_config = if let Some(RpcContextConfig { commitment, .. }) = config {
|
let commitment_config = config
|
||||||
commitment.unwrap_or_default()
|
.map(|config| config.commitment.unwrap_or_default())
|
||||||
} else {
|
.unwrap_or_default();
|
||||||
CommitmentConfig::default()
|
|
||||||
};
|
|
||||||
|
|
||||||
let (blockhash, BlockInformation { slot, block_height }) = self
|
let (blockhash, BlockInformation { slot, block_height }) = self
|
||||||
.block_store
|
.block_store
|
||||||
|
|
Loading…
Reference in New Issue