Skip to content

Commit

Permalink
chore: removed unnecessary Result
Browse files Browse the repository at this point in the history
  • Loading branch information
frolvanya committed Jan 16, 2025
1 parent 0bae30a commit 4cb56bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion omni-relayer/src/startup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn build_omni_connector(
.wormhole_core(Some(solana.wormhole_id.parse()?))
.keypair(Some(startup::solana::get_keypair(
solana.credentials_path.as_ref(),
)?))
)))
.build()
.context("Failed to build SolanaBridgeClient")
})
Expand Down
8 changes: 3 additions & 5 deletions omni-relayer/src/startup/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,17 @@ use solana_sdk::{commitment_config::CommitmentConfig, pubkey::Pubkey};

use crate::{config, utils};

pub fn get_keypair(file: Option<&String>) -> Result<Keypair> {
pub fn get_keypair(file: Option<&String>) -> Keypair {
if let Some(file) = file {
if let Ok(keypair) = Keypair::read_from_file(file) {
info!("Retrieved keypair from file");
return Ok(keypair);
return keypair;
}
}

info!("Retrieving Solana keypair from env");

Ok(Keypair::from_base58_string(&config::get_private_key(
ChainKind::Sol,
)))
Keypair::from_base58_string(&config::get_private_key(ChainKind::Sol))
}

pub async fn start_indexer(
Expand Down

0 comments on commit 4cb56bf

Please sign in to comment.