frostfs-node/pkg/morph/client/netmap/new_epoch.go

26 lines
578 B
Go
Raw Normal View History

2020-07-24 13:54:03 +00:00
package netmap
import (
"fmt"
)
2020-07-24 13:54:03 +00:00
// 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.addPeerMethod, args.number); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.newEpochMethod, err)
}
return nil
2020-07-24 13:54:03 +00:00
}