[#60] morph/netmap: Implement Epoch method on netmap client wrapper
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
20fb8547b6
commit
dae94aa230
1 changed files with 19 additions and 0 deletions
19
pkg/morph/client/netmap/wrapper/epoch.go
Normal file
19
pkg/morph/client/netmap/wrapper/epoch.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package wrapper
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// 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, errors.Wrapf(err, "(%T) could not get epoch number", w)
|
||||
}
|
||||
|
||||
return uint64(vals.Number()), nil
|
||||
}
|
Loading…
Reference in a new issue