frostfs-node/pkg/morph/client/netmap/new_epoch.go
Alex Vanin 5df55bcfaf [#648] morph/client: Fix method name in NewEpoch
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-06-25 16:29:00 +03:00

25 lines
579 B
Go

package netmap
import (
"fmt"
)
// NewEpochArgs groups the arguments
// of new epoch invocation call.
type NewEpochArgs struct {
number int64 // new epoch number
}
// 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 {
if err := c.client.Invoke(c.newEpochMethod, args.number); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.newEpochMethod, err)
}
return nil
}