Removed unused ParseLoginParams and newErrZeroAddress functions

This commit is contained in:
Samuel Hawksby-Robinson 2024-03-19 13:09:47 +00:00
parent 5dba9833dd
commit 9eb49e1692
1 changed files with 0 additions and 32 deletions

View File

@ -1,7 +1,6 @@
package account
import (
"encoding/json"
"errors"
"fmt"
@ -32,37 +31,6 @@ func (e *ErrZeroAddress) Error() string {
return fmt.Sprintf("%s contains an empty address", e.field)
}
func newErrZeroAddress(field string) *ErrZeroAddress {
return &ErrZeroAddress{
field: field,
}
}
func ParseLoginParams(paramsJSON string) (LoginParams, error) {
var (
params LoginParams
zeroAddress types.Address
)
if err := json.Unmarshal([]byte(paramsJSON), &params); err != nil {
return params, err
}
if params.ChatAddress == zeroAddress {
return params, newErrZeroAddress("ChatAddress")
}
if params.MainAccount == zeroAddress {
return params, newErrZeroAddress("MainAccount")
}
for _, address := range params.WatchAddresses {
if address == zeroAddress {
return params, newErrZeroAddress("WatchAddresses")
}
}
return params, nil
}
// Info contains wallet and chat addresses and public keys of an account.
type Info struct {
WalletAddress string