[#421] morph/client: Add designate role getter wrapper for NeoFSAlphabet role

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-23 13:03:23 +03:00 committed by Alex Vanin
parent 2f6adb0465
commit 61dff99774

View file

@ -217,6 +217,18 @@ func (c *Client) Committee() (keys.PublicKeys, error) {
return roleKeys, nil
}
// NeoFSAlphabetList returns keys that stored in NeoFS Alphabet role. Main chain
// stores alphabet node keys of inner ring there, however side chain stores both
// alphabet and non alphabet node keys of inner ring.
func (c *Client) NeoFSAlphabetList() (keys.PublicKeys, error) {
list, err := c.roleList(native.RoleNeoFSAlphabet)
if err != nil {
return nil, errors.Wrap(err, "can't get alphabet nodes role list")
}
return list, nil
}
func (c *Client) roleList(r native.Role) (keys.PublicKeys, error) {
height, err := c.client.GetBlockCount()
if err != nil {