[#421] morph/client: Add role getter from designate contract

RoleManagement native contract (ex designate contract) stores list
of keys per role. Main net uses NeoFSAlphabet role to store keys of
alphabet nodes of inner ring. Side chain uses the same role to store
keys of all inner ring nodes, including alphabet.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-23 13:02:24 +03:00 committed by Alex Vanin
parent f42c5e64fc
commit 2f6adb0465
2 changed files with 28 additions and 0 deletions

View file

@ -105,12 +105,18 @@ func New(key *ecdsa.PrivateKey, endpoint string, opts ...Option) (*Client, error
return nil, err
}
designate, err := cli.GetNativeContractHash(nativenames.Designation)
if err != nil {
return nil, err
}
return &Client{
logger: cfg.logger,
client: cli,
acc: account,
gas: gas,
neo: neo,
designate: designate,
waitInterval: cfg.waitInterval,
}, nil
}