You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Change UpdatePassword to take multiple addresses, roll back on error (#175)
BREAKING CHANGE: Change `UpdatePassword` to take an array of addresses,
roll back on error.
Explanation: Currently, `UpdatePassword` takes a single address of the
account to update the password. If a native application wants to change
multiple accounts to the new password, it does a loop to call
`UpdatePassword` multiple times. But if one of the calls has an error,
the application breaks out of the loop and leaves the Keybase in an
inconsistent state where some passwords are changed but not all. The
application could write some logic to roll back these changes, but it is
better for the Gno Native Kit service to handle this.
This PR has two commits:
1. Change the `UpdatePassword` request to take a required array of
account addresses. (If the application only wants to update the password
of one account, it is easy to make an array of one address.) In api.go,
we also change `UpdatePassword` to roll back to the old password in case
of error.
2. In types.ts and GnoNativeApi.ts, change `updatePassword` to take a
required array of Uint8Array for the addresses.
---------
Signed-off-by: Jeff Thompson <[email protected]>
0 commit comments