Skip to content

Commit

Permalink
Fix xprv key conversion?
Browse files Browse the repository at this point in the history
  • Loading branch information
pokkst committed Dec 21, 2023
1 parent fbba3c4 commit 002af7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion swap/src/seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::fmt;
use std::fs::{self, File};
use std::io::{self, Write};
use std::path::{Path, PathBuf};
use std::str::FromStr;
use torut::onion::TorSecretKeyV3;

pub const SEED_LENGTH: usize = 32;
Expand Down Expand Up @@ -45,7 +46,8 @@ impl Seed {
&self
) -> Result<ExtendedPrivKey> {
let key_bytes = self.bytes();
let xprv = ExtendedPrivKey::decode(&key_bytes).expect("Failed to decode key_bytes");
let xprv_string = bitcoin::util::base58::encode_slice(&key_bytes);
let xprv = ExtendedPrivKey::from_str(&xprv_string).expect("Failed to parse xprv_string");
Ok(xprv)
}

Expand Down

0 comments on commit 002af7d

Please sign in to comment.