From 00b487e3c3a9029d0a4dff080acdfe907e7bc4da Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 16 Jul 2021 16:53:23 +0300 Subject: [PATCH] [#705] morph/notary: Add `ProbeNotary` method to Client `ProbeNotary` method checks if native `Notary` contract is presented on chain. Signed-off-by: Pavel Karpy --- pkg/morph/client/notary.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index f4355ec477..bec2b28cf1 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -102,6 +102,12 @@ func (c *Client) NotaryEnabled() bool { 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 // 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