frostfs-node/pkg/morph/client/audit/put_result.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

31 lines
742 B
Go

package audit
import (
"fmt"
)
// PutAuditResultArgs groups the arguments
// of "put audit result" invocation call.
type PutAuditResultArgs struct {
rawResult []byte // audit result in NeoFS API-compatible binary representation
}
// SetRawResult sets audit result structure
// in NeoFS API-compatible binary representation.
func (g *PutAuditResultArgs) SetRawResult(v []byte) {
g.rawResult = v
}
// PutAuditResult invokes the call of "put audit result" method
// of NeoFS Audit contract.
func (c *Client) PutAuditResult(args PutAuditResultArgs) error {
err := c.client.Invoke(
c.putResultMethod,
args.rawResult,
)
if err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.putResultMethod, err)
}
return nil
}