From 46df288d339df5ddb6810f356fd383622fe8e5ec Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 3 Sep 2021 20:19:16 +0300 Subject: [PATCH] [#770] pkg/morph: Add `Morph()` method Add access to low-level morph client in wrappers Signed-off-by: Pavel Karpy --- pkg/morph/client/container/client.go | 5 +++++ pkg/morph/client/static.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pkg/morph/client/container/client.go b/pkg/morph/client/container/client.go index dd9fb5d1f..3c068d698 100644 --- a/pkg/morph/client/container/client.go +++ b/pkg/morph/client/container/client.go @@ -112,6 +112,11 @@ func New(c *client.StaticClient, opts ...Option) (*Client, error) { return res, nil } +// Morph returns raw morph client. +func (c Client) Morph() *client.Client { + return c.client.Morph() +} + // WithPutMethod returns a client constructor option that // specifies the method name of container storing operation. // diff --git a/pkg/morph/client/static.go b/pkg/morph/client/static.go index d438bc821..57d02604d 100644 --- a/pkg/morph/client/static.go +++ b/pkg/morph/client/static.go @@ -71,6 +71,11 @@ func NewStatic(client *Client, scriptHash util.Uint160, fee fixedn.Fixed8, opts }, nil } +// Morph return wrapped raw morph client. +func (s StaticClient) Morph() *Client { + return s.client +} + // Invoke calls Invoke method of Client with static internal script hash and fee. // Supported args types are the same as in Client. //