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 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) {

View file

@ -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