From 3f81346e6bcd55323c298c496bce7d24feb85aff Mon Sep 17 00:00:00 2001 From: thunderbiscuit Date: Tue, 8 Nov 2022 09:54:50 -0500 Subject: [PATCH] Refactor from_str() method on the Mnemonic struct to from_string() --- src/bdk.udl | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bdk.udl b/src/bdk.udl index a1e6fe5..e45fe87 100644 --- a/src/bdk.udl +++ b/src/bdk.udl @@ -287,7 +287,7 @@ interface BumpFeeTxBuilder { interface Mnemonic { constructor(WordCount word_count); - [Name=from_str, Throws=BdkError] + [Name=from_string, Throws=BdkError] constructor(string mnemonic); [Name=from_entropy, Throws=BdkError] diff --git a/src/lib.rs b/src/lib.rs index cb4b528..e062281 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -890,7 +890,7 @@ impl Mnemonic { } /// Parse a Mnemonic with given string - fn from_str(mnemonic: String) -> Result { + fn from_string(mnemonic: String) -> Result { BdkMnemonic::from_str(&mnemonic) .map(|m| Mnemonic { internal: m }) .map_err(|e| BdkError::Generic(e.to_string())) @@ -1164,7 +1164,7 @@ mod test { } fn get_descriptor_secret_key() -> DescriptorSecretKey { - let mnemonic = Mnemonic::from_str("chaos fabric time speed sponsor all flat solution wisdom trophy crack object robot pave observe combine where aware bench orient secret primary cable detect".to_string()).unwrap(); + let mnemonic = Mnemonic::from_string("chaos fabric time speed sponsor all flat solution wisdom trophy crack object robot pave observe combine where aware bench orient secret primary cable detect".to_string()).unwrap(); DescriptorSecretKey::new(Testnet, Arc::new(mnemonic), None) }