Commit c1f6ed27 authored by Son of Odin's avatar Son of Odin

tweak node account type

parent 473ac776
......@@ -118,17 +118,20 @@ func NewNodeAccount(nodeAddress sdk.AccAddress, status NodeStatus, nodePubKeySet
// IsEmpty decide whether NodeAccount is empty
func (n NodeAccount) IsEmpty() bool {
return n.NodeAddress.Empty()
return n.NodeAddress.Empty() || n.Status == Unknown
}
// IsValid check whether NodeAccount has all necessary values
func (n NodeAccount) IsValid() error {
if n.NodeAddress.Empty() {
return errors.New("node bep address is empty")
return errors.New("node thor address is empty")
}
if n.BondAddress.IsEmpty() {
return errors.New("bond address is empty")
}
if n.Status == Unknown {
return errors.New("node status cannot be unknown")
}
return nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment