2020-07-24 13:54:03 +00:00
|
|
|
package netmap
|
|
|
|
|
2021-05-18 08:12:51 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
2021-11-09 20:52:29 +00:00
|
|
|
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
2021-05-18 08:12:51 +00:00
|
|
|
)
|
2020-07-24 13:54:03 +00:00
|
|
|
|
2022-01-31 11:58:55 +00:00
|
|
|
// NewEpoch updates NeoFS epoch number through
|
|
|
|
// Netmap contract call.
|
|
|
|
func (c *Client) NewEpoch(epoch uint64) error {
|
2021-11-09 20:52:29 +00:00
|
|
|
prm := client.InvokePrm{}
|
2022-01-29 13:06:36 +00:00
|
|
|
prm.SetMethod(newEpochMethod)
|
2022-03-11 09:28:34 +00:00
|
|
|
prm.SetArgs(epoch)
|
2021-11-09 20:52:29 +00:00
|
|
|
|
|
|
|
if err := c.client.Invoke(prm); err != nil {
|
2022-01-29 13:06:36 +00:00
|
|
|
return fmt.Errorf("could not invoke method (%s): %w", newEpochMethod, err)
|
2021-05-18 08:12:51 +00:00
|
|
|
}
|
|
|
|
return nil
|
2020-07-24 13:54:03 +00:00
|
|
|
}
|