status-go/protocol/requests/restore_account.go

21 lines
385 B
Go
Raw Normal View History

2023-03-21 17:02:04 +00:00
package requests
import (
"errors"
)
var ErrRestoreAccountInvalidMnemonic = errors.New("restore-account: invalid mnemonic")
type RestoreAccount struct {
Mnemonic string `json:"mnemonic"`
CreateAccount
}
func (c *RestoreAccount) Validate() error {
if len(c.Mnemonic) == 0 {
return ErrRestoreAccountInvalidMnemonic
}
return ValidateAccountCreationRequest(c.CreateAccount)
}