2020-07-24 13:54:03 +00:00
|
|
|
package netmap
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/pkg/errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
// AddPeerArgs groups the arguments
|
|
|
|
// of add peer invocation call.
|
|
|
|
type AddPeerArgs struct {
|
2020-09-08 09:37:53 +00:00
|
|
|
info []byte
|
2020-07-24 13:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetInfo sets the peer information.
|
2020-09-08 09:37:53 +00:00
|
|
|
func (a *AddPeerArgs) SetInfo(v []byte) {
|
2020-07-24 13:54:03 +00:00
|
|
|
a.info = v
|
|
|
|
}
|
|
|
|
|
|
|
|
// AddPeer invokes the call of add peer method
|
|
|
|
// of NeoFS Netmap contract.
|
|
|
|
func (c *Client) AddPeer(args AddPeerArgs) error {
|
|
|
|
info := args.info
|
|
|
|
|
|
|
|
return errors.Wrapf(c.client.Invoke(
|
|
|
|
c.addPeerMethod,
|
2020-09-08 09:37:53 +00:00
|
|
|
info,
|
2020-07-24 13:54:03 +00:00
|
|
|
), "could not invoke method (%s)", c.addPeerMethod)
|
|
|
|
}
|