[#496] morph/wrappers: Deprecate all notary-dedicated methods

All client wrappers should use underlying static client with enabled notary
work mode in order to produce invocations of notary contract.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-25 15:16:59 +03:00 committed by Alex Vanin
parent 9f122f279a
commit 8d201f920e
3 changed files with 10 additions and 0 deletions

View file

@ -48,6 +48,9 @@ func (c *Client) TransferX(args TransferXArgs) error {
// TransferXNotary invokes the call of "transferX" method // TransferXNotary invokes the call of "transferX" method
// of NeoFS Balance contract via notary contract. // of NeoFS Balance contract via notary contract.
//
// Deprecated: construct underlying StaticClient with TryNotary() option
// and use TransferX.
func (c *Client) TransferXNotary(args TransferXArgs) error { func (c *Client) TransferXNotary(args TransferXArgs) error {
return c.transferX(true, args) return c.transferX(true, args)
} }

View file

@ -27,6 +27,8 @@ func (c *Client) StartEstimation(args StartEstimation) error {
return nil return nil
} }
// Deprecated: construct underlying StaticClient with TryNotary() option
// and use StartEstimation.
func (c *Client) StartEstimationNotary(args StartEstimation) error { func (c *Client) StartEstimationNotary(args StartEstimation) error {
if err := c.client.NotaryInvoke(c.startEstimation, args.epoch); err != nil { if err := c.client.NotaryInvoke(c.startEstimation, args.epoch); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.startEstimation, err) return fmt.Errorf("could not invoke method (%s): %w", c.startEstimation, err)
@ -41,6 +43,8 @@ func (c *Client) StopEstimation(args StopEstimation) error {
return nil return nil
} }
// Deprecated: construct underlying StaticClient with TryNotary() option
// and use StopEstimation.
func (c *Client) StopEstimationNotary(args StopEstimation) error { func (c *Client) StopEstimationNotary(args StopEstimation) error {
if err := c.client.NotaryInvoke(c.stopEstimation, args.epoch); err != nil { if err := c.client.NotaryInvoke(c.stopEstimation, args.epoch); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.stopEstimation, err) return fmt.Errorf("could not invoke method (%s): %w", c.stopEstimation, err)

View file

@ -43,6 +43,9 @@ func (c *Client) Put(args PutArgs) error {
// PutViaNotary invokes notary call of "put reputation value" method of // PutViaNotary invokes notary call of "put reputation value" method of
// reputation contract. // reputation contract.
//
// Deprecated: construct underlying StaticClient with TryNotary() option
// and use Put.
func (c *Client) PutViaNotary(args PutArgs) error { func (c *Client) PutViaNotary(args PutArgs) error {
err := c.client.NotaryInvoke( err := c.client.NotaryInvoke(
c.putMethod, c.putMethod,