[#971] morph/netmap: Add optional parameters

Add optional parameters to the client call
signature. Group parameters of a client call
into struct to improve future codebase
support.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-11-10 13:44:19 +03:00 committed by Alex Vanin
parent 3114be39d0
commit c25f5a86ae
11 changed files with 224 additions and 90 deletions

View file

@ -10,6 +10,8 @@ import (
// of new epoch invocation call.
type NewEpochArgs struct {
number int64 // new epoch number
client.InvokePrmOptional
}
// SetEpochNumber sets the new epoch number.
@ -24,6 +26,7 @@ func (c *Client) NewEpoch(args NewEpochArgs) error {
prm.SetMethod(c.newEpochMethod)
prm.SetArgs(args.number)
prm.InvokePrmOptional = args.InvokePrmOptional
if err := c.client.Invoke(prm); err != nil {
return fmt.Errorf("could not invoke method (%s): %w", c.newEpochMethod, err)