[#625] client/netmap: remove intermediate wrapper

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-31 14:58:55 +03:00 committed by Alex Vanin
parent 8c5c3ac9e8
commit 97d18bc515
36 changed files with 511 additions and 1011 deletions

View file

@ -6,27 +6,12 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
)
// NewEpochArgs groups the arguments
// of new epoch invocation call.
type NewEpochArgs struct {
number int64 // new epoch number
client.InvokePrmOptional
}
// SetEpochNumber sets the new epoch number.
func (a *NewEpochArgs) SetEpochNumber(v int64) {
a.number = v
}
// NewEpoch invokes the call of new epoch method
// of NeoFS Netmap contract.
func (c *Client) NewEpoch(args NewEpochArgs) error {
// NewEpoch updates NeoFS epoch number through
// Netmap contract call.
func (c *Client) NewEpoch(epoch uint64) error {
prm := client.InvokePrm{}
prm.SetMethod(newEpochMethod)
prm.SetArgs(args.number)
prm.InvokePrmOptional = args.InvokePrmOptional
prm.SetArgs(int64(epoch))
if err := c.client.Invoke(prm); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", newEpochMethod, err)