Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
JayT106 committed Nov 8, 2024
1 parent c85ff39 commit 2020bc0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/node/da_clients/src/avail/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ pub struct AvailClient {

impl AvailClient {
pub async fn new(config: AvailConfig, secrets: AvailSecrets) -> anyhow::Result<Self> {
let sdk_client = if secrets.private_key.is_some() {
let pk = secrets.private_key.clone().unwrap();

let bytes = Vec::from_hex(pk).map_err(|e| anyhow::anyhow!("hex string convert failed: {}", e.to_string()))?;
let sdk_client = if let Some(_pk) = &secrets.private_key {
let bytes = Vec::from_hex(_pk).map_err(|e| anyhow::anyhow!("hex string convert failed: {}", e.to_string()))?;
if bytes.len() != 32 {
return Err(anyhow::anyhow!("Hex string must represent exactly 32 bytes."));
}
Expand Down

0 comments on commit 2020bc0

Please sign in to comment.