2020-10-21 16:19:06 +00:00
|
|
|
package wrapper
|
|
|
|
|
|
|
|
import (
|
2021-05-18 08:12:51 +00:00
|
|
|
"fmt"
|
|
|
|
|
2020-10-21 16:19:06 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Epoch receives number of current NeoFS epoch
|
|
|
|
// through the Netmap contract call.
|
|
|
|
func (w *Wrapper) Epoch() (uint64, error) {
|
|
|
|
args := netmap.EpochArgs{}
|
|
|
|
|
|
|
|
vals, err := w.client.Epoch(args)
|
|
|
|
if err != nil {
|
2021-05-18 08:12:51 +00:00
|
|
|
return 0, fmt.Errorf("(%T) could not get epoch number: %w", w, err)
|
2020-10-21 16:19:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return uint64(vals.Number()), nil
|
|
|
|
}
|