2021-01-28 11:39:08 +00:00
|
|
|
package wrapper
|
|
|
|
|
|
|
|
import (
|
2021-11-12 15:14:55 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
2021-01-28 11:39:08 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client/container"
|
|
|
|
)
|
|
|
|
|
2021-11-12 15:14:55 +00:00
|
|
|
// StartEstimationPrm groups parameters of StartEstimation operation.
|
|
|
|
type StartEstimationPrm struct {
|
|
|
|
epoch uint64
|
|
|
|
|
|
|
|
client.InvokePrmOptional
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetEpoch sets epoch.
|
|
|
|
func (s *StartEstimationPrm) SetEpoch(epoch uint64) {
|
|
|
|
s.epoch = epoch
|
|
|
|
}
|
|
|
|
|
2021-01-28 11:39:08 +00:00
|
|
|
// StartEstimation votes to produce start estimation notification.
|
2021-11-12 15:14:55 +00:00
|
|
|
func (w *Wrapper) StartEstimation(prm StartEstimationPrm) error {
|
2021-01-28 11:39:08 +00:00
|
|
|
args := container.StartEstimation{}
|
2021-11-12 15:14:55 +00:00
|
|
|
args.SetEpoch(int64(prm.epoch))
|
|
|
|
args.InvokePrmOptional = prm.InvokePrmOptional
|
2021-01-28 11:39:08 +00:00
|
|
|
|
|
|
|
return w.client.StartEstimation(args)
|
|
|
|
}
|
|
|
|
|
2021-11-12 15:14:55 +00:00
|
|
|
// StopEstimationPrm groups parameters of StopEstimation operation.
|
|
|
|
type StopEstimationPrm struct {
|
|
|
|
epoch uint64
|
|
|
|
|
|
|
|
client.InvokePrmOptional
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetEpoch sets epoch.
|
|
|
|
func (s *StopEstimationPrm) SetEpoch(epoch uint64) {
|
|
|
|
s.epoch = epoch
|
|
|
|
}
|
|
|
|
|
2021-01-28 11:39:08 +00:00
|
|
|
// StopEstimation votes to produce stop estimation notification.
|
2021-11-12 15:14:55 +00:00
|
|
|
func (w *Wrapper) StopEstimation(prm StopEstimationPrm) error {
|
2021-01-28 11:39:08 +00:00
|
|
|
args := container.StopEstimation{}
|
2021-11-12 15:14:55 +00:00
|
|
|
args.SetEpoch(int64(prm.epoch))
|
|
|
|
args.InvokePrmOptional = prm.InvokePrmOptional
|
2021-01-28 11:39:08 +00:00
|
|
|
|
|
|
|
return w.client.StopEstimation(args)
|
|
|
|
}
|