Skip to content
Snippets Groups Projects
Commit 345a6005 authored by poka's avatar poka
Browse files

Change derivation %3 to %2; Harden derivation

parent d53facca
No related branches found
No related tags found
No related merge requests found
Pipeline #15581 failed
......@@ -126,10 +126,10 @@ class MyWalletsProvider with ChangeNotifier {
List<WalletData> _walletConfig = readAllWallets(_chest);
if (_walletConfig.isEmpty) {
_newDerivationNbr = 3;
_newDerivationNbr = 2;
_newWalletNbr = 0;
} else {
_newDerivationNbr = _walletConfig.last.derivation! + 3;
_newDerivationNbr = _walletConfig.last.derivation! + 2;
_newWalletNbr = _walletConfig.last.number! + 1;
}
......@@ -141,7 +141,8 @@ class MyWalletsProvider with ChangeNotifier {
final int? _currentChestNumber = myWalletProvider.getCurrentChest();
final ChestData _currentChest = chestBox.get(_currentChestNumber)!;
final address = await _sdk.derive(context, _currentChest.address!, _newDerivationNbr, pinCode);
final address = await _sdk.derive(
context, _currentChest.address!, _newDerivationNbr, pinCode);
WalletData newWallet = WalletData(
chest: _chest,
......
......@@ -299,7 +299,7 @@ class SubstrateSdk with ChangeNotifier {
print(generatedMnemonic);
print(sourceDerivation);
return await importAccount(fromMnemonic: true, derivePath: '/$number');
return await importAccount(fromMnemonic: true, derivePath: '//$number');
}
}
......
......@@ -124,7 +124,8 @@ class SettingsScreen extends StatelessWidget {
),
onPressed: () async => {
log.i('Suppression de tous les wallets'),
await _myWallets.deleteAllWallet(context)
await _myWallets.deleteAllWallet(context),
await _sub.deleteAllAccounts()
},
child: const Text("EFFACER TOUS MES PORTEFEUILLES",
style: TextStyle(fontSize: 20)))))),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment