decred: Add change wallet pass.

This commit is contained in:
JoeGruff 2024-03-12 14:58:21 +09:00
parent 5d19f4f601
commit 4029b512bb
2 changed files with 13 additions and 5 deletions

View file

@ -96,9 +96,16 @@ void closeWallet(String walletName) {
);
}
Future<void> changeWalletPassword(
String walletName, String currentPassword, String newPassword) async {
// TODO.
String changeWalletPassword(
String walletName, String currentPassword, String newPassword) {
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) {

View file

@ -418,8 +418,9 @@ abstract class DecredWalletBase extends WalletBase<DecredBalance,
@override
Future<void> changePassword(String password) async {
await libdcrwallet.changeWalletPassword(
walletInfo.name, _password, password);
return () async {
libdcrwallet.changeWalletPassword(walletInfo.name, _password, password);
}();
}
@override