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