[#720] pkg/innerring: Check Notary availability automatically

Do not read `without_notary` config value from env.
Make morph client constructor return client without
notary support. Enabling notary support should be done
with public `EnableNotarySupport` method separately.

Notary availability is deducted with client. Further,
if notary is presented on chain its support is
enabled at the corresponding client.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-07-23 17:37:56 +03:00 committed by Alex Vanin
parent 28aa0f521e
commit 896c749b92
4 changed files with 56 additions and 59 deletions

View file

@ -65,10 +65,10 @@ func defaultNotaryConfig(c *Client) *notaryCfg {
}
}
// enableNotarySupport creates notary structure in client that provides
// EnableNotarySupport creates notary structure in client that provides
// ability for client to get alphabet keys from committee or provided source
// and use proxy contract script hash to create tx for notary contract.
func (c *Client) enableNotarySupport(opts ...NotaryOption) error {
func (c *Client) EnableNotarySupport(opts ...NotaryOption) error {
cfg := defaultNotaryConfig(c)
for _, opt := range opts {