frostfs-node/pkg/morph/client/container/estimations.go
Alex Vanin c4f4381b13 [#486] morph/client: Separate container estimation functions
Inner ring should be able to invoke contract methods both notary
and non notary way.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-05-05 12:45:16 +03:00

49 lines
1 KiB
Go

package container
import (
"github.com/pkg/errors"
)
type StartEstimation struct {
epoch int64
}
func (e *StartEstimation) SetEpoch(v int64) {
e.epoch = v
}
type StopEstimation struct {
epoch int64
}
func (e *StopEstimation) SetEpoch(v int64) {
e.epoch = v
}
func (c *Client) StartEstimation(args StartEstimation) error {
return errors.Wrapf(c.client.Invoke(
c.startEstimation,
args.epoch,
), "could not invoke method (%s)", c.startEstimation)
}
func (c *Client) StartEstimationNotary(args StartEstimation) error {
return errors.Wrapf(c.client.NotaryInvoke(
c.startEstimation,
args.epoch,
), "could not invoke method (%s)", c.startEstimation)
}
func (c *Client) StopEstimation(args StopEstimation) error {
return errors.Wrapf(c.client.Invoke(
c.stopEstimation,
args.epoch,
), "could not invoke method (%s)", c.stopEstimation)
}
func (c *Client) StopEstimationNotary(args StopEstimation) error {
return errors.Wrapf(c.client.NotaryInvoke(
c.stopEstimation,
args.epoch,
), "could not invoke method (%s)", c.stopEstimation)
}