forked from TrueCloudLab/frostfs-node
[#787] morph: Return VUB for IR service calls
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
518f3baf41
commit
2393d13e4d
12 changed files with 78 additions and 41 deletions
|
@ -11,14 +11,17 @@ import (
|
|||
// If `force` is true, this call is normally initiated by a control
|
||||
// service command and uses a control notary transaction internally
|
||||
// to ensure all nodes produce the same transaction with high probability.
|
||||
func (c *Client) NewEpoch(epoch uint64, force bool) error {
|
||||
// If vub > 0, vub will be used as valid until block value.
|
||||
func (c *Client) NewEpoch(epoch uint64, vub uint32, force bool) (uint32, error) {
|
||||
prm := client.InvokePrm{}
|
||||
prm.SetMethod(newEpochMethod)
|
||||
prm.SetArgs(epoch)
|
||||
prm.SetControlTX(force)
|
||||
prm.SetVUB(vub)
|
||||
|
||||
if _, err := c.client.Invoke(prm); err != nil {
|
||||
return fmt.Errorf("could not invoke method (%s): %w", newEpochMethod, err)
|
||||
res, err := c.client.Invoke(prm)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("could not invoke method (%s): %w", newEpochMethod, err)
|
||||
}
|
||||
return nil
|
||||
return res.VUB, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue