diff --git a/cw_decred/lib/wallet_service.dart b/cw_decred/lib/wallet_service.dart index ee4fa684e2..f22476b80d 100644 --- a/cw_decred/lib/wallet_service.dart +++ b/cw_decred/lib/wallet_service.dart @@ -49,8 +49,9 @@ class DecredWalletService extends WalletService< password: credentials.password!, network: isTestnet == true ? testnet : mainnet, ); - credentials.walletInfo!.derivationPath = - isTestnet == true ? seedRestorePathTestnet : seedRestorePath; + final di = DerivationInfo( + derivationPath: isTestnet == true ? seedRestorePathTestnet : seedRestorePath); + credentials.walletInfo!.derivationInfo = di; final wallet = DecredWallet(credentials.walletInfo!, credentials.password!, this.unspentCoinsInfoSource); await wallet.init(); @@ -61,8 +62,8 @@ class DecredWalletService extends WalletService< Future openWallet(String name, String password) async { final walletInfo = walletInfoSource.values .firstWhereOrNull((info) => info.id == WalletBase.idFor(name, getType()))!; - final network = walletInfo.derivationPath == seedRestorePathTestnet || - walletInfo.derivationPath == pubkeyRestorePathTestnet + final network = walletInfo.derivationInfo?.derivationPath == seedRestorePathTestnet || + walletInfo.derivationInfo?.derivationPath == pubkeyRestorePathTestnet ? testnet : mainnet; @@ -93,8 +94,8 @@ class DecredWalletService extends WalletService< Future rename(String currentName, String password, String newName) async { final currentWalletInfo = walletInfoSource.values .firstWhereOrNull((info) => info.id == WalletBase.idFor(currentName, getType()))!; - final network = currentWalletInfo.derivationPath == seedRestorePathTestnet || - currentWalletInfo.derivationPath == pubkeyRestorePathTestnet + final network = currentWalletInfo.derivationInfo?.derivationPath == seedRestorePathTestnet || + currentWalletInfo.derivationInfo?.derivationPath == pubkeyRestorePathTestnet ? testnet : mainnet; final currentWallet = DecredWallet(currentWalletInfo, password, this.unspentCoinsInfoSource); @@ -120,8 +121,9 @@ class DecredWalletService extends WalletService< password: credentials.password!, mnemonic: credentials.mnemonic, network: isTestnet == true ? testnet : mainnet); - credentials.walletInfo!.derivationPath = - isTestnet == true ? seedRestorePathTestnet : seedRestorePath; + final di = DerivationInfo( + derivationPath: isTestnet == true ? seedRestorePathTestnet : seedRestorePath); + credentials.walletInfo!.derivationInfo = di; final wallet = DecredWallet(credentials.walletInfo!, credentials.password!, this.unspentCoinsInfoSource); await wallet.init(); @@ -139,8 +141,9 @@ class DecredWalletService extends WalletService< credentials.pubkey, isTestnet == true ? testnet : mainnet, ); - credentials.walletInfo!.derivationPath = - isTestnet == true ? pubkeyRestorePathTestnet : pubkeyRestorePath; + final di = DerivationInfo( + derivationPath: isTestnet == true ? pubkeyRestorePathTestnet : pubkeyRestorePath); + credentials.walletInfo!.derivationInfo = di; final wallet = DecredWallet(credentials.walletInfo!, credentials.password!, this.unspentCoinsInfoSource); await wallet.init(); diff --git a/cw_decred/pubspec.lock b/cw_decred/pubspec.lock index 1cd2123e80..8d932bebab 100644 --- a/cw_decred/pubspec.lock +++ b/cw_decred/pubspec.lock @@ -769,10 +769,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.4" + version: "14.2.5" watcher: dependency: transitive description: