forked from TrueCloudLab/frostfs-node
[#708] morph/client: Add epoch block getter from netmap
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
7e43af3de3
commit
7146afcd28
3 changed files with 57 additions and 0 deletions
|
@ -18,3 +18,16 @@ func (w *Wrapper) Epoch() (uint64, error) {
|
|||
|
||||
return uint64(vals.Number()), nil
|
||||
}
|
||||
|
||||
// LastEpochBlock receives block number of current NeoFS epoch
|
||||
// through the Netmap contract call.
|
||||
func (w *Wrapper) LastEpochBlock() (uint32, error) {
|
||||
args := netmap.EpochBlockArgs{}
|
||||
|
||||
vals, err := w.client.LastEpochBlock(args)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("(%T) could not get epoch block number: %w", w, err)
|
||||
}
|
||||
|
||||
return uint32(vals.Block()), nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue