feat: `VerifyKeystoreFileForAccount` endpoint added
This commit is contained in:
parent
f1e3ae5b46
commit
5d7da45f07
|
@ -229,13 +229,17 @@ func (api *API) GetRandomMnemonic(ctx context.Context) (string, error) {
|
||||||
return api.manager.GetRandomMnemonic()
|
return api.manager.GetRandomMnemonic()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (api *API) VerifyKeystoreFileForAccount(address types.Address, password string) bool {
|
||||||
|
_, err := api.manager.VerifyAccountPassword(api.config.KeyStoreDir, address.Hex(), password)
|
||||||
|
return err == nil
|
||||||
|
}
|
||||||
|
|
||||||
func (api *API) VerifyPassword(password string) bool {
|
func (api *API) VerifyPassword(password string) bool {
|
||||||
address, err := api.db.GetChatAddress()
|
address, err := api.db.GetChatAddress()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
_, err = api.manager.VerifyAccountPassword(api.config.KeyStoreDir, address.Hex(), password)
|
return api.VerifyKeystoreFileForAccount(address, password)
|
||||||
return err == nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *API) AddMigratedKeyPairOrAddAccountsIfKeyPairIsAdded(ctx context.Context, kcUID string, kpName string, keyUID string, accountAddresses []string, password string) error {
|
func (api *API) AddMigratedKeyPairOrAddAccountsIfKeyPairIsAdded(ctx context.Context, kcUID string, kpName string, keyUID string, accountAddresses []string, password string) error {
|
||||||
|
|
Loading…
Reference in New Issue