frostfs-node/pkg/morph/client/netmap/wrapper/epoch.go
Evgenii Stratonikov 71b87155ef [#521] *: use stdlib errors package
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-05-19 16:42:54 +03:00

20 lines
417 B
Go

package wrapper
import (
"fmt"
"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 {
return 0, fmt.Errorf("(%T) could not get epoch number: %w", w, err)
}
return uint64(vals.Number()), nil
}