[#787] morph: Return VUB for IR service calls

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-11-08 12:05:03 +03:00
parent 518f3baf41
commit 2393d13e4d
12 changed files with 78 additions and 41 deletions

View file

@ -26,7 +26,8 @@ func Delete(c *Client, witness core.RemovalWitness) error {
prm.SetToken(tok.Marshal())
}
return c.Delete(prm)
_, err := c.Delete(prm)
return err
}
// DeletePrm groups parameters of Delete client operation.
@ -62,13 +63,13 @@ func (d *DeletePrm) SetKey(key []byte) {
// Delete removes the container from FrostFS system
// through Container contract call.
//
// Returns any error encountered that caused
// Returns valid until block and any error encountered that caused
// the removal to interrupt.
//
// If TryNotary is provided, calls notary contract.
func (c *Client) Delete(p DeletePrm) error {
func (c *Client) Delete(p DeletePrm) (uint32, error) {
if len(p.signature) == 0 && !p.IsControl() {
return errNilArgument
return 0, errNilArgument
}
prm := client.InvokePrm{}
@ -76,9 +77,9 @@ func (c *Client) Delete(p DeletePrm) error {
prm.SetArgs(p.cnr, p.signature, p.key, p.token)
prm.InvokePrmOptional = p.InvokePrmOptional
_, err := c.client.Invoke(prm)
res, err := c.client.Invoke(prm)
if err != nil {
return fmt.Errorf("could not invoke method (%s): %w", deleteMethod, err)
return 0, fmt.Errorf("could not invoke method (%s): %w", deleteMethod, err)
}
return nil
return res.VUB, nil
}