[#705] morph/notary: Add ProbeNotary method to Client

`ProbeNotary` method checks if native `Notary`
contract is presented on chain.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-07-16 16:53:23 +03:00 committed by Alex Vanin
parent 46a66a21ec
commit 00b487e3c3

View file

@ -102,6 +102,12 @@ func (c *Client) NotaryEnabled() bool {
return c.notary != nil return c.notary != nil
} }
// ProbeNotary checks if native `Notary` contract is presented on chain.
func (c *Client) ProbeNotary() bool {
_, err := c.client.GetNativeContractHash(nativenames.Notary)
return err == nil
}
// DepositNotary calls notary deposit method. Deposit is required to operate // DepositNotary calls notary deposit method. Deposit is required to operate
// with notary contract. It used by notary contract in to produce fallback tx // with notary contract. It used by notary contract in to produce fallback tx
// if main tx failed to create. Deposit isn't last forever, so it should // if main tx failed to create. Deposit isn't last forever, so it should