From 8bc161f40fc6020277a45b2c3982c5aa7ffe121d Mon Sep 17 00:00:00 2001 From: archipelago Date: Mon, 17 Aug 2026 11:31:52 -0400 Subject: [PATCH] fix(ecash): repair two mangled warning messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both import refusals reached the operator with runs of ~18 spaces mid sentence — "Importing a different one means coins minted…". The string literals had been written as single long lines with the line-continuation whitespace baked in rather than escaped, so Rust preserved it verbatim. Only visible once the sanitizer stopped swallowing these messages, which is its own small lesson: the text had been wrong since it was written and nothing could show it. Cosmetic, but not trivially so — this is the warning that stops someone replacing the phrase their balance was minted under, and text that looks broken is text people stop reading. Co-Authored-By: Claude Opus 5 (1M context) --- core/archipelago/src/wallet/nut13.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/archipelago/src/wallet/nut13.rs b/core/archipelago/src/wallet/nut13.rs index 16eea3a1..e7448236 100644 --- a/core/archipelago/src/wallet/nut13.rs +++ b/core/archipelago/src/wallet/nut13.rs @@ -282,7 +282,9 @@ pub async fn establish_independent(data_dir: &Path) -> Result { pub async fn import_mnemonic(data_dir: &Path, words: &str, confirm: bool) -> Result { let mnemonic: bip39::Mnemonic = words.split_whitespace().collect::>().join(" ").parse() .map_err(|e| anyhow::anyhow!( - "That is not a valid BIP-39 recovery phrase: {e}. Check for typos — every word must come from the BIP-39 word list, and the phrase as a whole carries a checksum." + "That is not a valid BIP-39 recovery phrase: {e}. Check for typos — \ + every word must come from the BIP-39 word list, and the phrase as \ + a whole carries a checksum." ))?; if let Some(existing) = load_seed(data_dir).await? { @@ -293,7 +295,11 @@ pub async fn import_mnemonic(data_dir: &Path, words: &str, confirm: bool) -> Res } if !confirm { anyhow::bail!( - "This wallet already has a backup phrase. Importing a different one means coins minted under the current phrase will no longer be restorable from words — they stay spendable, but a restore will not find them. Reveal and write down the current phrase first, then confirm to replace it." + "This wallet already has a backup phrase. Importing a different one \ + means coins minted under the current phrase will no longer be \ + restorable from words — they stay spendable, but a restore will \ + not find them. Reveal and write down the current phrase first, \ + then confirm to replace it." ); } archive_seed(data_dir).await?;