From fc8d1be115d7c46dbfee13cb7ae5fb27aa81e84a Mon Sep 17 00:00:00 2001 From: Thoralf-M Date: Mon, 9 Oct 2023 17:10:46 +0200 Subject: [PATCH] Fix `migrate_db_chrysalis_to_stardust()` for some ledger nano wallets --- bindings/nodejs/CHANGELOG.md | 1 + sdk/CHANGELOG.md | 1 + sdk/src/wallet/migration/chrysalis.rs | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/nodejs/CHANGELOG.md b/bindings/nodejs/CHANGELOG.md index 36136e60a9..c8feca82e8 100644 --- a/bindings/nodejs/CHANGELOG.md +++ b/bindings/nodejs/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Added `SeedSecretManager` to `SecretManagerType`; +- `migrateDbChrysalisToStardust()` for some ledger nano wallets; ### Removed diff --git a/sdk/CHANGELOG.md b/sdk/CHANGELOG.md index f1bd3fe731..837cba08ae 100644 --- a/sdk/CHANGELOG.md +++ b/sdk/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Update protocol params and addresses with correct bech32 HRP in `Wallet::set_client_options()`; +- `migrate_db_chrysalis_to_stardust()` for some ledger nano wallets; ## 1.1.0 - 2023-09-29 diff --git a/sdk/src/wallet/migration/chrysalis.rs b/sdk/src/wallet/migration/chrysalis.rs index 222633f9ac..41ff1e934f 100644 --- a/sdk/src/wallet/migration/chrysalis.rs +++ b/sdk/src/wallet/migration/chrysalis.rs @@ -319,7 +319,9 @@ pub(crate) mod rocksdb { let value_utf8 = String::from_utf8(value.to_vec()).map_err(|_| Error::Migration("invalid utf8".into()))?; // "iota-wallet-key-checksum_value" is never an encrypted value - if key_utf8 == "iota-wallet-key-checksum_value" { + // "FIRST_LEDGER_ADDRESS" was at some point not re-encrypted with the correct password and should + // therefore also be ignored to not return an error + if key_utf8 == "iota-wallet-key-checksum_value" || key_utf8 == "FIRST_LEDGER_ADDRESS" { value_utf8 } else if let Ok(value) = serde_json::from_str::>(&value_utf8) { decrypt_record(value, encryption_key)?