[#979] morph/client: Get proxy contract address from NNS

Make `Client.EnableNotarySupport` method to call `NNSContractAddress`
for proxy contract if it is not specified in corresponding option.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-11-30 14:56:01 +03:00 committed by LeL
parent 9622c9c858
commit 069a174129

View file

@ -80,7 +80,12 @@ func (c *Client) EnableNotarySupport(opts ...NotaryOption) error {
}
if cfg.proxy.Equals(util.Uint160{}) {
return errors.New("proxy contract hash is missing")
var err error
cfg.proxy, err = c.NNSContractAddress(NNSProxyContractName)
if err != nil {
return fmt.Errorf("get proxy contract addess from NNS: %w", err)
}
}
notaryCfg := &notary{