mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-19 09:15:11 +00:00
decred: Add change wallet pass.
This commit is contained in:
parent
5d19f4f601
commit
4029b512bb
2 changed files with 13 additions and 5 deletions
|
@ -96,9 +96,16 @@ void closeWallet(String walletName) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> changeWalletPassword(
|
String changeWalletPassword(
|
||||||
String walletName, String currentPassword, String newPassword) async {
|
String walletName, String currentPassword, String newPassword) {
|
||||||
// TODO.
|
final cName = walletName.toCString();
|
||||||
|
final cCurrentPass = currentPassword.toCString();
|
||||||
|
final cNewPass = newPassword.toCString();
|
||||||
|
final res = executePayloadFn(
|
||||||
|
fn: () => dcrwalletApi.changePassphrase(cName, cCurrentPass, cNewPass),
|
||||||
|
ptrsToFree: [cName, cCurrentPass, cNewPass],
|
||||||
|
);
|
||||||
|
return res.payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
String? walletSeed(String walletName, String walletPassword) {
|
String? walletSeed(String walletName, String walletPassword) {
|
||||||
|
|
|
@ -418,8 +418,9 @@ abstract class DecredWalletBase extends WalletBase<DecredBalance,
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> changePassword(String password) async {
|
Future<void> changePassword(String password) async {
|
||||||
await libdcrwallet.changeWalletPassword(
|
return () async {
|
||||||
walletInfo.name, _password, password);
|
libdcrwallet.changeWalletPassword(walletInfo.name, _password, password);
|
||||||
|
}();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue